@kosdev-code/kos-dispense-sdk 2.1.39 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dispense-registration-manager-C6k10ipu.cjs → dispense-registration-manager-BH0mkCQx.cjs} +227 -253
- package/dispense-registration-manager-BH0mkCQx.cjs.map +1 -0
- package/{dispense-registration-manager-lJlcyq5G.js → dispense-registration-manager-BSKa5Oi9.js} +244 -270
- package/dispense-registration-manager-BSKa5Oi9.js.map +1 -0
- package/{extension-utils-DNbm2KRk.cjs → extension-utils-FKfiDSbi.cjs} +14 -25
- package/extension-utils-FKfiDSbi.cjs.map +1 -0
- package/{extension-utils-AS0Z5eod.js → extension-utils-jntF0-vN.js} +20 -31
- package/extension-utils-jntF0-vN.js.map +1 -0
- package/extensions/control-pour-extension.d.ts +8 -9
- package/extensions/control-pour-extension.d.ts.map +1 -1
- package/extensions/index.d.ts.map +1 -1
- package/index.cjs +3 -6
- package/index.cjs.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +89 -92
- package/index.js.map +1 -1
- package/models/constants/constants.d.ts.map +1 -1
- package/models/constants/index.d.ts.map +1 -1
- package/models/index.d.ts.map +1 -1
- package/models/models/assembly/assembly-model.d.ts +4 -5
- package/models/models/assembly/assembly-model.d.ts.map +1 -1
- package/models/models/assembly/assembly-registration.d.ts +1 -2
- package/models/models/assembly/assembly-registration.d.ts.map +1 -1
- package/models/models/assembly/board-utils.d.ts +1 -2
- package/models/models/assembly/board-utils.d.ts.map +1 -1
- package/models/models/assembly/holder-utils.d.ts +1 -2
- package/models/models/assembly/holder-utils.d.ts.map +1 -1
- package/models/models/assembly/index.d.ts.map +1 -1
- package/models/models/assembly/nozzle-utils.d.ts +1 -2
- package/models/models/assembly/nozzle-utils.d.ts.map +1 -1
- package/models/models/assembly/pump-utils.d.ts +2 -3
- package/models/models/assembly/pump-utils.d.ts.map +1 -1
- package/models/models/assembly/services/assembly-services.d.ts +0 -1
- package/models/models/assembly/services/assembly-services.d.ts.map +1 -1
- package/models/models/assembly/services/index.d.ts.map +1 -1
- package/models/models/assembly/types/index.d.ts +2 -3
- package/models/models/availability/availability-model.d.ts +1 -2
- package/models/models/availability/availability-model.d.ts.map +1 -1
- package/models/models/availability/index.d.ts.map +1 -1
- package/models/models/availability/types/index.d.ts +0 -1
- package/models/models/board/board-container-model.d.ts +2 -3
- package/models/models/board/board-container-model.d.ts.map +1 -1
- package/models/models/board/board-container-registration.d.ts +2 -3
- package/models/models/board/board-container-registration.d.ts.map +1 -1
- package/models/models/board/board-model.d.ts +1 -2
- package/models/models/board/board-model.d.ts.map +1 -1
- package/models/models/board/board-registration.d.ts +1 -2
- package/models/models/board/board-registration.d.ts.map +1 -1
- package/models/models/board/index.d.ts.map +1 -1
- package/models/models/board/types/index.d.ts +0 -2
- package/models/models/board/types/services.d.ts.map +1 -1
- package/models/models/board/utils/board-trouble-data-mapper.d.ts +1 -2
- package/models/models/board/utils/board-trouble-data-mapper.d.ts.map +1 -1
- package/models/models/board/utils/board-trouble-resolver.d.ts +0 -1
- package/models/models/board/utils/board-trouble-resolver.d.ts.map +1 -1
- package/models/models/device-assembly/device-assembly-model.d.ts +2 -3
- package/models/models/device-assembly/device-assembly-model.d.ts.map +1 -1
- package/models/models/device-assembly/device-assembly-registration.d.ts +2 -3
- package/models/models/device-assembly/device-assembly-registration.d.ts.map +1 -1
- package/models/models/device-assembly/index.d.ts.map +1 -1
- package/models/models/generic-pour/generic-pour-model.d.ts +3 -4
- package/models/models/generic-pour/generic-pour-model.d.ts.map +1 -1
- package/models/models/generic-pour/generic-pour-registration.d.ts +2 -3
- package/models/models/generic-pour/generic-pour-registration.d.ts.map +1 -1
- package/models/models/generic-pour/index.d.ts.map +1 -1
- package/models/models/generic-pour/services/generic-pour-services.d.ts.map +1 -1
- package/models/models/generic-pour/services/index.d.ts.map +1 -1
- package/models/models/holder/holder-model.d.ts +1 -2
- package/models/models/holder/holder-model.d.ts.map +1 -1
- package/models/models/holder/index.d.ts.map +1 -1
- package/models/models/holder/services/assignment-services.d.ts.map +1 -1
- package/models/models/holder/services/holder-services.d.ts.map +1 -1
- package/models/models/holder/services/index.d.ts.map +1 -1
- package/models/models/holder/types/index.d.ts +5 -7
- package/models/models/holder/utils/holder-utils.d.ts +0 -1
- package/models/models/holder/utils/holder-utils.d.ts.map +1 -1
- package/models/models/holder-container/holder-container-model.d.ts +1 -2
- package/models/models/holder-container/holder-container-model.d.ts.map +1 -1
- package/models/models/holder-container/index.d.ts.map +1 -1
- package/models/models/holder-container/types/index.d.ts +1 -3
- package/models/models/index.d.ts.map +1 -1
- package/models/models/ingredient/index.d.ts.map +1 -1
- package/models/models/ingredient/ingredient-model.d.ts +1 -2
- package/models/models/ingredient/ingredient-model.d.ts.map +1 -1
- package/models/models/ingredient/services/index.d.ts.map +1 -1
- package/models/models/ingredient/services/ingredient-services.d.ts.map +1 -1
- package/models/models/ingredient/types/index.d.ts +0 -2
- package/models/models/ingredient-container/index.d.ts.map +1 -1
- package/models/models/ingredient-container/ingredient-container-model.d.ts +1 -2
- package/models/models/ingredient-container/ingredient-container-model.d.ts.map +1 -1
- package/models/models/ingredient-container/types/index.d.ts +1 -3
- package/models/models/nozzle/index.d.ts.map +1 -1
- package/models/models/nozzle/nozzle-model.d.ts +6 -7
- package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
- package/models/models/nozzle/services/index.d.ts.map +1 -1
- package/models/models/nozzle/services/nozzle-services.d.ts.map +1 -1
- package/models/models/nozzle/types/index.d.ts +1 -3
- package/models/models/pump/index.d.ts.map +1 -1
- package/models/models/pump/pump-model.d.ts +1 -2
- package/models/models/pump/pump-model.d.ts.map +1 -1
- package/models/models/pump/services/index.d.ts.map +1 -1
- package/models/models/pump/services/pump-services.d.ts +3 -5
- package/models/models/pump/services/pump-services.d.ts.map +1 -1
- package/models/models/pump/types/index.d.ts +1 -3
- package/models/models/pump/utils/pump-trouble-resolver.d.ts +0 -1
- package/models/models/pump/utils/pump-trouble-resolver.d.ts.map +1 -1
- package/models/models/pump-container/index.d.ts.map +1 -1
- package/models/models/pump-container/pump-container-model.d.ts +1 -2
- package/models/models/pump-container/pump-container-model.d.ts.map +1 -1
- package/models/models/pump-container/types/index.d.ts +1 -3
- package/models/models/types/assembly.d.ts.map +1 -1
- package/models/models/types/index.d.ts.map +1 -1
- package/models/models/types/intent.d.ts +0 -1
- package/models/models/types/intent.d.ts.map +1 -1
- package/models/models/types/pouring.d.ts.map +1 -1
- package/models/utils/dispense-registration-manager.d.ts +5 -6
- package/models/utils/dispense-registration-manager.d.ts.map +1 -1
- package/models/utils/extension-utils.d.ts +6 -7
- package/models/utils/extension-utils.d.ts.map +1 -1
- package/models/utils/openapi-index.d.ts.map +1 -1
- package/models/utils/registration.d.ts +0 -1
- package/models/utils/registration.d.ts.map +1 -1
- package/models/utils/service.d.ts +34 -35
- package/models/utils/service.d.ts.map +1 -1
- package/models/utils/services/dispense/1.6.5/service.d.ts +34 -35
- package/models/utils/services/dispense/1.6.5/service.d.ts.map +1 -1
- package/models/utils/services/dispense/1.8.1/service.d.ts +34 -35
- package/models/utils/services/dispense/1.8.1/service.d.ts.map +1 -1
- package/models/utils/services/dispense/daily/service.d.ts +34 -35
- package/models/utils/services/dispense/daily/service.d.ts.map +1 -1
- package/models/utils/services-index.d.ts.map +1 -1
- package/models.cjs +2 -4
- package/models.cjs.map +1 -1
- package/models.d.ts +1 -0
- package/models.js +25 -27
- package/models.js.map +1 -1
- package/package.json +10 -11
- package/{pump-provider-D4Ed_gH6.cjs → pump-provider-D4iVLU-o.cjs} +154 -175
- package/pump-provider-D4iVLU-o.cjs.map +1 -0
- package/{pump-provider-BSEusYig.js → pump-provider-ntLT8vr7.js} +217 -238
- package/pump-provider-ntLT8vr7.js.map +1 -0
- package/ui/contexts/assembly/assembly-provider.d.ts +1 -2
- package/ui/contexts/assembly/assembly-provider.d.ts.map +1 -1
- package/ui/contexts/assembly/index.d.ts.map +1 -1
- package/ui/contexts/availability/availability-provider.d.ts +1 -2
- package/ui/contexts/availability/availability-provider.d.ts.map +1 -1
- package/ui/contexts/availability/index.d.ts.map +1 -1
- package/ui/contexts/board/board-provider.d.ts +1 -2
- package/ui/contexts/board/board-provider.d.ts.map +1 -1
- package/ui/contexts/board/index.d.ts.map +1 -1
- package/ui/contexts/board-container/board-container-provider.d.ts +1 -2
- package/ui/contexts/board-container/board-container-provider.d.ts.map +1 -1
- package/ui/contexts/board-container/index.d.ts.map +1 -1
- package/ui/contexts/cui-kit/cui-kit.d.ts +1 -2
- package/ui/contexts/cui-kit/cui-kit.d.ts.map +1 -1
- package/ui/contexts/cui-kit/index.d.ts.map +1 -1
- package/ui/contexts/device-assembly/device-assembly-provider.d.ts +1 -2
- package/ui/contexts/device-assembly/device-assembly-provider.d.ts.map +1 -1
- package/ui/contexts/device-assembly/index.d.ts.map +1 -1
- package/ui/contexts/holder/holder-provider.d.ts +1 -2
- package/ui/contexts/holder/holder-provider.d.ts.map +1 -1
- package/ui/contexts/holder/index.d.ts.map +1 -1
- package/ui/contexts/holder-container/holder-container-provider.d.ts +1 -2
- package/ui/contexts/holder-container/holder-container-provider.d.ts.map +1 -1
- package/ui/contexts/holder-container/index.d.ts.map +1 -1
- package/ui/contexts/index.d.ts.map +1 -1
- package/ui/contexts/ingredient/index.d.ts.map +1 -1
- package/ui/contexts/ingredient/ingredient-provider.d.ts +1 -2
- package/ui/contexts/ingredient/ingredient-provider.d.ts.map +1 -1
- package/ui/contexts/ingredient-container/index.d.ts.map +1 -1
- package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts +1 -2
- package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts.map +1 -1
- package/ui/contexts/nozzle/index.d.ts.map +1 -1
- package/ui/contexts/nozzle/nozzle-provider.d.ts +1 -2
- package/ui/contexts/nozzle/nozzle-provider.d.ts.map +1 -1
- package/ui/contexts/pump/index.d.ts.map +1 -1
- package/ui/contexts/pump/pump-provider.d.ts +1 -2
- package/ui/contexts/pump/pump-provider.d.ts.map +1 -1
- package/ui/hooks/assembly/index.d.ts.map +1 -1
- package/ui/hooks/assembly/use-assembly.d.ts +1 -2
- package/ui/hooks/assembly/use-assembly.d.ts.map +1 -1
- package/ui/hooks/assembly/with-assembly.d.ts +0 -1
- package/ui/hooks/assembly/with-assembly.d.ts.map +1 -1
- package/ui/hooks/availability/index.d.ts.map +1 -1
- package/ui/hooks/availability/use-availability.d.ts +1 -2
- package/ui/hooks/availability/use-availability.d.ts.map +1 -1
- package/ui/hooks/availability/with-availability.d.ts +0 -1
- package/ui/hooks/availability/with-availability.d.ts.map +1 -1
- package/ui/hooks/board/index.d.ts.map +1 -1
- package/ui/hooks/board/use-board.d.ts +1 -2
- package/ui/hooks/board/use-board.d.ts.map +1 -1
- package/ui/hooks/board/with-board.d.ts +0 -1
- package/ui/hooks/board/with-board.d.ts.map +1 -1
- package/ui/hooks/board-container/index.d.ts.map +1 -1
- package/ui/hooks/board-container/use-board-container.d.ts +1 -2
- package/ui/hooks/board-container/use-board-container.d.ts.map +1 -1
- package/ui/hooks/board-container/with-board-container.d.ts +0 -1
- package/ui/hooks/board-container/with-board-container.d.ts.map +1 -1
- package/ui/hooks/cui-kit/dispense-topics.d.ts +0 -1
- package/ui/hooks/cui-kit/dispense-topics.d.ts.map +1 -1
- package/ui/hooks/cui-kit/index.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-ambient-attract-timers.d.ts +0 -1
- package/ui/hooks/cui-kit/use-ambient-attract-timers.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-beverages.d.ts +1 -2
- package/ui/hooks/cui-kit/use-beverages.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-brands.d.ts +1 -2
- package/ui/hooks/cui-kit/use-brands.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-cui-kit.d.ts +3 -4
- package/ui/hooks/cui-kit/use-cui-kit.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts +0 -1
- package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts +0 -1
- package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-dispense-timers.d.ts +0 -1
- package/ui/hooks/cui-kit/use-dispense-timers.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-flavors.d.ts +1 -2
- package/ui/hooks/cui-kit/use-flavors.d.ts.map +1 -1
- package/ui/hooks/device-assembly/index.d.ts.map +1 -1
- package/ui/hooks/device-assembly/use-device-assembly.d.ts +1 -2
- package/ui/hooks/device-assembly/use-device-assembly.d.ts.map +1 -1
- package/ui/hooks/device-assembly/with-device-assembly.d.ts +0 -1
- package/ui/hooks/device-assembly/with-device-assembly.d.ts.map +1 -1
- package/ui/hooks/generic-pour/index.d.ts.map +1 -1
- package/ui/hooks/generic-pour/use-generic-pour.d.ts +2 -3
- package/ui/hooks/generic-pour/use-generic-pour.d.ts.map +1 -1
- package/ui/hooks/generic-pour/with-generic-pour.d.ts +0 -1
- package/ui/hooks/generic-pour/with-generic-pour.d.ts.map +1 -1
- package/ui/hooks/holder/index.d.ts.map +1 -1
- package/ui/hooks/holder/use-holder.d.ts +1 -2
- package/ui/hooks/holder/use-holder.d.ts.map +1 -1
- package/ui/hooks/holder/with-holder.d.ts +0 -1
- package/ui/hooks/holder/with-holder.d.ts.map +1 -1
- package/ui/hooks/holder-container/index.d.ts.map +1 -1
- package/ui/hooks/holder-container/use-holder-container.d.ts +1 -2
- package/ui/hooks/holder-container/use-holder-container.d.ts.map +1 -1
- package/ui/hooks/holder-container/with-holder-container.d.ts +0 -1
- package/ui/hooks/holder-container/with-holder-container.d.ts.map +1 -1
- package/ui/hooks/index.d.ts.map +1 -1
- package/ui/hooks/ingredient/index.d.ts.map +1 -1
- package/ui/hooks/ingredient/use-ingredient-pour.d.ts +2 -3
- package/ui/hooks/ingredient/use-ingredient-pour.d.ts.map +1 -1
- package/ui/hooks/ingredient/use-ingredient.d.ts +1 -2
- package/ui/hooks/ingredient/use-ingredient.d.ts.map +1 -1
- package/ui/hooks/ingredient/with-ingredient.d.ts +0 -1
- package/ui/hooks/ingredient/with-ingredient.d.ts.map +1 -1
- package/ui/hooks/ingredient-container/index.d.ts.map +1 -1
- package/ui/hooks/ingredient-container/use-ingredient-container.d.ts +1 -2
- package/ui/hooks/ingredient-container/use-ingredient-container.d.ts.map +1 -1
- package/ui/hooks/ingredient-container/with-ingredient-container.d.ts +0 -1
- package/ui/hooks/ingredient-container/with-ingredient-container.d.ts.map +1 -1
- package/ui/hooks/nozzle/index.d.ts.map +1 -1
- package/ui/hooks/nozzle/use-dispense-kit.d.ts +0 -1
- package/ui/hooks/nozzle/use-dispense-kit.d.ts.map +1 -1
- package/ui/hooks/nozzle/use-nozzle.d.ts +1 -2
- package/ui/hooks/nozzle/use-nozzle.d.ts.map +1 -1
- package/ui/hooks/nozzle/with-nozzle.d.ts +0 -1
- package/ui/hooks/nozzle/with-nozzle.d.ts.map +1 -1
- package/ui/hooks/nozzle-pour/index.d.ts.map +1 -1
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts +3 -4
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts.map +1 -1
- package/ui/hooks/pour/index.d.ts.map +1 -1
- package/ui/hooks/pour/use-pour.d.ts +4 -5
- package/ui/hooks/pour/use-pour.d.ts.map +1 -1
- package/ui/hooks/pump/index.d.ts.map +1 -1
- package/ui/hooks/pump/use-pump.d.ts +1 -2
- package/ui/hooks/pump/use-pump.d.ts.map +1 -1
- package/ui/hooks/pump/with-pump.d.ts +0 -1
- package/ui/hooks/pump/with-pump.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts +1 -2
- package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts +0 -1
- package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/index.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts +1 -2
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts +1 -2
- package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts +1 -2
- package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts +0 -1
- package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts.map +1 -1
- package/ui/index.d.ts.map +1 -1
- package/ui/utils/pour-context.d.ts.map +1 -1
- package/ui.cjs +1 -5
- package/ui.cjs.map +1 -1
- package/ui.d.ts +1 -0
- package/ui.js +64 -68
- package/ui.js.map +1 -1
- package/dispense-registration-manager-C6k10ipu.cjs.map +0 -1
- package/dispense-registration-manager-lJlcyq5G.js.map +0 -1
- package/extension-utils-AS0Z5eod.js.map +0 -1
- package/extension-utils-DNbm2KRk.cjs.map +0 -1
- package/kos-models.json +0 -180
- package/pump-provider-BSEusYig.js.map +0 -1
- package/pump-provider-D4Ed_gH6.cjs.map +0 -1
package/{dispense-registration-manager-C6k10ipu.cjs → dispense-registration-manager-BH0mkCQx.cjs}
RENAMED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
-
var __publicField = (obj, key, value) => {
|
|
5
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
-
return value;
|
|
7
|
-
};
|
|
8
2
|
const kosUiSdk = require("@kosdev-code/kos-ui-sdk");
|
|
9
3
|
require("react");
|
|
10
4
|
var ExtensionType = /* @__PURE__ */ ((ExtensionType2) => {
|
|
@@ -47,6 +41,11 @@ var __decorateClass$c = (decorators, target, key, kind) => {
|
|
|
47
41
|
};
|
|
48
42
|
const MODEL_TYPE$c = "ingredient-model";
|
|
49
43
|
let IngredientModelImpl = class {
|
|
44
|
+
id;
|
|
45
|
+
ingredientId;
|
|
46
|
+
name;
|
|
47
|
+
type;
|
|
48
|
+
data;
|
|
50
49
|
constructor(modelId, {
|
|
51
50
|
name,
|
|
52
51
|
type,
|
|
@@ -54,11 +53,6 @@ let IngredientModelImpl = class {
|
|
|
54
53
|
ingredientId,
|
|
55
54
|
...rest
|
|
56
55
|
}) {
|
|
57
|
-
__publicField(this, "id");
|
|
58
|
-
__publicField(this, "ingredientId");
|
|
59
|
-
__publicField(this, "name");
|
|
60
|
-
__publicField(this, "type");
|
|
61
|
-
__publicField(this, "data");
|
|
62
56
|
this.id = modelId;
|
|
63
57
|
this.ingredientId = ingredientId;
|
|
64
58
|
this.name = name;
|
|
@@ -113,16 +107,15 @@ var __decorateClass$b = (decorators, target, key, kind) => {
|
|
|
113
107
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
114
108
|
if (decorator = decorators[i])
|
|
115
109
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
116
|
-
if (kind && result)
|
|
117
|
-
__defProp$9(target, key, result);
|
|
110
|
+
if (kind && result) __defProp$9(target, key, result);
|
|
118
111
|
return result;
|
|
119
112
|
};
|
|
120
113
|
const MODEL_TYPE$b = "ingredient-container-model";
|
|
121
114
|
const log$3 = kosUiSdk.KosLog.createLogger({ name: "ingredient-container-model" });
|
|
122
115
|
let IngredientContainerModelImpl = class {
|
|
116
|
+
id;
|
|
117
|
+
ingredients;
|
|
123
118
|
constructor(modelId, options) {
|
|
124
|
-
__publicField(this, "id");
|
|
125
|
-
__publicField(this, "ingredients");
|
|
126
119
|
this.id = modelId;
|
|
127
120
|
this.ingredients = new kosUiSdk.KosModelContainer({
|
|
128
121
|
indexMap: {
|
|
@@ -139,19 +132,18 @@ let IngredientContainerModelImpl = class {
|
|
|
139
132
|
return this.ingredients.getIndexByKey("ingredientType", type);
|
|
140
133
|
}
|
|
141
134
|
async load(context) {
|
|
142
|
-
var _a;
|
|
143
135
|
log$3.debug(`loading ingredient container ${this.id}`);
|
|
144
136
|
const allIngredients = await getIngredients();
|
|
145
|
-
if (
|
|
137
|
+
if (allIngredients?.status !== 200) {
|
|
146
138
|
throw new Error("Failed to load ingredients");
|
|
147
139
|
}
|
|
148
140
|
const ingredientContext = await kosUiSdk.KosExtensionUtils.executeLoaderExtension({
|
|
149
141
|
context,
|
|
150
142
|
extension: ExtensionType.IngredientLoader
|
|
151
143
|
});
|
|
152
|
-
const ingredientData =
|
|
144
|
+
const ingredientData = allIngredients?.data ?? {};
|
|
153
145
|
for (const key of Object.keys(ingredientData)) {
|
|
154
|
-
for (const ingredientData2 of
|
|
146
|
+
for (const ingredientData2 of allIngredients?.data?.[key] || []) {
|
|
155
147
|
const data = await kosUiSdk.KosExtensionUtils.executeDataMapperExtension({
|
|
156
148
|
extension: ExtensionType.IngredientMapper,
|
|
157
149
|
data: ingredientData2,
|
|
@@ -227,8 +219,7 @@ const unassignHolderIngredient = async (holderPath) => {
|
|
|
227
219
|
return response;
|
|
228
220
|
};
|
|
229
221
|
const replaceLine = async (holderPath) => {
|
|
230
|
-
if (!holderPath)
|
|
231
|
-
throw new Error("Missing holderPath");
|
|
222
|
+
if (!holderPath) throw new Error("Missing holderPath");
|
|
232
223
|
log$2.debug(
|
|
233
224
|
`sending POST request to /api/ext/dispense/pumpEvents/replaceLine/${holderPath}`
|
|
234
225
|
);
|
|
@@ -249,7 +240,6 @@ const getAssignments = async () => {
|
|
|
249
240
|
return response;
|
|
250
241
|
};
|
|
251
242
|
const sendRfidOverride = async (holderPath, overrides) => {
|
|
252
|
-
var _a, _b, _c, _d;
|
|
253
243
|
const factoryJson = JSON.stringify(overrides);
|
|
254
244
|
const url = `${URL$4}/api/ext/dispense/assignments`;
|
|
255
245
|
try {
|
|
@@ -257,15 +247,15 @@ const sendRfidOverride = async (holderPath, overrides) => {
|
|
|
257
247
|
model: { holderPath, factoryJson },
|
|
258
248
|
urlOverride: url
|
|
259
249
|
});
|
|
260
|
-
if (
|
|
250
|
+
if (response?.status === 200 && response?.data?.error) {
|
|
261
251
|
return [response.data.error || "unknownError", response.data];
|
|
262
252
|
}
|
|
263
|
-
return [void 0, response
|
|
253
|
+
return [void 0, response?.data];
|
|
264
254
|
} catch (error) {
|
|
265
255
|
if (error instanceof kosUiSdk.FetchError) {
|
|
266
256
|
return [
|
|
267
|
-
|
|
268
|
-
|
|
257
|
+
error.payload?.data?.error || "unknownError",
|
|
258
|
+
error.payload?.data
|
|
269
259
|
];
|
|
270
260
|
}
|
|
271
261
|
}
|
|
@@ -291,8 +281,7 @@ var __decorateClass$a = (decorators, target, key, kind) => {
|
|
|
291
281
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
292
282
|
if (decorator = decorators[i])
|
|
293
283
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
294
|
-
if (kind && result)
|
|
295
|
-
__defProp$8(target, key, result);
|
|
284
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
296
285
|
return result;
|
|
297
286
|
};
|
|
298
287
|
const MODEL_TYPE$a = DispenseModelType.Holder;
|
|
@@ -316,7 +305,7 @@ kosUiSdk.ExtensionManager[kosUiSdk.EXTENSION_TROUBLE_DATA_MAPPER].register(
|
|
|
316
305
|
const ingredientModel = pumpModel.ingredientId ? kosUiSdk.getKosModelSync(pumpModel.ingredientId).model : void 0;
|
|
317
306
|
return {
|
|
318
307
|
ingredientId: pumpModel.ingredientId,
|
|
319
|
-
ingredientName:
|
|
308
|
+
ingredientName: ingredientModel?.displayName ?? (ingredientModel?.name || ""),
|
|
320
309
|
childPumpName: pumpModel.name
|
|
321
310
|
};
|
|
322
311
|
}
|
|
@@ -343,7 +332,7 @@ kosUiSdk.ExtensionManager[kosUiSdk.EXTENSION_TROUBLE_DATA_MAPPER].register(
|
|
|
343
332
|
const ingredientId = trouble.data.ingredients[0];
|
|
344
333
|
const { model } = kosUiSdk.getKosModelSync(ingredientId);
|
|
345
334
|
return {
|
|
346
|
-
ingredientName:
|
|
335
|
+
ingredientName: model?.displayName ?? (model?.name || ""),
|
|
347
336
|
ingredients: trouble.data.ingredients ? trouble.data.ingredients : [],
|
|
348
337
|
unknonwnIngredientId: trouble.data.unknonwnIngredientId ?? ""
|
|
349
338
|
};
|
|
@@ -352,14 +341,28 @@ kosUiSdk.ExtensionManager[kosUiSdk.EXTENSION_TROUBLE_DATA_MAPPER].register(
|
|
|
352
341
|
}
|
|
353
342
|
);
|
|
354
343
|
class AssignmentError extends Error {
|
|
344
|
+
type;
|
|
355
345
|
constructor(type, message) {
|
|
356
346
|
super(message);
|
|
357
|
-
__publicField(this, "type");
|
|
358
347
|
this.name = "AssignmentError";
|
|
359
348
|
this.type = type;
|
|
360
349
|
}
|
|
361
350
|
}
|
|
362
351
|
let HolderModelImpl = class {
|
|
352
|
+
id;
|
|
353
|
+
path;
|
|
354
|
+
name;
|
|
355
|
+
ingredientId;
|
|
356
|
+
ingredientType;
|
|
357
|
+
ingredientSource;
|
|
358
|
+
group;
|
|
359
|
+
slice;
|
|
360
|
+
logger;
|
|
361
|
+
data;
|
|
362
|
+
enjoyByDate;
|
|
363
|
+
attributes;
|
|
364
|
+
pumps;
|
|
365
|
+
ingredientContainer;
|
|
363
366
|
constructor(modelId, {
|
|
364
367
|
path,
|
|
365
368
|
name,
|
|
@@ -372,20 +375,6 @@ let HolderModelImpl = class {
|
|
|
372
375
|
enjoyByDate,
|
|
373
376
|
attributes
|
|
374
377
|
}, context) {
|
|
375
|
-
__publicField(this, "id");
|
|
376
|
-
__publicField(this, "path");
|
|
377
|
-
__publicField(this, "name");
|
|
378
|
-
__publicField(this, "ingredientId");
|
|
379
|
-
__publicField(this, "ingredientType");
|
|
380
|
-
__publicField(this, "ingredientSource");
|
|
381
|
-
__publicField(this, "group");
|
|
382
|
-
__publicField(this, "slice");
|
|
383
|
-
__publicField(this, "logger");
|
|
384
|
-
__publicField(this, "data");
|
|
385
|
-
__publicField(this, "enjoyByDate");
|
|
386
|
-
__publicField(this, "attributes");
|
|
387
|
-
__publicField(this, "pumps");
|
|
388
|
-
__publicField(this, "ingredientContainer");
|
|
389
378
|
this.id = modelId;
|
|
390
379
|
this.path = path;
|
|
391
380
|
this.name = name;
|
|
@@ -428,8 +417,7 @@ let HolderModelImpl = class {
|
|
|
428
417
|
return !!this.enjoyByDate && !this.unassigned;
|
|
429
418
|
}
|
|
430
419
|
get hasEnjoyByWarning() {
|
|
431
|
-
|
|
432
|
-
return ((_a = this.troublesByType["EnjoyByTrouble"]) == null ? void 0 : _a.length) > 0;
|
|
420
|
+
return this.troublesByType["EnjoyByTrouble"]?.length > 0;
|
|
433
421
|
}
|
|
434
422
|
get nozzlePaths() {
|
|
435
423
|
return this.pumps.data.map((pump) => pump.nozzlePath);
|
|
@@ -451,7 +439,7 @@ let HolderModelImpl = class {
|
|
|
451
439
|
const intent = typeof props === "string" ? props : props.intent;
|
|
452
440
|
const pumpPath = typeof props === "string" ? void 0 : props.pumpPath;
|
|
453
441
|
const pump = pumpPath ? this.pumps.getModel(pumpPath) : this.pumps.data[0];
|
|
454
|
-
return pump
|
|
442
|
+
return pump?.performIntent({ intent });
|
|
455
443
|
}
|
|
456
444
|
get pourState() {
|
|
457
445
|
const state = this.pumps.data.reduce((resolvedState, pump) => {
|
|
@@ -463,8 +451,7 @@ let HolderModelImpl = class {
|
|
|
463
451
|
return state;
|
|
464
452
|
}
|
|
465
453
|
get nozzlePath() {
|
|
466
|
-
|
|
467
|
-
return (_a = this.pumps.data[0]) == null ? void 0 : _a.nozzlePath;
|
|
454
|
+
return this.pumps.data[0]?.nozzlePath;
|
|
468
455
|
}
|
|
469
456
|
get pumpPaths() {
|
|
470
457
|
return this.pumps.data.map((pump) => pump.id);
|
|
@@ -481,11 +468,10 @@ let HolderModelImpl = class {
|
|
|
481
468
|
});
|
|
482
469
|
}
|
|
483
470
|
get ingredient() {
|
|
484
|
-
var _a;
|
|
485
471
|
if (!this.ingredientId) {
|
|
486
472
|
return void 0;
|
|
487
473
|
}
|
|
488
|
-
const ingredient =
|
|
474
|
+
const ingredient = this.ingredientContainer?.ingredients.getModel(
|
|
489
475
|
this.ingredientId
|
|
490
476
|
);
|
|
491
477
|
return ingredient;
|
|
@@ -500,11 +486,10 @@ let HolderModelImpl = class {
|
|
|
500
486
|
}
|
|
501
487
|
}
|
|
502
488
|
get previousIngredient() {
|
|
503
|
-
var _a;
|
|
504
489
|
if (!this.prevIngredientId) {
|
|
505
490
|
return void 0;
|
|
506
491
|
}
|
|
507
|
-
const ingredient =
|
|
492
|
+
const ingredient = this.ingredientContainer?.ingredients.getModel(
|
|
508
493
|
this.prevIngredientId
|
|
509
494
|
);
|
|
510
495
|
return ingredient;
|
|
@@ -519,8 +504,7 @@ let HolderModelImpl = class {
|
|
|
519
504
|
}
|
|
520
505
|
}
|
|
521
506
|
get prevIngredientId() {
|
|
522
|
-
|
|
523
|
-
return (_b = (_a = this.pumps.data) == null ? void 0 : _a[0]) == null ? void 0 : _b.prevIngredientId;
|
|
507
|
+
return this.pumps.data?.[0]?.prevIngredientId;
|
|
524
508
|
}
|
|
525
509
|
get unassigned() {
|
|
526
510
|
return (!this.ingredientId || this.ingredientId === "0") && (!this.prevIngredientId || this.prevIngredientId === "0");
|
|
@@ -574,7 +558,7 @@ let HolderModelImpl = class {
|
|
|
574
558
|
);
|
|
575
559
|
}
|
|
576
560
|
kosUiSdk.kosAction(() => {
|
|
577
|
-
this.ingredientId = result
|
|
561
|
+
this.ingredientId = result?.ingredientId;
|
|
578
562
|
});
|
|
579
563
|
return result;
|
|
580
564
|
} catch (e) {
|
|
@@ -649,7 +633,6 @@ const Holder = {
|
|
|
649
633
|
factory: kosUiSdk.Kos.Factory.create(MODEL_TYPE$a)
|
|
650
634
|
};
|
|
651
635
|
const mapAssemblyHolderToModel = async (group, holderData) => {
|
|
652
|
-
var _a;
|
|
653
636
|
const _ingredientId = kosUiSdk.ExtensionManager.propertyMapper.executeMapper(
|
|
654
637
|
ExtensionType.HolderIngredientMapper,
|
|
655
638
|
holderData
|
|
@@ -681,7 +664,7 @@ const mapAssemblyHolderToModel = async (group, holderData) => {
|
|
|
681
664
|
ingredientId: _ingredientId || ingredientId,
|
|
682
665
|
ingredientType: type || ingType,
|
|
683
666
|
ingredientSource: ingSource,
|
|
684
|
-
enjoyByDate:
|
|
667
|
+
enjoyByDate: holderData.container?.enjoyByDate ? new Date(holderData.container.enjoyByDate) : void 0,
|
|
685
668
|
slice: sliceData,
|
|
686
669
|
group,
|
|
687
670
|
attributes,
|
|
@@ -710,18 +693,17 @@ var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
|
710
693
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
711
694
|
if (decorator = decorators[i])
|
|
712
695
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
713
|
-
if (kind && result)
|
|
714
|
-
__defProp$7(target, key, result);
|
|
696
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
715
697
|
return result;
|
|
716
698
|
};
|
|
717
699
|
const MODEL_TYPE$9 = "board-container-model";
|
|
718
700
|
const TOPIC_BOARD_LINKED = "/kos/hardware/board/linked";
|
|
719
701
|
const TOPIC_BOARD_UNLINKED = "/kos/hardware/board/unlinked";
|
|
720
702
|
exports.BoardContainerModel = class BoardContainerModel {
|
|
703
|
+
id;
|
|
704
|
+
logger;
|
|
705
|
+
models;
|
|
721
706
|
constructor(modelId, options, context) {
|
|
722
|
-
__publicField(this, "id");
|
|
723
|
-
__publicField(this, "logger");
|
|
724
|
-
__publicField(this, "models");
|
|
725
707
|
this.id = modelId;
|
|
726
708
|
this.logger = context.logger;
|
|
727
709
|
this.models = new kosUiSdk.KosModelContainer({
|
|
@@ -792,7 +774,7 @@ const boardTroubleDataMapper = async (trouble) => {
|
|
|
792
774
|
const boardPath = trouble.data.boardPath;
|
|
793
775
|
const { model } = kosUiSdk.getKosModelSync(boardPath);
|
|
794
776
|
return {
|
|
795
|
-
boardName:
|
|
777
|
+
boardName: model?.name || ""
|
|
796
778
|
};
|
|
797
779
|
};
|
|
798
780
|
var __defProp$6 = Object.defineProperty;
|
|
@@ -802,8 +784,7 @@ var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
|
802
784
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
803
785
|
if (decorator = decorators[i])
|
|
804
786
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
805
|
-
if (kind && result)
|
|
806
|
-
__defProp$6(target, key, result);
|
|
787
|
+
if (kind && result) __defProp$6(target, key, result);
|
|
807
788
|
return result;
|
|
808
789
|
};
|
|
809
790
|
const MODEL_TYPE$8 = DispenseModelType.PumpContainer;
|
|
@@ -814,9 +795,9 @@ var PumpIndex = /* @__PURE__ */ ((PumpIndex2) => {
|
|
|
814
795
|
return PumpIndex2;
|
|
815
796
|
})(PumpIndex || {});
|
|
816
797
|
let PumpContainerModelImpl = class {
|
|
798
|
+
id;
|
|
799
|
+
pumps;
|
|
817
800
|
constructor(modelId, options) {
|
|
818
|
-
__publicField(this, "id");
|
|
819
|
-
__publicField(this, "pumps");
|
|
820
801
|
this.id = modelId;
|
|
821
802
|
this.pumps = new kosUiSdk.KosModelContainer({
|
|
822
803
|
indexMap: {
|
|
@@ -905,7 +886,7 @@ const boardTroubleResolver = async (trouble) => {
|
|
|
905
886
|
const pumpContainer = await kosUiSdk.getKosModel(
|
|
906
887
|
PumpContainer.type
|
|
907
888
|
);
|
|
908
|
-
if (pumpContainer
|
|
889
|
+
if (pumpContainer?.model) {
|
|
909
890
|
const boardPumps = pumpContainer.model.models.getIndexByKey(
|
|
910
891
|
PumpIndex.byBoard,
|
|
911
892
|
boardPath
|
|
@@ -950,14 +931,14 @@ kosUiSdk.ExtensionManager[kosUiSdk.EXTENSION_TROUBLE_DATA_MAPPER].register(
|
|
|
950
931
|
boardTroubleDataMapper
|
|
951
932
|
);
|
|
952
933
|
let BoardModelImpl = class {
|
|
934
|
+
id;
|
|
935
|
+
type;
|
|
936
|
+
name;
|
|
937
|
+
path;
|
|
938
|
+
linked;
|
|
939
|
+
instanceId;
|
|
940
|
+
logger;
|
|
953
941
|
constructor(modelId, options, context) {
|
|
954
|
-
__publicField(this, "id");
|
|
955
|
-
__publicField(this, "type");
|
|
956
|
-
__publicField(this, "name");
|
|
957
|
-
__publicField(this, "path");
|
|
958
|
-
__publicField(this, "linked");
|
|
959
|
-
__publicField(this, "instanceId");
|
|
960
|
-
__publicField(this, "logger");
|
|
961
942
|
this.id = modelId;
|
|
962
943
|
this.logger = context.logger;
|
|
963
944
|
mapOptionsToModel(options, this);
|
|
@@ -1008,8 +989,7 @@ var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
|
1008
989
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1009
990
|
if (decorator = decorators[i])
|
|
1010
991
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1011
|
-
if (kind && result)
|
|
1012
|
-
__defProp$5(target, key, result);
|
|
992
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
1013
993
|
return result;
|
|
1014
994
|
};
|
|
1015
995
|
const MODEL_TYPE$6 = DispenseModelType.HolderContainer;
|
|
@@ -1020,10 +1000,10 @@ const TOPIC_REMOVE = "/kos/insertion/remove";
|
|
|
1020
1000
|
const TOPIC_REPLACE_LINE = "/kos/pumpEvent/replaceLine";
|
|
1021
1001
|
const TOPIC_HOLDER_CHANGED = "/kos/handle/*";
|
|
1022
1002
|
let HolderContainerModelImpl = class {
|
|
1003
|
+
id;
|
|
1004
|
+
holders;
|
|
1005
|
+
logger;
|
|
1023
1006
|
constructor(modelId, _options, context) {
|
|
1024
|
-
__publicField(this, "id");
|
|
1025
|
-
__publicField(this, "holders");
|
|
1026
|
-
__publicField(this, "logger");
|
|
1027
1007
|
this.id = modelId;
|
|
1028
1008
|
this.holders = new kosUiSdk.KosModelContainer({
|
|
1029
1009
|
indexMap: {
|
|
@@ -1038,7 +1018,6 @@ let HolderContainerModelImpl = class {
|
|
|
1038
1018
|
updateModel() {
|
|
1039
1019
|
}
|
|
1040
1020
|
handleHolderEvents(event) {
|
|
1041
|
-
var _a, _b, _c;
|
|
1042
1021
|
kosUiSdk.KosLog.ifDebug(
|
|
1043
1022
|
() => this.logger.debug("Received holder change event", JSON.stringify(event))
|
|
1044
1023
|
);
|
|
@@ -1047,9 +1026,9 @@ let HolderContainerModelImpl = class {
|
|
|
1047
1026
|
this.logger.info(
|
|
1048
1027
|
`Received change event for holder ${holder.path}. Updating fuel gauge data.`
|
|
1049
1028
|
);
|
|
1050
|
-
holder.slice.currentVolMl =
|
|
1051
|
-
holder.slice.maxVolMl =
|
|
1052
|
-
if (
|
|
1029
|
+
holder.slice.currentVolMl = event.slice?.currentVolMl;
|
|
1030
|
+
holder.slice.maxVolMl = event.slice?.maxVolMl;
|
|
1031
|
+
if (event?.container?.enjoyByDate) {
|
|
1053
1032
|
holder.enjoyByDate = new Date(event.container.enjoyByDate);
|
|
1054
1033
|
} else {
|
|
1055
1034
|
holder.enjoyByDate = void 0;
|
|
@@ -1063,7 +1042,6 @@ let HolderContainerModelImpl = class {
|
|
|
1063
1042
|
const wrappedData = Array.isArray(data) ? data : [data];
|
|
1064
1043
|
wrappedData.forEach((event) => {
|
|
1065
1044
|
kosUiSdk.kosAction(() => {
|
|
1066
|
-
var _a, _b, _c;
|
|
1067
1045
|
const ingredientId = event.ingredientId;
|
|
1068
1046
|
const holder = this.holders.getModel(event.path);
|
|
1069
1047
|
if (holder) {
|
|
@@ -1071,9 +1049,9 @@ let HolderContainerModelImpl = class {
|
|
|
1071
1049
|
`Received insertion event for holder ${holder.path}`
|
|
1072
1050
|
);
|
|
1073
1051
|
holder.updateIngredient(ingredientId);
|
|
1074
|
-
holder.slice.currentVolMl =
|
|
1075
|
-
holder.slice.maxVolMl =
|
|
1076
|
-
if (
|
|
1052
|
+
holder.slice.currentVolMl = event.slice?.currentVolMl;
|
|
1053
|
+
holder.slice.maxVolMl = event.slice?.maxVolMl;
|
|
1054
|
+
if (event?.container?.enjoyByDate) {
|
|
1077
1055
|
holder.enjoyByDate = new Date(event.container.enjoyByDate);
|
|
1078
1056
|
} else {
|
|
1079
1057
|
holder.enjoyByDate = void 0;
|
|
@@ -1180,7 +1158,7 @@ const sendIntent = async ({
|
|
|
1180
1158
|
}) => {
|
|
1181
1159
|
const url = `${URL$2}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/pour/${pumpId}/${intent}`;
|
|
1182
1160
|
const response = await postModel$2({ model: {}, urlOverride: url, tracker });
|
|
1183
|
-
if (response
|
|
1161
|
+
if (response?.data) {
|
|
1184
1162
|
kosUiSdk.FutureManager.initiateFuture(response.data);
|
|
1185
1163
|
}
|
|
1186
1164
|
return response;
|
|
@@ -1188,7 +1166,7 @@ const sendIntent = async ({
|
|
|
1188
1166
|
const getIntentVolume = async (pumpId, intent) => {
|
|
1189
1167
|
const url = `${URL$2}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/intent/${pumpId}/${intent}/volume`;
|
|
1190
1168
|
const response = await getOne$1({ urlOverride: url });
|
|
1191
|
-
if (!
|
|
1169
|
+
if (!response?.data) {
|
|
1192
1170
|
return { volume: -1 };
|
|
1193
1171
|
}
|
|
1194
1172
|
return response.data;
|
|
@@ -1200,8 +1178,7 @@ var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
|
1200
1178
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1201
1179
|
if (decorator = decorators[i])
|
|
1202
1180
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1203
|
-
if (kind && result)
|
|
1204
|
-
__defProp$4(target, key, result);
|
|
1181
|
+
if (kind && result) __defProp$4(target, key, result);
|
|
1205
1182
|
return result;
|
|
1206
1183
|
};
|
|
1207
1184
|
const MODEL_TYPE$5 = DispenseModelType.Pump;
|
|
@@ -1210,25 +1187,25 @@ kosUiSdk.ExtensionManager[kosUiSdk.EXTENSION_TROUBLE_MAPPER].register(
|
|
|
1210
1187
|
pumpTroubleResolver
|
|
1211
1188
|
);
|
|
1212
1189
|
let PumpModelImpl = class {
|
|
1190
|
+
id;
|
|
1191
|
+
inserted;
|
|
1192
|
+
type;
|
|
1193
|
+
virtual;
|
|
1194
|
+
ingredientId;
|
|
1195
|
+
holderPath;
|
|
1196
|
+
boardPath;
|
|
1197
|
+
nozzlePath;
|
|
1198
|
+
childPump;
|
|
1199
|
+
name;
|
|
1200
|
+
path;
|
|
1201
|
+
prevIngredientId;
|
|
1202
|
+
/**
|
|
1203
|
+
* @kosApiLevel 12
|
|
1204
|
+
*/
|
|
1205
|
+
state;
|
|
1206
|
+
futureHandler;
|
|
1207
|
+
currentState = PourState.IDLE;
|
|
1213
1208
|
constructor(modelId, options) {
|
|
1214
|
-
__publicField(this, "id");
|
|
1215
|
-
__publicField(this, "inserted");
|
|
1216
|
-
__publicField(this, "type");
|
|
1217
|
-
__publicField(this, "virtual");
|
|
1218
|
-
__publicField(this, "ingredientId");
|
|
1219
|
-
__publicField(this, "holderPath");
|
|
1220
|
-
__publicField(this, "boardPath");
|
|
1221
|
-
__publicField(this, "nozzlePath");
|
|
1222
|
-
__publicField(this, "childPump");
|
|
1223
|
-
__publicField(this, "name");
|
|
1224
|
-
__publicField(this, "path");
|
|
1225
|
-
__publicField(this, "prevIngredientId");
|
|
1226
|
-
/**
|
|
1227
|
-
* @kosApiLevel 12
|
|
1228
|
-
*/
|
|
1229
|
-
__publicField(this, "state");
|
|
1230
|
-
__publicField(this, "futureHandler");
|
|
1231
|
-
__publicField(this, "currentState", PourState.IDLE);
|
|
1232
1209
|
this.id = modelId;
|
|
1233
1210
|
const {
|
|
1234
1211
|
inserted,
|
|
@@ -1283,12 +1260,10 @@ let PumpModelImpl = class {
|
|
|
1283
1260
|
}
|
|
1284
1261
|
// -------------------LIFECYCLE----------------------------
|
|
1285
1262
|
get pouringState() {
|
|
1286
|
-
|
|
1287
|
-
return ((_a = this.future) == null ? void 0 : _a.endState) || "";
|
|
1263
|
+
return this.future?.endState || "";
|
|
1288
1264
|
}
|
|
1289
1265
|
get isPouring() {
|
|
1290
|
-
|
|
1291
|
-
return !!(this.future && !((_a = this.future) == null ? void 0 : _a.endState)) || this.currentState === PourState.POUR_STARTING || this.currentState === PourState.POURING;
|
|
1266
|
+
return !!(this.future && !this.future?.endState) || this.currentState === PourState.POUR_STARTING || this.currentState === PourState.POURING;
|
|
1292
1267
|
}
|
|
1293
1268
|
get canPour() {
|
|
1294
1269
|
return !!this.ingredientId && !this.isPouring;
|
|
@@ -1301,10 +1276,9 @@ let PumpModelImpl = class {
|
|
|
1301
1276
|
}
|
|
1302
1277
|
}
|
|
1303
1278
|
async cancelPour() {
|
|
1304
|
-
var _a;
|
|
1305
1279
|
if (this.currentState === PourState.POURING || this.currentState === PourState.POUR_STARTING) {
|
|
1306
1280
|
this.currentState = PourState.POUR_CANCELING;
|
|
1307
|
-
await
|
|
1281
|
+
await this.future?.cancelFuture();
|
|
1308
1282
|
kosUiSdk.kosAction(() => {
|
|
1309
1283
|
this.currentState = PourState.IDLE;
|
|
1310
1284
|
});
|
|
@@ -1339,7 +1313,7 @@ let PumpModelImpl = class {
|
|
|
1339
1313
|
this.currentState = PourState.POURING;
|
|
1340
1314
|
});
|
|
1341
1315
|
}
|
|
1342
|
-
return result
|
|
1316
|
+
return result?.data;
|
|
1343
1317
|
} else {
|
|
1344
1318
|
throw new Error(`Cannot pour in state ${this.currentState}`);
|
|
1345
1319
|
}
|
|
@@ -1390,18 +1364,17 @@ const mapAssemblyPumpToModel = (nozzlePath, pump) => {
|
|
|
1390
1364
|
return pumpModel;
|
|
1391
1365
|
};
|
|
1392
1366
|
const assemblyPumpMap = (pumpContainer) => (holderContainer) => (nozzle) => (assemblyPump) => {
|
|
1393
|
-
var _a;
|
|
1394
1367
|
try {
|
|
1395
1368
|
Logger.debug(`adding pump ${assemblyPump.name}`);
|
|
1396
1369
|
const pump = mapAssemblyPumpToModel(nozzle.path, assemblyPump);
|
|
1397
1370
|
pumpContainer.addModel(pump);
|
|
1398
1371
|
const holderPath = pump.holderPath;
|
|
1399
1372
|
const holder = holderContainer.holders.getModel(holderPath);
|
|
1400
|
-
holder
|
|
1401
|
-
if (!
|
|
1402
|
-
holder
|
|
1373
|
+
holder?.pumps.addModel(pump);
|
|
1374
|
+
if (!holder?.nozzlePaths.includes(nozzle.path)) {
|
|
1375
|
+
holder?.nozzlePaths.push(nozzle.path);
|
|
1403
1376
|
}
|
|
1404
|
-
|
|
1377
|
+
assemblyPump?.pumps?.forEach((subPump) => {
|
|
1405
1378
|
const subHolderPath = pump.holderPath;
|
|
1406
1379
|
const subPumpData = {
|
|
1407
1380
|
...subPump,
|
|
@@ -1423,22 +1396,21 @@ var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
|
1423
1396
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1424
1397
|
if (decorator = decorators[i])
|
|
1425
1398
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1426
|
-
if (kind && result)
|
|
1427
|
-
__defProp$3(target, key, result);
|
|
1399
|
+
if (kind && result) __defProp$3(target, key, result);
|
|
1428
1400
|
return result;
|
|
1429
1401
|
};
|
|
1430
1402
|
const MODEL_TYPE$4 = "assembly-model";
|
|
1431
1403
|
const CONTEXT_ASSEMBLY_DATA = "assembly-data";
|
|
1432
1404
|
const CONTEXT_ASSEMBLY_RAW_DATA = "assembly-raw-data";
|
|
1433
1405
|
let AssemblyModelImpl = class {
|
|
1406
|
+
id;
|
|
1407
|
+
_nozzlePaths = /* @__PURE__ */ new Set();
|
|
1408
|
+
troubleContainer;
|
|
1409
|
+
holderContainer;
|
|
1410
|
+
boardContainer;
|
|
1411
|
+
pumpContainer;
|
|
1412
|
+
logger;
|
|
1434
1413
|
constructor(modelId, _options, context) {
|
|
1435
|
-
__publicField(this, "id");
|
|
1436
|
-
__publicField(this, "_nozzlePaths", /* @__PURE__ */ new Set());
|
|
1437
|
-
__publicField(this, "troubleContainer");
|
|
1438
|
-
__publicField(this, "holderContainer");
|
|
1439
|
-
__publicField(this, "boardContainer");
|
|
1440
|
-
__publicField(this, "pumpContainer");
|
|
1441
|
-
__publicField(this, "logger");
|
|
1442
1414
|
this.id = modelId;
|
|
1443
1415
|
this.holderContainer = HolderContainer.factory({});
|
|
1444
1416
|
this.boardContainer = BoardContainer.factory({});
|
|
@@ -1485,8 +1457,7 @@ let AssemblyModelImpl = class {
|
|
|
1485
1457
|
this.logger.debug(`initializing assembly ${this.id}`);
|
|
1486
1458
|
}
|
|
1487
1459
|
async ready() {
|
|
1488
|
-
|
|
1489
|
-
(_a = this.troubleContainer) == null ? void 0 : _a.troubles.increment();
|
|
1460
|
+
this.troubleContainer?.troubles.increment();
|
|
1490
1461
|
kosUiSdk.ExtensionManager[kosUiSdk.EXTENSION_FEATURE_FLAG_RESOLVER].execute(
|
|
1491
1462
|
ExtensionType.AssemblyFeatureFlags,
|
|
1492
1463
|
this
|
|
@@ -1495,7 +1466,7 @@ let AssemblyModelImpl = class {
|
|
|
1495
1466
|
async load(context) {
|
|
1496
1467
|
this.logger.debug(`loading assembly ${this.id}`);
|
|
1497
1468
|
const result = await getAssembly();
|
|
1498
|
-
if (
|
|
1469
|
+
if (result?.status === 200) {
|
|
1499
1470
|
const data = await kosUiSdk.KosExtensionUtils.executeDataMapperExtension({
|
|
1500
1471
|
extension: ExtensionType.AssemblyMapper,
|
|
1501
1472
|
data: result.data,
|
|
@@ -1523,11 +1494,10 @@ let AssemblyModelImpl = class {
|
|
|
1523
1494
|
this.logger.debug(`adding assembly ${name}`);
|
|
1524
1495
|
this.logger.warn(`Assembly rest keys: ${Object.keys(rest).join(", ")}`);
|
|
1525
1496
|
Object.keys(rest).forEach((key) => {
|
|
1526
|
-
var _a;
|
|
1527
1497
|
this.logger.warn(`Enabling feature flag: ${key}`);
|
|
1528
1498
|
kosUiSdk.KosFeatureFlags.enableFeature(key);
|
|
1529
1499
|
context.set(`assembly-feature-${key}`, rest[key]);
|
|
1530
|
-
if (
|
|
1500
|
+
if (rest[key]["state"]?.["path"] !== void 0) {
|
|
1531
1501
|
const statePath = rest[key]["state"]["path"];
|
|
1532
1502
|
this.logger.warn(`Feature flag ${key} state path: ${statePath}`);
|
|
1533
1503
|
context.set(`assembly-state-path-${key}`, statePath);
|
|
@@ -1597,20 +1567,20 @@ var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
|
1597
1567
|
};
|
|
1598
1568
|
const MODEL_TYPE$3 = DispenseModelType.Availability;
|
|
1599
1569
|
let AvailabilityModelImpl = class {
|
|
1570
|
+
id;
|
|
1571
|
+
data;
|
|
1572
|
+
properties;
|
|
1573
|
+
available;
|
|
1574
|
+
visible;
|
|
1575
|
+
groupId;
|
|
1576
|
+
rawId;
|
|
1577
|
+
altId;
|
|
1578
|
+
type;
|
|
1579
|
+
note;
|
|
1580
|
+
taggedIds;
|
|
1581
|
+
parentId;
|
|
1582
|
+
logger;
|
|
1600
1583
|
constructor(modelId, options, context) {
|
|
1601
|
-
__publicField(this, "id");
|
|
1602
|
-
__publicField(this, "data");
|
|
1603
|
-
__publicField(this, "properties");
|
|
1604
|
-
__publicField(this, "available");
|
|
1605
|
-
__publicField(this, "visible");
|
|
1606
|
-
__publicField(this, "groupId");
|
|
1607
|
-
__publicField(this, "rawId");
|
|
1608
|
-
__publicField(this, "altId");
|
|
1609
|
-
__publicField(this, "type");
|
|
1610
|
-
__publicField(this, "note");
|
|
1611
|
-
__publicField(this, "taggedIds");
|
|
1612
|
-
__publicField(this, "parentId");
|
|
1613
|
-
__publicField(this, "logger");
|
|
1614
1584
|
this.id = modelId;
|
|
1615
1585
|
this.taggedIds = options.taggedIds || [];
|
|
1616
1586
|
this.logger = context.logger;
|
|
@@ -1665,11 +1635,11 @@ const { postModel: postModel$1, deleteModel, getOne } = kosUiSdk.ServiceFactory.
|
|
|
1665
1635
|
const pourPourable = async (nozzleId, tracker) => {
|
|
1666
1636
|
const response = await postModel$1({
|
|
1667
1637
|
model: {},
|
|
1668
|
-
urlOverride: `${URL$1}/api/ext/dispense/nozzle/${nozzleId}/pipeline/beverage/pour`,
|
|
1638
|
+
urlOverride: `${URL$1}/api/ext/dispense/nozzle/${nozzleId}/pipeline/beverage/pour/selected/maxVolume`,
|
|
1669
1639
|
ordered: true,
|
|
1670
1640
|
tracker
|
|
1671
1641
|
});
|
|
1672
|
-
if (response
|
|
1642
|
+
if (response?.data) {
|
|
1673
1643
|
kosUiSdk.FutureManager.initiateFuture(response.data);
|
|
1674
1644
|
}
|
|
1675
1645
|
return response;
|
|
@@ -1681,7 +1651,7 @@ const pourNamedPourable = async (name, nozzleId, tracker) => {
|
|
|
1681
1651
|
ordered: true,
|
|
1682
1652
|
tracker
|
|
1683
1653
|
});
|
|
1684
|
-
if (response
|
|
1654
|
+
if (response?.data) {
|
|
1685
1655
|
kosUiSdk.FutureManager.initiateFuture(response.data);
|
|
1686
1656
|
}
|
|
1687
1657
|
return response;
|
|
@@ -1713,8 +1683,7 @@ var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
|
1713
1683
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1714
1684
|
if (decorator = decorators[i])
|
|
1715
1685
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1716
|
-
if (kind && result)
|
|
1717
|
-
__defProp$2(target, key, result);
|
|
1686
|
+
if (kind && result) __defProp$2(target, key, result);
|
|
1718
1687
|
return result;
|
|
1719
1688
|
};
|
|
1720
1689
|
const MODEL_TYPE$2 = DispenseModelType.Nozzle;
|
|
@@ -1726,37 +1695,18 @@ const TOPIC_NOZZLE_POUR_STARTED = "/kos/nozzle/pour/started";
|
|
|
1726
1695
|
const TOPIC_NOZZLE_POUR_PROGRESS = "/kos/nozzle/pour/progress";
|
|
1727
1696
|
const TOPIC_NOZZLE_POUR_CANCEL = "/kos/nozzle/pour/cancel";
|
|
1728
1697
|
let NozzleModelImpl = class {
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
__publicField(this, "urlPrefix");
|
|
1742
|
-
this.id = modelId;
|
|
1743
|
-
this.path = options.path;
|
|
1744
|
-
this.name = options.name;
|
|
1745
|
-
this.beverageTopicPrefix = options.beverageTopicPrefix;
|
|
1746
|
-
this.topicPrefix = options.topicPrefix;
|
|
1747
|
-
this.urlPrefix = options.urlPrefix;
|
|
1748
|
-
this._selectedBeverage = void 0;
|
|
1749
|
-
this._selectedBrand = void 0;
|
|
1750
|
-
this._additionalItems = [];
|
|
1751
|
-
this.futureHandler = new kosUiSdk.MultipleFutureHandler(this);
|
|
1752
|
-
this._availabilityItems = new kosUiSdk.KosModelContainer({
|
|
1753
|
-
indexMap: {
|
|
1754
|
-
byGroup: "groupId",
|
|
1755
|
-
byParent: "parentId"
|
|
1756
|
-
},
|
|
1757
|
-
parentId: modelId
|
|
1758
|
-
});
|
|
1759
|
-
}
|
|
1698
|
+
/** the unique identifier for this nozzle.*/
|
|
1699
|
+
id;
|
|
1700
|
+
path;
|
|
1701
|
+
name;
|
|
1702
|
+
_selectedBeverage;
|
|
1703
|
+
_selectedBrand;
|
|
1704
|
+
_additionalItems;
|
|
1705
|
+
_availabilityItems;
|
|
1706
|
+
futureHandler;
|
|
1707
|
+
beverageTopicPrefix;
|
|
1708
|
+
topicPrefix;
|
|
1709
|
+
urlPrefix;
|
|
1760
1710
|
/**
|
|
1761
1711
|
* The availability nodes that can be dispensed from this nozzle.
|
|
1762
1712
|
* This is a subset of the availability for the entire dispenser
|
|
@@ -1783,8 +1733,7 @@ let NozzleModelImpl = class {
|
|
|
1783
1733
|
* @readonly
|
|
1784
1734
|
*/
|
|
1785
1735
|
get isPouring() {
|
|
1786
|
-
|
|
1787
|
-
return !!(this.futureHandler.getFuture() && !((_a = this.futureHandler.getFuture()) == null ? void 0 : _a.endState)) || this.currentState === PourState.POUR_STARTING || this.currentState === PourState.POURING || this.currentState === PourState.POUR_CANCELING;
|
|
1736
|
+
return !!(this.futureHandler.getFuture() && !this.futureHandler.getFuture()?.endState) || this.currentState === PourState.POUR_STARTING || this.currentState === PourState.POURING || this.currentState === PourState.POUR_CANCELING;
|
|
1788
1737
|
}
|
|
1789
1738
|
/**
|
|
1790
1739
|
* A derived value that indicates if the nozzle is currently available to pour a beverage.
|
|
@@ -1815,8 +1764,26 @@ let NozzleModelImpl = class {
|
|
|
1815
1764
|
return this.futureHandler.getFuture();
|
|
1816
1765
|
}
|
|
1817
1766
|
get pourProgress() {
|
|
1818
|
-
|
|
1819
|
-
|
|
1767
|
+
return this.future?.progress ?? 0;
|
|
1768
|
+
}
|
|
1769
|
+
constructor(modelId, options) {
|
|
1770
|
+
this.id = modelId;
|
|
1771
|
+
this.path = options.path;
|
|
1772
|
+
this.name = options.name;
|
|
1773
|
+
this.beverageTopicPrefix = options.beverageTopicPrefix;
|
|
1774
|
+
this.topicPrefix = options.topicPrefix;
|
|
1775
|
+
this.urlPrefix = options.urlPrefix;
|
|
1776
|
+
this._selectedBeverage = void 0;
|
|
1777
|
+
this._selectedBrand = void 0;
|
|
1778
|
+
this._additionalItems = [];
|
|
1779
|
+
this.futureHandler = new kosUiSdk.MultipleFutureHandler(this);
|
|
1780
|
+
this._availabilityItems = new kosUiSdk.KosModelContainer({
|
|
1781
|
+
indexMap: {
|
|
1782
|
+
byGroup: "groupId",
|
|
1783
|
+
byParent: "parentId"
|
|
1784
|
+
},
|
|
1785
|
+
parentId: modelId
|
|
1786
|
+
});
|
|
1820
1787
|
}
|
|
1821
1788
|
updateModel() {
|
|
1822
1789
|
}
|
|
@@ -1842,7 +1809,7 @@ let NozzleModelImpl = class {
|
|
|
1842
1809
|
async setSelectedPourable({ beverage, additional, context }, forceUpdate = false) {
|
|
1843
1810
|
if (!beverage) {
|
|
1844
1811
|
const response2 = await clearPourable(this.name);
|
|
1845
|
-
if (
|
|
1812
|
+
if (response2?.status !== 200) {
|
|
1846
1813
|
throw new Error("Failed to clear pourable");
|
|
1847
1814
|
}
|
|
1848
1815
|
this._selectedBeverage = void 0;
|
|
@@ -1881,7 +1848,7 @@ let NozzleModelImpl = class {
|
|
|
1881
1848
|
}
|
|
1882
1849
|
const payload = selectedPayload ?? defaultPayload;
|
|
1883
1850
|
const response = await selectPourable(this.name, payload);
|
|
1884
|
-
if (
|
|
1851
|
+
if (response?.status !== 200) {
|
|
1885
1852
|
throw new Error("Failed to select pourable");
|
|
1886
1853
|
}
|
|
1887
1854
|
}
|
|
@@ -1918,9 +1885,8 @@ let NozzleModelImpl = class {
|
|
|
1918
1885
|
handlePouringStart() {
|
|
1919
1886
|
this.logger.info("Pour started");
|
|
1920
1887
|
kosUiSdk.getAllKosCompanionModels(this).forEach((model) => {
|
|
1921
|
-
var _a;
|
|
1922
1888
|
if (isPourAware$1(model)) {
|
|
1923
|
-
|
|
1889
|
+
model.onPourStart?.();
|
|
1924
1890
|
}
|
|
1925
1891
|
});
|
|
1926
1892
|
}
|
|
@@ -1933,9 +1899,8 @@ let NozzleModelImpl = class {
|
|
|
1933
1899
|
handleCanceled() {
|
|
1934
1900
|
this.logger.info("Pour canceled");
|
|
1935
1901
|
kosUiSdk.getAllKosCompanionModels(this).forEach((model) => {
|
|
1936
|
-
var _a;
|
|
1937
1902
|
if (isPourAware$1(model)) {
|
|
1938
|
-
|
|
1903
|
+
model.onPourCancel?.();
|
|
1939
1904
|
}
|
|
1940
1905
|
});
|
|
1941
1906
|
const evt = {
|
|
@@ -1975,7 +1940,6 @@ let NozzleModelImpl = class {
|
|
|
1975
1940
|
}
|
|
1976
1941
|
// Inherits throwOnInvalid: false from class
|
|
1977
1942
|
async pour(tracker) {
|
|
1978
|
-
var _a;
|
|
1979
1943
|
try {
|
|
1980
1944
|
this.transition("START_POUR");
|
|
1981
1945
|
if (!tracker) {
|
|
@@ -1988,7 +1952,7 @@ let NozzleModelImpl = class {
|
|
|
1988
1952
|
type: "free"
|
|
1989
1953
|
};
|
|
1990
1954
|
kosUiSdk.EventBus.publish(TOPIC_NOZZLE_POUR_STARTED, evt);
|
|
1991
|
-
if (
|
|
1955
|
+
if (result?.data?.endState) {
|
|
1992
1956
|
this.transition("POUR_COMPLETED");
|
|
1993
1957
|
}
|
|
1994
1958
|
return result;
|
|
@@ -2002,7 +1966,6 @@ let NozzleModelImpl = class {
|
|
|
2002
1966
|
}
|
|
2003
1967
|
// Inherits throwOnInvalid: false from class
|
|
2004
1968
|
async fixedPour(name, tracker) {
|
|
2005
|
-
var _a;
|
|
2006
1969
|
try {
|
|
2007
1970
|
this.transition("START_POUR");
|
|
2008
1971
|
if (!tracker) {
|
|
@@ -2015,7 +1978,7 @@ let NozzleModelImpl = class {
|
|
|
2015
1978
|
type: "fixed"
|
|
2016
1979
|
};
|
|
2017
1980
|
kosUiSdk.EventBus.publish(TOPIC_NOZZLE_POUR_STARTED, evt);
|
|
2018
|
-
if (
|
|
1981
|
+
if (result?.data?.endState) {
|
|
2019
1982
|
this.transition("POUR_COMPLETED");
|
|
2020
1983
|
}
|
|
2021
1984
|
return result;
|
|
@@ -2029,9 +1992,8 @@ let NozzleModelImpl = class {
|
|
|
2029
1992
|
}
|
|
2030
1993
|
// Inherits throwOnInvalid: false - silently ignore if already idle
|
|
2031
1994
|
async cancelPour() {
|
|
2032
|
-
var _a;
|
|
2033
1995
|
this.transition("CANCEL_POUR");
|
|
2034
|
-
await
|
|
1996
|
+
await this.futureHandler.getFuture()?.cancelFuture();
|
|
2035
1997
|
this.transition("POUR_CANCELED");
|
|
2036
1998
|
}
|
|
2037
1999
|
updateGroupMembers() {
|
|
@@ -2051,33 +2013,32 @@ let NozzleModelImpl = class {
|
|
|
2051
2013
|
async reload() {
|
|
2052
2014
|
this.logger.info(`reloading nozzle ${this.id}`);
|
|
2053
2015
|
const context = kosUiSdk.KosContextManager.getContext(this.id);
|
|
2054
|
-
|
|
2016
|
+
context?.get(ExtensionType.AvailabilityLoader) || {};
|
|
2055
2017
|
const availability = await getAvailability(this.urlPrefix);
|
|
2056
|
-
if (
|
|
2018
|
+
if (availability?.status !== 200 || !availability?.data) {
|
|
2057
2019
|
this.logger.error("Failed to load nozzle availability");
|
|
2058
2020
|
return;
|
|
2059
2021
|
}
|
|
2060
|
-
const update = availability
|
|
2022
|
+
const update = availability?.data;
|
|
2061
2023
|
if (update) {
|
|
2062
2024
|
await this.updateAvailability(update);
|
|
2063
2025
|
}
|
|
2064
2026
|
}
|
|
2065
2027
|
/** @internal */
|
|
2066
2028
|
async load(context) {
|
|
2067
|
-
var _a, _b;
|
|
2068
2029
|
this.logger.debug(`loading nozzle ${this.id}`);
|
|
2069
2030
|
const availability = await getAvailability(this.urlPrefix);
|
|
2070
|
-
if (
|
|
2031
|
+
if (availability?.status !== 200) {
|
|
2071
2032
|
throw new Error("Failed to load nozzle availability");
|
|
2072
2033
|
}
|
|
2073
2034
|
const beverageContext = await kosUiSdk.ExtensionManager.loader.executeLoader(
|
|
2074
2035
|
ExtensionType.AvailabilityLoader,
|
|
2075
2036
|
{}
|
|
2076
2037
|
);
|
|
2077
|
-
context
|
|
2078
|
-
context
|
|
2079
|
-
for (const group of Object.keys(
|
|
2080
|
-
for (const beverageData of
|
|
2038
|
+
context?.set(ExtensionType.AvailabilityLoader, beverageContext);
|
|
2039
|
+
context?.set(Nozzle.type, this);
|
|
2040
|
+
for (const group of Object.keys(availability.data?.groups) || []) {
|
|
2041
|
+
for (const beverageData of availability.data?.groups[group] || []) {
|
|
2081
2042
|
const extensionData = await kosUiSdk.ExtensionManager.dataMapper.executeMapper(
|
|
2082
2043
|
ExtensionType.AvailabilityMapper,
|
|
2083
2044
|
{ ...beverageData, groupId: group },
|
|
@@ -2102,19 +2063,25 @@ let NozzleModelImpl = class {
|
|
|
2102
2063
|
}
|
|
2103
2064
|
async updateAvailability(update) {
|
|
2104
2065
|
const context = kosUiSdk.KosContextManager.getContext(this.id);
|
|
2105
|
-
const beverageContext =
|
|
2066
|
+
const beverageContext = context?.get(ExtensionType.AvailabilityLoader) || {};
|
|
2106
2067
|
if (update.rebuild) {
|
|
2107
|
-
|
|
2068
|
+
this.logger.info(
|
|
2069
|
+
`Received rebuild update for nozzle ${this.path}, rebuilding entire availability set`
|
|
2070
|
+
);
|
|
2071
|
+
for (const group of Object.keys(update?.groups) || []) {
|
|
2108
2072
|
const deletedBeverages = this._availabilityItems.getIndexByKey("group", group).filter(
|
|
2109
2073
|
(beverage) => !update.groups[group].find(
|
|
2110
2074
|
(b) => `${this.id}-${group}-${b.id}` === beverage.id
|
|
2111
2075
|
)
|
|
2112
2076
|
);
|
|
2113
2077
|
deletedBeverages.forEach((beverage) => {
|
|
2078
|
+
this.logger.info(
|
|
2079
|
+
`Removing beverage ${beverage.id} from nozzle ${this.path} due to rebuild update`
|
|
2080
|
+
);
|
|
2114
2081
|
this._availabilityItems.removeModel(beverage.id);
|
|
2115
2082
|
kosUiSdk.destroyKosModel(beverage);
|
|
2116
2083
|
});
|
|
2117
|
-
for (const beverageData of
|
|
2084
|
+
for (const beverageData of update?.groups[group] || []) {
|
|
2118
2085
|
const extensionData = await kosUiSdk.ExtensionManager.dataMapper.executeMapper(
|
|
2119
2086
|
ExtensionType.AvailabilityMapper,
|
|
2120
2087
|
{ ...beverageData, groupId: group },
|
|
@@ -2134,8 +2101,16 @@ let NozzleModelImpl = class {
|
|
|
2134
2101
|
`${this.id}-${group}-${beverageData.id}`
|
|
2135
2102
|
);
|
|
2136
2103
|
if (existing) {
|
|
2104
|
+
if (existing.available !== beverageOptions.available) {
|
|
2105
|
+
this.logger.info(
|
|
2106
|
+
`Updating availability of beverage ${existing.id} in nozzle ${this.path} to ${beverageOptions.available}`
|
|
2107
|
+
);
|
|
2108
|
+
}
|
|
2137
2109
|
existing.updateModel(beverageOptions);
|
|
2138
2110
|
} else {
|
|
2111
|
+
this.logger.info(
|
|
2112
|
+
`Adding beverage ${beverageData.id} to nozzle ${this.path}`
|
|
2113
|
+
);
|
|
2139
2114
|
const beverage = Availability.factory(
|
|
2140
2115
|
`${this.id}-${group}-${beverageData.id}`
|
|
2141
2116
|
)(beverageOptions);
|
|
@@ -2144,8 +2119,11 @@ let NozzleModelImpl = class {
|
|
|
2144
2119
|
}
|
|
2145
2120
|
}
|
|
2146
2121
|
} else {
|
|
2147
|
-
|
|
2148
|
-
|
|
2122
|
+
this.logger.info(
|
|
2123
|
+
`Received delta update for nozzle ${this.path}, updating availability nodes`
|
|
2124
|
+
);
|
|
2125
|
+
for (const group of Object.keys(update?.groups) || []) {
|
|
2126
|
+
for (const beverageData of update?.groups[group] || []) {
|
|
2149
2127
|
const extensionData = await kosUiSdk.ExtensionManager.dataMapper.executeMapper(
|
|
2150
2128
|
ExtensionType.AvailabilityMapper,
|
|
2151
2129
|
{ ...beverageData, groupId: group },
|
|
@@ -2166,6 +2144,11 @@ let NozzleModelImpl = class {
|
|
|
2166
2144
|
`${this.id}-${group}-${beverageData.id}`
|
|
2167
2145
|
);
|
|
2168
2146
|
if (existing) {
|
|
2147
|
+
if (existing.available !== beverageOptions.available) {
|
|
2148
|
+
this.logger.info(
|
|
2149
|
+
`Updating availability of beverage ${existing.id} in nozzle ${this.path} to ${beverageOptions.available}`
|
|
2150
|
+
);
|
|
2151
|
+
}
|
|
2169
2152
|
existing.updateModel(beverageOptions);
|
|
2170
2153
|
}
|
|
2171
2154
|
}
|
|
@@ -2267,16 +2250,15 @@ var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
|
2267
2250
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2268
2251
|
if (decorator = decorators[i])
|
|
2269
2252
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2270
|
-
if (kind && result)
|
|
2271
|
-
__defProp$1(target, key, result);
|
|
2253
|
+
if (kind && result) __defProp$1(target, key, result);
|
|
2272
2254
|
return result;
|
|
2273
2255
|
};
|
|
2274
2256
|
const MODEL_TYPE$1 = "device-assembly-model";
|
|
2275
2257
|
let DeviceAssemblyModelImpl = class {
|
|
2258
|
+
id;
|
|
2259
|
+
deviceNozzles;
|
|
2260
|
+
logger;
|
|
2276
2261
|
constructor(modelId, _options, context) {
|
|
2277
|
-
__publicField(this, "id");
|
|
2278
|
-
__publicField(this, "deviceNozzles");
|
|
2279
|
-
__publicField(this, "logger");
|
|
2280
2262
|
this.id = modelId;
|
|
2281
2263
|
this.logger = context.logger;
|
|
2282
2264
|
this.deviceNozzles = new kosUiSdk.KosModelContainer();
|
|
@@ -2294,12 +2276,11 @@ let DeviceAssemblyModelImpl = class {
|
|
|
2294
2276
|
async load() {
|
|
2295
2277
|
this.logger.debug(`loading device-assembly ${this.id}`);
|
|
2296
2278
|
const result = await getAssembly();
|
|
2297
|
-
if (
|
|
2279
|
+
if (result?.status === 200) {
|
|
2298
2280
|
const nozzles = result.data.assemblies.map((assembly) => assembly.nozzles ?? []).flat();
|
|
2299
2281
|
nozzles.forEach((nozzleData) => {
|
|
2300
|
-
var _a;
|
|
2301
2282
|
const nozzleId = nozzleData.path;
|
|
2302
|
-
const beverageTopicPrefix =
|
|
2283
|
+
const beverageTopicPrefix = nozzleData.pipelines.find((pipeline) => pipeline.name === "beverage")?.topicPrefix || "";
|
|
2303
2284
|
const nozzle = Nozzle.factory(nozzleId)({
|
|
2304
2285
|
path: nozzleData.path,
|
|
2305
2286
|
name: nozzleData.name,
|
|
@@ -2333,20 +2314,19 @@ const pourOnTarget = async (path, tracker) => {
|
|
|
2333
2314
|
ordered: true,
|
|
2334
2315
|
tracker
|
|
2335
2316
|
});
|
|
2336
|
-
if (response
|
|
2317
|
+
if (response?.data) {
|
|
2337
2318
|
kosUiSdk.FutureManager.initiateFuture(response.data);
|
|
2338
2319
|
}
|
|
2339
2320
|
return response;
|
|
2340
2321
|
};
|
|
2341
|
-
var
|
|
2322
|
+
var __defProp = Object.defineProperty;
|
|
2342
2323
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
2343
2324
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
2344
2325
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
2345
2326
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2346
2327
|
if (decorator = decorators[i])
|
|
2347
2328
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2348
|
-
if (kind && result)
|
|
2349
|
-
__defProp2(target, key, result);
|
|
2329
|
+
if (kind && result) __defProp(target, key, result);
|
|
2350
2330
|
return result;
|
|
2351
2331
|
};
|
|
2352
2332
|
const MODEL_TYPE = "generic-pour-model";
|
|
@@ -2355,18 +2335,18 @@ const TOPIC_GENERIC_POUR_PROGRESS = "/kos/generic/pour/progress";
|
|
|
2355
2335
|
const TOPIC_GENERIC_POUR_CANCEL = "/kos/generic/pour/cancel";
|
|
2356
2336
|
const isPourAware = (model) => model.onPourStart !== void 0 && model.onPourCancel !== void 0 && model.onPourProgress !== void 0;
|
|
2357
2337
|
let GenericPourModelImpl = class {
|
|
2338
|
+
id;
|
|
2339
|
+
/**
|
|
2340
|
+
* @kosApiLevel 5
|
|
2341
|
+
*/
|
|
2342
|
+
servicePathFactory;
|
|
2343
|
+
pourType;
|
|
2344
|
+
/**
|
|
2345
|
+
* @kosApiLevel 5
|
|
2346
|
+
*/
|
|
2347
|
+
selectedId;
|
|
2348
|
+
state;
|
|
2358
2349
|
constructor(modelId, options) {
|
|
2359
|
-
__publicField(this, "id");
|
|
2360
|
-
/**
|
|
2361
|
-
* @kosApiLevel 5
|
|
2362
|
-
*/
|
|
2363
|
-
__publicField(this, "servicePathFactory");
|
|
2364
|
-
__publicField(this, "pourType");
|
|
2365
|
-
/**
|
|
2366
|
-
* @kosApiLevel 5
|
|
2367
|
-
*/
|
|
2368
|
-
__publicField(this, "selectedId");
|
|
2369
|
-
__publicField(this, "state");
|
|
2370
2350
|
this.id = modelId;
|
|
2371
2351
|
this.futureHandler = new kosUiSdk.FutureHandler(this);
|
|
2372
2352
|
this.servicePathFactory = options.servicePathFactory;
|
|
@@ -2412,9 +2392,8 @@ let GenericPourModelImpl = class {
|
|
|
2412
2392
|
handlePouringStart() {
|
|
2413
2393
|
this.logger.info("Pour started");
|
|
2414
2394
|
kosUiSdk.getAllKosCompanionModels(this).forEach((model) => {
|
|
2415
|
-
var _a;
|
|
2416
2395
|
if (isPourAware(model)) {
|
|
2417
|
-
|
|
2396
|
+
model.onPourStart?.();
|
|
2418
2397
|
}
|
|
2419
2398
|
});
|
|
2420
2399
|
const evt = {
|
|
@@ -2432,9 +2411,8 @@ let GenericPourModelImpl = class {
|
|
|
2432
2411
|
handleCanceled() {
|
|
2433
2412
|
this.logger.info("Pour canceled");
|
|
2434
2413
|
kosUiSdk.getAllKosCompanionModels(this).forEach((model) => {
|
|
2435
|
-
var _a;
|
|
2436
2414
|
if (isPourAware(model)) {
|
|
2437
|
-
|
|
2415
|
+
model.onPourCancel?.();
|
|
2438
2416
|
}
|
|
2439
2417
|
});
|
|
2440
2418
|
const evt = {
|
|
@@ -2444,7 +2422,6 @@ let GenericPourModelImpl = class {
|
|
|
2444
2422
|
}
|
|
2445
2423
|
// Inherits throwOnInvalid: false from class
|
|
2446
2424
|
async pour(tracker) {
|
|
2447
|
-
var _a;
|
|
2448
2425
|
try {
|
|
2449
2426
|
this.transition("START_POUR");
|
|
2450
2427
|
if (!tracker) {
|
|
@@ -2452,7 +2429,7 @@ let GenericPourModelImpl = class {
|
|
|
2452
2429
|
}
|
|
2453
2430
|
const result = await pourOnTarget(this.servicePath, tracker);
|
|
2454
2431
|
this.transition("POUR_ACTIVE");
|
|
2455
|
-
if (
|
|
2432
|
+
if (result?.data?.endState) {
|
|
2456
2433
|
this.transition("POUR_COMPLETED");
|
|
2457
2434
|
}
|
|
2458
2435
|
return result;
|
|
@@ -2466,9 +2443,8 @@ let GenericPourModelImpl = class {
|
|
|
2466
2443
|
}
|
|
2467
2444
|
// Inherits throwOnInvalid: false - silently ignore if already idle
|
|
2468
2445
|
async cancelPour() {
|
|
2469
|
-
var _a;
|
|
2470
2446
|
this.transition("CANCEL_POUR");
|
|
2471
|
-
await
|
|
2447
|
+
await this.futureHandler.getFuture()?.cancelFuture();
|
|
2472
2448
|
this.transition("POUR_CANCELED");
|
|
2473
2449
|
}
|
|
2474
2450
|
// ============================================================================
|
|
@@ -2479,8 +2455,7 @@ let GenericPourModelImpl = class {
|
|
|
2479
2455
|
* @readonly
|
|
2480
2456
|
*/
|
|
2481
2457
|
get isPouring() {
|
|
2482
|
-
|
|
2483
|
-
return !!(this.future && !((_a = this.future) == null ? void 0 : _a.endState)) || this.currentState === PourState.POUR_STARTING || this.currentState === PourState.POURING || this.currentState === PourState.POUR_CANCELING;
|
|
2458
|
+
return !!(this.future && !this.future?.endState) || this.currentState === PourState.POUR_STARTING || this.currentState === PourState.POURING || this.currentState === PourState.POUR_CANCELING;
|
|
2484
2459
|
}
|
|
2485
2460
|
/**
|
|
2486
2461
|
* A derived value that indicates if the pour target is currently available to pour a beverage.
|
|
@@ -2615,8 +2590,7 @@ const registerDispenseModels = (root) => () => {
|
|
|
2615
2590
|
kosUiSdk.ExtensionManager[kosUiSdk.EXTENSION_TROUBLE_DATA_MAPPER].register(
|
|
2616
2591
|
"FirmwareUpdateInProgressTrouble",
|
|
2617
2592
|
async (trouble) => {
|
|
2618
|
-
|
|
2619
|
-
if ((_a = trouble.data) == null ? void 0 : _a.deviceId) {
|
|
2593
|
+
if (trouble.data?.deviceId) {
|
|
2620
2594
|
const { model: assemblyModel } = kosUiSdk.getKosModelSync(
|
|
2621
2595
|
Assembly.type
|
|
2622
2596
|
);
|
|
@@ -2695,4 +2669,4 @@ exports.selectPourable = selectPourable;
|
|
|
2695
2669
|
exports.sendIntent = sendIntent;
|
|
2696
2670
|
exports.sendRfidOverride = sendRfidOverride;
|
|
2697
2671
|
exports.unassignHolderIngredient = unassignHolderIngredient;
|
|
2698
|
-
//# sourceMappingURL=dispense-registration-manager-
|
|
2672
|
+
//# sourceMappingURL=dispense-registration-manager-BH0mkCQx.cjs.map
|