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