@kosdev-code/kos-freestyle-sdk 2.1.28 → 2.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{extension-utils-CbiToj2v.cjs → extension-utils-BIzRIXwB.cjs} +2 -2
- package/{extension-utils-CbiToj2v.cjs.map → extension-utils-BIzRIXwB.cjs.map} +1 -1
- package/{extension-utils-DP5eulYE.js → extension-utils-D-CdnEQJ.js} +2 -2
- package/{extension-utils-DP5eulYE.js.map → extension-utils-D-CdnEQJ.js.map} +1 -1
- package/index.cjs +1 -1
- package/index.js +3 -3
- package/models/models/agitation-required-trouble/agitation-required-trouble-model.d.ts.map +1 -1
- package/models.cjs +1 -1
- package/models.js +2 -2
- package/package.json +2 -2
- package/{service-_jG-Kd3m.js → service-B5BitF77.js} +4 -2
- package/{service-_jG-Kd3m.js.map → service-B5BitF77.js.map} +1 -1
- package/{service-BYZ3LYEa.cjs → service-Dlc0A1Rk.cjs} +2 -2
- package/{service-BYZ3LYEa.cjs.map → service-Dlc0A1Rk.cjs.map} +1 -1
- package/ui.cjs +1 -1
- package/ui.js +2 -2
- package/{use-nutrition-info-B9ybCLwb.js → use-nutrition-info-CGBsABee.js} +2 -2
- package/{use-nutrition-info-B9ybCLwb.js.map → use-nutrition-info-CGBsABee.js.map} +1 -1
- package/{use-nutrition-info-C-RDcG4S.cjs → use-nutrition-info-tOQ6wnpq.cjs} +2 -2
- package/{use-nutrition-info-C-RDcG4S.cjs.map → use-nutrition-info-tOQ6wnpq.cjs.map} +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-BYZ3LYEa.cjs","sources":["../../../../packages/sdk/kos-freestyle-sdk/src/models/models/carb-agitator/services/carb-tank-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/carb-agitator/carb-agitator-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-container-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/services/cartridge-agitator-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-container-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cgp-pump/cgp-pump-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/fcm-pump/services/fcm-pump-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/fcm-pump/fcm-pump-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/fcm-pump/fcm-pump-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-assembly/freestyle-assembly-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-assembly/freestyle-assembly-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-container-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-container-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-holder/freestyle-holder-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-holder/freestyle-holder-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-nozzle/services/freestyle-nozzle-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-nozzle/freestyle-nozzle-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-nozzle/freestyle-nozzle-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-pump/services/freestyle-pump-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-pump/freestyle-pump-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-pump/freestyle-pump-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/ice-agitator/services/ice-agitator-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/ice-agitator/ice-agitator-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/ice-agitator/ice-agitator-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/lfcv-pump/lfcv-pump-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/lfcv-pump/lfcv-pump-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/lfcv-pump/services/lfcv-pump-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/spm-pump/services/spm-pump-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/spm-pump/spm-pump-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/spm-pump/spm-pump-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/agitation-required-trouble/agitation-required-trouble-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/extensions/assembly/assembly-data-mapper.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/freestyle-registration-manager.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/services/freestyle/1.6.5/service.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/services/freestyle/1.8.1/service.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/services/freestyle/daily/service.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/services/handle/1.8.1/service.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/services/handle/daily/service.ts"],"sourcesContent":["/**\n * (C) Copyright 2024, TCCC, All rights reserved.\n */\n\nimport {\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n type FutureResponse,\n type KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nconst { URL } = resolveServiceUrl(\"ICE_AGITATOR_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/ext/freestyle/ice`,\n});\n\nconst log = KosLog.createLogger({\n name: \"carb-tank-service\",\n group: \"Services\",\n});\n\n/**\n * Initiates a carb tank test operation on the device.\n *\n * Sends a test command to the carb tank hardware at the specified path and returns\n * a future response that can be used to track the test operation's progress and\n * completion status.\n *\n * @param path - Device path to the carb tank hardware (e.g., \"assembly:core:board:macksm:carbTank:carbTank\")\n * @param tracker - Future tracker ID for monitoring operation progress\n * @returns Promise resolving to a FutureResponse for operation tracking\n * @throws {Error} If the server returns no response data\n *\n * @example\n * ```typescript\n * const future = await testCarbTank(\n * \"assembly:core:board:macksm:carbTank:carbTank\",\n * \"tracker-123\"\n * );\n *\n * // Monitor future progress\n * console.log(`Test status: ${future.status}`);\n * ```\n *\n * @category Services\n */\nexport const testCarbTank = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/test`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response?.data as FutureResponse;\n};\n","/**\n * (C) Copyright 2024, TCCC, All rights reserved.\n */\n\n/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\n\nimport { type AssemblyModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n IKosDataModel,\n KosCompanionComposition,\n KosConfigProperty,\n KosCreationContext,\n KosFutureAwareFull,\n KosLoggerAware,\n KosModelRegistrationType,\n KosStateMachineAware,\n KosStateProp,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n DependencyLifecycle,\n kosCompanion,\n kosConfigProperty,\n kosFuture,\n kosFutureAware,\n kosLoggerAware,\n kosModel,\n kosStateEntry,\n kosStateExit,\n kosStateGuard,\n kosStateMachine,\n kosStateProp,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport type { ProbeAware } from \"../types/assembly\";\nimport { testCarbTank } from \"./services/carb-tank-services\";\nimport type { CarbAgitatorOptions } from \"./types\";\n\n/**\n * Unique identifier for the carb agitator model type used in KOS model registration.\n *\n * @category Constants\n */\nexport const MODEL_TYPE = \"carb-agitator-model\";\n\n/**\n * Internal property key for accessing the carb agitator state path.\n *\n * @internal\n */\nconst PROP_STATE_PATH = createPropKey<CarbAgitatorModel>(\"statePath\");\n\n/**\n * State machine states for carb agitator initialization workflow.\n *\n * The carb agitator progresses through these states during setup and operation:\n * - UNINITIALIZED: Initial state, awaiting user action\n * - ACTIVATING: Carb tank is being initialized\n * - INITIALIZED: Carb tank is ready for operation\n * - SKIPPED: User chose to proceed without carbonation\n *\n * @category State Machine\n */\nexport enum CarbAgitatorState {\n /**\n * Initial state before any action is taken.\n * Can transition to ACTIVATING or SKIPPED.\n */\n UNINITIALIZED = \"UNINITIALIZED\",\n\n /**\n * Carb tank activation is in progress.\n * Transitions to INITIALIZED when complete.\n */\n ACTIVATING = \"ACTIVATING\",\n\n /**\n * Carb tank is initialized and ready for operation.\n * Can transition back to UNINITIALIZED via RESET.\n */\n INITIALIZED = \"INITIALIZED\",\n\n /**\n * User chose to skip carbonation for this workflow.\n * Can transition back to UNINITIALIZED via RESET.\n */\n SKIPPED = \"SKIPPED\",\n}\n\n/**\n * Events that trigger state transitions in the carb agitator state machine.\n *\n * - ACTIVATE: Begin carb tank activation process\n * - ACTIVATION_COMPLETE: Carb tank activation finished successfully\n * - SKIP: Bypass carbonation for this workflow\n * - RESET: Return to uninitialized state\n *\n * @category State Machine\n */\nexport type CarbAgitatorEvent =\n | \"ACTIVATE\"\n | \"ACTIVATION_COMPLETE\"\n | \"SKIP\"\n | \"RESET\";\n\n/**\n * Public interface type for the carb agitator model.\n *\n * This type represents the public-facing API of the carb agitator model,\n * exposing only public methods and properties while hiding internal implementation details.\n *\n * @category Types\n */\nexport type CarbAgitatorModel = PublicModelInterface<CarbAgitatorModelImpl>;\n\n/**\n * Interface defining the capabilities of the carb agitator model implementation.\n *\n * This interface combines multiple KOS aware interfaces to provide:\n * - Logging capabilities via KosLoggerAware\n * - Probe monitoring via ProbeAware (high/low probes, filling status)\n * - State machine management via KosStateMachineAware\n * - Async operations via KosFutureAwareFull\n * - Parent-child relationships via KosCompanionComposition\n *\n * @category Types\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CarbAgitatorModelImpl\n extends KosLoggerAware,\n ProbeAware,\n KosStateMachineAware<CarbAgitatorState, CarbAgitatorEvent>,\n KosFutureAwareFull,\n KosCompanionComposition<AssemblyModel> {}\n@kosModel({ modelTypeId: MODEL_TYPE, singleton: false })\n@kosLoggerAware()\n@kosCompanion({ mode: \"composition\", lifecycle: DependencyLifecycle.LOAD })\n@kosFutureAware()\n@kosStateMachine<CarbAgitatorState, CarbAgitatorEvent>(\n {\n initial: CarbAgitatorState.UNINITIALIZED,\n states: {\n [CarbAgitatorState.UNINITIALIZED]: {\n on: {\n ACTIVATE: CarbAgitatorState.ACTIVATING,\n SKIP: CarbAgitatorState.SKIPPED,\n },\n },\n [CarbAgitatorState.ACTIVATING]: {\n on: {\n ACTIVATION_COMPLETE: CarbAgitatorState.INITIALIZED,\n },\n },\n [CarbAgitatorState.INITIALIZED]: {\n on: { RESET: CarbAgitatorState.UNINITIALIZED },\n },\n [CarbAgitatorState.SKIPPED]: {\n on: { RESET: CarbAgitatorState.UNINITIALIZED },\n },\n },\n },\n {\n throwOnInvalid: false, // Graceful handling for button clicks\n }\n)\n/**\n * Model for managing carbonation agitator operations in beverage dispensing systems.\n *\n * This model implements a state machine workflow for carb tank initialization, tracking\n * the activation process, probe states, and carbonation readiness. It manages the\n * lifecycle of carbonation operations including activation, deactivation, and testing.\n *\n * The model integrates with:\n * - Device configuration for carb tank enable/disable state\n * - State properties for monitoring high/low probes and filling status\n * - Assembly model for accessing holder and pump information\n * - Futures for async operations like carb tank testing\n *\n * @remarks\n * This is a companion model to the Assembly model, providing specialized management\n * for carbonation agitation hardware.\n *\n * @example\n * ```typescript\n * // Create carb agitator model\n * const carbAgitator = CarbAgitator\n * .instance(\"carb-agitator-1\")\n * .options({ name: \"Carb Tank\" })\n * .build();\n *\n * // Activate carb tank\n * await carbAgitator.activateCarbTank();\n *\n * // Check if ready to proceed\n * if (carbAgitator.canProceed) {\n * console.log(\"Carb tank ready\");\n * }\n *\n * // Test carb tank operation\n * await carbAgitator.handleTestCarbTank(\"tracker-123\");\n * ```\n *\n * @category Models\n * @author Mark Pomerant (mark@matrica.ca)\n * @version 2.1.27\n */\nexport class CarbAgitatorModelImpl implements IKosDataModel {\n /**\n * Registration factory for creating CarbAgitator model instances.\n *\n * Automatically injected by the `@kosModel` decorator.\n *\n * @see {@link CarbAgitator}\n */\n static Registration: KosModelRegistrationType<\n CarbAgitatorModel,\n CarbAgitatorOptions\n >;\n\n /**\n * Unique identifier for this carb agitator instance.\n */\n id: string;\n\n /**\n * Display name for this carb agitator.\n */\n name: string;\n\n /**\n * Device path for carb tank operations.\n */\n path: string;\n\n /**\n * State path for accessing probe and filling status.\n */\n statePath: string;\n\n /**\n * High probe wet status indicator.\n *\n * Monitors whether the high-level probe in the carb tank is detecting liquid.\n */\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"highProbeWet\",\n })\n highProbeWet!: KosStateProp<boolean>;\n\n /**\n * Low probe wet status indicator.\n *\n * Monitors whether the low-level probe in the carb tank is detecting liquid.\n */\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"lowProbeWet\",\n })\n lowProbeWet!: KosStateProp<boolean>;\n\n /**\n * Carb tank filling status indicator.\n *\n * Indicates whether the carb tank is currently being filled with liquid.\n */\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"filling\",\n })\n filling!: KosStateProp<boolean>;\n\n /**\n * Configuration property controlling carb tank enable/disable state.\n *\n * When enabled, the carb tank is operational and carbonation is active.\n * When disabled, carbonation is bypassed.\n */\n @kosConfigProperty({\n path: \"assembly:core:board:macksm:carbTank:carbTank\",\n attribute: \"enabled\",\n })\n enabled!: KosConfigProperty<boolean>;\n\n /**\n * Creates a new carb agitator model instance.\n *\n * @param modelId - Unique identifier for this instance\n * @param options - Configuration options including name\n * @param context - KOS creation context providing assembly paths\n */\n constructor(\n modelId: string,\n options: CarbAgitatorOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.name = options.name;\n this.path = context.kosContext.get(`assembly-feature-carbTank`)?.path || \"\";\n\n const statePath = context.kosContext.get(`assembly-state-path-carbTank`);\n this.statePath = statePath;\n }\n\n /**\n * Gets the carb holder associated with this agitator.\n *\n * Retrieves the first holder from the \"carb\" group in the parent assembly.\n *\n * @returns The carb holder model, or undefined if not found\n */\n get holder() {\n const carbHolder = this.getCompanionParent()?.getHoldersByGroup(\"carb\")[0];\n return carbHolder;\n }\n\n /**\n * Gets the pump associated with the carb holder.\n *\n * Returns the first pump from the holder's pump collection.\n *\n * @returns The pump model, or undefined if holder or pump not available\n */\n get pump() {\n return this.holder?.pumps.data[0];\n }\n\n /**\n * Indicates whether the carb tank is currently being filled.\n *\n * @returns true if the filling state property indicates active filling\n */\n get isFilling(): boolean {\n return !!this.filling.value;\n }\n\n /**\n * Indicates whether the carb tank has been initialized.\n *\n * @returns true if the carb tank enabled configuration is set to true\n */\n get isCarbInitialized(): boolean {\n return !!this.enabled.value;\n }\n\n /**\n * Indicates whether carb tank activation is allowed.\n *\n * Activation is only allowed when the carb tank is not already enabled.\n *\n * @returns true if the carb tank can be activated\n */\n get canActivate(): boolean {\n return !this.enabled.value;\n }\n\n /**\n * Indicates whether the workflow can proceed past carb initialization.\n *\n * The workflow can proceed when the state machine is in either INITIALIZED\n * (carb tank activated) or SKIPPED (user chose to bypass carbonation).\n *\n * @returns true if ready to proceed with beverage operations\n */\n get canProceed(): boolean {\n return (\n this.isInState(CarbAgitatorState.INITIALIZED) ||\n this.isInState(CarbAgitatorState.SKIPPED)\n );\n }\n\n /**\n * State entry handler when entering ACTIVATING state.\n *\n * Logs the start of carb tank activation process.\n *\n * @internal\n */\n @kosStateEntry(CarbAgitatorState.ACTIVATING)\n handleActivationStart(): void {\n this.logger.info(\"Carb tank activation started\");\n }\n\n /**\n * State exit handler when leaving ACTIVATING state.\n *\n * Logs successful completion of carb tank initialization.\n *\n * @internal\n */\n @kosStateExit(CarbAgitatorState.ACTIVATING)\n handleActivationComplete(): void {\n this.logger.info(\"Carb tank initialized\");\n }\n\n /**\n * State entry handler when entering INITIALIZED state.\n *\n * Logs that the carb tank is ready for beverage operations.\n *\n * @internal\n */\n @kosStateEntry(CarbAgitatorState.INITIALIZED)\n handleInitialized(): void {\n this.logger.info(\"Carb tank ready to proceed\");\n }\n\n /**\n * State entry handler when entering SKIPPED state.\n *\n * Logs that the user has chosen to proceed without carbonation.\n *\n * @internal\n */\n @kosStateEntry(CarbAgitatorState.SKIPPED)\n handleSkipped(): void {\n this.logger.info(\"Proceeding without carbinator\");\n }\n\n /**\n * Activates the carb tank and transitions through initialization workflow.\n *\n * This method:\n * 1. Transitions to ACTIVATING state\n * 2. Updates the enabled configuration property to true\n * 3. Transitions to INITIALIZED state\n *\n * Can only be called when in UNINITIALIZED state (enforced by state guard).\n *\n * @throws {Error} If called from an invalid state\n */\n @kosStateGuard({ allowedStates: [CarbAgitatorState.UNINITIALIZED] })\n async activateCarbTank(): Promise<void> {\n this.transition(\"ACTIVATE\");\n this.enabled.updateProperty(true);\n this.transition(\"ACTIVATION_COMPLETE\");\n }\n\n /**\n * Deactivates the carb tank and resets to uninitialized state.\n *\n * This method:\n * 1. Updates the enabled configuration property to false\n * 2. Transitions back to UNINITIALIZED state\n *\n * Can be called from any state.\n */\n async deactivateCarbTank(): Promise<void> {\n this.enabled.updateProperty(false);\n this.transition(\"RESET\");\n }\n\n /**\n * Skips carb tank initialization and proceeds without carbonation.\n *\n * Allows the workflow to continue without activating the carb tank.\n * Transitions from UNINITIALIZED to SKIPPED state.\n *\n * Can only be called when in UNINITIALIZED state (enforced by state guard).\n *\n * @throws {Error} If called from an invalid state\n */\n @kosStateGuard({ allowedStates: [CarbAgitatorState.UNINITIALIZED] })\n skip(): void {\n this.transition(\"SKIP\");\n }\n\n /**\n * Resets the carb tank to uninitialized state.\n *\n * This method:\n * 1. Updates the enabled configuration property to false\n * 2. Transitions back to UNINITIALIZED state\n *\n * Can only be called when in INITIALIZED or SKIPPED states (enforced by state guard).\n *\n * @throws {Error} If called from an invalid state\n */\n @kosStateGuard({\n allowedStates: [CarbAgitatorState.INITIALIZED, CarbAgitatorState.SKIPPED],\n })\n reset(): void {\n this.enabled.updateProperty(false);\n this.transition(\"RESET\");\n }\n\n /**\n * Toggles the carb tank between enabled and disabled states.\n *\n * If currently enabled, calls {@link deactivateCarbTank}.\n * If currently disabled, calls {@link activateCarbTank}.\n */\n toggleCarbTank(): void {\n if (this.enabled.value) {\n this.deactivateCarbTank();\n } else {\n this.activateCarbTank();\n }\n }\n\n /**\n * Tests the carb tank operation and returns a future for tracking progress.\n *\n * Initiates a carb tank test operation on the device and returns a future\n * that can be monitored for progress and completion status.\n *\n * @param tracker - Future tracker ID (injected by @kosFuture decorator)\n * @returns Promise resolving to a FutureResponse for operation tracking\n * @throws {Error} If tracker is not provided by the decorator\n */\n @kosFuture()\n handleTestCarbTank(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n this.logger.info(`testing carb tank: ${this.id}`);\n\n return testCarbTank(this.path, tracker);\n }\n}\n\n/**\n * Registration factory for creating CarbAgitator model instances.\n *\n * Use this constant to create new carb agitator instances using the fluent factory pattern.\n *\n * @example\n * ```typescript\n * // Create a new carb agitator model\n * const carbAgitator = CarbAgitator\n * .instance(\"carb-agitator-1\")\n * .options({ name: \"Carb Tank\" })\n * .build();\n *\n * // Activate carb tank\n * await carbAgitator.activateCarbTank();\n *\n * // Check readiness\n * if (carbAgitator.canProceed) {\n * console.log(\"Ready for beverage operations\");\n * }\n * ```\n *\n * @category Models\n */\nexport const CarbAgitator = CarbAgitatorModelImpl.Registration;\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n IKosModelContainer,\n IKosModelHolder,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosChild, kosModel, KosModelContainer } from \"@kosdev-code/kos-ui-sdk\";\nimport type { CartridgeAgitatorModel } from \"./cartridge-agitator-model\";\nimport type { CartridgeAgitatorContainerOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"cartridge-agitator-container-model\";\n\nexport type CartridgeAgitatorContainerModel =\n PublicModelInterface<CartridgeAgitatorContainerModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class CartridgeAgitatorContainerModelImpl\n implements\n IKosIdentifiable,\n IKosModelHolder<CartridgeAgitatorModel>,\n IKosDataModel\n{\n id: string;\n private logger: KosContextLogger;\n @kosChild private _models: IKosModelContainer<CartridgeAgitatorModel>;\n constructor(\n modelId: string,\n options: CartridgeAgitatorContainerOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this._models = new KosModelContainer<CartridgeAgitatorModel>({\n parentId: modelId,\n });\n if (options) {\n // Assign options properties here.\n }\n }\n\n getModel(id: string) {\n return this._models.getModel(id);\n }\n get models() {\n return this._models;\n }\n get data() {\n return this._models.data;\n }\n\n addModel(model: CartridgeAgitatorModel) {\n this._models.addModel(model);\n }\n\n removeModel(id: string) {\n this._models.removeModel(id);\n }\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(\n `initializing cartridge-agitator-container container ${this.id}`\n );\n }\n\n async load(): Promise<void> {\n this.logger.debug(\n `loading cartridge-agitator-container container ${this.id}`\n );\n }\n}\n","import type {\n FutureResponse,\n KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { resolveServiceUrl, ServiceFactory } from \"@kosdev-code/kos-ui-sdk\";\n\nconst { URL } = resolveServiceUrl(\"CARTRIDGE_AGITATOR_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/ext/freestyle/freestyle/ice`,\n});\n/**\n * @category Service\n * Retrieves the initial screen data.\n */\nexport const agitate = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/test`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response.data;\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport type {\n ExternalFutureInterface,\n IKosDataModel,\n IKosIdentifiable,\n KosFutureAwareFull,\n KosLoggerAware,\n KosStateProp,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n EventBus,\n kosFuture,\n kosFutureAware,\n kosLoggerAware,\n kosModel,\n kosModelEffect,\n kosStateProp,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { agitate } from \"./services/cartridge-agitator-services\";\nimport type { CartridgeAgitatorOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"cartridge-agitator-model\";\n\nexport type CartridgeAgitatorModel =\n PublicModelInterface<CartridgeAgitatorModelImpl> & ExternalFutureInterface;\n\nexport class CartridgeAgitatorEvents {\n static TOPIC_AGITATION_STARTED = \"/kos/events/ddk/agitation-started\";\n static TOPIC_AGITATION_ENDED = \"/kos/events/ddk/agitation-ended\";\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CartridgeAgitatorModelImpl\n extends KosFutureAwareFull,\n KosLoggerAware {}\nconst PROP_PATH = createPropKey<CartridgeAgitatorModel>(\"statePath\");\n\n@kosModel(MODEL_TYPE)\n@kosFutureAware()\n@kosLoggerAware()\nexport class CartridgeAgitatorModelImpl\n implements IKosDataModel, IKosIdentifiable\n{\n id: string;\n @kosStateProp({ path: PROP_PATH, attribute: \"agitating\" })\n private agitating!: KosStateProp<boolean>;\n path: string;\n statePath: string;\n name: string;\n constructor(modelId: string, options: CartridgeAgitatorOptions) {\n this.id = modelId;\n\n this.path = options.path;\n this.name = options.name;\n this.statePath = options.statePath;\n }\n\n get isAgitating(): boolean {\n return !!this.agitating.value;\n }\n\n @kosFuture()\n async testAgitate(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n this.logger.info(`agitating cartridge-agitator ${this.id}`);\n\n return agitate(this.path, tracker);\n }\n\n @kosModelEffect({\n dependencies: (model) => [model.isAgitating],\n })\n handleAgitation() {\n if (this.isAgitating) {\n this.logger.info(`agitating cartridge-agitator ${this.id}`);\n EventBus.publish(CartridgeAgitatorEvents.TOPIC_AGITATION_STARTED, {\n path: this.path,\n futureId: this.future?.futureId,\n });\n } else {\n EventBus.publish(CartridgeAgitatorEvents.TOPIC_AGITATION_ENDED, {\n path: this.path,\n });\n }\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n CartridgeAgitatorModel,\n CartridgeAgitatorModelImpl,\n MODEL_TYPE,\n} from \"./cartridge-agitator-model\";\nimport type { CartridgeAgitatorOptions } from \"./types\";\n\n/**\n * # CartridgeAgitator\n *\n * The registration bean includes convenience methods for creating and working with CartridgeAgitatorModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * import type { CartridgeAgitatorModel } from \"./cartridge-agitator-model\";\n * \n * @kosDependency({modelType: CartridgeAgitator.type, id: \"cartridgeAgitatorId\"})\n * private cartridgeAgitatorModel: CartridgeAgitatorModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new CartridgeAgitatorModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = CartridgeAgitator.factory(\"cartridgeAgitatorId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a CartridgeAgitatorModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (CartridgeAgitator.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to CartridgeAgitatorModel\n * // and the compiler will know that the model has the CartridgeAgitatorModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { CartridgeAgitator } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(CartridgeAgitator);\n * ```\n *\n * ## registration.singleton\n \n * The cartridgeAgitator model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const CartridgeAgitator = new KosModelRegistrationFactory<\n CartridgeAgitatorModel,\n CartridgeAgitatorOptions\n>({\n class: CartridgeAgitatorModelImpl as any,\n type: MODEL_TYPE,\n});\n","import { SingletonKosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { CartridgeAgitatorContainerModel } from \"./cartridge-agitator-container-model\";\nimport {\n CartridgeAgitatorContainerModelImpl,\n MODEL_TYPE,\n} from \"./cartridge-agitator-container-model\";\nimport { CartridgeAgitator } from \"./cartridge-agitator-registration\";\nimport type { CartridgeAgitatorContainerOptions } from \"./types\";\n\n/**\n * # CartridgeAgitatorContainer\n *\n * The registration bean includes convenience methods for creating and working with CartridgeAgitatorContainerModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: CartridgeAgitatorContainer.type, id: \"cartridgeAgitatorContainerId\"})\n * private cartridgeAgitatorContainerModel: CartridgeAgitatorContainerModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new CartridgeAgitatorContainerModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = CartridgeAgitatorContainer.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a CartridgeAgitatorContainerModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (CartridgeAgitatorContainer.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to CartridgeAgitatorContainerModel\n * // and the compiler will know that the model has the CartridgeAgitatorContainerModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { CartridgeAgitatorContainer } from \"@kosdev-code/kos-dispense-sdk\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...CartridgeAgitatorContainer.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The cartridgeAgitatorContainer model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const CartridgeAgitatorContainer =\n new SingletonKosModelRegistrationFactory<\n CartridgeAgitatorContainerModel,\n CartridgeAgitatorContainerOptions\n >({\n class: CartridgeAgitatorContainerModelImpl,\n type: MODEL_TYPE,\n });\n\nCartridgeAgitatorContainer.addRelatedModel(CartridgeAgitator);\n","/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport type {\n IKosDataModel,\n IKosIdentifiable,\n KosCompanionComposition,\n KosLoggerAware,\n KosModelRegistrationType,\n KosStateProp,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n kosCompanion,\n kosLoggerAware,\n kosModel,\n kosStateProp,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport type { CgpPumpOptions } from \"./types\";\n\nimport type { PumpModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type { ProbeAware } from \"../types/assembly\";\n\nexport const MODEL_TYPE = \"cgp-pump-model\";\n\nexport type CgpPumpModel = PublicModelInterface<CgpPumpModelImpl>;\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CgpPumpModelImpl\n extends KosLoggerAware,\n ProbeAware,\n KosCompanionComposition<PumpModel> {}\n\nconst PROP_STATE_PATH = createPropKey<CgpPumpModel>(\"statePath\");\n@kosModel({ modelTypeId: MODEL_TYPE, singleton: false })\n@kosCompanion({\n mode: \"composition\",\n})\n@kosLoggerAware()\nexport class CgpPumpModelImpl implements IKosDataModel, IKosIdentifiable {\n // Registration property for type safety - actual value injected by @kosModel decorator\n static Registration: KosModelRegistrationType<CgpPumpModel, CgpPumpOptions>;\n\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"highProbeWet\",\n })\n highProbeWet!: KosStateProp<boolean>;\n\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"lowProbeWet\",\n })\n lowProbeWet!: KosStateProp<boolean>;\n\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"filling\",\n })\n filling!: KosStateProp<boolean>;\n id: string;\n state: { name: string; path: string };\n\n constructor(modelId: string, options: CgpPumpOptions) {\n this.id = modelId;\n\n this.state = options.data?.state ?? { name: \"unknown\", path: \"\" };\n }\n\n get statePath() {\n return this.state.path;\n }\n}\n\nexport const CgpPump = CgpPumpModelImpl.Registration;\n","import {\n FetchError,\n FutureEndState,\n FutureManager,\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n type FutureResponse,\n type KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"FCM-PUMP_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/fcm-pump`,\n});\n\nconst log = KosLog.createLogger({\n name: \"fcm-pump-service\",\n group: \"Services\",\n});\n\nexport type ElectricalTestErrorType = \"errEEPROM\" | \"unknownError\";\nexport type ElectricalTestData = {\n error?: ElectricalTestErrorType;\n result?: string;\n};\nexport type ElectricalTestResponse = [\n ElectricalTestErrorType | undefined,\n ElectricalTestData\n];\n\nexport const performElectricalTest = async (\n path: string\n): Promise<ElectricalTestResponse> => {\n log.debug(\n `performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${path}/electricalTest`\n );\n\n try {\n const response = await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/fcm/diagnostics/${path}/electricalTest`,\n });\n\n log.debug(\"performElectricalTest - response:\", response);\n\n if (\n (response?.status === 200 || response?.status === 499) &&\n response.data?.error\n ) {\n return [response.data.error || \"unknownError\", response.data];\n }\n\n return [undefined, response?.data];\n } catch (error) {\n log.error(\n `performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${path}/electricalTest`,\n error\n );\n\n if (error instanceof FetchError) {\n const errorCode =\n error.payload?.data?.error || error.payload?.error || \"unknownError\";\n\n return [errorCode, error.payload?.data || { error: errorCode }];\n }\n }\n\n return [\"unknownError\", { error: \"unknownError\" }];\n};\n\nexport const performPreCalibrate = async (pump: string, tracker?: string) => {\n log.debug(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/preCalibrate`\n );\n\n try {\n const response = (await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/fcm/calibration/${pump}/preCalibrate`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performPreCalibrate - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/preCalibrate`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\nexport const performCalibrate = async (pump: string, tracker?: string) => {\n log.debug(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/calibrate`\n );\n\n try {\n const response = (await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/fcm/calibration/${pump}/calibrate`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performPreCalibrate - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/calibrate`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\nexport const performVerify = async (\n pump: string,\n volume: string,\n tracker?: string\n) => {\n log.debug(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/verify/${volume}`\n );\n\n try {\n const response = (await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/fcm/calibration/${pump}/verify/${volume}`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performVerify - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performVerify - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/verify/${volume}`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\n/**\n * Help function to process the response from the performComplete service call.\n * If the response is \"success\" or undefined, it returns \"success\".\n * If the response contains an error message, it returns that message.\n * If the response is undefined, it returns \"error\".\n *\n * This function is used to standardize the handling of responses from the performComplete service call.\n * to capture the case where the response is undefined, which is possible in cases where the volumes are\n * so close that the backend chooses to not perform the calibration at all.\n * @param response\n * @returns\n */\n\nconst processResponse = (response: KosServiceResponse<string> | undefined) => {\n if (response) {\n if (response.data === \"success\" || !response.data) {\n return \"success\";\n } else {\n return response.data;\n }\n }\n return \"error\";\n};\nexport const performComplete = async (\n pump: string,\n volume1: string,\n volume2: string\n) => {\n log.debug(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/complete/${volume1}/${volume2}`\n );\n\n try {\n const response = await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/fcm/calibration/${pump}/complete/${volume1}/${volume2}`,\n });\n\n log.debug(\"performPreCalibrate - response:\", response);\n\n return processResponse(response?.data);\n } catch (error) {\n log.error(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/complete/${volume1}/${volume2}`,\n error\n );\n\n return undefined;\n }\n};\n","import type {\n IntentAware,\n IntentAwareProps,\n PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n FutureAwareContainer,\n FutureContainer,\n FutureResponse,\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n FutureHandler,\n kosFuture,\n KosLog,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n performCalibrate,\n performComplete,\n performElectricalTest,\n performPreCalibrate,\n performVerify,\n} from \"./services\";\nimport type { FcmPumpOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"fcm-pump-model\";\n\nconst log = KosLog.createLogger({ name: \"fcm-pump-model\" });\n\nexport type FcmPumpModel = PublicModelInterface<FcmPumpModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class FcmPumpModelImpl\n implements IKosDataModel, IKosIdentifiable, IntentAware, FutureContainer\n{\n id: string;\n private logger: KosContextLogger;\n private pumpModel: PumpModel;\n futureHandler: FutureAwareContainer;\n constructor(\n modelId: string,\n options: FcmPumpOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.pumpModel = options.companionParent;\n this.futureHandler = new FutureHandler(this);\n }\n\n get future() {\n return this.futureHandler.future;\n }\n\n get name() {\n return this.pumpModel.name;\n }\n\n get canPour() {\n return this.pumpModel.canPour;\n }\n\n get isPouring() {\n return this.pumpModel.isPouring;\n }\n\n async cancelPour() {\n return this.pumpModel.cancelPour();\n }\n\n performIntent(\n props: IntentAwareProps | string\n ): Promise<FutureResponse | undefined> {\n return this.pumpModel.performIntent(props);\n }\n\n async performElectricalTest() {\n const [error, data] = await performElectricalTest(this.pumpModel.path);\n if (error) {\n log.error(`Failed to perform electrical test on pump ${this.id}`, error);\n }\n\n return data;\n }\n\n getChildren() {\n const allFutures = this.futureHandler.allFutures;\n return [...allFutures];\n }\n\n @kosFuture()\n async performPreCalibrate(tracker?: string) {\n return performPreCalibrate(this.pumpModel.path, tracker);\n }\n\n @kosFuture()\n async performCalibrate(tracker?: string) {\n return performCalibrate(this.pumpModel.path, tracker);\n }\n\n @kosFuture()\n async performVerify(volume: string, tracker?: string) {\n return performVerify(this.pumpModel.path, volume, tracker);\n }\n\n async performComplete(volume1: string, volume2: string) {\n return performComplete(this.pumpModel.path, volume1, volume2);\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing fcm-pump ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading fcm-pump ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FcmPumpOptions } from \"./types\";\nimport { FcmPumpModelImpl, MODEL_TYPE } from \"./fcm-pump-model\";\nimport type { FcmPumpModel } from \"./fcm-pump-model\";\n\n/**\n * # FcmPump\n *\n * The registration bean includes convenience methods for creating and working with FcmPumpModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FcmPump.type, id: \"fcmPumpId\"})\n * private fcmPumpModel: FcmPumpModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FcmPumpModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FcmPump.factory(\"fcmPumpId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FcmPumpModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FcmPump.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FcmPumpModel\n * // and the compiler will know that the model has the FcmPumpModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FcmPump } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FcmPump);\n * ```\n *\n * ## registration.singleton\n \n * The fcmPump model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const FcmPump = new KosModelRegistrationFactory<\n FcmPumpModel,\n FcmPumpOptions\n>({\n class: FcmPumpModelImpl,\n type: MODEL_TYPE,\n});\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n getKosCompanionModel,\n kosChild,\n KosFeatureFlags,\n kosModel,\n kosParentAware,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleAssemblyOptions } from \"./types\";\n\nimport {\n type AssemblyModel,\n type AssemblyOptions,\n type BoardModel,\n type HolderModel,\n type PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport { CarbAgitator, type CarbAgitatorModel } from \"../carb-agitator\";\nimport {\n type CartridgeAgitatorContainerModel,\n type CartridgeAgitatorModel,\n} from \"../cartridge-agitator\";\nimport type { IceAgitatorModel } from \"../ice-agitator\";\nimport { type RemoteTrayContainerModel } from \"../remote-tray\";\nimport type {\n FreestyleHolderModelExt,\n FreestyleModelAssemblyExt,\n} from \"../types/assembly\";\n\nexport const MODEL_TYPE = \"freestyle-assembly-model\";\n\nexport const FEATURE_SUPPORTS_ICE = \"iceAgitator\";\nexport const FEATURE_SUPPORTS_CARB = \"carbTank\";\nexport const FEATURE_SUPPORTS_REMOTE_TRAYS = \"remoteTrays\";\n\nexport type FreestyleAssemblyModel =\n PublicModelInterface<FreestyleAssemblyModelImpl> &\n AssemblyModel<FreestyleModelAssemblyExt, FreestyleHolderModelExt>;\n\n@kosParentAware()\n@kosModel(MODEL_TYPE)\nexport class FreestyleAssemblyModelImpl\n implements\n IKosDataModel,\n IKosIdentifiable,\n AssemblyModel<FreestyleModelAssemblyExt, FreestyleHolderModelExt>\n{\n id: string;\n\n private _carbTankModel?: CarbAgitatorModel;\n private logger: KosContextLogger;\n private assembly: AssemblyModel<\n FreestyleModelAssemblyExt,\n FreestyleHolderModelExt\n >;\n\n @kosChild\n private _remoteTrays!: RemoteTrayContainerModel;\n\n constructor(\n modelId: string,\n options: FreestyleAssemblyOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this.assembly = options.companionParent;\n\n if (options) {\n // Assign options properties here.\n }\n }\n get holderGroups(): string[] {\n return this.assembly.holderGroups;\n }\n get nozzlePaths(): string[] {\n return this.assembly.nozzlePaths;\n }\n get allHolders(): HolderModel<FreestyleHolderModelExt>[] {\n return this.assembly.allHolders;\n }\n getHoldersByGroup(group: string): HolderModel<FreestyleHolderModelExt>[] {\n return this.assembly.getHoldersByGroup(group);\n }\n getHoldersByNozzle(\n nozzlePath: string\n ): HolderModel<FreestyleHolderModelExt>[] {\n return this.assembly.getHoldersByNozzle(nozzlePath);\n }\n get pumpsByNozzle(): Record<string, PumpModel<any>[]> {\n return this.assembly.pumpsByNozzle;\n }\n get pumpPaths(): string[] {\n return this.assembly.pumpPaths;\n }\n\n get boards(): BoardModel<any>[] {\n return this.assembly.boards;\n }\n updateModel(options: AssemblyOptions): void {\n return this.assembly.updateModel(options);\n }\n get iceAgitator(): IceAgitatorModel {\n return this.assembly.iceAgitator;\n }\n get carbTank(): CarbAgitatorModel | undefined {\n return this._carbTankModel;\n }\n\n get cartridgeAgitators(): CartridgeAgitatorContainerModel {\n return this.assembly.cartridgeAgitators;\n }\n\n get defaultCartridgeAgitator(): CartridgeAgitatorModel {\n return this.assembly.cartridgeAgitators.data[0];\n }\n get cartridgeAgitatorModels(): CartridgeAgitatorModel[] {\n return this.assembly.cartridgeAgitators.data;\n }\n\n get hasCartridgeAgitators(): boolean {\n return this.assembly.cartridgeAgitators.data.length > 0;\n }\n\n get remoteTrays(): RemoteTrayContainerModel {\n return this.assembly.remoteTrays;\n }\n\n get hasRemoteTrays(): boolean {\n return this.assembly.remoteTrays\n ? this.assembly.remoteTrays.data.length > 0\n : false;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n get supportsRemoteTrays(): boolean {\n return KosFeatureFlags.isFeatureEnabled(FEATURE_SUPPORTS_REMOTE_TRAYS);\n }\n get supportsIce() {\n return KosFeatureFlags.isFeatureEnabled(FEATURE_SUPPORTS_ICE);\n }\n\n get supportsCarb() {\n return KosFeatureFlags.isFeatureEnabled(FEATURE_SUPPORTS_CARB);\n }\n\n async init(): Promise<void> {\n this.logger.debug(`initializing freestyle-assembly ${this.id}`);\n }\n\n async ready(): Promise<void> {\n const _carbTank = getKosCompanionModel<CarbAgitatorModel>(\n this.assembly,\n CarbAgitator.type\n );\n\n this._carbTankModel = _carbTank;\n }\n}\n","import { SingletonKosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleAssemblyModel } from \"./freestyle-assembly-model\";\nimport {\n FreestyleAssemblyModelImpl,\n MODEL_TYPE,\n} from \"./freestyle-assembly-model\";\nimport type { FreestyleAssemblyOptions } from \"./types\";\n\n/**\n * # FreestyleAssembly\n *\n * The registration bean includes convenience methods for creating and working with FreestyleAssemblyModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestyleAssembly.type, id: \"freestyleAssemblyId\"})\n * private freestyleAssemblyModel: FreestyleAssemblyModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestyleAssemblyModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestyleAssembly.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestyleAssemblyModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestyleAssembly.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestyleAssemblyModel\n * // and the compiler will know that the model has the FreestyleAssemblyModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestyleAssembly } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestyleAssembly);\n * ```\n *\n * ## registration.singleton\n \n * The freestyleAssembly model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const FreestyleAssembly = new SingletonKosModelRegistrationFactory<\n FreestyleAssemblyModel,\n FreestyleAssemblyOptions\n>({\n class: FreestyleAssemblyModelImpl,\n type: MODEL_TYPE,\n});\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n TroubleAware,\n TroubleModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n getKosModelSync,\n kosConfigProperty,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport type { HolderModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type { ActiveAware } from \"../types/assembly\";\nimport type { RemoteTrayOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"remote-tray-model\";\n\n/**\n * Model for managing remote tray configurations in the KOS Freestyle system.\n *\n * A remote tray represents a physical or virtual tray that can be enabled/disabled\n * remotely and is associated with a holder in the dispensing system. This model\n * manages the tray's configuration, activation state, and trouble propagation\n * from its associated holder.\n *\n * ## Key Features\n * - Remote enable/disable capability through configuration properties\n * - Automatic trouble propagation from associated holder\n * - Active state management based on configuration\n * - Integration with the KOS dispensing system through holder references\n *\n * ## Properties\n * - `id` - Unique identifier for the remote tray\n * - `name` - Display name of the tray\n * - `holderPath` - Path reference to the associated holder model\n * - `configPath` - Configuration path for tray settings\n * - `remoteTrayEnabled` - Configuration property controlling tray activation\n * - `active` - Computed property indicating if the tray is currently active\n * - `holder` - Reference to the associated holder model\n * - `troubles` - Propagated troubles from the associated holder\n *\n * ## Methods\n * - `updateModel(options)` - Updates the model with new configuration options\n * - `init()` - Initializes the remote tray model\n * - `load()` - Loads the remote tray configuration and data\n *\n * @example\n * ```typescript\n * // Create a new remote tray instance\n * const remoteTray = RemoteTray.instance('tray-1')\n * .options({\n * name: 'Remote Tray 1',\n * holderPath: '/holders/holder-1',\n * configPath: '/config/trays/tray-1'\n * })\n * .build();\n *\n * // Check if tray is active\n * if (remoteTray.active) {\n * console.log(`${remoteTray.name} is enabled`);\n * }\n *\n * // Access associated holder\n * const holder = remoteTray.holder;\n * console.log(`Holder status: ${holder?.status}`);\n * ```\n *\n * @example\n * ```typescript\n * // Monitor trouble states\n * const TrayStatus = ({ tray }: { tray: RemoteTrayModel }) => {\n * const troubles = tray.troubles;\n * const isEnabled = tray.remoteTrayEnabled.value;\n *\n * return (\n * <div>\n * <h3>{tray.name}</h3>\n * <p>Status: {isEnabled ? 'Enabled' : 'Disabled'}</p>\n * {troubles.length > 0 && (\n * <Alert severity=\"warning\">\n * {troubles.length} issue(s) detected\n * </Alert>\n * )}\n * </div>\n * );\n * };\n * ```\n *\n * @example\n * ```typescript\n * // Programmatically enable/disable tray\n * async function toggleRemoteTray(tray: RemoteTrayModel) {\n * const currentState = tray.remoteTrayEnabled.value;\n * await tray.remoteTrayEnabled.setValue(!currentState);\n *\n * console.log(`Tray ${tray.name} is now ${!currentState ? 'enabled' : 'disabled'}`);\n * }\n * ```\n *\n * @category KOS Model\n * @subcategory Freestyle Models\n *\n * @see {@link HolderModel} - The associated holder model\n * @see {@link ActiveAware} - Interface for active state management\n * @see {@link TroubleAware} - Interface for trouble tracking\n */\nexport type RemoteTrayModel = PublicModelInterface<RemoteTrayModelImpl>;\n\nconst PROP_HOLDER_PATH = createPropKey<RemoteTrayModel>(\"holderPath\");\nconst PROP_CONFIG_PATH = createPropKey<RemoteTrayModel>(\"configPath\");\n\n/**\n * Implementation class for RemoteTrayModel.\n *\n * @internal\n * @category KOS Model\n * @subcategory Freestyle Models\n */\n@kosModel(MODEL_TYPE)\nexport class RemoteTrayModelImpl\n implements IKosDataModel, IKosIdentifiable, ActiveAware, TroubleAware\n{\n /** Unique identifier for the remote tray instance */\n id: string;\n private logger: KosContextLogger;\n\n /** Path reference to the associated holder model */\n holderPath: string;\n /** Configuration path for tray-specific settings */\n configPath: string;\n /** Display name of the remote tray */\n name: string;\n /** Configuration property that controls whether the tray is enabled remotely */\n @kosConfigProperty({\n path: PROP_CONFIG_PATH,\n attribute: \"enabled\",\n })\n remoteTrayEnabled!: KosConfigProperty<boolean>;\n\n constructor(\n modelId: string,\n options: RemoteTrayOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this.holderPath = options.holderPath;\n this.configPath = options.configPath;\n this.name = options.name;\n }\n\n /**\n * Gets the troubles from the associated holder model.\n * Propagates trouble states from the holder to this remote tray.\n *\n * @returns Array of trouble models from the holder, or empty array if no holder\n */\n get troubles(): TroubleModel<any>[] {\n return this.holder?.troubles ?? [];\n }\n\n /**\n * Gets the highest priority trouble status.\n * Currently returns empty string as troubles are managed by the holder.\n *\n * @returns Empty string (trouble status handled by holder)\n */\n get troubleStatus() {\n return \"\";\n }\n\n /**\n * Gets troubles grouped by type from the associated holder.\n *\n * @returns Record of troubles grouped by type from the holder, or empty object if no holder\n */\n get troublesByType() {\n return this.holder?.troublesByType ?? {};\n }\n\n /**\n * Updates the model with new configuration options.\n * Can be used to modify the holder path, config path, or name after initialization.\n *\n * @param _options - New configuration options for the remote tray\n */\n updateModel(_options: RemoteTrayOptions): void {\n // Update model properties here.\n }\n\n /**\n * Gets the associated holder model for this remote tray.\n * Uses synchronous model lookup to retrieve the holder by path.\n *\n * @returns The HolderModel instance referenced by holderPath, or undefined if not found\n */\n get holder() {\n return getKosModelSync<HolderModel>(this.holderPath).model;\n }\n\n /**\n * Determines if the remote tray is currently active.\n * Active state is based on the remoteTrayEnabled configuration property.\n *\n * @returns true if the tray is enabled, false otherwise\n */\n get active(): boolean {\n return !!this.remoteTrayEnabled.value;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n /**\n * Initializes the remote tray model.\n * Called during the model lifecycle initialization phase.\n * Sets up initial state and prepares the model for use.\n *\n * @returns Promise that resolves when initialization is complete\n */\n async init(): Promise<void> {\n this.logger.debug(`initializing remote-tray ${this.id}`);\n }\n\n /**\n * Loads the remote tray configuration and associated data.\n * Called during the model lifecycle load phase.\n * Typically loads configuration settings and establishes holder references.\n *\n * @returns Promise that resolves when loading is complete\n */\n async load(): Promise<void> {\n this.logger.debug(`loading remote-tray ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { RemoteTrayOptions } from \"./types\";\nimport {\n RemoteTrayModelImpl,\n MODEL_TYPE,\n RemoteTrayModel,\n} from \"./remote-tray-model\";\n\n/**\n * # RemoteTray\n *\n * The registration bean includes convenience methods for creating and working with RemoteTrayModel instances.\n\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: RemoteTray.type, id: \"remoteTrayId\"})\n * private remoteTrayModel: RemoteTrayModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new RemoteTrayModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = RemoteTray.factory(\"remoteTrayId\")({\n * // Add option data\n * });\n\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a RemoteTrayModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (RemoteTray.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to RemoteTrayModel\n * // and the compiler will know that the model has the RemoteTrayModel interface\n * model.updateAvailability(false);\n\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { RemoteTray } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(RemoteTray);\n * ```\n *\n * ## registration.singleton\n \n * The remoteTray model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const RemoteTray = new KosModelRegistrationFactory<\n RemoteTrayModel,\n RemoteTrayOptions\n>({\n class: RemoteTrayModelImpl,\n type: MODEL_TYPE,\n});\n","/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport type {\n IKosDataModel,\n IKosIdentifiable,\n KosContainerAware,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n kosContainerAware,\n kosLoggerAware,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { RemoteTrayModel } from \"./remote-tray-model\";\n\nexport const MODEL_TYPE = \"remote-tray-container-model\";\n\nexport type RemoteTrayContainerModel =\n PublicModelInterface<RemoteTrayContainerModelImpl>;\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface RemoteTrayContainerModelImpl\n extends KosContainerAware<RemoteTrayModel> {}\n@kosModel(MODEL_TYPE)\n@kosLoggerAware()\n@kosContainerAware()\nexport class RemoteTrayContainerModelImpl\n implements IKosIdentifiable, IKosDataModel\n{\n id: string;\n\n constructor(modelId: string) {\n this.id = modelId;\n }\n}\n","import { SingletonKosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { RemoteTrayContainerOptions } from \"./types\";\nimport { RemoteTray } from \"./remote-tray-registration\";\nimport {\n RemoteTrayContainerModelImpl,\n MODEL_TYPE,\n} from \"./remote-tray-container-model\";\nimport type { RemoteTrayContainerModel } from \"./remote-tray-container-model\";\n\n/**\n * # RemoteTrayContainer\n *\n * The registration bean includes convenience methods for creating and working with RemoteTrayContainerModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: RemoteTrayContainer.type, id: \"remoteTrayContainerId\"})\n * private remoteTrayContainerModel: RemoteTrayContainerModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new RemoteTrayContainerModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = RemoteTrayContainer.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a RemoteTrayContainerModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (RemoteTrayContainer.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to RemoteTrayContainerModel\n * // and the compiler will know that the model has the RemoteTrayContainerModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { RemoteTrayContainer } from \"@kosdev-code/kos-freestyle-sdk\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...RemoteTrayContainer.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The remoteTrayContainer model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const RemoteTrayContainer = new SingletonKosModelRegistrationFactory<\n RemoteTrayContainerModel,\n RemoteTrayContainerOptions\n>({\n class: RemoteTrayContainerModelImpl,\n type: MODEL_TYPE,\n});\n\nRemoteTrayContainer.addRelatedModel(RemoteTray);\n","import type {\n FutureContainer,\n FutureDelegate,\n FutureResponse,\n IFutureModel,\n IKosDataModel,\n IKosIdentifiable,\n KosContext,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n FutureManager,\n getKosModelSync,\n KosContextManager,\n KosLog,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleHolderOptions } from \"./types\";\n\nimport type { HolderModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type { FreestyleHolderExt } from \"../../utils/extensions/assembly/types\";\nimport type { CartridgeAgitatorModel } from \"../cartridge-agitator\";\nimport {\n FreestyleAssembly,\n type FreestyleAssemblyModel,\n} from \"../freestyle-assembly\";\nimport { RemoteTray, type RemoteTrayModel } from \"../remote-tray\";\n\nexport const MODEL_TYPE = \"freestyle-holder-model\";\ntype MethodsReturningType<T, ReturnType> = {\n [K in keyof T]: T[K] extends (...args: any[]) => ReturnType ? K : never;\n}[keyof T];\n\ntype FutureDelegateType = MethodsReturningType<\n CartridgeAgitatorModel,\n Promise<FutureResponse>\n>;\n\nfunction resolveFreestyleAssembly(\n id: string\n): FreestyleAssemblyModel | undefined {\n const context = KosContextManager.getContext(id);\n const freestyleAssembly: FreestyleAssemblyModel = context?.get(\n FreestyleAssembly.type\n );\n if (!freestyleAssembly) {\n KosLog.error(\"Freestyle assembly not found\");\n return undefined;\n }\n return freestyleAssembly;\n}\nasync function futureDelegate(\n model?: FutureContainer,\n method?: FutureDelegateType\n): Promise<IFutureModel | undefined> {\n if (!model || !method) {\n return undefined;\n }\n const response = (await model[method]()) as FutureResponse;\n if (response?.tracker) {\n return FutureManager.getFuture(response.tracker);\n }\n return undefined;\n}\nexport const freestyleHolderFactory = (holder: HolderModel) => {\n if (holder.data.agitated) {\n return MODEL_TYPE;\n }\n return undefined;\n};\nexport type FreestyleHolderModel =\n PublicModelInterface<FreestyleHolderModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class FreestyleHolderModelImpl\n implements IKosDataModel, IKosIdentifiable, FutureDelegate\n{\n id: string;\n private logger: KosContextLogger;\n private holder: HolderModel<FreestyleHolderExt>;\n private context: KosContext;\n\n future?: IFutureModel;\n constructor(\n modelId: string,\n options: FreestyleHolderOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.context = context.kosContext;\n this.holder = options.companionParent;\n }\n\n get agitated() {\n return this.holder.data.agitated;\n }\n async agitate() {\n if (!this.holder.data.agitated) {\n return undefined;\n }\n this.future = undefined;\n const freestyleAssembly = resolveFreestyleAssembly(this.id);\n\n if (!freestyleAssembly) {\n return undefined;\n }\n const agitator = freestyleAssembly.defaultCartridgeAgitator;\n if (!agitator) {\n this.logger.error(\"Agitator not found\");\n return undefined;\n }\n this.future = await futureDelegate(\n freestyleAssembly.defaultCartridgeAgitator,\n \"testAgitate\"\n );\n\n return this.future;\n }\n\n get isRemote(): boolean {\n const remoteTrayId = `${RemoteTray.type}-${this.holder.path}`;\n const remoteTray = getKosModelSync<RemoteTrayModel>(remoteTrayId);\n if (!remoteTray?.model) {\n return false;\n }\n return !!remoteTray.model.remoteTrayEnabled.value;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing freestyle-holder ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading freestyle-holder ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleHolderModel } from \"./freestyle-holder-model\";\nimport { FreestyleHolderModelImpl, MODEL_TYPE } from \"./freestyle-holder-model\";\nimport type { FreestyleHolderOptions } from \"./types\";\n\n/**\n * # FreestyleHolder\n *\n * The registration bean includes convenience methods for creating and working with FreestyleHolderModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestyleHolder.type, id: \"freestyleHolderId\"})\n * private freestyleHolderModel: FreestyleHolderModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestyleHolderModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestyleHolder.factory(\"freestyleHolderId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestyleHolderModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestyleHolder.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestyleHolderModel\n * // and the compiler will know that the model has the FreestyleHolderModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestyleHolder } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestyleHolder);\n * ```\n *\n * ## registration.singleton\n \n * The freestyleHolder model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const FreestyleHolder = new KosModelRegistrationFactory<\n FreestyleHolderModel,\n FreestyleHolderOptions\n>({\n class: FreestyleHolderModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"FREESTYLE-NOZZLE_SERVICE\");\nconst { getOne } = ServiceFactory.build({\n basePath: `${URL}/api/freestyle-nozzle`,\n});\n\nconst log = KosLog.createLogger({\n name: \"freestyle-nozzle-service\",\n group: \"Services\",\n});\n\ninterface NutritionValue {\n displayValue: string;\n units: string;\n type: string;\n}\ninterface NutritionVolume {\n volume: number;\n values: NutritionValue[];\n}\nexport interface FreestyleNutritionInfoResponse {\n labels?: {\n allergens: string;\n legalDescriptor: string;\n ingredients: string;\n ingredientsHeading: string;\n };\n volumes: NutritionVolume[];\n error?: string;\n}\n\nexport class NutritionInfoError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"NutritionInfoError\";\n }\n}\n\nexport class InvalidRequestError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"InvalidRequestError\";\n }\n}\n/**\n * @category Service\n * Retrieves the initial freestyle-nozzle data.\n */\nexport const getFreestyleNutritionInfo = async (\n nozzleUrlPrefix: string,\n beverageId: string,\n volumes: number[],\n baseUrl = \"http://localhost:8081\"\n) => {\n log.debug(\"sending GET for freestyle-nozzle\");\n\n if (!beverageId) {\n log.error(\"Invalid freestyle-nozzle request: beverageId is required\");\n throw new InvalidRequestError(\"No beverageId provided\");\n }\n\n if (!volumes || volumes.length === 0) {\n log.error(\"Invalid freestyle-nozzle request: volumes are required\");\n throw new InvalidRequestError(\"No volumes provided\");\n }\n const response = await getOne<FreestyleNutritionInfoResponse>({\n urlOverride: `${baseUrl}${nozzleUrlPrefix}/pipeline/beverage/engine/nutrition/${beverageId}?volumes=${volumes.join(\n \",\"\n )}`,\n });\n\n if (!response?.data) {\n log.error(\"Failed to retrieve freestyle-nozzle data\");\n throw new Error(\"Failed to retrieve freestyle-nozzle data\");\n }\n\n if (response.data.error) {\n throw new NutritionInfoError(response.data.error);\n }\n\n return response.data;\n};\n","import type { NozzleModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n kosAction,\n kosModel,\n kosModelEffect,\n kosParentAware,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport {\n getFreestyleNutritionInfo,\n type FreestyleNutritionInfoResponse,\n} from \"./services\";\nimport type { FreestyleNozzleOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"freestyle-nozzle-model\";\n\nexport type FreestyleNozzleModel =\n PublicModelInterface<FreestyleNozzleModelImpl>;\n\n@kosParentAware()\n@kosModel(MODEL_TYPE)\nexport class FreestyleNozzleModelImpl\n implements IKosDataModel, IKosIdentifiable\n{\n id: string;\n private logger: KosContextLogger;\n private nozzleModel: NozzleModel;\n private _cupSizes: number[];\n private _nutritionInfo?: FreestyleNutritionInfoResponse;\n constructor(\n modelId: string,\n options: FreestyleNozzleOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.nozzleModel = options.companionParent;\n this._cupSizes = [100];\n }\n\n set cupSizes(cupSizes: number[]) {\n this._cupSizes = cupSizes;\n }\n get nutritionInfo() {\n return this._nutritionInfo;\n }\n\n get selectedPourable() {\n return this.nozzleModel.selectedPourable;\n }\n\n @kosModelEffect({\n dependencies: (model: FreestyleNozzleModel) => [\n model.selectedPourable.beverage,\n ],\n })\n async handleBeverageSelection() {\n if (this.nozzleModel.selectedPourable.beverage && this._cupSizes.length) {\n this.logger.debug(\n `selected beverage: ${\n this.nozzleModel.selectedPourable.beverage.rawId\n }. Volume: ${this._cupSizes.join(\", \")}`\n );\n const beverageId = this.nozzleModel.selectedPourable.beverage.rawId;\n const prefix = this.nozzleModel.urlPrefix;\n try {\n const response = await getFreestyleNutritionInfo(\n prefix,\n beverageId,\n this._cupSizes\n );\n kosAction(() => {\n this._nutritionInfo = response;\n });\n } catch (error) {\n this.logger.error(`Error fetching nutrition info: ${error}`);\n }\n }\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing freestyle-nozzle ${this.id}`);\n }\n\n unload(): void {\n this.logger.debug(`unloading freestyle-nozzle ${this.id}`);\n }\n async load(): Promise<void> {\n this.logger.debug(`loading freestyle-nozzle ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleNozzleModel } from \"./freestyle-nozzle-model\";\nimport { FreestyleNozzleModelImpl, MODEL_TYPE } from \"./freestyle-nozzle-model\";\nimport type { FreestyleNozzleOptions } from \"./types\";\n\n/**\n * # FreestyleNozzle\n *\n * The registration bean includes convenience methods for creating and working with FreestyleNozzleModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestyleNozzle.type, id: \"freestyleNozzleId\"})\n * private freestyleNozzleModel: FreestyleNozzleModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestyleNozzleModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestyleNozzle.factory(\"freestyleNozzleId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestyleNozzleModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestyleNozzle.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestyleNozzleModel\n * // and the compiler will know that the model has the FreestyleNozzleModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestyleNozzle } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestyleNozzle);\n * ```\n *\n * ## registration.singleton\n \n * The freestyleNozzle model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const FreestyleNozzle = new KosModelRegistrationFactory<\n FreestyleNozzleModel,\n FreestyleNozzleOptions\n>({\n class: FreestyleNozzleModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n FetchError,\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"PUMP_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/ext/freestyle/microCalibration`,\n});\n\nconst log = KosLog.createLogger({\n name: \"freestyle-pump-service\",\n group: \"Services\",\n});\nexport type ReplacePumpErrorType = \"unknownError\" | undefined;\nexport type ReplacePumpData = {\n error?: ReplacePumpErrorType;\n};\nexport type ReplacePumpResponse = [\n ReplacePumpErrorType | undefined,\n ReplacePumpData\n];\nexport const replacePump = async (\n pumpId: string,\n code: string\n): Promise<ReplacePumpResponse> => {\n log.debug(\n `replacePump - sending POST request to /api/ext/freestyle/microCalibration/cal/${pumpId}/code/${code}`\n );\n\n try {\n const response = await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/microCalibration/cal/${pumpId}/code/${code}`,\n });\n\n log.debug(\"replacePump - response:\", response);\n\n if (\n (response?.status === 200 || response?.status === 499) &&\n response.data?.error\n ) {\n return [response.data.error || \"unknownError\", response.data];\n }\n\n return [undefined, response?.data];\n } catch (error) {\n log.error(\n `replacePump - sending POST request to /api/cal/${pumpId}/code/${code}`,\n error\n );\n\n if (error instanceof FetchError) {\n const errorCode =\n error.payload?.data?.error || error.payload?.error || \"unknownError\";\n\n return [errorCode, error.payload?.data || { error: errorCode }];\n }\n }\n\n return [\"unknownError\", { error: \"unknownError\" }];\n};\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestylePumpOptions } from \"./types\";\n\nimport type { PumpModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport {\n replacePump,\n type ReplacePumpData,\n type ReplacePumpErrorType,\n} from \"./services\";\n\nexport const MODEL_TYPE = \"freestyle-pump-model\";\n\nexport type FreestylePumpModel = PublicModelInterface<FreestylePumpModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class FreestylePumpModelImpl implements IKosDataModel, IKosIdentifiable {\n id: string;\n private logger: KosContextLogger;\n private pump: PumpModel;\n constructor(\n modelId: string,\n options: FreestylePumpOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.pump = options.companionParent;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async replacePump(\n code: string\n ): Promise<[ReplacePumpErrorType, ReplacePumpData]> {\n const [error, data] = await replacePump(this.pump.path, code);\n if (error) {\n this.logger.error(`Failed to replace the pump, ${this.pump.id}`, error);\n }\n\n return [error, data];\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestylePumpModel } from \"./freestyle-pump-model\";\nimport { FreestylePumpModelImpl, MODEL_TYPE } from \"./freestyle-pump-model\";\nimport type { FreestylePumpOptions } from \"./types\";\n\n/**\n * # FreestylePump\n *\n * The registration bean includes convenience methods for creating and working with FreestylePumpModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestylePump.type, id: \"freestylePumpId\"})\n * private freestylePumpModel: FreestylePumpModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestylePumpModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestylePump.factory(\"freestylePumpId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestylePumpModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestylePump.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestylePumpModel\n * // and the compiler will know that the model has the FreestylePumpModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestylePump } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestylePump);\n * ```\n *\n * ## registration.singleton\n \n * The freestylePump model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const FreestylePump = new KosModelRegistrationFactory<\n FreestylePumpModel,\n FreestylePumpOptions\n>({\n class: FreestylePumpModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n type FutureResponse,\n type KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"ICE_AGITATOR_SERVICE\");\nconst { getAll, postModel } = ServiceFactory.build({\n basePath: `${URL}/api/ext/freestyle/ice`,\n});\n\nconst log = KosLog.createLogger({\n name: \"ice-agitator-service\",\n group: \"Services\",\n});\n\n/**\n * @category Service\n * Retrieves the initial dispenser data.\n */\nexport const getIceTypes = async (path: string) => {\n log.debug(\"sending GET for ice types\");\n const response = await getAll<string>({\n urlOverride: `${URL}/api/handle/${path}/types`,\n });\n return response;\n};\n\nexport const updateIceType = async (agitator: string, type: string) => {\n log.debug(\"sending POST for ice types\");\n const response = await postModel({\n urlOverride: `${URL}/api/handle/${agitator}/type/${type}`,\n model: {},\n });\n return response;\n};\n\nexport const resetIceSetting = async (path: string) => {\n const response = await getAll({\n urlOverride: `${URL}/api/kos/config/details/${path}/4`,\n });\n return response;\n};\n\nexport const pour = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/pour`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response?.data as FutureResponse;\n};\n\nexport const agitate = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/test/agitation`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response?.data as FutureResponse;\n};\n\nexport const testGate = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/test/gate`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response?.data as FutureResponse;\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport type {\n IKosDataModel,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n KosMultipleFutureAwareFull,\n KosStateProp,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n EventBus,\n KOS_MODEL_ID,\n kosAction,\n kosConfigProperty,\n kosFuture,\n kosModel,\n kosModelEffect,\n kosMultipleFutureAware,\n kosStateProp,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport { PourState } from \"@kosdev-code/kos-dispense-sdk\";\nimport {\n agitate,\n getIceTypes,\n pour,\n resetIceSetting,\n testGate,\n updateIceType,\n} from \"./services/ice-agitator-services\";\nimport type { IceAgitatorOptions } from \"./types\";\n\nexport type IceAgitatorModel = PublicModelInterface<IceAgitatorModelImpl>;\n\nexport class IceAgitatorEvents {\n static TOPIC_AGITATION_STARTED = \"/kos/events/ddk/ice-agitation-started\";\n static TOPIC_AGITATION_ENDED = \"/kos/events/ddk/ice-agitation-ended\";\n}\n\nexport const MODEL_TYPE = \"ice-agitator-model\";\nconst PROP_PATH = createPropKey<IceAgitatorModel>(\"statePath\");\n\n// Define the type for the model implementation with named futures\ntype IceAgitatorModelType = KosMultipleFutureAwareFull<\n \"pour\" | \"agitate\" | \"gate\"\n>;\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IceAgitatorModelImpl extends IceAgitatorModelType {}\n\n@kosModel(MODEL_TYPE)\n@kosMultipleFutureAware()\nexport class IceAgitatorModelImpl implements IKosDataModel {\n id: string;\n name: string;\n path: string;\n // futureHandler, future, pourFuture, agitateFuture, gateFuture,\n // and all status/progress properties are added by @kosMultipleFutureAware decorator\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.volWithoutIceMl\",\n })\n volWithoutIceMl!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.durationSec\",\n converter: {\n to: \"second\",\n },\n })\n durationSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"enableIceChuteClear\",\n })\n enableIceChuteClear!: KosConfigProperty<boolean>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"iceChuteClearDurationMs\",\n })\n iceChuteClearDurationMs!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"iceChuteClearIntervalSec\",\n })\n iceChuteClearIntervalSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"iceChuteClearRetryIntervalSec\",\n })\n iceChuteClearRetryIntervalSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"maxDispenseSec\",\n })\n maxDispenseSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"type\",\n })\n type!: KosConfigProperty<string>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.dilutionOffset\",\n })\n dilutionOffset!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.inactivitySec\",\n converter: {\n to: \"minute\",\n },\n })\n inactivitySec!: KosConfigProperty<number>;\n @kosStateProp({ path: PROP_PATH, attribute: \"agitating\" })\n private agitating!: KosStateProp<boolean>;\n\n @kosStateProp({ path: PROP_PATH, attribute: \"iceChuteOpen\" })\n private iceChuteOpen!: KosStateProp<boolean>;\n\n statePath: string;\n private _allIceTypes: string[];\n private logger: KosContextLogger;\n currentState: PourState = PourState.IDLE;\n constructor(\n modelId: string,\n options: IceAgitatorOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.name = options.name;\n this.path = options.path;\n this.statePath = options.statePath;\n this._allIceTypes = [];\n this.logger = context.logger;\n // MultipleFutureHandler setup is now handled by @kosMultipleFutureAware decorator\n }\n\n get iceTypes(): string[] {\n return this._allIceTypes;\n }\n\n get isAgitating(): boolean {\n return !!this.agitating.value;\n }\n\n get isIceChuteOpen(): boolean {\n return !!this.iceChuteOpen.value;\n }\n\n // future, pourFuture, agitateFuture, gateFuture getters are now provided by @kosMultipleFutureAware decorator\n\n /**\n * A derived value that indicates if the nozzle is currently pouring a beverage.\n * @readonly\n */\n get isPouring() {\n return (\n !!(this.pourFuture && !this.pourFuture?.endState) ||\n this.currentState === PourState.POUR_STARTING ||\n this.currentState === PourState.POURING ||\n this.currentState === PourState.POUR_CANCELING\n );\n }\n\n /**\n * A derived value that indicates if it is possible to dispense ice.\n *\n * The value is observable and will change as the current dispense state changes\n * @readonly\n * */\n get canPour() {\n return this.currentState === PourState.IDLE;\n }\n private updateIfCurrent(currentState: PourState, nextState: PourState) {\n if (this.currentState === currentState) {\n kosAction(() => {\n this.currentState = nextState;\n });\n }\n }\n @kosFuture({ alias: \"pour\" })\n public async pourIce(tracker?: string) {\n try {\n if (this.currentState === PourState.IDLE) {\n this.updateIfCurrent(PourState.IDLE, PourState.POUR_STARTING);\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n const result = await pour(this.path, tracker);\n this.updateIfCurrent(PourState.POUR_STARTING, PourState.POURING);\n\n if (result?.endState) {\n this.updateIfCurrent(PourState.POURING, PourState.IDLE);\n }\n return result as unknown as Promise<void>;\n } else {\n throw new Error(`Cannot pour in state ${this.currentState}`);\n }\n } catch (e) {\n this.logger.error(e);\n this.currentState = PourState.IDLE;\n throw e;\n }\n }\n\n /**\n * An action that will cancel the ice dispense if it is currently in progress.\n * */\n public async cancelIceDispense() {\n if (\n this.currentState === PourState.POURING ||\n this.currentState === PourState.POUR_STARTING\n ) {\n this.currentState = PourState.POUR_CANCELING;\n\n await this.pourFuture?.cancelFuture();\n kosAction(() => {\n this.currentState = PourState.IDLE;\n });\n } else {\n this.logger.warn(\n `Cannot cancel ice dispense in state ${this.currentState}`\n );\n }\n }\n @kosFuture({ alias: \"agitate\" })\n async testAgitate(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n this.logger.info(`agitating ice-agitator ${this.id}`);\n\n return agitate(this.path, tracker);\n }\n\n @kosFuture({\n alias: \"gate\",\n })\n async testGate(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n this.logger.info(`testing ice gate: ${this.id}`);\n\n return testGate(this.path, tracker);\n }\n @kosModelEffect({\n dependencies: (model) => [model.isAgitating],\n })\n handleAgitationChange() {\n if (this.isAgitating) {\n this.logger.info(`agitating ice-agitator ${this.id}`);\n EventBus.publish(IceAgitatorEvents.TOPIC_AGITATION_STARTED, {\n path: this.path,\n futureId: this.futureHandler.future?.futureId,\n });\n } else {\n EventBus.publish(IceAgitatorEvents.TOPIC_AGITATION_ENDED, {\n path: this.path,\n });\n }\n }\n async updateIceType(type: string) {\n await updateIceType(this.path, type);\n }\n\n resetDefaultValues = async () => {\n const defaults = await resetIceSetting(this.path);\n return defaults;\n };\n\n async init(): Promise<void> {\n this.logger.debug(`initializing ice-agitator ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading ice-agitator ${this.id}`);\n const iceTypes = await getIceTypes(this.path);\n if (iceTypes?.status === 200) {\n kosAction(() => {\n this._allIceTypes = iceTypes.data || [];\n });\n }\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n IceAgitatorModelImpl,\n MODEL_TYPE,\n type IceAgitatorModel,\n} from \"./ice-agitator-model\";\nimport type { IceAgitatorOptions } from \"./types\";\n\n/**\n * # IceAgitator\n *\n * The registration bean includes convenience methods for creating and working with IceAgitatorModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: IceAgitator.type, id: \"iceAgitatorId\"})\n * private iceAgitatorModel: IceAgitatorModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new IceAgitatorModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = IceAgitator.factory(\"iceAgitatorId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a IceAgitatorModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (IceAgitator.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to IceAgitatorModel\n * // and the compiler will know that the model has the IceAgitatorModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { IceAgitator } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...IceAgitator.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The iceAgitator model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\n\nexport const IceAgitator = new KosModelRegistrationFactory<\n IceAgitatorModel,\n IceAgitatorOptions\n>({\n class: IceAgitatorModelImpl,\n type: MODEL_TYPE,\n});\n","import type {\n IntentAware,\n IntentAwareProps,\n PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n FutureResponse,\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { LfcvPumpOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"lfcv-pump-model\";\n\nexport type LfcvPumpModel = PublicModelInterface<LfcvPumpModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class LfcvPumpModelImpl\n implements IKosDataModel, IKosIdentifiable, IntentAware\n{\n id: string;\n private logger: KosContextLogger;\n private pumpModel: PumpModel;\n constructor(\n modelId: string,\n options: LfcvPumpOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.pumpModel = options.companionParent;\n }\n\n get name() {\n return this.pumpModel.name;\n }\n\n get canPour() {\n return this.pumpModel.canPour;\n }\n\n get isPouring() {\n return this.pumpModel.isPouring;\n }\n\n async cancelPour() {\n return this.pumpModel.cancelPour();\n }\n\n performIntent(\n props: IntentAwareProps | string\n ): Promise<FutureResponse | undefined> {\n return this.pumpModel.performIntent(props);\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing lfcv-pump ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading lfcv-pump ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { LfcvPumpOptions } from \"./types\";\nimport { LfcvPumpModelImpl, MODEL_TYPE } from \"./lfcv-pump-model\";\nimport type { LfcvPumpModel } from \"./lfcv-pump-model\";\n\n/**\n * # LfcvPump\n *\n * The registration bean includes convenience methods for creating and working with LfcvPumpModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: LfcvPump.type, id: \"lfcvPumpId\"})\n * private lfcvPumpModel: LfcvPumpModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new LfcvPumpModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = LfcvPump.factory(\"lfcvPumpId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a LfcvPumpModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (LfcvPump.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to LfcvPumpModel\n * // and the compiler will know that the model has the LfcvPumpModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { LfcvPump } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(LfcvPump);\n * ```\n *\n * ## registration.singleton\n \n * The lfcvPump model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const LfcvPump = new KosModelRegistrationFactory<\n LfcvPumpModel,\n LfcvPumpOptions\n>({\n class: LfcvPumpModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n ServiceFactory,\n resolveServiceUrl,\n KosLog,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"LFCV-PUMP_SERVICE\");\nconst { getAll } = ServiceFactory.build({\n basePath: `${URL}/api/lfcv-pump`,\n});\n\nconst log = KosLog.createLogger({\n name: \"lfcv-pump-service\",\n group: \"Services\",\n});\ninterface LfcvPumpResponse {\n id: string;\n}\n/**\n * @category Service\n * Retrieves the initial lfcv-pump data.\n */\nexport const getLfcvPumps = async () => {\n log.debug(\"sending GET for lfcv-pump\");\n const response = await getAll<LfcvPumpResponse>({});\n return response;\n};\n","import {\n FetchError,\n FutureEndState,\n FutureManager,\n KosLog,\n resolveServiceUrl,\n ServiceFactory,\n type FutureResponse,\n type KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nconst { URL } = resolveServiceUrl(\"SPM-PUMP_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/spm-pump`,\n});\n\nconst log = KosLog.createLogger({\n name: \"spm-pump-service\",\n group: \"Services\",\n});\n\nexport const performPreCalibrate = async (pump: string, tracker?: string) => {\n log.debug(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/preCalibrate`\n );\n\n try {\n const response = (await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/microCalibration/pour/${pump}/preCalibrate`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performPreCalibrate - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/preCalibrate`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\nexport const performCalibrate = async (pump: string, tracker?: string) => {\n log.debug(\n `performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/calibrate`\n );\n\n try {\n const response = (await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/microCalibration/pour/${pump}/calibrate`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performCalibrate - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/calibrate`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\nexport const performVerify = async (\n pump: string,\n volume: string,\n payload: any,\n tracker?: string\n) => {\n log.debug(\n `performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/verify`\n );\n\n try {\n const response = (await postModel({\n model: {\n ...payload,\n // commandedCalibrationVolume: 0,\n measuredCalibrationVolume: volume,\n // measuredVerificationVolume: 0,\n // newCalibrationValue: 0,\n // pouredCalibrationVolume: 0,\n },\n urlOverride: `${URL}/api/ext/freestyle/microCalibration/pour/${pump}/verify`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performVerify - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/verify`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\nexport const performComplete = async (\n pump: string,\n volume1: string,\n volume2: string,\n payload: any\n) => {\n log.debug(\n `performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/complete`\n );\n\n try {\n const response = await postModel({\n model: {\n ...payload,\n // commandedCalibrationVolume: 0,\n measuredCalibrationVolume: volume1,\n measuredVerificationVolume: volume2,\n // newCalibrationValue: 0,\n // pouredCalibrationVolume: 0,\n },\n urlOverride: `${URL}/api/ext/freestyle/microCalibration/pour/${pump}/complete`,\n });\n\n log.debug(\"performComplete - response:\", response);\n\n if (\n (response?.status === 200 || response?.status === 499) &&\n response.data?.error\n ) {\n return [response.data.error || \"unknownError\", response.data];\n }\n\n return [undefined, response?.data];\n } catch (error) {\n log.error(\n `performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/complete`,\n error\n );\n\n if (error instanceof FetchError) {\n const errorCode =\n error.payload?.data?.error || error.payload?.error || \"unknownError\";\n\n return [errorCode, error.payload?.data || { error: errorCode }];\n }\n }\n\n return [\"unknownError\", { error: \"unknownError\" }];\n};\n","import type {\n KosContextLogger,\n KosCreationContext,\n IKosDataModel,\n IKosIdentifiable,\n PublicModelInterface,\n FutureContainer,\n FutureAwareContainer,\n FutureResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { FutureHandler, kosFuture, kosModel } from \"@kosdev-code/kos-ui-sdk\";\n\nimport type { SpmPumpOptions } from \"./types\";\n\nimport type {\n IntentAware,\n IntentAwareProps,\n PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport {\n performCalibrate,\n performComplete,\n performPreCalibrate,\n performVerify,\n} from \"./services\";\n\nexport const MODEL_TYPE = \"spm-pump-model\";\n\nexport type SpmPumpModel = PublicModelInterface<SpmPumpModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class SpmPumpModelImpl\n implements IKosDataModel, IKosIdentifiable, IntentAware, FutureContainer\n{\n id: string;\n private logger: KosContextLogger;\n private pump: PumpModel;\n futureHandler: FutureAwareContainer;\n\n constructor(\n modelId: string,\n options: SpmPumpOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this.pump = options.companionParent;\n this.futureHandler = new FutureHandler(this);\n }\n\n get name() {\n return this.pump.name;\n }\n\n get canPour() {\n return this.pump.canPour;\n }\n\n get isPouring() {\n return this.pump.isPouring;\n }\n\n async cancelPour() {\n return this.pump.cancelPour();\n }\n\n performIntent(\n props: IntentAwareProps | string\n ): Promise<FutureResponse | undefined> {\n return this.pump.performIntent(props);\n }\n\n get future() {\n return this.futureHandler.future;\n }\n\n @kosFuture()\n async performPreCalibrate(tracker?: string) {\n return performPreCalibrate(this.pump.path, tracker);\n }\n\n @kosFuture()\n async performCalibrate(tracker?: string) {\n return performCalibrate(this.pump.path, tracker);\n }\n\n @kosFuture()\n async performVerify(volume: string, payload: any, tracker?: string) {\n return performVerify(this.pump.path, volume, payload, tracker);\n }\n\n async performComplete(volume1: string, volume2: string, payload: any) {\n return performComplete(this.pump.path, volume1, volume2, payload);\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing spm-pump ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading spm-pump ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { SpmPumpOptions } from \"./types\";\nimport { SpmPumpModelImpl, MODEL_TYPE } from \"./spm-pump-model\";\nimport type { SpmPumpModel } from \"./spm-pump-model\";\n\n/**\n * # SpmPump\n *\n * The registration bean includes convenience methods for creating and working with SpmPumpModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: SpmPump.type, id: \"spmPumpId\"})\n * private spmPumpModel: SpmPumpModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new SpmPumpModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = SpmPump.factory(\"spmPumpId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a SpmPumpModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (SpmPump.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to SpmPumpModel\n * // and the compiler will know that the model has the SpmPumpModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { SpmPump } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(SpmPump);\n * ```\n *\n * ## registration.singleton\n \n * The spmPump model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const SpmPump = new KosModelRegistrationFactory<\n SpmPumpModel,\n SpmPumpOptions\n>({\n class: SpmPumpModelImpl,\n type: MODEL_TYPE,\n});\n","/**\n * (C) Copyright 2024, TCCC, All rights reserved.\n *\n */\n\n/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport {\n Assembly,\n HolderModel,\n type HolderTroubleData,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n DeferAware,\n FutureResponse,\n IKosDataModel,\n IKosIdentifiable,\n KosCompanionComposition,\n KosConfigProperty,\n KosLoggerAware,\n KosModelRegistrationFactory,\n PublicModelInterface,\n ResolveAware,\n TroubleModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n DependencyLifecycle,\n getKosModelSync,\n kosCompanion,\n kosConfigProperty,\n kosLoggerAware,\n kosModel,\n kosTopicHandler,\n modelTypeEventTopicFactory,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { AgitationRequiredTroubleOptions } from \"./types\";\n\n/**\n * Agitation required trouble model type identifier.\n *\n * Used for model registration and type predicates when working with\n * agitation-related troubles in the KOS framework.\n *\n * @category Trouble Models\n */\nexport const MODEL_TYPE = \"agitation-required-trouble-model\";\n\n/**\n * Public interface for the AgitationRequiredTrouble model.\n *\n * This model manages troubles related to insufficient agitation in beverage\n * holders, providing resolution capabilities and deferral logic based on\n * configuration properties.\n *\n * @see {@link AgitationRequiredTroubleModelImpl} for the implementation\n * @category Trouble Models\n */\nexport type AgitationRequiredTroubleModel =\n PublicModelInterface<AgitationRequiredTroubleModelImpl>;\n\n/**\n * Factory function to determine if a trouble requires agitation handling.\n *\n * Examines the trouble model's data to determine if it represents an\n * insufficient agitation condition that requires a dedicated agitation\n * trouble model.\n *\n * @param troubleModel - The trouble model to examine\n * @returns The agitation model type if agitation is required, undefined otherwise\n *\n * @example\n * ```typescript\n * const modelType = agitationModelFactory(troubleModel);\n * if (modelType) {\n * // Create agitation trouble model\n * const agitationModel = AgitationRequiredTrouble\n * .instance(troubleModel.id)\n * .options({ companionParent: troubleModel })\n * .build();\n * }\n * ```\n *\n * @category Trouble Models\n */\nexport const agitationModelFactory = (troubleModel: TroubleModel) => {\n if (troubleModel.data.agitationRequired) {\n return MODEL_TYPE;\n }\n return undefined;\n};\n\n/**\n * Trouble type identifier for insufficient agitation troubles.\n *\n * This constant is used to filter and identify agitation-related troubles\n * in the trouble system.\n *\n * @category Trouble Models\n */\nexport const AGITATION_REQUIRED_TROUBLE = \"InsufficientAgitationTrouble\";\n\nexport interface AgitationRequiredTroubleModelImpl\n extends KosLoggerAware,\n KosCompanionComposition<TroubleModel<HolderTroubleData>> {\n /** Parent trouble model (set by @kosCompanion decorator via parentProperty: \"trouble\") */\n trouble: TroubleModel<HolderTroubleData>;\n}\n\n/**\n * Companion model for managing agitation-required troubles in KOS beverage dispensers.\n *\n * This model represents troubles caused by insufficient agitation in ingredient holders,\n * typically occurring when carbonation levels are too low or agitation mechanisms fail.\n * It provides resolution capabilities and deferral logic to prevent pouring until\n * agitation conditions are met.\n *\n * The model integrates with the KOS configuration system to respect the\n * `ncui.agitateBeforePour` setting, allowing operators to control whether\n * pouring should wait for agitation to complete.\n *\n * @remarks\n * This is a companion model to the parent trouble model, created via the\n * {@link agitationModelFactory} when a trouble's `agitationRequired` flag is set.\n *\n * @example\n * ```typescript\n * // Factory-based creation (typical usage)\n * const agitationTrouble = AgitationRequiredTrouble\n * .instance(troubleId)\n * .options({ companionParent: parentTroubleModel })\n * .build();\n *\n * // Check if pouring should be deferred\n * if (agitationTrouble.shouldDefer) {\n * await agitationTrouble.defer();\n * }\n *\n * // Resolve the trouble\n * await agitationTrouble.resolve();\n * ```\n *\n * @category Trouble Models\n * @author Mark Pomerant (mark@matrica.ca)\n * @version 2.1.27\n */\n@kosModel({ modelTypeId: MODEL_TYPE, singleton: false })\n@kosLoggerAware()\n@kosCompanion({ mode: \"composition\", parentProperty: \"trouble\" })\nexport class AgitationRequiredTroubleModelImpl\n implements IKosDataModel, IKosIdentifiable, ResolveAware, DeferAware\n{\n /**\n * Registration factory for creating AgitationRequiredTrouble model instances.\n *\n * Automatically injected by the `@kosModel` decorator. Use the exported\n * {@link AgitationRequiredTrouble} constant instead of accessing this directly.\n *\n * @see {@link AgitationRequiredTrouble}\n */\n static Registration: KosModelRegistrationFactory<\n AgitationRequiredTroubleModel,\n AgitationRequiredTroubleOptions\n >;\n\n /**\n * Unique identifier for this model instance.\n */\n id: string;\n\n private _deferred: boolean;\n private _holdersLoaded = false;\n\n /**\n * Configuration property controlling whether to wait for agitation before pouring.\n *\n * When enabled, pouring will be deferred if the holder has insufficient agitation troubles.\n * This ensures beverage quality by preventing pours with inadequate carbonation or mixing.\n */\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.agitateBeforePour\",\n })\n agitateBeforePour!: KosConfigProperty<boolean>;\n\n /**\n * Creates a new AgitationRequiredTrouble model instance.\n *\n * @param modelId - Unique identifier for this model instance (typically matches parent trouble ID)\n */\n constructor(modelId: string) {\n this.id = modelId;\n this._deferred = false;\n }\n\n /**\n * Resolves the agitation trouble by delegating to the parent trouble model.\n *\n * Resolution typically involves completing the agitation process and clearing\n * the trouble state once carbonation or mixing levels are acceptable.\n *\n * @returns Promise resolving to the future response from the parent trouble's resolution\n */\n async resolve(): Promise<FutureResponse | undefined> {\n return this.trouble.resolve();\n }\n\n /**\n * Gets the holder model associated with this agitation trouble.\n *\n * The holder is the physical container (cartridge holder, ingredient holder, etc.)\n * that requires agitation. Returns undefined if the holder model hasn't been\n * loaded yet through the Assembly model initialization.\n *\n * @returns The holder model or undefined if not yet loaded\n */\n get holder() {\n const holderPath = this.trouble.data.holderPaths[0];\n const holderModel = getKosModelSync<HolderModel>(holderPath);\n\n if (!this._holdersLoaded && !holderModel.model) {\n return undefined;\n }\n\n return holderModel?.model;\n }\n\n /**\n * Handles Assembly model events to track when holder models become available.\n *\n * This topic handler listens for Assembly model lifecycle events to determine\n * when holder models have been fully loaded and are accessible.\n *\n * @internal\n */\n @kosTopicHandler({\n topic: modelTypeEventTopicFactory(Assembly.type),\n lifecycle: DependencyLifecycle.INIT,\n })\n updateHolder() {\n if (!this._holdersLoaded) {\n const holderPath = this.trouble.data.holderPaths[0];\n const holderModel = getKosModelSync<HolderModel>(holderPath);\n if (holderModel.model) {\n this._holdersLoaded = true;\n }\n }\n }\n\n /**\n * Determines if trouble resolution should be deferred until agitation completes.\n *\n * Trouble resolution is deferred when:\n * 1. The holder has active insufficient agitation troubles\n * 2. The `agitateBeforePour` configuration is enabled\n *\n * This ensures that operations requiring agitation (prime, purge, or other\n * holder-related troubles) wait for proper carbonation or mixing before\n * being marked as resolved.\n *\n * @returns true if trouble resolution should wait for agitation to complete\n */\n get shouldDefer() {\n if (!this.holder) {\n return true;\n }\n const troubleList =\n this.holder?.troublesByType[AGITATION_REQUIRED_TROUBLE] || [];\n const hasInsufficientAgitationTrouble = troubleList.length > 0;\n const waitForAgitation = !!this.agitateBeforePour?.value;\n return waitForAgitation && hasInsufficientAgitationTrouble;\n }\n\n /**\n * Gets the current deferral state of this trouble.\n *\n * @returns true if this trouble resolution is currently deferred\n */\n get deferred() {\n return this._deferred;\n }\n\n /**\n * Marks this trouble as deferred, preventing immediate resolution.\n *\n * Called by the trouble system to indicate that trouble resolution\n * should wait for agitation to complete before being marked as resolved.\n */\n defer() {\n this._deferred = true;\n }\n\n /**\n * Clears the deferral state, allowing trouble resolution to proceed.\n *\n * Typically called after agitation has completed and the trouble can\n * now be safely resolved.\n */\n clearDefer() {\n this._deferred = false;\n }\n}\n\n/**\n * Registration factory for creating AgitationRequiredTrouble model instances.\n *\n * Use this constant to create new instances of the agitation trouble model\n * using the fluent factory pattern.\n *\n * @example\n * ```typescript\n * // Create a new agitation trouble model\n * const agitationTrouble = AgitationRequiredTrouble\n * .instance(troubleId)\n * .options({ companionParent: parentTroubleModel })\n * .build();\n *\n * // Check deferral status\n * if (agitationTrouble.shouldDefer) {\n * console.log('Pouring deferred due to agitation');\n * }\n * ```\n *\n * @category Trouble Models\n */\nexport const AgitationRequiredTrouble =\n AgitationRequiredTroubleModelImpl.Registration;\n","import { KosLog, type DataMapper } from \"@kosdev-code/kos-ui-sdk\";\nimport { type CarbAgitatorModel } from \"../../../models/carb-agitator\";\nimport {\n IceAgitator,\n type IceAgitatorModel,\n} from \"../../../models/ice-agitator\";\n\nimport {\n CartridgeAgitator,\n CartridgeAgitatorContainer,\n} from \"../../../models/cartridge-agitator\";\nimport { RemoteTray, RemoteTrayContainer } from \"../../../models/remote-tray\";\nimport type { FreestyleModelAssemblyExt } from \"../../../models/types/assembly\";\nimport type { FreestyleAssemblyResponse } from \"./types\";\n\ntype AgitatorModel = CarbAgitatorModel | IceAgitatorModel;\nexport type AgitatorTypes = \"iceAgitator\";\nexport const AGITATOR_KEYS: AgitatorTypes[] = [\"iceAgitator\"];\nexport const AGITATOR_FACTORY_MAP = {\n iceAgitator: IceAgitator.factory,\n};\nexport const AGITATOR_NAME_MAP = {\n iceAgitator: \"Ice Agitator\",\n};\n\nconst logger = KosLog.createLogger({ name: \"freestyle-assembly-data-mapper\" });\n\nexport const freestyleAssemblyDataMapper: DataMapper<\n FreestyleAssemblyResponse,\n FreestyleModelAssemblyExt\n> = async (data) => {\n const cartridgeAgitators = CartridgeAgitatorContainer.instance()\n .options({})\n .build();\n const remoteTrays = RemoteTrayContainer.instance().options({}).build();\n const response = data.assemblies.reduce((acc, assembly) => {\n AGITATOR_KEYS.forEach((key) => {\n const agitator = assembly[key];\n if (agitator) {\n const factory = AGITATOR_FACTORY_MAP[key](agitator.path);\n acc[key] = factory({\n name: agitator.name,\n path: agitator.path,\n statePath: agitator.state?.path || \"\",\n });\n }\n });\n\n assembly.cartridgeAgitators?.forEach((cartridgeAgitatorData) => {\n const cartridgeAgitator = CartridgeAgitator.instance(\n cartridgeAgitatorData.path\n )\n .options({\n name: cartridgeAgitatorData.name,\n path: cartridgeAgitatorData.path,\n statePath: cartridgeAgitatorData.state?.path || \"\",\n })\n .build();\n cartridgeAgitators.addModel(cartridgeAgitator);\n });\n\n if (assembly.remoteTrays) {\n assembly.remoteTrays.forEach((tray) => {\n logger.info(`Found remote tray ${tray.name} with path ${tray.path}`);\n\n const trayId = `${RemoteTray.type}-${tray.holderPath}`;\n const trayModel = RemoteTray.instance(trayId)\n .options({\n holderPath: tray.holderPath,\n configPath: tray.path,\n name: tray.name,\n })\n .build();\n\n remoteTrays.addModel(trayModel);\n });\n }\n\n return acc;\n }, {} as { [key in AgitatorTypes]?: AgitatorModel });\n\n const supportsIce = !!response.iceAgitator;\n const supportsCarb = !!response[\"carbTank\"];\n\n return {\n ...response,\n cartridgeAgitators,\n remoteTrays,\n supportsCarb,\n supportsIce,\n } as FreestyleModelAssemblyExt;\n};\n","import {\n Assembly,\n KosModelRegistry as DispenseModelRegistration,\n Holder,\n Nozzle,\n Pump,\n PumpContainer,\n PumpContainerModel,\n PumpIndex,\n registerDispenseModels,\n type IngredientModel,\n type PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\n\nimport {\n EXTENSION_TROUBLE_DATA_MAPPER,\n ExtensionManager,\n getKosModelSync,\n registerCoreModels,\n RegistrationManager,\n Trouble,\n type RegistrationResult,\n type TroubleModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n agitationModelFactory,\n AgitationRequiredTrouble,\n} from \"../models/agitation-required-trouble/agitation-required-trouble-model\";\n\nimport { CarbAgitator } from \"../models/carb-agitator\";\nimport { CartridgeAgitatorContainer } from \"../models/cartridge-agitator\";\nimport { CgpPump } from \"../models/cgp-pump\";\nimport { FcmPump } from \"../models/fcm-pump\";\nimport { FreestyleAssembly } from \"../models/freestyle-assembly\";\nimport { FreestyleHolder } from \"../models/freestyle-holder\";\nimport { FreestyleNozzle } from \"../models/freestyle-nozzle\";\nimport { FreestylePump } from \"../models/freestyle-pump\";\nimport { IceAgitator } from \"../models/ice-agitator\";\nimport { LfcvPump } from \"../models/lfcv-pump\";\nimport { RemoteTray, RemoteTrayContainer } from \"../models/remote-tray\";\nimport { SpmPump } from \"../models/spm-pump\";\n\nexport const registerFreestyleModels =\n <R>(root: R) =>\n () => {\n registerCoreModels(root)();\n registerDispenseModels(root)();\n FreestyleNozzle.register();\n FreestyleAssembly.register();\n IceAgitator.register();\n CarbAgitator.register();\n CartridgeAgitatorContainer.register();\n SpmPump.register();\n FcmPump.register();\n LfcvPump.register();\n CgpPump.register();\n FreestylePump.register();\n FreestyleHolder.register();\n RemoteTray.register();\n RemoteTrayContainer.register();\n RegistrationManager.companion.register(root)(\n Nozzle.type,\n FreestyleNozzle.type\n );\n\n RegistrationManager.companion.register(root)(\n Assembly.type,\n FreestyleAssembly.type\n );\n\n AgitationRequiredTrouble.register();\n RegistrationManager.companion.register(root)(\n Trouble.type,\n agitationModelFactory\n );\n\n RegistrationManager.companion.register(root)(Pump.type, FreestylePump.type);\n RegistrationManager.companion.register(root)(\n Holder.type,\n FreestyleHolder.type\n );\n\n ExtensionManager[EXTENSION_TROUBLE_DATA_MAPPER].register(\n \"EnjoyByTrouble\",\n async (trouble: TroubleModel) => {\n // If the trouble has an enjoy by date, we can calculate the days since\n if (trouble.data.enjoyByDate) {\n const enjoyByDate = new Date(trouble.data.enjoyByDate);\n const now = new Date();\n const daysSinceEnjoyBy = Math.floor(\n (now.getTime() - enjoyByDate.getTime()) / (1000 * 60 * 60 * 24)\n );\n return {\n enjoyByDays: daysSinceEnjoyBy || \"\",\n };\n }\n\n return {};\n }\n );\n\n ExtensionManager[EXTENSION_TROUBLE_DATA_MAPPER].register(\n \"SuperPumpRequiredTrouble\", // This is the trouble type\n async (_trouble: TroubleModel) => {\n const { model: pumpContainer } = getKosModelSync<PumpContainerModel>(\n PumpContainer.type\n );\n\n if (pumpContainer) {\n const superPumpModels = pumpContainer.models.getIndexByKey(\n PumpIndex.byType,\n \"microSuper\"\n );\n const superPumps = superPumpModels\n .map((model) => model.name)\n .join(\", \");\n return {\n superPumps,\n };\n }\n return {};\n }\n );\n ExtensionManager[EXTENSION_TROUBLE_DATA_MAPPER].register(\n \"MicroPumpAirDetectTrouble\",\n async (trouble: TroubleModel) => {\n // If the trouble is related to a container, we don't need to map the data\n if (trouble.ifaces.includes(\"container\")) {\n return {};\n }\n if (trouble.data.pumpPath) {\n const { model: pumpModel } = getKosModelSync<PumpModel>(\n trouble.data.pumpPath\n );\n\n if (pumpModel) {\n const ingredientModel = pumpModel.ingredientId\n ? getKosModelSync<IngredientModel>(pumpModel.ingredientId).model\n : undefined;\n return {\n ingredientId: pumpModel.ingredientId,\n ingredientName: ingredientModel?.name || \"\",\n };\n }\n }\n return {};\n }\n );\n return {\n preload: RegistrationManager.model.preloadModel(root),\n model: RegistrationManager.model.register(root),\n companion: RegistrationManager.companion.register(root),\n legacy: RegistrationManager.model.registerLegacyModel(root),\n };\n };\n\ntype ModelRegistry<R> = typeof DispenseModelRegistration & {\n freestyle: { models: () => RegistrationResult<R> };\n preload: ReturnType<typeof RegistrationManager.model.preloadModel>;\n model: ReturnType<typeof RegistrationManager.model.register>;\n companion: ReturnType<typeof RegistrationManager.companion.register>;\n};\n\nconst _KosModelRegistry = {\n ...DispenseModelRegistration,\n};\n\n(_KosModelRegistry as any).freestyle = {\n models: registerFreestyleModels(_KosModelRegistry),\n};\n(_KosModelRegistry as any).preload =\n RegistrationManager.model.preloadModel(_KosModelRegistry);\n(_KosModelRegistry as any).model =\n RegistrationManager.model.register(_KosModelRegistry);\n(_KosModelRegistry as any).companion =\n RegistrationManager.companion.register(_KosModelRegistry);\n(_KosModelRegistry as any).legacy =\n RegistrationManager.model.registerLegacyModel(_KosModelRegistry);\n\ntype KosModelRegistryType = ModelRegistry<typeof _KosModelRegistry>;\n\nconst KosModelRegistry: KosModelRegistryType = _KosModelRegistry as any;\n\nexport { KosModelRegistry };\n","import {\n kosServiceRequest as baseKosServiceRequest,\n createClient,\n type ClientResponse,\n type HttpMethod,\n type IKosServiceRequestParams,\n type KosExecutionContext,\n type PathsByMethod,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { paths } from \"./openapi\";\n\n/**\n * Type aliases for freestyle API\n */\nexport type Api = paths;\nexport type ApiPath = keyof paths;\nexport type ValidPaths = PathsByMethod<paths>;\n\n/**\n * Get client response type for freestyle API\n */\nexport type ApiResponse<\n Path extends ApiPath,\n Method extends \"get\" | \"post\" | \"put\" | \"delete\" = \"get\"\n> = ClientResponse<paths, Path, Method>;\n\n/**\n * Get execution context type for freestyle API\n */\nexport type ExecutionContext<\n Path extends ApiPath = ApiPath,\n Method extends HttpMethod = \"get\"\n> = KosExecutionContext<paths, Path, Method>;\n\n/**\n * Typed decorator factory for @kosServiceRequest with freestyle API types\n *\n * Provides full IntelliSense and type safety for path, query params, and body\n * based on the freestyle OpenAPI schema.\n *\n * @example\n * ```typescript\n * import { kosServiceRequest } from '../../utils/services/freestyle/1.6.5/service';\n * import { DependencyLifecycle } from '@kosdev-code/kos-ui-sdk';\n *\n * @kosServiceRequest({\n * path: '/api/...',\n * method: 'get',\n * lifecycle: DependencyLifecycle.LOAD\n * })\n * private onDataLoaded(): void {\n * // Fully typed based on freestyle API\n * }\n * ```\n */\nexport function kosServiceRequest<\n Path extends ApiPath,\n Method extends HttpMethod = \"get\",\n Response = any,\n TransformedResponse = Response\n>(\n params: IKosServiceRequestParams<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >\n) {\n return baseKosServiceRequest<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >(params);\n}\n\n/**\n * Create an API client for freestyle\n */\nexport const api = createClient<paths>();\n\nexport default api;\n","import {\n kosServiceRequest as baseKosServiceRequest,\n createClient,\n type ClientResponse,\n type HttpMethod,\n type IKosServiceRequestParams,\n type KosExecutionContext,\n type PathsByMethod,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { paths } from \"./openapi\";\n\n/**\n * Type aliases for freestyle API\n */\nexport type Api = paths;\nexport type ApiPath = keyof paths;\nexport type ValidPaths = PathsByMethod<paths>;\n\n/**\n * Get client response type for freestyle API\n */\nexport type ApiResponse<\n Path extends ApiPath,\n Method extends \"get\" | \"post\" | \"put\" | \"delete\" = \"get\"\n> = ClientResponse<paths, Path, Method>;\n\n/**\n * Get execution context type for freestyle API\n */\nexport type ExecutionContext<\n Path extends ApiPath = ApiPath,\n Method extends HttpMethod = \"get\"\n> = KosExecutionContext<paths, Path, Method>;\n\n/**\n * Typed decorator factory for @kosServiceRequest with freestyle API types\n *\n * Provides full IntelliSense and type safety for path, query params, and body\n * based on the freestyle OpenAPI schema.\n *\n * @example\n * ```typescript\n * import { kosServiceRequest } from '../../utils/services/freestyle/1.8.1/service';\n * import { DependencyLifecycle } from '@kosdev-code/kos-ui-sdk';\n *\n * @kosServiceRequest({\n * path: '/api/...',\n * method: 'get',\n * lifecycle: DependencyLifecycle.LOAD\n * })\n * private onDataLoaded(): void {\n * // Fully typed based on freestyle API\n * }\n * ```\n */\nexport function kosServiceRequest<\n Path extends ApiPath,\n Method extends HttpMethod = \"get\",\n Response = any,\n TransformedResponse = Response\n>(\n params: IKosServiceRequestParams<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >\n) {\n return baseKosServiceRequest<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >(params);\n}\n\n/**\n * Create an API client for freestyle\n */\nexport const api = createClient<paths>();\n\nexport default api;\n","import {\n kosServiceRequest as baseKosServiceRequest,\n createClient,\n type ClientResponse,\n type HttpMethod,\n type IKosServiceRequestParams,\n type KosExecutionContext,\n type PathsByMethod,\n} from \"@kosdev-code/kos-ui-sdk\"\nimport type { paths } from \"./openapi\";\n\n/**\n * Type aliases for freestyle API\n */\nexport type Api = paths;\nexport type ApiPath = keyof paths;\nexport type ValidPaths = PathsByMethod<paths>;\n\n/**\n * Get client response type for freestyle API\n */\nexport type ApiResponse<\n Path extends ApiPath,\n Method extends \"get\" | \"post\" | \"put\" | \"delete\" = \"get\"\n> = ClientResponse<paths, Path, Method>;\n\n/**\n * Get execution context type for freestyle API\n */\nexport type ExecutionContext<\n Path extends ApiPath = ApiPath,\n Method extends HttpMethod = \"get\"\n> = KosExecutionContext<paths, Path, Method>;\n\n/**\n * Typed decorator factory for @kosServiceRequest with freestyle API types\n *\n * Provides full IntelliSense and type safety for path, query params, and body\n * based on the freestyle OpenAPI schema.\n *\n * @example\n * ```typescript\n * import { kosServiceRequest } from '../../utils/services/freestyle/daily/service';\n * import { DependencyLifecycle } from '@kosdev-code/kos-ui-sdk';\n *\n * @kosServiceRequest({\n * path: '/api/...',\n * method: 'get',\n * lifecycle: DependencyLifecycle.LOAD\n * })\n * private onDataLoaded(): void {\n * // Fully typed based on freestyle API\n * }\n * ```\n */\nexport function kosServiceRequest<\n Path extends ApiPath,\n Method extends HttpMethod = \"get\",\n Response = any,\n TransformedResponse = Response\n>(\n params: IKosServiceRequestParams<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >\n) {\n return baseKosServiceRequest<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >(params);\n}\n\n/**\n * Create an API client for freestyle\n */\nexport const api = createClient<paths>();\n\nexport default api;\n","import {\n kosServiceRequest as baseKosServiceRequest,\n createClient,\n type ClientResponse,\n type HttpMethod,\n type IKosServiceRequestParams,\n type KosExecutionContext,\n type PathsByMethod,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { paths } from \"./openapi\";\n\n/**\n * Type aliases for handle API\n */\nexport type Api = paths;\nexport type ApiPath = keyof paths;\nexport type ValidPaths = PathsByMethod<paths>;\n\n/**\n * Get client response type for handle API\n */\nexport type ApiResponse<\n Path extends ApiPath,\n Method extends \"get\" | \"post\" | \"put\" | \"delete\" = \"get\"\n> = ClientResponse<paths, Path, Method>;\n\n/**\n * Get execution context type for handle API\n */\nexport type ExecutionContext<\n Path extends ApiPath = ApiPath,\n Method extends HttpMethod = \"get\"\n> = KosExecutionContext<paths, Path, Method>;\n\n/**\n * Typed decorator factory for @kosServiceRequest with handle API types\n *\n * Provides full IntelliSense and type safety for path, query params, and body\n * based on the handle OpenAPI schema.\n *\n * @example\n * ```typescript\n * import { kosServiceRequest } from '../../utils/services/handle/1.8.1/service';\n * import { DependencyLifecycle } from '@kosdev-code/kos-ui-sdk';\n *\n * @kosServiceRequest({\n * path: '/api/...',\n * method: 'get',\n * lifecycle: DependencyLifecycle.LOAD\n * })\n * private onDataLoaded(): void {\n * // Fully typed based on handle API\n * }\n * ```\n */\nexport function kosServiceRequest<\n Path extends ApiPath,\n Method extends HttpMethod = \"get\",\n Response = any,\n TransformedResponse = Response\n>(\n params: IKosServiceRequestParams<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >\n) {\n return baseKosServiceRequest<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >(params);\n}\n\n/**\n * Create an API client for handle\n */\nexport const api = createClient<paths>();\n\nexport default api;\n","import {\n kosServiceRequest as baseKosServiceRequest,\n createClient,\n type ClientResponse,\n type HttpMethod,\n type IKosServiceRequestParams,\n type KosExecutionContext,\n type PathsByMethod,\n} from \"@kosdev-code/kos-ui-sdk\"\nimport type { paths } from \"./openapi\";\n\n/**\n * Type aliases for handle API\n */\nexport type Api = paths;\nexport type ApiPath = keyof paths;\nexport type ValidPaths = PathsByMethod<paths>;\n\n/**\n * Get client response type for handle API\n */\nexport type ApiResponse<\n Path extends ApiPath,\n Method extends \"get\" | \"post\" | \"put\" | \"delete\" = \"get\"\n> = ClientResponse<paths, Path, Method>;\n\n/**\n * Get execution context type for handle API\n */\nexport type ExecutionContext<\n Path extends ApiPath = ApiPath,\n Method extends HttpMethod = \"get\"\n> = KosExecutionContext<paths, Path, Method>;\n\n/**\n * Typed decorator factory for @kosServiceRequest with handle API types\n *\n * Provides full IntelliSense and type safety for path, query params, and body\n * based on the handle OpenAPI schema.\n *\n * @example\n * ```typescript\n * import { kosServiceRequest } from '../../utils/services/handle/daily/service';\n * import { DependencyLifecycle } from '@kosdev-code/kos-ui-sdk';\n *\n * @kosServiceRequest({\n * path: '/api/...',\n * method: 'get',\n * lifecycle: DependencyLifecycle.LOAD\n * })\n * private onDataLoaded(): void {\n * // Fully typed based on handle API\n * }\n * ```\n */\nexport function kosServiceRequest<\n Path extends ApiPath,\n Method extends HttpMethod = \"get\",\n Response = any,\n TransformedResponse = Response\n>(\n params: IKosServiceRequestParams<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >\n) {\n return baseKosServiceRequest<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >(params);\n}\n\n/**\n * Create an API client for handle\n */\nexport const api = createClient<paths>();\n\nexport default api;\n"],"names":["URL","resolveServiceUrl","postModel","ServiceFactory","KosLog","testCarbTank","path","tracker","response","MODEL_TYPE","PROP_STATE_PATH","createPropKey","CarbAgitatorModelImpl","modelId","options","context","__publicField","_a","statePath","__decorateClass","kosStateProp","kosConfigProperty","kosStateEntry","kosStateExit","kosStateGuard","kosFuture","kosModel","kosLoggerAware","kosCompanion","DependencyLifecycle","kosFutureAware","kosStateMachine","CarbAgitator","CartridgeAgitatorContainerModelImpl","KosModelContainer","id","model","kosChild","agitate","CartridgeAgitatorEvents","PROP_PATH","CartridgeAgitatorModelImpl","EventBus","kosModelEffect","CartridgeAgitator","KosModelRegistrationFactory","CartridgeAgitatorContainer","SingletonKosModelRegistrationFactory","CgpPumpModelImpl","CgpPump","log","performElectricalTest","error","FetchError","errorCode","_c","_b","_d","_e","performPreCalibrate","pump","FutureManager","futureResponse","FutureEndState","performCalibrate","performVerify","volume","processResponse","performComplete","volume1","volume2","FcmPumpModelImpl","FutureHandler","props","data","FcmPump","FEATURE_SUPPORTS_ICE","FEATURE_SUPPORTS_CARB","FEATURE_SUPPORTS_REMOTE_TRAYS","FreestyleAssemblyModelImpl","group","nozzlePath","KosFeatureFlags","_carbTank","getKosCompanionModel","kosParentAware","FreestyleAssembly","PROP_CONFIG_PATH","RemoteTrayModelImpl","_options","getKosModelSync","RemoteTray","RemoteTrayContainerModelImpl","kosContainerAware","RemoteTrayContainer","resolveFreestyleAssembly","KosContextManager","freestyleAssembly","futureDelegate","method","FreestyleHolderModelImpl","remoteTrayId","remoteTray","FreestyleHolder","getOne","NutritionInfoError","message","InvalidRequestError","getFreestyleNutritionInfo","nozzleUrlPrefix","beverageId","volumes","baseUrl","FreestyleNozzleModelImpl","cupSizes","prefix","kosAction","FreestyleNozzle","replacePump","pumpId","code","FreestylePumpModelImpl","FreestylePump","getAll","getIceTypes","updateIceType","agitator","type","resetIceSetting","pour","testGate","IceAgitatorEvents","IceAgitatorModelImpl","PourState","currentState","nextState","result","e","iceTypes","KOS_MODEL_ID","kosMultipleFutureAware","IceAgitator","LfcvPumpModelImpl","LfcvPump","getLfcvPumps","payload","SpmPumpModelImpl","SpmPump","agitationModelFactory","troubleModel","AGITATION_REQUIRED_TROUBLE","AgitationRequiredTroubleModelImpl","holderPath","holderModel","hasInsufficientAgitationTrouble","kosTopicHandler","modelTypeEventTopicFactory","Assembly","AgitationRequiredTrouble","AGITATOR_KEYS","AGITATOR_FACTORY_MAP","logger","freestyleAssemblyDataMapper","cartridgeAgitators","remoteTrays","acc","assembly","key","factory","cartridgeAgitatorData","cartridgeAgitator","tray","trayId","trayModel","supportsIce","supportsCarb","registerFreestyleModels","root","registerCoreModels","registerDispenseModels","RegistrationManager","Nozzle","Trouble","Pump","Holder","ExtensionManager","EXTENSION_TROUBLE_DATA_MAPPER","trouble","enjoyByDate","_trouble","pumpContainer","PumpContainer","PumpIndex","pumpModel","ingredientModel","_KosModelRegistry","DispenseModelRegistration","KosModelRegistry","kosServiceRequest","params","baseKosServiceRequest","api","createClient"],"mappings":"+QAYM,KAAEA,EAAA,EAAQC,EAAAA,kBAAkB,sBAAsB,EAClD,WAAEC,EAAA,EAAcC,EAAAA,eAAe,MAAM,CACzC,SAAU,GAAGH,EAAG,wBAClB,CAAC,EAEWI,EAAAA,OAAO,aAAa,CAC9B,KAAM,oBACN,MAAO,UACT,CAAC,EA2BM,MAAMC,GAAe,MAAOC,EAAcC,IAAoB,CACnE,MAAMC,EACJ,MAAMN,GAAU,CACd,MAAO,CAAA,EACP,QAAAK,EACA,YAAa,GAAGP,EAAG,eAAeM,CAAI,OAAA,CACvC,EAEH,GAAI,EAACE,GAAA,MAAAA,EAAU,MACb,MAAM,IAAI,MAAM,yBAAyB,EAE3C,OAAOA,GAAA,YAAAA,EAAU,IACnB,yTCfO,MAAMC,GAAa,sBAOpBC,GAAkBC,EAAAA,cAAiC,WAAW,EA4J7D,IAAMC,EAAN,KAAqD,CAqF1D,YACEC,EACAC,EACAC,EACA,CAzEFC,EAAA,WAKAA,EAAA,aAKAA,EAAA,aAKAA,EAAA,kBAWAA,EAAA,qBAWAA,EAAA,oBAWAA,EAAA,gBAYAA,EAAA,sBAcE,KAAK,GAAKH,EACV,KAAK,KAAOC,EAAQ,KACpB,KAAK,OAAOG,EAAAF,EAAQ,WAAW,IAAI,2BAA2B,IAAlD,YAAAE,EAAqD,OAAQ,GAEzE,MAAMC,EAAYH,EAAQ,WAAW,IAAI,8BAA8B,EACvE,KAAK,UAAYG,CACnB,CASA,IAAI,QAAS,OAEX,OADmBD,EAAA,KAAK,mBAAA,IAAL,YAAAA,EAA2B,kBAAkB,QAAQ,EAE1E,CASA,IAAI,MAAO,OACT,OA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C,CACF,CACA,MAAO,CAAA,CACT,CAAA,EAEK,CACL,QAASd,EAAAA,oBAAoB,MAAM,aAAaH,CAAI,EACpD,MAAOG,EAAAA,oBAAoB,MAAM,SAASH,CAAI,EAC9C,UAAWG,EAAAA,oBAAoB,UAAU,SAASH,CAAI,EACtD,OAAQG,EAAAA,oBAAoB,MAAM,oBAAoBH,CAAI,CAAA,GAW1DkB,EAAoB,CACxB,GAAGC,EAAAA,gBACL,EAECD,EAA0B,UAAY,CACrC,OAAQnB,GAAwBmB,CAAiB,CACnD,EACCA,EAA0B,QACzBf,EAAAA,oBAAoB,MAAM,aAAae,CAAiB,EACzDA,EAA0B,MACzBf,EAAAA,oBAAoB,MAAM,SAASe,CAAiB,EACrDA,EAA0B,UACzBf,EAAAA,oBAAoB,UAAU,SAASe,CAAiB,EACzDA,EAA0B,OACzBf,EAAAA,oBAAoB,MAAM,oBAAoBe,CAAiB,EAIjE,MAAME,GAAyCF,EC9HxC,SAASG,GAMdC,EAOA,CACA,OAAOC,EAAAA,kBAMLD,CAAM,CACV,CAKO,MAAME,GAAMC,EAAAA,aAAA,uIC1BZ,SAASJ,GAMdC,EAOA,CACA,OAAOC,EAAAA,kBAMLD,CAAM,CACV,CAKO,MAAME,GAAMC,EAAAA,aAAA,uIC1BZ,SAASJ,GAMdC,EAOA,CACA,OAAOC,EAAAA,kBAMLD,CAAM,CACV,CAKO,MAAME,GAAMC,EAAAA,aAAA,uIC1BZ,SAASJ,GAMdC,EAOA,CACA,OAAOC,EAAAA,kBAMLD,CAAM,CACV,CAKO,MAAME,GAAMC,EAAAA,aAAA,uIC1BZ,SAASJ,GAMdC,EAOA,CACA,OAAOC,EAAAA,kBAMLD,CAAM,CACV,CAKO,MAAME,GAAMC,EAAAA,aAAA"}
|
|
1
|
+
{"version":3,"file":"service-Dlc0A1Rk.cjs","sources":["../../../../packages/sdk/kos-freestyle-sdk/src/models/models/carb-agitator/services/carb-tank-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/carb-agitator/carb-agitator-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-container-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/services/cartridge-agitator-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-container-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cgp-pump/cgp-pump-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/fcm-pump/services/fcm-pump-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/fcm-pump/fcm-pump-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/fcm-pump/fcm-pump-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-assembly/freestyle-assembly-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-assembly/freestyle-assembly-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-container-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-container-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-holder/freestyle-holder-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-holder/freestyle-holder-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-nozzle/services/freestyle-nozzle-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-nozzle/freestyle-nozzle-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-nozzle/freestyle-nozzle-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-pump/services/freestyle-pump-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-pump/freestyle-pump-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-pump/freestyle-pump-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/ice-agitator/services/ice-agitator-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/ice-agitator/ice-agitator-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/ice-agitator/ice-agitator-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/lfcv-pump/lfcv-pump-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/lfcv-pump/lfcv-pump-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/lfcv-pump/services/lfcv-pump-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/spm-pump/services/spm-pump-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/spm-pump/spm-pump-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/spm-pump/spm-pump-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/agitation-required-trouble/agitation-required-trouble-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/extensions/assembly/assembly-data-mapper.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/freestyle-registration-manager.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/services/freestyle/1.6.5/service.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/services/freestyle/1.8.1/service.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/services/freestyle/daily/service.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/services/handle/1.8.1/service.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/services/handle/daily/service.ts"],"sourcesContent":["/**\n * (C) Copyright 2024, TCCC, All rights reserved.\n */\n\nimport {\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n type FutureResponse,\n type KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nconst { URL } = resolveServiceUrl(\"ICE_AGITATOR_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/ext/freestyle/ice`,\n});\n\nconst log = KosLog.createLogger({\n name: \"carb-tank-service\",\n group: \"Services\",\n});\n\n/**\n * Initiates a carb tank test operation on the device.\n *\n * Sends a test command to the carb tank hardware at the specified path and returns\n * a future response that can be used to track the test operation's progress and\n * completion status.\n *\n * @param path - Device path to the carb tank hardware (e.g., \"assembly:core:board:macksm:carbTank:carbTank\")\n * @param tracker - Future tracker ID for monitoring operation progress\n * @returns Promise resolving to a FutureResponse for operation tracking\n * @throws {Error} If the server returns no response data\n *\n * @example\n * ```typescript\n * const future = await testCarbTank(\n * \"assembly:core:board:macksm:carbTank:carbTank\",\n * \"tracker-123\"\n * );\n *\n * // Monitor future progress\n * console.log(`Test status: ${future.status}`);\n * ```\n *\n * @category Services\n */\nexport const testCarbTank = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/test`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response?.data as FutureResponse;\n};\n","/**\n * (C) Copyright 2024, TCCC, All rights reserved.\n */\n\n/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\n\nimport { type AssemblyModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n IKosDataModel,\n KosCompanionComposition,\n KosConfigProperty,\n KosCreationContext,\n KosFutureAwareFull,\n KosLoggerAware,\n KosModelRegistrationType,\n KosStateMachineAware,\n KosStateProp,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n DependencyLifecycle,\n kosCompanion,\n kosConfigProperty,\n kosFuture,\n kosFutureAware,\n kosLoggerAware,\n kosModel,\n kosStateEntry,\n kosStateExit,\n kosStateGuard,\n kosStateMachine,\n kosStateProp,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport type { ProbeAware } from \"../types/assembly\";\nimport { testCarbTank } from \"./services/carb-tank-services\";\nimport type { CarbAgitatorOptions } from \"./types\";\n\n/**\n * Unique identifier for the carb agitator model type used in KOS model registration.\n *\n * @category Constants\n */\nexport const MODEL_TYPE = \"carb-agitator-model\";\n\n/**\n * Internal property key for accessing the carb agitator state path.\n *\n * @internal\n */\nconst PROP_STATE_PATH = createPropKey<CarbAgitatorModel>(\"statePath\");\n\n/**\n * State machine states for carb agitator initialization workflow.\n *\n * The carb agitator progresses through these states during setup and operation:\n * - UNINITIALIZED: Initial state, awaiting user action\n * - ACTIVATING: Carb tank is being initialized\n * - INITIALIZED: Carb tank is ready for operation\n * - SKIPPED: User chose to proceed without carbonation\n *\n * @category State Machine\n */\nexport enum CarbAgitatorState {\n /**\n * Initial state before any action is taken.\n * Can transition to ACTIVATING or SKIPPED.\n */\n UNINITIALIZED = \"UNINITIALIZED\",\n\n /**\n * Carb tank activation is in progress.\n * Transitions to INITIALIZED when complete.\n */\n ACTIVATING = \"ACTIVATING\",\n\n /**\n * Carb tank is initialized and ready for operation.\n * Can transition back to UNINITIALIZED via RESET.\n */\n INITIALIZED = \"INITIALIZED\",\n\n /**\n * User chose to skip carbonation for this workflow.\n * Can transition back to UNINITIALIZED via RESET.\n */\n SKIPPED = \"SKIPPED\",\n}\n\n/**\n * Events that trigger state transitions in the carb agitator state machine.\n *\n * - ACTIVATE: Begin carb tank activation process\n * - ACTIVATION_COMPLETE: Carb tank activation finished successfully\n * - SKIP: Bypass carbonation for this workflow\n * - RESET: Return to uninitialized state\n *\n * @category State Machine\n */\nexport type CarbAgitatorEvent =\n | \"ACTIVATE\"\n | \"ACTIVATION_COMPLETE\"\n | \"SKIP\"\n | \"RESET\";\n\n/**\n * Public interface type for the carb agitator model.\n *\n * This type represents the public-facing API of the carb agitator model,\n * exposing only public methods and properties while hiding internal implementation details.\n *\n * @category Types\n */\nexport type CarbAgitatorModel = PublicModelInterface<CarbAgitatorModelImpl>;\n\n/**\n * Interface defining the capabilities of the carb agitator model implementation.\n *\n * This interface combines multiple KOS aware interfaces to provide:\n * - Logging capabilities via KosLoggerAware\n * - Probe monitoring via ProbeAware (high/low probes, filling status)\n * - State machine management via KosStateMachineAware\n * - Async operations via KosFutureAwareFull\n * - Parent-child relationships via KosCompanionComposition\n *\n * @category Types\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CarbAgitatorModelImpl\n extends KosLoggerAware,\n ProbeAware,\n KosStateMachineAware<CarbAgitatorState, CarbAgitatorEvent>,\n KosFutureAwareFull,\n KosCompanionComposition<AssemblyModel> {}\n@kosModel({ modelTypeId: MODEL_TYPE, singleton: false })\n@kosLoggerAware()\n@kosCompanion({ mode: \"composition\", lifecycle: DependencyLifecycle.LOAD })\n@kosFutureAware()\n@kosStateMachine<CarbAgitatorState, CarbAgitatorEvent>(\n {\n initial: CarbAgitatorState.UNINITIALIZED,\n states: {\n [CarbAgitatorState.UNINITIALIZED]: {\n on: {\n ACTIVATE: CarbAgitatorState.ACTIVATING,\n SKIP: CarbAgitatorState.SKIPPED,\n },\n },\n [CarbAgitatorState.ACTIVATING]: {\n on: {\n ACTIVATION_COMPLETE: CarbAgitatorState.INITIALIZED,\n },\n },\n [CarbAgitatorState.INITIALIZED]: {\n on: { RESET: CarbAgitatorState.UNINITIALIZED },\n },\n [CarbAgitatorState.SKIPPED]: {\n on: { RESET: CarbAgitatorState.UNINITIALIZED },\n },\n },\n },\n {\n throwOnInvalid: false, // Graceful handling for button clicks\n }\n)\n/**\n * Model for managing carbonation agitator operations in beverage dispensing systems.\n *\n * This model implements a state machine workflow for carb tank initialization, tracking\n * the activation process, probe states, and carbonation readiness. It manages the\n * lifecycle of carbonation operations including activation, deactivation, and testing.\n *\n * The model integrates with:\n * - Device configuration for carb tank enable/disable state\n * - State properties for monitoring high/low probes and filling status\n * - Assembly model for accessing holder and pump information\n * - Futures for async operations like carb tank testing\n *\n * @remarks\n * This is a companion model to the Assembly model, providing specialized management\n * for carbonation agitation hardware.\n *\n * @example\n * ```typescript\n * // Create carb agitator model\n * const carbAgitator = CarbAgitator\n * .instance(\"carb-agitator-1\")\n * .options({ name: \"Carb Tank\" })\n * .build();\n *\n * // Activate carb tank\n * await carbAgitator.activateCarbTank();\n *\n * // Check if ready to proceed\n * if (carbAgitator.canProceed) {\n * console.log(\"Carb tank ready\");\n * }\n *\n * // Test carb tank operation\n * await carbAgitator.handleTestCarbTank(\"tracker-123\");\n * ```\n *\n * @category Models\n * @author Mark Pomerant (mark@matrica.ca)\n * @version 2.1.27\n */\nexport class CarbAgitatorModelImpl implements IKosDataModel {\n /**\n * Registration factory for creating CarbAgitator model instances.\n *\n * Automatically injected by the `@kosModel` decorator.\n *\n * @see {@link CarbAgitator}\n */\n static Registration: KosModelRegistrationType<\n CarbAgitatorModel,\n CarbAgitatorOptions\n >;\n\n /**\n * Unique identifier for this carb agitator instance.\n */\n id: string;\n\n /**\n * Display name for this carb agitator.\n */\n name: string;\n\n /**\n * Device path for carb tank operations.\n */\n path: string;\n\n /**\n * State path for accessing probe and filling status.\n */\n statePath: string;\n\n /**\n * High probe wet status indicator.\n *\n * Monitors whether the high-level probe in the carb tank is detecting liquid.\n */\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"highProbeWet\",\n })\n highProbeWet!: KosStateProp<boolean>;\n\n /**\n * Low probe wet status indicator.\n *\n * Monitors whether the low-level probe in the carb tank is detecting liquid.\n */\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"lowProbeWet\",\n })\n lowProbeWet!: KosStateProp<boolean>;\n\n /**\n * Carb tank filling status indicator.\n *\n * Indicates whether the carb tank is currently being filled with liquid.\n */\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"filling\",\n })\n filling!: KosStateProp<boolean>;\n\n /**\n * Configuration property controlling carb tank enable/disable state.\n *\n * When enabled, the carb tank is operational and carbonation is active.\n * When disabled, carbonation is bypassed.\n */\n @kosConfigProperty({\n path: \"assembly:core:board:macksm:carbTank:carbTank\",\n attribute: \"enabled\",\n })\n enabled!: KosConfigProperty<boolean>;\n\n /**\n * Creates a new carb agitator model instance.\n *\n * @param modelId - Unique identifier for this instance\n * @param options - Configuration options including name\n * @param context - KOS creation context providing assembly paths\n */\n constructor(\n modelId: string,\n options: CarbAgitatorOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.name = options.name;\n this.path = context.kosContext.get(`assembly-feature-carbTank`)?.path || \"\";\n\n const statePath = context.kosContext.get(`assembly-state-path-carbTank`);\n this.statePath = statePath;\n }\n\n /**\n * Gets the carb holder associated with this agitator.\n *\n * Retrieves the first holder from the \"carb\" group in the parent assembly.\n *\n * @returns The carb holder model, or undefined if not found\n */\n get holder() {\n const carbHolder = this.getCompanionParent()?.getHoldersByGroup(\"carb\")[0];\n return carbHolder;\n }\n\n /**\n * Gets the pump associated with the carb holder.\n *\n * Returns the first pump from the holder's pump collection.\n *\n * @returns The pump model, or undefined if holder or pump not available\n */\n get pump() {\n return this.holder?.pumps.data[0];\n }\n\n /**\n * Indicates whether the carb tank is currently being filled.\n *\n * @returns true if the filling state property indicates active filling\n */\n get isFilling(): boolean {\n return !!this.filling.value;\n }\n\n /**\n * Indicates whether the carb tank has been initialized.\n *\n * @returns true if the carb tank enabled configuration is set to true\n */\n get isCarbInitialized(): boolean {\n return !!this.enabled.value;\n }\n\n /**\n * Indicates whether carb tank activation is allowed.\n *\n * Activation is only allowed when the carb tank is not already enabled.\n *\n * @returns true if the carb tank can be activated\n */\n get canActivate(): boolean {\n return !this.enabled.value;\n }\n\n /**\n * Indicates whether the workflow can proceed past carb initialization.\n *\n * The workflow can proceed when the state machine is in either INITIALIZED\n * (carb tank activated) or SKIPPED (user chose to bypass carbonation).\n *\n * @returns true if ready to proceed with beverage operations\n */\n get canProceed(): boolean {\n return (\n this.isInState(CarbAgitatorState.INITIALIZED) ||\n this.isInState(CarbAgitatorState.SKIPPED)\n );\n }\n\n /**\n * State entry handler when entering ACTIVATING state.\n *\n * Logs the start of carb tank activation process.\n *\n * @internal\n */\n @kosStateEntry(CarbAgitatorState.ACTIVATING)\n handleActivationStart(): void {\n this.logger.info(\"Carb tank activation started\");\n }\n\n /**\n * State exit handler when leaving ACTIVATING state.\n *\n * Logs successful completion of carb tank initialization.\n *\n * @internal\n */\n @kosStateExit(CarbAgitatorState.ACTIVATING)\n handleActivationComplete(): void {\n this.logger.info(\"Carb tank initialized\");\n }\n\n /**\n * State entry handler when entering INITIALIZED state.\n *\n * Logs that the carb tank is ready for beverage operations.\n *\n * @internal\n */\n @kosStateEntry(CarbAgitatorState.INITIALIZED)\n handleInitialized(): void {\n this.logger.info(\"Carb tank ready to proceed\");\n }\n\n /**\n * State entry handler when entering SKIPPED state.\n *\n * Logs that the user has chosen to proceed without carbonation.\n *\n * @internal\n */\n @kosStateEntry(CarbAgitatorState.SKIPPED)\n handleSkipped(): void {\n this.logger.info(\"Proceeding without carbinator\");\n }\n\n /**\n * Activates the carb tank and transitions through initialization workflow.\n *\n * This method:\n * 1. Transitions to ACTIVATING state\n * 2. Updates the enabled configuration property to true\n * 3. Transitions to INITIALIZED state\n *\n * Can only be called when in UNINITIALIZED state (enforced by state guard).\n *\n * @throws {Error} If called from an invalid state\n */\n @kosStateGuard({ allowedStates: [CarbAgitatorState.UNINITIALIZED] })\n async activateCarbTank(): Promise<void> {\n this.transition(\"ACTIVATE\");\n this.enabled.updateProperty(true);\n this.transition(\"ACTIVATION_COMPLETE\");\n }\n\n /**\n * Deactivates the carb tank and resets to uninitialized state.\n *\n * This method:\n * 1. Updates the enabled configuration property to false\n * 2. Transitions back to UNINITIALIZED state\n *\n * Can be called from any state.\n */\n async deactivateCarbTank(): Promise<void> {\n this.enabled.updateProperty(false);\n this.transition(\"RESET\");\n }\n\n /**\n * Skips carb tank initialization and proceeds without carbonation.\n *\n * Allows the workflow to continue without activating the carb tank.\n * Transitions from UNINITIALIZED to SKIPPED state.\n *\n * Can only be called when in UNINITIALIZED state (enforced by state guard).\n *\n * @throws {Error} If called from an invalid state\n */\n @kosStateGuard({ allowedStates: [CarbAgitatorState.UNINITIALIZED] })\n skip(): void {\n this.transition(\"SKIP\");\n }\n\n /**\n * Resets the carb tank to uninitialized state.\n *\n * This method:\n * 1. Updates the enabled configuration property to false\n * 2. Transitions back to UNINITIALIZED state\n *\n * Can only be called when in INITIALIZED or SKIPPED states (enforced by state guard).\n *\n * @throws {Error} If called from an invalid state\n */\n @kosStateGuard({\n allowedStates: [CarbAgitatorState.INITIALIZED, CarbAgitatorState.SKIPPED],\n })\n reset(): void {\n this.enabled.updateProperty(false);\n this.transition(\"RESET\");\n }\n\n /**\n * Toggles the carb tank between enabled and disabled states.\n *\n * If currently enabled, calls {@link deactivateCarbTank}.\n * If currently disabled, calls {@link activateCarbTank}.\n */\n toggleCarbTank(): void {\n if (this.enabled.value) {\n this.deactivateCarbTank();\n } else {\n this.activateCarbTank();\n }\n }\n\n /**\n * Tests the carb tank operation and returns a future for tracking progress.\n *\n * Initiates a carb tank test operation on the device and returns a future\n * that can be monitored for progress and completion status.\n *\n * @param tracker - Future tracker ID (injected by @kosFuture decorator)\n * @returns Promise resolving to a FutureResponse for operation tracking\n * @throws {Error} If tracker is not provided by the decorator\n */\n @kosFuture()\n handleTestCarbTank(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n this.logger.info(`testing carb tank: ${this.id}`);\n\n return testCarbTank(this.path, tracker);\n }\n}\n\n/**\n * Registration factory for creating CarbAgitator model instances.\n *\n * Use this constant to create new carb agitator instances using the fluent factory pattern.\n *\n * @example\n * ```typescript\n * // Create a new carb agitator model\n * const carbAgitator = CarbAgitator\n * .instance(\"carb-agitator-1\")\n * .options({ name: \"Carb Tank\" })\n * .build();\n *\n * // Activate carb tank\n * await carbAgitator.activateCarbTank();\n *\n * // Check readiness\n * if (carbAgitator.canProceed) {\n * console.log(\"Ready for beverage operations\");\n * }\n * ```\n *\n * @category Models\n */\nexport const CarbAgitator = CarbAgitatorModelImpl.Registration;\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n IKosModelContainer,\n IKosModelHolder,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosChild, kosModel, KosModelContainer } from \"@kosdev-code/kos-ui-sdk\";\nimport type { CartridgeAgitatorModel } from \"./cartridge-agitator-model\";\nimport type { CartridgeAgitatorContainerOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"cartridge-agitator-container-model\";\n\nexport type CartridgeAgitatorContainerModel =\n PublicModelInterface<CartridgeAgitatorContainerModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class CartridgeAgitatorContainerModelImpl\n implements\n IKosIdentifiable,\n IKosModelHolder<CartridgeAgitatorModel>,\n IKosDataModel\n{\n id: string;\n private logger: KosContextLogger;\n @kosChild private _models: IKosModelContainer<CartridgeAgitatorModel>;\n constructor(\n modelId: string,\n options: CartridgeAgitatorContainerOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this._models = new KosModelContainer<CartridgeAgitatorModel>({\n parentId: modelId,\n });\n if (options) {\n // Assign options properties here.\n }\n }\n\n getModel(id: string) {\n return this._models.getModel(id);\n }\n get models() {\n return this._models;\n }\n get data() {\n return this._models.data;\n }\n\n addModel(model: CartridgeAgitatorModel) {\n this._models.addModel(model);\n }\n\n removeModel(id: string) {\n this._models.removeModel(id);\n }\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(\n `initializing cartridge-agitator-container container ${this.id}`\n );\n }\n\n async load(): Promise<void> {\n this.logger.debug(\n `loading cartridge-agitator-container container ${this.id}`\n );\n }\n}\n","import type {\n FutureResponse,\n KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { resolveServiceUrl, ServiceFactory } from \"@kosdev-code/kos-ui-sdk\";\n\nconst { URL } = resolveServiceUrl(\"CARTRIDGE_AGITATOR_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/ext/freestyle/freestyle/ice`,\n});\n/**\n * @category Service\n * Retrieves the initial screen data.\n */\nexport const agitate = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/test`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response.data;\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport type {\n ExternalFutureInterface,\n IKosDataModel,\n IKosIdentifiable,\n KosFutureAwareFull,\n KosLoggerAware,\n KosStateProp,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n EventBus,\n kosFuture,\n kosFutureAware,\n kosLoggerAware,\n kosModel,\n kosModelEffect,\n kosStateProp,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { agitate } from \"./services/cartridge-agitator-services\";\nimport type { CartridgeAgitatorOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"cartridge-agitator-model\";\n\nexport type CartridgeAgitatorModel =\n PublicModelInterface<CartridgeAgitatorModelImpl> & ExternalFutureInterface;\n\nexport class CartridgeAgitatorEvents {\n static TOPIC_AGITATION_STARTED = \"/kos/events/ddk/agitation-started\";\n static TOPIC_AGITATION_ENDED = \"/kos/events/ddk/agitation-ended\";\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CartridgeAgitatorModelImpl\n extends KosFutureAwareFull,\n KosLoggerAware {}\nconst PROP_PATH = createPropKey<CartridgeAgitatorModel>(\"statePath\");\n\n@kosModel(MODEL_TYPE)\n@kosFutureAware()\n@kosLoggerAware()\nexport class CartridgeAgitatorModelImpl\n implements IKosDataModel, IKosIdentifiable\n{\n id: string;\n @kosStateProp({ path: PROP_PATH, attribute: \"agitating\" })\n private agitating!: KosStateProp<boolean>;\n path: string;\n statePath: string;\n name: string;\n constructor(modelId: string, options: CartridgeAgitatorOptions) {\n this.id = modelId;\n\n this.path = options.path;\n this.name = options.name;\n this.statePath = options.statePath;\n }\n\n get isAgitating(): boolean {\n return !!this.agitating.value;\n }\n\n @kosFuture()\n async testAgitate(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n this.logger.info(`agitating cartridge-agitator ${this.id}`);\n\n return agitate(this.path, tracker);\n }\n\n @kosModelEffect({\n dependencies: (model) => [model.isAgitating],\n })\n handleAgitation() {\n if (this.isAgitating) {\n this.logger.info(`agitating cartridge-agitator ${this.id}`);\n EventBus.publish(CartridgeAgitatorEvents.TOPIC_AGITATION_STARTED, {\n path: this.path,\n futureId: this.future?.futureId,\n });\n } else {\n EventBus.publish(CartridgeAgitatorEvents.TOPIC_AGITATION_ENDED, {\n path: this.path,\n });\n }\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n CartridgeAgitatorModel,\n CartridgeAgitatorModelImpl,\n MODEL_TYPE,\n} from \"./cartridge-agitator-model\";\nimport type { CartridgeAgitatorOptions } from \"./types\";\n\n/**\n * # CartridgeAgitator\n *\n * The registration bean includes convenience methods for creating and working with CartridgeAgitatorModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * import type { CartridgeAgitatorModel } from \"./cartridge-agitator-model\";\n * \n * @kosDependency({modelType: CartridgeAgitator.type, id: \"cartridgeAgitatorId\"})\n * private cartridgeAgitatorModel: CartridgeAgitatorModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new CartridgeAgitatorModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = CartridgeAgitator.factory(\"cartridgeAgitatorId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a CartridgeAgitatorModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (CartridgeAgitator.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to CartridgeAgitatorModel\n * // and the compiler will know that the model has the CartridgeAgitatorModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { CartridgeAgitator } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(CartridgeAgitator);\n * ```\n *\n * ## registration.singleton\n \n * The cartridgeAgitator model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const CartridgeAgitator = new KosModelRegistrationFactory<\n CartridgeAgitatorModel,\n CartridgeAgitatorOptions\n>({\n class: CartridgeAgitatorModelImpl as any,\n type: MODEL_TYPE,\n});\n","import { SingletonKosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { CartridgeAgitatorContainerModel } from \"./cartridge-agitator-container-model\";\nimport {\n CartridgeAgitatorContainerModelImpl,\n MODEL_TYPE,\n} from \"./cartridge-agitator-container-model\";\nimport { CartridgeAgitator } from \"./cartridge-agitator-registration\";\nimport type { CartridgeAgitatorContainerOptions } from \"./types\";\n\n/**\n * # CartridgeAgitatorContainer\n *\n * The registration bean includes convenience methods for creating and working with CartridgeAgitatorContainerModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: CartridgeAgitatorContainer.type, id: \"cartridgeAgitatorContainerId\"})\n * private cartridgeAgitatorContainerModel: CartridgeAgitatorContainerModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new CartridgeAgitatorContainerModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = CartridgeAgitatorContainer.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a CartridgeAgitatorContainerModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (CartridgeAgitatorContainer.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to CartridgeAgitatorContainerModel\n * // and the compiler will know that the model has the CartridgeAgitatorContainerModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { CartridgeAgitatorContainer } from \"@kosdev-code/kos-dispense-sdk\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...CartridgeAgitatorContainer.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The cartridgeAgitatorContainer model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const CartridgeAgitatorContainer =\n new SingletonKosModelRegistrationFactory<\n CartridgeAgitatorContainerModel,\n CartridgeAgitatorContainerOptions\n >({\n class: CartridgeAgitatorContainerModelImpl,\n type: MODEL_TYPE,\n });\n\nCartridgeAgitatorContainer.addRelatedModel(CartridgeAgitator);\n","/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport type {\n IKosDataModel,\n IKosIdentifiable,\n KosCompanionComposition,\n KosLoggerAware,\n KosModelRegistrationType,\n KosStateProp,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n kosCompanion,\n kosLoggerAware,\n kosModel,\n kosStateProp,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport type { CgpPumpOptions } from \"./types\";\n\nimport type { PumpModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type { ProbeAware } from \"../types/assembly\";\n\nexport const MODEL_TYPE = \"cgp-pump-model\";\n\nexport type CgpPumpModel = PublicModelInterface<CgpPumpModelImpl>;\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CgpPumpModelImpl\n extends KosLoggerAware,\n ProbeAware,\n KosCompanionComposition<PumpModel> {}\n\nconst PROP_STATE_PATH = createPropKey<CgpPumpModel>(\"statePath\");\n@kosModel({ modelTypeId: MODEL_TYPE, singleton: false })\n@kosCompanion({\n mode: \"composition\",\n})\n@kosLoggerAware()\nexport class CgpPumpModelImpl implements IKosDataModel, IKosIdentifiable {\n // Registration property for type safety - actual value injected by @kosModel decorator\n static Registration: KosModelRegistrationType<CgpPumpModel, CgpPumpOptions>;\n\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"highProbeWet\",\n })\n highProbeWet!: KosStateProp<boolean>;\n\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"lowProbeWet\",\n })\n lowProbeWet!: KosStateProp<boolean>;\n\n @kosStateProp({\n path: PROP_STATE_PATH,\n attribute: \"filling\",\n })\n filling!: KosStateProp<boolean>;\n id: string;\n state: { name: string; path: string };\n\n constructor(modelId: string, options: CgpPumpOptions) {\n this.id = modelId;\n\n this.state = options.data?.state ?? { name: \"unknown\", path: \"\" };\n }\n\n get statePath() {\n return this.state.path;\n }\n}\n\nexport const CgpPump = CgpPumpModelImpl.Registration;\n","import {\n FetchError,\n FutureEndState,\n FutureManager,\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n type FutureResponse,\n type KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"FCM-PUMP_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/fcm-pump`,\n});\n\nconst log = KosLog.createLogger({\n name: \"fcm-pump-service\",\n group: \"Services\",\n});\n\nexport type ElectricalTestErrorType = \"errEEPROM\" | \"unknownError\";\nexport type ElectricalTestData = {\n error?: ElectricalTestErrorType;\n result?: string;\n};\nexport type ElectricalTestResponse = [\n ElectricalTestErrorType | undefined,\n ElectricalTestData\n];\n\nexport const performElectricalTest = async (\n path: string\n): Promise<ElectricalTestResponse> => {\n log.debug(\n `performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${path}/electricalTest`\n );\n\n try {\n const response = await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/fcm/diagnostics/${path}/electricalTest`,\n });\n\n log.debug(\"performElectricalTest - response:\", response);\n\n if (\n (response?.status === 200 || response?.status === 499) &&\n response.data?.error\n ) {\n return [response.data.error || \"unknownError\", response.data];\n }\n\n return [undefined, response?.data];\n } catch (error) {\n log.error(\n `performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${path}/electricalTest`,\n error\n );\n\n if (error instanceof FetchError) {\n const errorCode =\n error.payload?.data?.error || error.payload?.error || \"unknownError\";\n\n return [errorCode, error.payload?.data || { error: errorCode }];\n }\n }\n\n return [\"unknownError\", { error: \"unknownError\" }];\n};\n\nexport const performPreCalibrate = async (pump: string, tracker?: string) => {\n log.debug(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/preCalibrate`\n );\n\n try {\n const response = (await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/fcm/calibration/${pump}/preCalibrate`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performPreCalibrate - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/preCalibrate`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\nexport const performCalibrate = async (pump: string, tracker?: string) => {\n log.debug(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/calibrate`\n );\n\n try {\n const response = (await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/fcm/calibration/${pump}/calibrate`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performPreCalibrate - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/calibrate`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\nexport const performVerify = async (\n pump: string,\n volume: string,\n tracker?: string\n) => {\n log.debug(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/verify/${volume}`\n );\n\n try {\n const response = (await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/fcm/calibration/${pump}/verify/${volume}`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performVerify - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performVerify - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/verify/${volume}`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\n/**\n * Help function to process the response from the performComplete service call.\n * If the response is \"success\" or undefined, it returns \"success\".\n * If the response contains an error message, it returns that message.\n * If the response is undefined, it returns \"error\".\n *\n * This function is used to standardize the handling of responses from the performComplete service call.\n * to capture the case where the response is undefined, which is possible in cases where the volumes are\n * so close that the backend chooses to not perform the calibration at all.\n * @param response\n * @returns\n */\n\nconst processResponse = (response: KosServiceResponse<string> | undefined) => {\n if (response) {\n if (response.data === \"success\" || !response.data) {\n return \"success\";\n } else {\n return response.data;\n }\n }\n return \"error\";\n};\nexport const performComplete = async (\n pump: string,\n volume1: string,\n volume2: string\n) => {\n log.debug(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/complete/${volume1}/${volume2}`\n );\n\n try {\n const response = await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/fcm/calibration/${pump}/complete/${volume1}/${volume2}`,\n });\n\n log.debug(\"performPreCalibrate - response:\", response);\n\n return processResponse(response?.data);\n } catch (error) {\n log.error(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${pump}/complete/${volume1}/${volume2}`,\n error\n );\n\n return undefined;\n }\n};\n","import type {\n IntentAware,\n IntentAwareProps,\n PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n FutureAwareContainer,\n FutureContainer,\n FutureResponse,\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n FutureHandler,\n kosFuture,\n KosLog,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n performCalibrate,\n performComplete,\n performElectricalTest,\n performPreCalibrate,\n performVerify,\n} from \"./services\";\nimport type { FcmPumpOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"fcm-pump-model\";\n\nconst log = KosLog.createLogger({ name: \"fcm-pump-model\" });\n\nexport type FcmPumpModel = PublicModelInterface<FcmPumpModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class FcmPumpModelImpl\n implements IKosDataModel, IKosIdentifiable, IntentAware, FutureContainer\n{\n id: string;\n private logger: KosContextLogger;\n private pumpModel: PumpModel;\n futureHandler: FutureAwareContainer;\n constructor(\n modelId: string,\n options: FcmPumpOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.pumpModel = options.companionParent;\n this.futureHandler = new FutureHandler(this);\n }\n\n get future() {\n return this.futureHandler.future;\n }\n\n get name() {\n return this.pumpModel.name;\n }\n\n get canPour() {\n return this.pumpModel.canPour;\n }\n\n get isPouring() {\n return this.pumpModel.isPouring;\n }\n\n async cancelPour() {\n return this.pumpModel.cancelPour();\n }\n\n performIntent(\n props: IntentAwareProps | string\n ): Promise<FutureResponse | undefined> {\n return this.pumpModel.performIntent(props);\n }\n\n async performElectricalTest() {\n const [error, data] = await performElectricalTest(this.pumpModel.path);\n if (error) {\n log.error(`Failed to perform electrical test on pump ${this.id}`, error);\n }\n\n return data;\n }\n\n getChildren() {\n const allFutures = this.futureHandler.allFutures;\n return [...allFutures];\n }\n\n @kosFuture()\n async performPreCalibrate(tracker?: string) {\n return performPreCalibrate(this.pumpModel.path, tracker);\n }\n\n @kosFuture()\n async performCalibrate(tracker?: string) {\n return performCalibrate(this.pumpModel.path, tracker);\n }\n\n @kosFuture()\n async performVerify(volume: string, tracker?: string) {\n return performVerify(this.pumpModel.path, volume, tracker);\n }\n\n async performComplete(volume1: string, volume2: string) {\n return performComplete(this.pumpModel.path, volume1, volume2);\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing fcm-pump ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading fcm-pump ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FcmPumpOptions } from \"./types\";\nimport { FcmPumpModelImpl, MODEL_TYPE } from \"./fcm-pump-model\";\nimport type { FcmPumpModel } from \"./fcm-pump-model\";\n\n/**\n * # FcmPump\n *\n * The registration bean includes convenience methods for creating and working with FcmPumpModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FcmPump.type, id: \"fcmPumpId\"})\n * private fcmPumpModel: FcmPumpModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FcmPumpModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FcmPump.factory(\"fcmPumpId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FcmPumpModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FcmPump.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FcmPumpModel\n * // and the compiler will know that the model has the FcmPumpModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FcmPump } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FcmPump);\n * ```\n *\n * ## registration.singleton\n \n * The fcmPump model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const FcmPump = new KosModelRegistrationFactory<\n FcmPumpModel,\n FcmPumpOptions\n>({\n class: FcmPumpModelImpl,\n type: MODEL_TYPE,\n});\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n getKosCompanionModel,\n kosChild,\n KosFeatureFlags,\n kosModel,\n kosParentAware,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleAssemblyOptions } from \"./types\";\n\nimport {\n type AssemblyModel,\n type AssemblyOptions,\n type BoardModel,\n type HolderModel,\n type PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport { CarbAgitator, type CarbAgitatorModel } from \"../carb-agitator\";\nimport {\n type CartridgeAgitatorContainerModel,\n type CartridgeAgitatorModel,\n} from \"../cartridge-agitator\";\nimport type { IceAgitatorModel } from \"../ice-agitator\";\nimport { type RemoteTrayContainerModel } from \"../remote-tray\";\nimport type {\n FreestyleHolderModelExt,\n FreestyleModelAssemblyExt,\n} from \"../types/assembly\";\n\nexport const MODEL_TYPE = \"freestyle-assembly-model\";\n\nexport const FEATURE_SUPPORTS_ICE = \"iceAgitator\";\nexport const FEATURE_SUPPORTS_CARB = \"carbTank\";\nexport const FEATURE_SUPPORTS_REMOTE_TRAYS = \"remoteTrays\";\n\nexport type FreestyleAssemblyModel =\n PublicModelInterface<FreestyleAssemblyModelImpl> &\n AssemblyModel<FreestyleModelAssemblyExt, FreestyleHolderModelExt>;\n\n@kosParentAware()\n@kosModel(MODEL_TYPE)\nexport class FreestyleAssemblyModelImpl\n implements\n IKosDataModel,\n IKosIdentifiable,\n AssemblyModel<FreestyleModelAssemblyExt, FreestyleHolderModelExt>\n{\n id: string;\n\n private _carbTankModel?: CarbAgitatorModel;\n private logger: KosContextLogger;\n private assembly: AssemblyModel<\n FreestyleModelAssemblyExt,\n FreestyleHolderModelExt\n >;\n\n @kosChild\n private _remoteTrays!: RemoteTrayContainerModel;\n\n constructor(\n modelId: string,\n options: FreestyleAssemblyOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this.assembly = options.companionParent;\n\n if (options) {\n // Assign options properties here.\n }\n }\n get holderGroups(): string[] {\n return this.assembly.holderGroups;\n }\n get nozzlePaths(): string[] {\n return this.assembly.nozzlePaths;\n }\n get allHolders(): HolderModel<FreestyleHolderModelExt>[] {\n return this.assembly.allHolders;\n }\n getHoldersByGroup(group: string): HolderModel<FreestyleHolderModelExt>[] {\n return this.assembly.getHoldersByGroup(group);\n }\n getHoldersByNozzle(\n nozzlePath: string\n ): HolderModel<FreestyleHolderModelExt>[] {\n return this.assembly.getHoldersByNozzle(nozzlePath);\n }\n get pumpsByNozzle(): Record<string, PumpModel<any>[]> {\n return this.assembly.pumpsByNozzle;\n }\n get pumpPaths(): string[] {\n return this.assembly.pumpPaths;\n }\n\n get boards(): BoardModel<any>[] {\n return this.assembly.boards;\n }\n updateModel(options: AssemblyOptions): void {\n return this.assembly.updateModel(options);\n }\n get iceAgitator(): IceAgitatorModel {\n return this.assembly.iceAgitator;\n }\n get carbTank(): CarbAgitatorModel | undefined {\n return this._carbTankModel;\n }\n\n get cartridgeAgitators(): CartridgeAgitatorContainerModel {\n return this.assembly.cartridgeAgitators;\n }\n\n get defaultCartridgeAgitator(): CartridgeAgitatorModel {\n return this.assembly.cartridgeAgitators.data[0];\n }\n get cartridgeAgitatorModels(): CartridgeAgitatorModel[] {\n return this.assembly.cartridgeAgitators.data;\n }\n\n get hasCartridgeAgitators(): boolean {\n return this.assembly.cartridgeAgitators.data.length > 0;\n }\n\n get remoteTrays(): RemoteTrayContainerModel {\n return this.assembly.remoteTrays;\n }\n\n get hasRemoteTrays(): boolean {\n return this.assembly.remoteTrays\n ? this.assembly.remoteTrays.data.length > 0\n : false;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n get supportsRemoteTrays(): boolean {\n return KosFeatureFlags.isFeatureEnabled(FEATURE_SUPPORTS_REMOTE_TRAYS);\n }\n get supportsIce() {\n return KosFeatureFlags.isFeatureEnabled(FEATURE_SUPPORTS_ICE);\n }\n\n get supportsCarb() {\n return KosFeatureFlags.isFeatureEnabled(FEATURE_SUPPORTS_CARB);\n }\n\n async init(): Promise<void> {\n this.logger.debug(`initializing freestyle-assembly ${this.id}`);\n }\n\n async ready(): Promise<void> {\n const _carbTank = getKosCompanionModel<CarbAgitatorModel>(\n this.assembly,\n CarbAgitator.type\n );\n\n this._carbTankModel = _carbTank;\n }\n}\n","import { SingletonKosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleAssemblyModel } from \"./freestyle-assembly-model\";\nimport {\n FreestyleAssemblyModelImpl,\n MODEL_TYPE,\n} from \"./freestyle-assembly-model\";\nimport type { FreestyleAssemblyOptions } from \"./types\";\n\n/**\n * # FreestyleAssembly\n *\n * The registration bean includes convenience methods for creating and working with FreestyleAssemblyModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestyleAssembly.type, id: \"freestyleAssemblyId\"})\n * private freestyleAssemblyModel: FreestyleAssemblyModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestyleAssemblyModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestyleAssembly.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestyleAssemblyModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestyleAssembly.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestyleAssemblyModel\n * // and the compiler will know that the model has the FreestyleAssemblyModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestyleAssembly } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestyleAssembly);\n * ```\n *\n * ## registration.singleton\n \n * The freestyleAssembly model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const FreestyleAssembly = new SingletonKosModelRegistrationFactory<\n FreestyleAssemblyModel,\n FreestyleAssemblyOptions\n>({\n class: FreestyleAssemblyModelImpl,\n type: MODEL_TYPE,\n});\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n TroubleAware,\n TroubleModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n getKosModelSync,\n kosConfigProperty,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport type { HolderModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type { ActiveAware } from \"../types/assembly\";\nimport type { RemoteTrayOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"remote-tray-model\";\n\n/**\n * Model for managing remote tray configurations in the KOS Freestyle system.\n *\n * A remote tray represents a physical or virtual tray that can be enabled/disabled\n * remotely and is associated with a holder in the dispensing system. This model\n * manages the tray's configuration, activation state, and trouble propagation\n * from its associated holder.\n *\n * ## Key Features\n * - Remote enable/disable capability through configuration properties\n * - Automatic trouble propagation from associated holder\n * - Active state management based on configuration\n * - Integration with the KOS dispensing system through holder references\n *\n * ## Properties\n * - `id` - Unique identifier for the remote tray\n * - `name` - Display name of the tray\n * - `holderPath` - Path reference to the associated holder model\n * - `configPath` - Configuration path for tray settings\n * - `remoteTrayEnabled` - Configuration property controlling tray activation\n * - `active` - Computed property indicating if the tray is currently active\n * - `holder` - Reference to the associated holder model\n * - `troubles` - Propagated troubles from the associated holder\n *\n * ## Methods\n * - `updateModel(options)` - Updates the model with new configuration options\n * - `init()` - Initializes the remote tray model\n * - `load()` - Loads the remote tray configuration and data\n *\n * @example\n * ```typescript\n * // Create a new remote tray instance\n * const remoteTray = RemoteTray.instance('tray-1')\n * .options({\n * name: 'Remote Tray 1',\n * holderPath: '/holders/holder-1',\n * configPath: '/config/trays/tray-1'\n * })\n * .build();\n *\n * // Check if tray is active\n * if (remoteTray.active) {\n * console.log(`${remoteTray.name} is enabled`);\n * }\n *\n * // Access associated holder\n * const holder = remoteTray.holder;\n * console.log(`Holder status: ${holder?.status}`);\n * ```\n *\n * @example\n * ```typescript\n * // Monitor trouble states\n * const TrayStatus = ({ tray }: { tray: RemoteTrayModel }) => {\n * const troubles = tray.troubles;\n * const isEnabled = tray.remoteTrayEnabled.value;\n *\n * return (\n * <div>\n * <h3>{tray.name}</h3>\n * <p>Status: {isEnabled ? 'Enabled' : 'Disabled'}</p>\n * {troubles.length > 0 && (\n * <Alert severity=\"warning\">\n * {troubles.length} issue(s) detected\n * </Alert>\n * )}\n * </div>\n * );\n * };\n * ```\n *\n * @example\n * ```typescript\n * // Programmatically enable/disable tray\n * async function toggleRemoteTray(tray: RemoteTrayModel) {\n * const currentState = tray.remoteTrayEnabled.value;\n * await tray.remoteTrayEnabled.setValue(!currentState);\n *\n * console.log(`Tray ${tray.name} is now ${!currentState ? 'enabled' : 'disabled'}`);\n * }\n * ```\n *\n * @category KOS Model\n * @subcategory Freestyle Models\n *\n * @see {@link HolderModel} - The associated holder model\n * @see {@link ActiveAware} - Interface for active state management\n * @see {@link TroubleAware} - Interface for trouble tracking\n */\nexport type RemoteTrayModel = PublicModelInterface<RemoteTrayModelImpl>;\n\nconst PROP_HOLDER_PATH = createPropKey<RemoteTrayModel>(\"holderPath\");\nconst PROP_CONFIG_PATH = createPropKey<RemoteTrayModel>(\"configPath\");\n\n/**\n * Implementation class for RemoteTrayModel.\n *\n * @internal\n * @category KOS Model\n * @subcategory Freestyle Models\n */\n@kosModel(MODEL_TYPE)\nexport class RemoteTrayModelImpl\n implements IKosDataModel, IKosIdentifiable, ActiveAware, TroubleAware\n{\n /** Unique identifier for the remote tray instance */\n id: string;\n private logger: KosContextLogger;\n\n /** Path reference to the associated holder model */\n holderPath: string;\n /** Configuration path for tray-specific settings */\n configPath: string;\n /** Display name of the remote tray */\n name: string;\n /** Configuration property that controls whether the tray is enabled remotely */\n @kosConfigProperty({\n path: PROP_CONFIG_PATH,\n attribute: \"enabled\",\n })\n remoteTrayEnabled!: KosConfigProperty<boolean>;\n\n constructor(\n modelId: string,\n options: RemoteTrayOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this.holderPath = options.holderPath;\n this.configPath = options.configPath;\n this.name = options.name;\n }\n\n /**\n * Gets the troubles from the associated holder model.\n * Propagates trouble states from the holder to this remote tray.\n *\n * @returns Array of trouble models from the holder, or empty array if no holder\n */\n get troubles(): TroubleModel<any>[] {\n return this.holder?.troubles ?? [];\n }\n\n /**\n * Gets the highest priority trouble status.\n * Currently returns empty string as troubles are managed by the holder.\n *\n * @returns Empty string (trouble status handled by holder)\n */\n get troubleStatus() {\n return \"\";\n }\n\n /**\n * Gets troubles grouped by type from the associated holder.\n *\n * @returns Record of troubles grouped by type from the holder, or empty object if no holder\n */\n get troublesByType() {\n return this.holder?.troublesByType ?? {};\n }\n\n /**\n * Updates the model with new configuration options.\n * Can be used to modify the holder path, config path, or name after initialization.\n *\n * @param _options - New configuration options for the remote tray\n */\n updateModel(_options: RemoteTrayOptions): void {\n // Update model properties here.\n }\n\n /**\n * Gets the associated holder model for this remote tray.\n * Uses synchronous model lookup to retrieve the holder by path.\n *\n * @returns The HolderModel instance referenced by holderPath, or undefined if not found\n */\n get holder() {\n return getKosModelSync<HolderModel>(this.holderPath).model;\n }\n\n /**\n * Determines if the remote tray is currently active.\n * Active state is based on the remoteTrayEnabled configuration property.\n *\n * @returns true if the tray is enabled, false otherwise\n */\n get active(): boolean {\n return !!this.remoteTrayEnabled.value;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n /**\n * Initializes the remote tray model.\n * Called during the model lifecycle initialization phase.\n * Sets up initial state and prepares the model for use.\n *\n * @returns Promise that resolves when initialization is complete\n */\n async init(): Promise<void> {\n this.logger.debug(`initializing remote-tray ${this.id}`);\n }\n\n /**\n * Loads the remote tray configuration and associated data.\n * Called during the model lifecycle load phase.\n * Typically loads configuration settings and establishes holder references.\n *\n * @returns Promise that resolves when loading is complete\n */\n async load(): Promise<void> {\n this.logger.debug(`loading remote-tray ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { RemoteTrayOptions } from \"./types\";\nimport {\n RemoteTrayModelImpl,\n MODEL_TYPE,\n RemoteTrayModel,\n} from \"./remote-tray-model\";\n\n/**\n * # RemoteTray\n *\n * The registration bean includes convenience methods for creating and working with RemoteTrayModel instances.\n\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: RemoteTray.type, id: \"remoteTrayId\"})\n * private remoteTrayModel: RemoteTrayModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new RemoteTrayModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = RemoteTray.factory(\"remoteTrayId\")({\n * // Add option data\n * });\n\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a RemoteTrayModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (RemoteTray.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to RemoteTrayModel\n * // and the compiler will know that the model has the RemoteTrayModel interface\n * model.updateAvailability(false);\n\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { RemoteTray } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(RemoteTray);\n * ```\n *\n * ## registration.singleton\n \n * The remoteTray model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const RemoteTray = new KosModelRegistrationFactory<\n RemoteTrayModel,\n RemoteTrayOptions\n>({\n class: RemoteTrayModelImpl,\n type: MODEL_TYPE,\n});\n","/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport type {\n IKosDataModel,\n IKosIdentifiable,\n KosContainerAware,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n kosContainerAware,\n kosLoggerAware,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { RemoteTrayModel } from \"./remote-tray-model\";\n\nexport const MODEL_TYPE = \"remote-tray-container-model\";\n\nexport type RemoteTrayContainerModel =\n PublicModelInterface<RemoteTrayContainerModelImpl>;\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface RemoteTrayContainerModelImpl\n extends KosContainerAware<RemoteTrayModel> {}\n@kosModel(MODEL_TYPE)\n@kosLoggerAware()\n@kosContainerAware()\nexport class RemoteTrayContainerModelImpl\n implements IKosIdentifiable, IKosDataModel\n{\n id: string;\n\n constructor(modelId: string) {\n this.id = modelId;\n }\n}\n","import { SingletonKosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { RemoteTrayContainerOptions } from \"./types\";\nimport { RemoteTray } from \"./remote-tray-registration\";\nimport {\n RemoteTrayContainerModelImpl,\n MODEL_TYPE,\n} from \"./remote-tray-container-model\";\nimport type { RemoteTrayContainerModel } from \"./remote-tray-container-model\";\n\n/**\n * # RemoteTrayContainer\n *\n * The registration bean includes convenience methods for creating and working with RemoteTrayContainerModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: RemoteTrayContainer.type, id: \"remoteTrayContainerId\"})\n * private remoteTrayContainerModel: RemoteTrayContainerModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new RemoteTrayContainerModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = RemoteTrayContainer.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a RemoteTrayContainerModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (RemoteTrayContainer.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to RemoteTrayContainerModel\n * // and the compiler will know that the model has the RemoteTrayContainerModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { RemoteTrayContainer } from \"@kosdev-code/kos-freestyle-sdk\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...RemoteTrayContainer.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The remoteTrayContainer model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const RemoteTrayContainer = new SingletonKosModelRegistrationFactory<\n RemoteTrayContainerModel,\n RemoteTrayContainerOptions\n>({\n class: RemoteTrayContainerModelImpl,\n type: MODEL_TYPE,\n});\n\nRemoteTrayContainer.addRelatedModel(RemoteTray);\n","import type {\n FutureContainer,\n FutureDelegate,\n FutureResponse,\n IFutureModel,\n IKosDataModel,\n IKosIdentifiable,\n KosContext,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n FutureManager,\n getKosModelSync,\n KosContextManager,\n KosLog,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleHolderOptions } from \"./types\";\n\nimport type { HolderModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type { FreestyleHolderExt } from \"../../utils/extensions/assembly/types\";\nimport type { CartridgeAgitatorModel } from \"../cartridge-agitator\";\nimport {\n FreestyleAssembly,\n type FreestyleAssemblyModel,\n} from \"../freestyle-assembly\";\nimport { RemoteTray, type RemoteTrayModel } from \"../remote-tray\";\n\nexport const MODEL_TYPE = \"freestyle-holder-model\";\ntype MethodsReturningType<T, ReturnType> = {\n [K in keyof T]: T[K] extends (...args: any[]) => ReturnType ? K : never;\n}[keyof T];\n\ntype FutureDelegateType = MethodsReturningType<\n CartridgeAgitatorModel,\n Promise<FutureResponse>\n>;\n\nfunction resolveFreestyleAssembly(\n id: string\n): FreestyleAssemblyModel | undefined {\n const context = KosContextManager.getContext(id);\n const freestyleAssembly: FreestyleAssemblyModel = context?.get(\n FreestyleAssembly.type\n );\n if (!freestyleAssembly) {\n KosLog.error(\"Freestyle assembly not found\");\n return undefined;\n }\n return freestyleAssembly;\n}\nasync function futureDelegate(\n model?: FutureContainer,\n method?: FutureDelegateType\n): Promise<IFutureModel | undefined> {\n if (!model || !method) {\n return undefined;\n }\n const response = (await model[method]()) as FutureResponse;\n if (response?.tracker) {\n return FutureManager.getFuture(response.tracker);\n }\n return undefined;\n}\nexport const freestyleHolderFactory = (holder: HolderModel) => {\n if (holder.data.agitated) {\n return MODEL_TYPE;\n }\n return undefined;\n};\nexport type FreestyleHolderModel =\n PublicModelInterface<FreestyleHolderModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class FreestyleHolderModelImpl\n implements IKosDataModel, IKosIdentifiable, FutureDelegate\n{\n id: string;\n private logger: KosContextLogger;\n private holder: HolderModel<FreestyleHolderExt>;\n private context: KosContext;\n\n future?: IFutureModel;\n constructor(\n modelId: string,\n options: FreestyleHolderOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.context = context.kosContext;\n this.holder = options.companionParent;\n }\n\n get agitated() {\n return this.holder.data.agitated;\n }\n async agitate() {\n if (!this.holder.data.agitated) {\n return undefined;\n }\n this.future = undefined;\n const freestyleAssembly = resolveFreestyleAssembly(this.id);\n\n if (!freestyleAssembly) {\n return undefined;\n }\n const agitator = freestyleAssembly.defaultCartridgeAgitator;\n if (!agitator) {\n this.logger.error(\"Agitator not found\");\n return undefined;\n }\n this.future = await futureDelegate(\n freestyleAssembly.defaultCartridgeAgitator,\n \"testAgitate\"\n );\n\n return this.future;\n }\n\n get isRemote(): boolean {\n const remoteTrayId = `${RemoteTray.type}-${this.holder.path}`;\n const remoteTray = getKosModelSync<RemoteTrayModel>(remoteTrayId);\n if (!remoteTray?.model) {\n return false;\n }\n return !!remoteTray.model.remoteTrayEnabled.value;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing freestyle-holder ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading freestyle-holder ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleHolderModel } from \"./freestyle-holder-model\";\nimport { FreestyleHolderModelImpl, MODEL_TYPE } from \"./freestyle-holder-model\";\nimport type { FreestyleHolderOptions } from \"./types\";\n\n/**\n * # FreestyleHolder\n *\n * The registration bean includes convenience methods for creating and working with FreestyleHolderModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestyleHolder.type, id: \"freestyleHolderId\"})\n * private freestyleHolderModel: FreestyleHolderModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestyleHolderModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestyleHolder.factory(\"freestyleHolderId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestyleHolderModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestyleHolder.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestyleHolderModel\n * // and the compiler will know that the model has the FreestyleHolderModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestyleHolder } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestyleHolder);\n * ```\n *\n * ## registration.singleton\n \n * The freestyleHolder model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const FreestyleHolder = new KosModelRegistrationFactory<\n FreestyleHolderModel,\n FreestyleHolderOptions\n>({\n class: FreestyleHolderModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"FREESTYLE-NOZZLE_SERVICE\");\nconst { getOne } = ServiceFactory.build({\n basePath: `${URL}/api/freestyle-nozzle`,\n});\n\nconst log = KosLog.createLogger({\n name: \"freestyle-nozzle-service\",\n group: \"Services\",\n});\n\ninterface NutritionValue {\n displayValue: string;\n units: string;\n type: string;\n}\ninterface NutritionVolume {\n volume: number;\n values: NutritionValue[];\n}\nexport interface FreestyleNutritionInfoResponse {\n labels?: {\n allergens: string;\n legalDescriptor: string;\n ingredients: string;\n ingredientsHeading: string;\n };\n volumes: NutritionVolume[];\n error?: string;\n}\n\nexport class NutritionInfoError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"NutritionInfoError\";\n }\n}\n\nexport class InvalidRequestError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"InvalidRequestError\";\n }\n}\n/**\n * @category Service\n * Retrieves the initial freestyle-nozzle data.\n */\nexport const getFreestyleNutritionInfo = async (\n nozzleUrlPrefix: string,\n beverageId: string,\n volumes: number[],\n baseUrl = \"http://localhost:8081\"\n) => {\n log.debug(\"sending GET for freestyle-nozzle\");\n\n if (!beverageId) {\n log.error(\"Invalid freestyle-nozzle request: beverageId is required\");\n throw new InvalidRequestError(\"No beverageId provided\");\n }\n\n if (!volumes || volumes.length === 0) {\n log.error(\"Invalid freestyle-nozzle request: volumes are required\");\n throw new InvalidRequestError(\"No volumes provided\");\n }\n const response = await getOne<FreestyleNutritionInfoResponse>({\n urlOverride: `${baseUrl}${nozzleUrlPrefix}/pipeline/beverage/engine/nutrition/${beverageId}?volumes=${volumes.join(\n \",\"\n )}`,\n });\n\n if (!response?.data) {\n log.error(\"Failed to retrieve freestyle-nozzle data\");\n throw new Error(\"Failed to retrieve freestyle-nozzle data\");\n }\n\n if (response.data.error) {\n throw new NutritionInfoError(response.data.error);\n }\n\n return response.data;\n};\n","import type { NozzleModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n kosAction,\n kosModel,\n kosModelEffect,\n kosParentAware,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport {\n getFreestyleNutritionInfo,\n type FreestyleNutritionInfoResponse,\n} from \"./services\";\nimport type { FreestyleNozzleOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"freestyle-nozzle-model\";\n\nexport type FreestyleNozzleModel =\n PublicModelInterface<FreestyleNozzleModelImpl>;\n\n@kosParentAware()\n@kosModel(MODEL_TYPE)\nexport class FreestyleNozzleModelImpl\n implements IKosDataModel, IKosIdentifiable\n{\n id: string;\n private logger: KosContextLogger;\n private nozzleModel: NozzleModel;\n private _cupSizes: number[];\n private _nutritionInfo?: FreestyleNutritionInfoResponse;\n constructor(\n modelId: string,\n options: FreestyleNozzleOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.nozzleModel = options.companionParent;\n this._cupSizes = [100];\n }\n\n set cupSizes(cupSizes: number[]) {\n this._cupSizes = cupSizes;\n }\n get nutritionInfo() {\n return this._nutritionInfo;\n }\n\n get selectedPourable() {\n return this.nozzleModel.selectedPourable;\n }\n\n @kosModelEffect({\n dependencies: (model: FreestyleNozzleModel) => [\n model.selectedPourable.beverage,\n ],\n })\n async handleBeverageSelection() {\n if (this.nozzleModel.selectedPourable.beverage && this._cupSizes.length) {\n this.logger.debug(\n `selected beverage: ${\n this.nozzleModel.selectedPourable.beverage.rawId\n }. Volume: ${this._cupSizes.join(\", \")}`\n );\n const beverageId = this.nozzleModel.selectedPourable.beverage.rawId;\n const prefix = this.nozzleModel.urlPrefix;\n try {\n const response = await getFreestyleNutritionInfo(\n prefix,\n beverageId,\n this._cupSizes\n );\n kosAction(() => {\n this._nutritionInfo = response;\n });\n } catch (error) {\n this.logger.error(`Error fetching nutrition info: ${error}`);\n }\n }\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing freestyle-nozzle ${this.id}`);\n }\n\n unload(): void {\n this.logger.debug(`unloading freestyle-nozzle ${this.id}`);\n }\n async load(): Promise<void> {\n this.logger.debug(`loading freestyle-nozzle ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleNozzleModel } from \"./freestyle-nozzle-model\";\nimport { FreestyleNozzleModelImpl, MODEL_TYPE } from \"./freestyle-nozzle-model\";\nimport type { FreestyleNozzleOptions } from \"./types\";\n\n/**\n * # FreestyleNozzle\n *\n * The registration bean includes convenience methods for creating and working with FreestyleNozzleModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestyleNozzle.type, id: \"freestyleNozzleId\"})\n * private freestyleNozzleModel: FreestyleNozzleModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestyleNozzleModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestyleNozzle.factory(\"freestyleNozzleId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestyleNozzleModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestyleNozzle.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestyleNozzleModel\n * // and the compiler will know that the model has the FreestyleNozzleModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestyleNozzle } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestyleNozzle);\n * ```\n *\n * ## registration.singleton\n \n * The freestyleNozzle model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const FreestyleNozzle = new KosModelRegistrationFactory<\n FreestyleNozzleModel,\n FreestyleNozzleOptions\n>({\n class: FreestyleNozzleModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n FetchError,\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"PUMP_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/ext/freestyle/microCalibration`,\n});\n\nconst log = KosLog.createLogger({\n name: \"freestyle-pump-service\",\n group: \"Services\",\n});\nexport type ReplacePumpErrorType = \"unknownError\" | undefined;\nexport type ReplacePumpData = {\n error?: ReplacePumpErrorType;\n};\nexport type ReplacePumpResponse = [\n ReplacePumpErrorType | undefined,\n ReplacePumpData\n];\nexport const replacePump = async (\n pumpId: string,\n code: string\n): Promise<ReplacePumpResponse> => {\n log.debug(\n `replacePump - sending POST request to /api/ext/freestyle/microCalibration/cal/${pumpId}/code/${code}`\n );\n\n try {\n const response = await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/microCalibration/cal/${pumpId}/code/${code}`,\n });\n\n log.debug(\"replacePump - response:\", response);\n\n if (\n (response?.status === 200 || response?.status === 499) &&\n response.data?.error\n ) {\n return [response.data.error || \"unknownError\", response.data];\n }\n\n return [undefined, response?.data];\n } catch (error) {\n log.error(\n `replacePump - sending POST request to /api/cal/${pumpId}/code/${code}`,\n error\n );\n\n if (error instanceof FetchError) {\n const errorCode =\n error.payload?.data?.error || error.payload?.error || \"unknownError\";\n\n return [errorCode, error.payload?.data || { error: errorCode }];\n }\n }\n\n return [\"unknownError\", { error: \"unknownError\" }];\n};\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestylePumpOptions } from \"./types\";\n\nimport type { PumpModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport {\n replacePump,\n type ReplacePumpData,\n type ReplacePumpErrorType,\n} from \"./services\";\n\nexport const MODEL_TYPE = \"freestyle-pump-model\";\n\nexport type FreestylePumpModel = PublicModelInterface<FreestylePumpModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class FreestylePumpModelImpl implements IKosDataModel, IKosIdentifiable {\n id: string;\n private logger: KosContextLogger;\n private pump: PumpModel;\n constructor(\n modelId: string,\n options: FreestylePumpOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.pump = options.companionParent;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async replacePump(\n code: string\n ): Promise<[ReplacePumpErrorType, ReplacePumpData]> {\n const [error, data] = await replacePump(this.pump.path, code);\n if (error) {\n this.logger.error(`Failed to replace the pump, ${this.pump.id}`, error);\n }\n\n return [error, data];\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestylePumpModel } from \"./freestyle-pump-model\";\nimport { FreestylePumpModelImpl, MODEL_TYPE } from \"./freestyle-pump-model\";\nimport type { FreestylePumpOptions } from \"./types\";\n\n/**\n * # FreestylePump\n *\n * The registration bean includes convenience methods for creating and working with FreestylePumpModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestylePump.type, id: \"freestylePumpId\"})\n * private freestylePumpModel: FreestylePumpModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestylePumpModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestylePump.factory(\"freestylePumpId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestylePumpModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestylePump.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestylePumpModel\n * // and the compiler will know that the model has the FreestylePumpModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestylePump } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestylePump);\n * ```\n *\n * ## registration.singleton\n \n * The freestylePump model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const FreestylePump = new KosModelRegistrationFactory<\n FreestylePumpModel,\n FreestylePumpOptions\n>({\n class: FreestylePumpModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n type FutureResponse,\n type KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"ICE_AGITATOR_SERVICE\");\nconst { getAll, postModel } = ServiceFactory.build({\n basePath: `${URL}/api/ext/freestyle/ice`,\n});\n\nconst log = KosLog.createLogger({\n name: \"ice-agitator-service\",\n group: \"Services\",\n});\n\n/**\n * @category Service\n * Retrieves the initial dispenser data.\n */\nexport const getIceTypes = async (path: string) => {\n log.debug(\"sending GET for ice types\");\n const response = await getAll<string>({\n urlOverride: `${URL}/api/handle/${path}/types`,\n });\n return response;\n};\n\nexport const updateIceType = async (agitator: string, type: string) => {\n log.debug(\"sending POST for ice types\");\n const response = await postModel({\n urlOverride: `${URL}/api/handle/${agitator}/type/${type}`,\n model: {},\n });\n return response;\n};\n\nexport const resetIceSetting = async (path: string) => {\n const response = await getAll({\n urlOverride: `${URL}/api/kos/config/details/${path}/4`,\n });\n return response;\n};\n\nexport const pour = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/pour`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response?.data as FutureResponse;\n};\n\nexport const agitate = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/test/agitation`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response?.data as FutureResponse;\n};\n\nexport const testGate = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/test/gate`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response?.data as FutureResponse;\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport type {\n IKosDataModel,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n KosMultipleFutureAwareFull,\n KosStateProp,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n EventBus,\n KOS_MODEL_ID,\n kosAction,\n kosConfigProperty,\n kosFuture,\n kosModel,\n kosModelEffect,\n kosMultipleFutureAware,\n kosStateProp,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport { PourState } from \"@kosdev-code/kos-dispense-sdk\";\nimport {\n agitate,\n getIceTypes,\n pour,\n resetIceSetting,\n testGate,\n updateIceType,\n} from \"./services/ice-agitator-services\";\nimport type { IceAgitatorOptions } from \"./types\";\n\nexport type IceAgitatorModel = PublicModelInterface<IceAgitatorModelImpl>;\n\nexport class IceAgitatorEvents {\n static TOPIC_AGITATION_STARTED = \"/kos/events/ddk/ice-agitation-started\";\n static TOPIC_AGITATION_ENDED = \"/kos/events/ddk/ice-agitation-ended\";\n}\n\nexport const MODEL_TYPE = \"ice-agitator-model\";\nconst PROP_PATH = createPropKey<IceAgitatorModel>(\"statePath\");\n\n// Define the type for the model implementation with named futures\ntype IceAgitatorModelType = KosMultipleFutureAwareFull<\n \"pour\" | \"agitate\" | \"gate\"\n>;\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IceAgitatorModelImpl extends IceAgitatorModelType {}\n\n@kosModel(MODEL_TYPE)\n@kosMultipleFutureAware()\nexport class IceAgitatorModelImpl implements IKosDataModel {\n id: string;\n name: string;\n path: string;\n // futureHandler, future, pourFuture, agitateFuture, gateFuture,\n // and all status/progress properties are added by @kosMultipleFutureAware decorator\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.volWithoutIceMl\",\n })\n volWithoutIceMl!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.durationSec\",\n converter: {\n to: \"second\",\n },\n })\n durationSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"enableIceChuteClear\",\n })\n enableIceChuteClear!: KosConfigProperty<boolean>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"iceChuteClearDurationMs\",\n })\n iceChuteClearDurationMs!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"iceChuteClearIntervalSec\",\n })\n iceChuteClearIntervalSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"iceChuteClearRetryIntervalSec\",\n })\n iceChuteClearRetryIntervalSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"maxDispenseSec\",\n })\n maxDispenseSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"type\",\n })\n type!: KosConfigProperty<string>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.dilutionOffset\",\n })\n dilutionOffset!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.inactivitySec\",\n converter: {\n to: \"minute\",\n },\n })\n inactivitySec!: KosConfigProperty<number>;\n @kosStateProp({ path: PROP_PATH, attribute: \"agitating\" })\n private agitating!: KosStateProp<boolean>;\n\n @kosStateProp({ path: PROP_PATH, attribute: \"iceChuteOpen\" })\n private iceChuteOpen!: KosStateProp<boolean>;\n\n statePath: string;\n private _allIceTypes: string[];\n private logger: KosContextLogger;\n currentState: PourState = PourState.IDLE;\n constructor(\n modelId: string,\n options: IceAgitatorOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.name = options.name;\n this.path = options.path;\n this.statePath = options.statePath;\n this._allIceTypes = [];\n this.logger = context.logger;\n // MultipleFutureHandler setup is now handled by @kosMultipleFutureAware decorator\n }\n\n get iceTypes(): string[] {\n return this._allIceTypes;\n }\n\n get isAgitating(): boolean {\n return !!this.agitating.value;\n }\n\n get isIceChuteOpen(): boolean {\n return !!this.iceChuteOpen.value;\n }\n\n // future, pourFuture, agitateFuture, gateFuture getters are now provided by @kosMultipleFutureAware decorator\n\n /**\n * A derived value that indicates if the nozzle is currently pouring a beverage.\n * @readonly\n */\n get isPouring() {\n return (\n !!(this.pourFuture && !this.pourFuture?.endState) ||\n this.currentState === PourState.POUR_STARTING ||\n this.currentState === PourState.POURING ||\n this.currentState === PourState.POUR_CANCELING\n );\n }\n\n /**\n * A derived value that indicates if it is possible to dispense ice.\n *\n * The value is observable and will change as the current dispense state changes\n * @readonly\n * */\n get canPour() {\n return this.currentState === PourState.IDLE;\n }\n private updateIfCurrent(currentState: PourState, nextState: PourState) {\n if (this.currentState === currentState) {\n kosAction(() => {\n this.currentState = nextState;\n });\n }\n }\n @kosFuture({ alias: \"pour\" })\n public async pourIce(tracker?: string) {\n try {\n if (this.currentState === PourState.IDLE) {\n this.updateIfCurrent(PourState.IDLE, PourState.POUR_STARTING);\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n const result = await pour(this.path, tracker);\n this.updateIfCurrent(PourState.POUR_STARTING, PourState.POURING);\n\n if (result?.endState) {\n this.updateIfCurrent(PourState.POURING, PourState.IDLE);\n }\n return result as unknown as Promise<void>;\n } else {\n throw new Error(`Cannot pour in state ${this.currentState}`);\n }\n } catch (e) {\n this.logger.error(e);\n this.currentState = PourState.IDLE;\n throw e;\n }\n }\n\n /**\n * An action that will cancel the ice dispense if it is currently in progress.\n * */\n public async cancelIceDispense() {\n if (\n this.currentState === PourState.POURING ||\n this.currentState === PourState.POUR_STARTING\n ) {\n this.currentState = PourState.POUR_CANCELING;\n\n await this.pourFuture?.cancelFuture();\n kosAction(() => {\n this.currentState = PourState.IDLE;\n });\n } else {\n this.logger.warn(\n `Cannot cancel ice dispense in state ${this.currentState}`\n );\n }\n }\n @kosFuture({ alias: \"agitate\" })\n async testAgitate(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n this.logger.info(`agitating ice-agitator ${this.id}`);\n\n return agitate(this.path, tracker);\n }\n\n @kosFuture({\n alias: \"gate\",\n })\n async testGate(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n this.logger.info(`testing ice gate: ${this.id}`);\n\n return testGate(this.path, tracker);\n }\n @kosModelEffect({\n dependencies: (model) => [model.isAgitating],\n })\n handleAgitationChange() {\n if (this.isAgitating) {\n this.logger.info(`agitating ice-agitator ${this.id}`);\n EventBus.publish(IceAgitatorEvents.TOPIC_AGITATION_STARTED, {\n path: this.path,\n futureId: this.futureHandler.future?.futureId,\n });\n } else {\n EventBus.publish(IceAgitatorEvents.TOPIC_AGITATION_ENDED, {\n path: this.path,\n });\n }\n }\n async updateIceType(type: string) {\n await updateIceType(this.path, type);\n }\n\n resetDefaultValues = async () => {\n const defaults = await resetIceSetting(this.path);\n return defaults;\n };\n\n async init(): Promise<void> {\n this.logger.debug(`initializing ice-agitator ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading ice-agitator ${this.id}`);\n const iceTypes = await getIceTypes(this.path);\n if (iceTypes?.status === 200) {\n kosAction(() => {\n this._allIceTypes = iceTypes.data || [];\n });\n }\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n IceAgitatorModelImpl,\n MODEL_TYPE,\n type IceAgitatorModel,\n} from \"./ice-agitator-model\";\nimport type { IceAgitatorOptions } from \"./types\";\n\n/**\n * # IceAgitator\n *\n * The registration bean includes convenience methods for creating and working with IceAgitatorModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: IceAgitator.type, id: \"iceAgitatorId\"})\n * private iceAgitatorModel: IceAgitatorModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new IceAgitatorModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = IceAgitator.factory(\"iceAgitatorId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a IceAgitatorModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (IceAgitator.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to IceAgitatorModel\n * // and the compiler will know that the model has the IceAgitatorModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { IceAgitator } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...IceAgitator.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The iceAgitator model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\n\nexport const IceAgitator = new KosModelRegistrationFactory<\n IceAgitatorModel,\n IceAgitatorOptions\n>({\n class: IceAgitatorModelImpl,\n type: MODEL_TYPE,\n});\n","import type {\n IntentAware,\n IntentAwareProps,\n PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n FutureResponse,\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { LfcvPumpOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"lfcv-pump-model\";\n\nexport type LfcvPumpModel = PublicModelInterface<LfcvPumpModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class LfcvPumpModelImpl\n implements IKosDataModel, IKosIdentifiable, IntentAware\n{\n id: string;\n private logger: KosContextLogger;\n private pumpModel: PumpModel;\n constructor(\n modelId: string,\n options: LfcvPumpOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.pumpModel = options.companionParent;\n }\n\n get name() {\n return this.pumpModel.name;\n }\n\n get canPour() {\n return this.pumpModel.canPour;\n }\n\n get isPouring() {\n return this.pumpModel.isPouring;\n }\n\n async cancelPour() {\n return this.pumpModel.cancelPour();\n }\n\n performIntent(\n props: IntentAwareProps | string\n ): Promise<FutureResponse | undefined> {\n return this.pumpModel.performIntent(props);\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing lfcv-pump ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading lfcv-pump ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { LfcvPumpOptions } from \"./types\";\nimport { LfcvPumpModelImpl, MODEL_TYPE } from \"./lfcv-pump-model\";\nimport type { LfcvPumpModel } from \"./lfcv-pump-model\";\n\n/**\n * # LfcvPump\n *\n * The registration bean includes convenience methods for creating and working with LfcvPumpModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: LfcvPump.type, id: \"lfcvPumpId\"})\n * private lfcvPumpModel: LfcvPumpModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new LfcvPumpModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = LfcvPump.factory(\"lfcvPumpId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a LfcvPumpModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (LfcvPump.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to LfcvPumpModel\n * // and the compiler will know that the model has the LfcvPumpModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { LfcvPump } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(LfcvPump);\n * ```\n *\n * ## registration.singleton\n \n * The lfcvPump model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const LfcvPump = new KosModelRegistrationFactory<\n LfcvPumpModel,\n LfcvPumpOptions\n>({\n class: LfcvPumpModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n ServiceFactory,\n resolveServiceUrl,\n KosLog,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"LFCV-PUMP_SERVICE\");\nconst { getAll } = ServiceFactory.build({\n basePath: `${URL}/api/lfcv-pump`,\n});\n\nconst log = KosLog.createLogger({\n name: \"lfcv-pump-service\",\n group: \"Services\",\n});\ninterface LfcvPumpResponse {\n id: string;\n}\n/**\n * @category Service\n * Retrieves the initial lfcv-pump data.\n */\nexport const getLfcvPumps = async () => {\n log.debug(\"sending GET for lfcv-pump\");\n const response = await getAll<LfcvPumpResponse>({});\n return response;\n};\n","import {\n FetchError,\n FutureEndState,\n FutureManager,\n KosLog,\n resolveServiceUrl,\n ServiceFactory,\n type FutureResponse,\n type KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nconst { URL } = resolveServiceUrl(\"SPM-PUMP_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/spm-pump`,\n});\n\nconst log = KosLog.createLogger({\n name: \"spm-pump-service\",\n group: \"Services\",\n});\n\nexport const performPreCalibrate = async (pump: string, tracker?: string) => {\n log.debug(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/preCalibrate`\n );\n\n try {\n const response = (await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/microCalibration/pour/${pump}/preCalibrate`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performPreCalibrate - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/preCalibrate`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\nexport const performCalibrate = async (pump: string, tracker?: string) => {\n log.debug(\n `performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/calibrate`\n );\n\n try {\n const response = (await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/microCalibration/pour/${pump}/calibrate`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performCalibrate - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/calibrate`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\nexport const performVerify = async (\n pump: string,\n volume: string,\n payload: any,\n tracker?: string\n) => {\n log.debug(\n `performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/verify`\n );\n\n try {\n const response = (await postModel({\n model: {\n ...payload,\n // commandedCalibrationVolume: 0,\n measuredCalibrationVolume: volume,\n // measuredVerificationVolume: 0,\n // newCalibrationValue: 0,\n // pouredCalibrationVolume: 0,\n },\n urlOverride: `${URL}/api/ext/freestyle/microCalibration/pour/${pump}/verify`,\n tracker,\n })) as KosServiceResponse<FutureResponse>;\n\n log.debug(\"performVerify - response:\", response);\n\n if (response?.data) {\n FutureManager.initiateFuture(response.data);\n }\n\n return response?.data;\n } catch (error) {\n log.error(\n `performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/verify`,\n error\n );\n\n const futureResponse: FutureResponse = {\n id: tracker || \"\",\n endState: FutureEndState.Fail,\n tracker: tracker,\n reason: \"Failed to resolve trouble\",\n };\n\n FutureManager.initiateFuture(futureResponse);\n\n return futureResponse;\n }\n};\n\nexport const performComplete = async (\n pump: string,\n volume1: string,\n volume2: string,\n payload: any\n) => {\n log.debug(\n `performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/complete`\n );\n\n try {\n const response = await postModel({\n model: {\n ...payload,\n // commandedCalibrationVolume: 0,\n measuredCalibrationVolume: volume1,\n measuredVerificationVolume: volume2,\n // newCalibrationValue: 0,\n // pouredCalibrationVolume: 0,\n },\n urlOverride: `${URL}/api/ext/freestyle/microCalibration/pour/${pump}/complete`,\n });\n\n log.debug(\"performComplete - response:\", response);\n\n if (\n (response?.status === 200 || response?.status === 499) &&\n response.data?.error\n ) {\n return [response.data.error || \"unknownError\", response.data];\n }\n\n return [undefined, response?.data];\n } catch (error) {\n log.error(\n `performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${pump}/complete`,\n error\n );\n\n if (error instanceof FetchError) {\n const errorCode =\n error.payload?.data?.error || error.payload?.error || \"unknownError\";\n\n return [errorCode, error.payload?.data || { error: errorCode }];\n }\n }\n\n return [\"unknownError\", { error: \"unknownError\" }];\n};\n","import type {\n KosContextLogger,\n KosCreationContext,\n IKosDataModel,\n IKosIdentifiable,\n PublicModelInterface,\n FutureContainer,\n FutureAwareContainer,\n FutureResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { FutureHandler, kosFuture, kosModel } from \"@kosdev-code/kos-ui-sdk\";\n\nimport type { SpmPumpOptions } from \"./types\";\n\nimport type {\n IntentAware,\n IntentAwareProps,\n PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport {\n performCalibrate,\n performComplete,\n performPreCalibrate,\n performVerify,\n} from \"./services\";\n\nexport const MODEL_TYPE = \"spm-pump-model\";\n\nexport type SpmPumpModel = PublicModelInterface<SpmPumpModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class SpmPumpModelImpl\n implements IKosDataModel, IKosIdentifiable, IntentAware, FutureContainer\n{\n id: string;\n private logger: KosContextLogger;\n private pump: PumpModel;\n futureHandler: FutureAwareContainer;\n\n constructor(\n modelId: string,\n options: SpmPumpOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this.pump = options.companionParent;\n this.futureHandler = new FutureHandler(this);\n }\n\n get name() {\n return this.pump.name;\n }\n\n get canPour() {\n return this.pump.canPour;\n }\n\n get isPouring() {\n return this.pump.isPouring;\n }\n\n async cancelPour() {\n return this.pump.cancelPour();\n }\n\n performIntent(\n props: IntentAwareProps | string\n ): Promise<FutureResponse | undefined> {\n return this.pump.performIntent(props);\n }\n\n get future() {\n return this.futureHandler.future;\n }\n\n @kosFuture()\n async performPreCalibrate(tracker?: string) {\n return performPreCalibrate(this.pump.path, tracker);\n }\n\n @kosFuture()\n async performCalibrate(tracker?: string) {\n return performCalibrate(this.pump.path, tracker);\n }\n\n @kosFuture()\n async performVerify(volume: string, payload: any, tracker?: string) {\n return performVerify(this.pump.path, volume, payload, tracker);\n }\n\n async performComplete(volume1: string, volume2: string, payload: any) {\n return performComplete(this.pump.path, volume1, volume2, payload);\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing spm-pump ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading spm-pump ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { SpmPumpOptions } from \"./types\";\nimport { SpmPumpModelImpl, MODEL_TYPE } from \"./spm-pump-model\";\nimport type { SpmPumpModel } from \"./spm-pump-model\";\n\n/**\n * # SpmPump\n *\n * The registration bean includes convenience methods for creating and working with SpmPumpModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: SpmPump.type, id: \"spmPumpId\"})\n * private spmPumpModel: SpmPumpModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new SpmPumpModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = SpmPump.factory(\"spmPumpId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a SpmPumpModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (SpmPump.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to SpmPumpModel\n * // and the compiler will know that the model has the SpmPumpModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { SpmPump } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(SpmPump);\n * ```\n *\n * ## registration.singleton\n \n * The spmPump model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const SpmPump = new KosModelRegistrationFactory<\n SpmPumpModel,\n SpmPumpOptions\n>({\n class: SpmPumpModelImpl,\n type: MODEL_TYPE,\n});\n","/**\n * (C) Copyright 2024, TCCC, All rights reserved.\n *\n */\n\n/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport {\n Assembly,\n HolderModel,\n type HolderTroubleData,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n DeferAware,\n FutureResponse,\n IKosDataModel,\n IKosIdentifiable,\n KosCompanionComposition,\n KosConfigProperty,\n KosLoggerAware,\n KosModelRegistrationFactory,\n PublicModelInterface,\n ResolveAware,\n TroubleModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n DependencyLifecycle,\n getKosModelSync,\n kosCompanion,\n kosConfigProperty,\n kosLoggerAware,\n kosModel,\n kosTopicHandler,\n modelTypeEventTopicFactory,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { AgitationRequiredTroubleOptions } from \"./types\";\n\n/**\n * Agitation required trouble model type identifier.\n *\n * Used for model registration and type predicates when working with\n * agitation-related troubles in the KOS framework.\n *\n * @category Trouble Models\n */\nexport const MODEL_TYPE = \"agitation-required-trouble-model\";\n\n/**\n * Public interface for the AgitationRequiredTrouble model.\n *\n * This model manages troubles related to insufficient agitation in beverage\n * holders, providing resolution capabilities and deferral logic based on\n * configuration properties.\n *\n * @see {@link AgitationRequiredTroubleModelImpl} for the implementation\n * @category Trouble Models\n */\nexport type AgitationRequiredTroubleModel =\n PublicModelInterface<AgitationRequiredTroubleModelImpl>;\n\n/**\n * Factory function to determine if a trouble requires agitation handling.\n *\n * Examines the trouble model's data to determine if it represents an\n * insufficient agitation condition that requires a dedicated agitation\n * trouble model.\n *\n * @param troubleModel - The trouble model to examine\n * @returns The agitation model type if agitation is required, undefined otherwise\n *\n * @example\n * ```typescript\n * const modelType = agitationModelFactory(troubleModel);\n * if (modelType) {\n * // Create agitation trouble model\n * const agitationModel = AgitationRequiredTrouble\n * .instance(troubleModel.id)\n * .options({ companionParent: troubleModel })\n * .build();\n * }\n * ```\n *\n * @category Trouble Models\n */\nexport const agitationModelFactory = (troubleModel: TroubleModel) => {\n if (troubleModel.data.agitationRequired) {\n return MODEL_TYPE;\n }\n return undefined;\n};\n\n/**\n * Trouble type identifier for insufficient agitation troubles.\n *\n * This constant is used to filter and identify agitation-related troubles\n * in the trouble system.\n *\n * @category Trouble Models\n */\nexport const AGITATION_REQUIRED_TROUBLE = \"InsufficientAgitationTrouble\";\n\nexport interface AgitationRequiredTroubleModelImpl\n extends KosLoggerAware,\n KosCompanionComposition<TroubleModel<HolderTroubleData>> {\n /** Parent trouble model (set by @kosCompanion decorator via parentProperty: \"trouble\") */\n trouble: TroubleModel<HolderTroubleData>;\n}\n\n/**\n * Companion model for managing agitation-required troubles in KOS beverage dispensers.\n *\n * This model represents troubles caused by insufficient agitation in ingredient holders,\n * typically occurring when carbonation levels are too low or agitation mechanisms fail.\n * It provides resolution capabilities and deferral logic to prevent pouring until\n * agitation conditions are met.\n *\n * The model integrates with the KOS configuration system to respect the\n * `ncui.agitateBeforePour` setting, allowing operators to control whether\n * pouring should wait for agitation to complete.\n *\n * @remarks\n * This is a companion model to the parent trouble model, created via the\n * {@link agitationModelFactory} when a trouble's `agitationRequired` flag is set.\n *\n * @example\n * ```typescript\n * // Factory-based creation (typical usage)\n * const agitationTrouble = AgitationRequiredTrouble\n * .instance(troubleId)\n * .options({ companionParent: parentTroubleModel })\n * .build();\n *\n * // Check if pouring should be deferred\n * if (agitationTrouble.shouldDefer) {\n * await agitationTrouble.defer();\n * }\n *\n * // Resolve the trouble\n * await agitationTrouble.resolve();\n * ```\n *\n * @category Trouble Models\n * @author Mark Pomerant (mark@matrica.ca)\n * @version 2.1.27\n */\n@kosModel({ modelTypeId: MODEL_TYPE, singleton: false })\n@kosLoggerAware()\n@kosCompanion({ mode: \"composition\", parentProperty: \"trouble\" })\nexport class AgitationRequiredTroubleModelImpl\n implements IKosDataModel, IKosIdentifiable, ResolveAware, DeferAware\n{\n /**\n * Registration factory for creating AgitationRequiredTrouble model instances.\n *\n * Automatically injected by the `@kosModel` decorator. Use the exported\n * {@link AgitationRequiredTrouble} constant instead of accessing this directly.\n *\n * @see {@link AgitationRequiredTrouble}\n */\n static Registration: KosModelRegistrationFactory<\n AgitationRequiredTroubleModel,\n AgitationRequiredTroubleOptions\n >;\n\n /**\n * Unique identifier for this model instance.\n */\n id: string;\n\n private _deferred: boolean;\n private _holdersLoaded = false;\n\n /**\n * Configuration property controlling whether to wait for agitation before pouring.\n *\n * When enabled, pouring will be deferred if the holder has insufficient agitation troubles.\n * This ensures beverage quality by preventing pours with inadequate carbonation or mixing.\n */\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.agitateBeforePour\",\n })\n agitateBeforePour!: KosConfigProperty<boolean>;\n\n /**\n * Creates a new AgitationRequiredTrouble model instance.\n *\n * @param modelId - Unique identifier for this model instance (typically matches parent trouble ID)\n */\n constructor(modelId: string) {\n this.id = modelId;\n this._deferred = false;\n }\n\n /**\n * Resolves the agitation trouble by delegating to the parent trouble model.\n *\n * Resolution typically involves completing the agitation process and clearing\n * the trouble state once carbonation or mixing levels are acceptable.\n *\n * @returns Promise resolving to the future response from the parent trouble's resolution\n */\n async resolve(): Promise<FutureResponse | undefined> {\n return this.trouble.resolve();\n }\n\n /**\n * Gets the holder model associated with this agitation trouble.\n *\n * The holder is the physical container (cartridge holder, ingredient holder, etc.)\n * that requires agitation. Returns undefined if the holder model hasn't been\n * loaded yet through the Assembly model initialization.\n *\n * @returns The holder model or undefined if not yet loaded\n */\n\n get holder() {\n if (!this.trouble) {\n return undefined;\n }\n const holderPath = this.trouble.data.holderPaths[0];\n const holderModel = getKosModelSync<HolderModel>(holderPath);\n\n if (!this._holdersLoaded && !holderModel.model) {\n return undefined;\n }\n\n return holderModel?.model;\n }\n\n /**\n * Handles Assembly model events to track when holder models become available.\n *\n * This topic handler listens for Assembly model lifecycle events to determine\n * when holder models have been fully loaded and are accessible.\n *\n * @internal\n */\n @kosTopicHandler({\n topic: modelTypeEventTopicFactory(Assembly.type),\n lifecycle: DependencyLifecycle.INIT,\n })\n updateHolder() {\n if (!this._holdersLoaded && !!this.trouble) {\n const holderPath = this.trouble.data.holderPaths[0];\n const holderModel = getKosModelSync<HolderModel>(holderPath);\n if (holderModel.model) {\n this._holdersLoaded = true;\n }\n }\n }\n\n /**\n * Determines if trouble resolution should be deferred until agitation completes.\n *\n * Trouble resolution is deferred when:\n * 1. The holder has active insufficient agitation troubles\n * 2. The `agitateBeforePour` configuration is enabled\n *\n * This ensures that operations requiring agitation (prime, purge, or other\n * holder-related troubles) wait for proper carbonation or mixing before\n * being marked as resolved.\n *\n * @returns true if trouble resolution should wait for agitation to complete\n */\n get shouldDefer() {\n if (!this.holder) {\n return true;\n }\n const troubleList =\n this.holder?.troublesByType[AGITATION_REQUIRED_TROUBLE] || [];\n const hasInsufficientAgitationTrouble = troubleList.length > 0;\n const waitForAgitation = !!this.agitateBeforePour?.value;\n return waitForAgitation && hasInsufficientAgitationTrouble;\n }\n\n /**\n * Gets the current deferral state of this trouble.\n *\n * @returns true if this trouble resolution is currently deferred\n */\n get deferred() {\n return this._deferred;\n }\n\n /**\n * Marks this trouble as deferred, preventing immediate resolution.\n *\n * Called by the trouble system to indicate that trouble resolution\n * should wait for agitation to complete before being marked as resolved.\n */\n defer() {\n this._deferred = true;\n }\n\n /**\n * Clears the deferral state, allowing trouble resolution to proceed.\n *\n * Typically called after agitation has completed and the trouble can\n * now be safely resolved.\n */\n clearDefer() {\n this._deferred = false;\n }\n}\n\n/**\n * Registration factory for creating AgitationRequiredTrouble model instances.\n *\n * Use this constant to create new instances of the agitation trouble model\n * using the fluent factory pattern.\n *\n * @example\n * ```typescript\n * // Create a new agitation trouble model\n * const agitationTrouble = AgitationRequiredTrouble\n * .instance(troubleId)\n * .options({ companionParent: parentTroubleModel })\n * .build();\n *\n * // Check deferral status\n * if (agitationTrouble.shouldDefer) {\n * console.log('Pouring deferred due to agitation');\n * }\n * ```\n *\n * @category Trouble Models\n */\nexport const AgitationRequiredTrouble =\n AgitationRequiredTroubleModelImpl.Registration;\n","import { KosLog, type DataMapper } from \"@kosdev-code/kos-ui-sdk\";\nimport { type CarbAgitatorModel } from \"../../../models/carb-agitator\";\nimport {\n IceAgitator,\n type IceAgitatorModel,\n} from \"../../../models/ice-agitator\";\n\nimport {\n CartridgeAgitator,\n CartridgeAgitatorContainer,\n} from \"../../../models/cartridge-agitator\";\nimport { RemoteTray, RemoteTrayContainer } from \"../../../models/remote-tray\";\nimport type { FreestyleModelAssemblyExt } from \"../../../models/types/assembly\";\nimport type { FreestyleAssemblyResponse } from \"./types\";\n\ntype AgitatorModel = CarbAgitatorModel | IceAgitatorModel;\nexport type AgitatorTypes = \"iceAgitator\";\nexport const AGITATOR_KEYS: AgitatorTypes[] = [\"iceAgitator\"];\nexport const AGITATOR_FACTORY_MAP = {\n iceAgitator: IceAgitator.factory,\n};\nexport const AGITATOR_NAME_MAP = {\n iceAgitator: \"Ice Agitator\",\n};\n\nconst logger = KosLog.createLogger({ name: \"freestyle-assembly-data-mapper\" });\n\nexport const freestyleAssemblyDataMapper: DataMapper<\n FreestyleAssemblyResponse,\n FreestyleModelAssemblyExt\n> = async (data) => {\n const cartridgeAgitators = CartridgeAgitatorContainer.instance()\n .options({})\n .build();\n const remoteTrays = RemoteTrayContainer.instance().options({}).build();\n const response = data.assemblies.reduce((acc, assembly) => {\n AGITATOR_KEYS.forEach((key) => {\n const agitator = assembly[key];\n if (agitator) {\n const factory = AGITATOR_FACTORY_MAP[key](agitator.path);\n acc[key] = factory({\n name: agitator.name,\n path: agitator.path,\n statePath: agitator.state?.path || \"\",\n });\n }\n });\n\n assembly.cartridgeAgitators?.forEach((cartridgeAgitatorData) => {\n const cartridgeAgitator = CartridgeAgitator.instance(\n cartridgeAgitatorData.path\n )\n .options({\n name: cartridgeAgitatorData.name,\n path: cartridgeAgitatorData.path,\n statePath: cartridgeAgitatorData.state?.path || \"\",\n })\n .build();\n cartridgeAgitators.addModel(cartridgeAgitator);\n });\n\n if (assembly.remoteTrays) {\n assembly.remoteTrays.forEach((tray) => {\n logger.info(`Found remote tray ${tray.name} with path ${tray.path}`);\n\n const trayId = `${RemoteTray.type}-${tray.holderPath}`;\n const trayModel = RemoteTray.instance(trayId)\n .options({\n holderPath: tray.holderPath,\n configPath: tray.path,\n name: tray.name,\n })\n .build();\n\n remoteTrays.addModel(trayModel);\n });\n }\n\n return acc;\n }, {} as { [key in AgitatorTypes]?: AgitatorModel });\n\n const supportsIce = !!response.iceAgitator;\n const supportsCarb = !!response[\"carbTank\"];\n\n return {\n ...response,\n cartridgeAgitators,\n remoteTrays,\n supportsCarb,\n supportsIce,\n } as FreestyleModelAssemblyExt;\n};\n","import {\n Assembly,\n KosModelRegistry as DispenseModelRegistration,\n Holder,\n Nozzle,\n Pump,\n PumpContainer,\n PumpContainerModel,\n PumpIndex,\n registerDispenseModels,\n type IngredientModel,\n type PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\n\nimport {\n EXTENSION_TROUBLE_DATA_MAPPER,\n ExtensionManager,\n getKosModelSync,\n registerCoreModels,\n RegistrationManager,\n Trouble,\n type RegistrationResult,\n type TroubleModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n agitationModelFactory,\n AgitationRequiredTrouble,\n} from \"../models/agitation-required-trouble/agitation-required-trouble-model\";\n\nimport { CarbAgitator } from \"../models/carb-agitator\";\nimport { CartridgeAgitatorContainer } from \"../models/cartridge-agitator\";\nimport { CgpPump } from \"../models/cgp-pump\";\nimport { FcmPump } from \"../models/fcm-pump\";\nimport { FreestyleAssembly } from \"../models/freestyle-assembly\";\nimport { FreestyleHolder } from \"../models/freestyle-holder\";\nimport { FreestyleNozzle } from \"../models/freestyle-nozzle\";\nimport { FreestylePump } from \"../models/freestyle-pump\";\nimport { IceAgitator } from \"../models/ice-agitator\";\nimport { LfcvPump } from \"../models/lfcv-pump\";\nimport { RemoteTray, RemoteTrayContainer } from \"../models/remote-tray\";\nimport { SpmPump } from \"../models/spm-pump\";\n\nexport const registerFreestyleModels =\n <R>(root: R) =>\n () => {\n registerCoreModels(root)();\n registerDispenseModels(root)();\n FreestyleNozzle.register();\n FreestyleAssembly.register();\n IceAgitator.register();\n CarbAgitator.register();\n CartridgeAgitatorContainer.register();\n SpmPump.register();\n FcmPump.register();\n LfcvPump.register();\n CgpPump.register();\n FreestylePump.register();\n FreestyleHolder.register();\n RemoteTray.register();\n RemoteTrayContainer.register();\n RegistrationManager.companion.register(root)(\n Nozzle.type,\n FreestyleNozzle.type\n );\n\n RegistrationManager.companion.register(root)(\n Assembly.type,\n FreestyleAssembly.type\n );\n\n AgitationRequiredTrouble.register();\n RegistrationManager.companion.register(root)(\n Trouble.type,\n agitationModelFactory\n );\n\n RegistrationManager.companion.register(root)(Pump.type, FreestylePump.type);\n RegistrationManager.companion.register(root)(\n Holder.type,\n FreestyleHolder.type\n );\n\n ExtensionManager[EXTENSION_TROUBLE_DATA_MAPPER].register(\n \"EnjoyByTrouble\",\n async (trouble: TroubleModel) => {\n // If the trouble has an enjoy by date, we can calculate the days since\n if (trouble.data.enjoyByDate) {\n const enjoyByDate = new Date(trouble.data.enjoyByDate);\n const now = new Date();\n const daysSinceEnjoyBy = Math.floor(\n (now.getTime() - enjoyByDate.getTime()) / (1000 * 60 * 60 * 24)\n );\n return {\n enjoyByDays: daysSinceEnjoyBy || \"\",\n };\n }\n\n return {};\n }\n );\n\n ExtensionManager[EXTENSION_TROUBLE_DATA_MAPPER].register(\n \"SuperPumpRequiredTrouble\", // This is the trouble type\n async (_trouble: TroubleModel) => {\n const { model: pumpContainer } = getKosModelSync<PumpContainerModel>(\n PumpContainer.type\n );\n\n if (pumpContainer) {\n const superPumpModels = pumpContainer.models.getIndexByKey(\n PumpIndex.byType,\n \"microSuper\"\n );\n const superPumps = superPumpModels\n .map((model) => model.name)\n .join(\", \");\n return {\n superPumps,\n };\n }\n return {};\n }\n );\n ExtensionManager[EXTENSION_TROUBLE_DATA_MAPPER].register(\n \"MicroPumpAirDetectTrouble\",\n async (trouble: TroubleModel) => {\n // If the trouble is related to a container, we don't need to map the data\n if (trouble.ifaces.includes(\"container\")) {\n return {};\n }\n if (trouble.data.pumpPath) {\n const { model: pumpModel } = getKosModelSync<PumpModel>(\n trouble.data.pumpPath\n );\n\n if (pumpModel) {\n const ingredientModel = pumpModel.ingredientId\n ? getKosModelSync<IngredientModel>(pumpModel.ingredientId).model\n : undefined;\n return {\n ingredientId: pumpModel.ingredientId,\n ingredientName: ingredientModel?.name || \"\",\n };\n }\n }\n return {};\n }\n );\n return {\n preload: RegistrationManager.model.preloadModel(root),\n model: RegistrationManager.model.register(root),\n companion: RegistrationManager.companion.register(root),\n legacy: RegistrationManager.model.registerLegacyModel(root),\n };\n };\n\ntype ModelRegistry<R> = typeof DispenseModelRegistration & {\n freestyle: { models: () => RegistrationResult<R> };\n preload: ReturnType<typeof RegistrationManager.model.preloadModel>;\n model: ReturnType<typeof RegistrationManager.model.register>;\n companion: ReturnType<typeof RegistrationManager.companion.register>;\n};\n\nconst _KosModelRegistry = {\n ...DispenseModelRegistration,\n};\n\n(_KosModelRegistry as any).freestyle = {\n models: registerFreestyleModels(_KosModelRegistry),\n};\n(_KosModelRegistry as any).preload =\n RegistrationManager.model.preloadModel(_KosModelRegistry);\n(_KosModelRegistry as any).model =\n RegistrationManager.model.register(_KosModelRegistry);\n(_KosModelRegistry as any).companion =\n RegistrationManager.companion.register(_KosModelRegistry);\n(_KosModelRegistry as any).legacy =\n RegistrationManager.model.registerLegacyModel(_KosModelRegistry);\n\ntype KosModelRegistryType = ModelRegistry<typeof _KosModelRegistry>;\n\nconst KosModelRegistry: KosModelRegistryType = _KosModelRegistry as any;\n\nexport { KosModelRegistry };\n","import {\n kosServiceRequest as baseKosServiceRequest,\n createClient,\n type ClientResponse,\n type HttpMethod,\n type IKosServiceRequestParams,\n type KosExecutionContext,\n type PathsByMethod,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { paths } from \"./openapi\";\n\n/**\n * Type aliases for freestyle API\n */\nexport type Api = paths;\nexport type ApiPath = keyof paths;\nexport type ValidPaths = PathsByMethod<paths>;\n\n/**\n * Get client response type for freestyle API\n */\nexport type ApiResponse<\n Path extends ApiPath,\n Method extends \"get\" | \"post\" | \"put\" | \"delete\" = \"get\"\n> = ClientResponse<paths, Path, Method>;\n\n/**\n * Get execution context type for freestyle API\n */\nexport type ExecutionContext<\n Path extends ApiPath = ApiPath,\n Method extends HttpMethod = \"get\"\n> = KosExecutionContext<paths, Path, Method>;\n\n/**\n * Typed decorator factory for @kosServiceRequest with freestyle API types\n *\n * Provides full IntelliSense and type safety for path, query params, and body\n * based on the freestyle OpenAPI schema.\n *\n * @example\n * ```typescript\n * import { kosServiceRequest } from '../../utils/services/freestyle/1.6.5/service';\n * import { DependencyLifecycle } from '@kosdev-code/kos-ui-sdk';\n *\n * @kosServiceRequest({\n * path: '/api/...',\n * method: 'get',\n * lifecycle: DependencyLifecycle.LOAD\n * })\n * private onDataLoaded(): void {\n * // Fully typed based on freestyle API\n * }\n * ```\n */\nexport function kosServiceRequest<\n Path extends ApiPath,\n Method extends HttpMethod = \"get\",\n Response = any,\n TransformedResponse = Response\n>(\n params: IKosServiceRequestParams<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >\n) {\n return baseKosServiceRequest<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >(params);\n}\n\n/**\n * Create an API client for freestyle\n */\nexport const api = createClient<paths>();\n\nexport default api;\n","import {\n kosServiceRequest as baseKosServiceRequest,\n createClient,\n type ClientResponse,\n type HttpMethod,\n type IKosServiceRequestParams,\n type KosExecutionContext,\n type PathsByMethod,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { paths } from \"./openapi\";\n\n/**\n * Type aliases for freestyle API\n */\nexport type Api = paths;\nexport type ApiPath = keyof paths;\nexport type ValidPaths = PathsByMethod<paths>;\n\n/**\n * Get client response type for freestyle API\n */\nexport type ApiResponse<\n Path extends ApiPath,\n Method extends \"get\" | \"post\" | \"put\" | \"delete\" = \"get\"\n> = ClientResponse<paths, Path, Method>;\n\n/**\n * Get execution context type for freestyle API\n */\nexport type ExecutionContext<\n Path extends ApiPath = ApiPath,\n Method extends HttpMethod = \"get\"\n> = KosExecutionContext<paths, Path, Method>;\n\n/**\n * Typed decorator factory for @kosServiceRequest with freestyle API types\n *\n * Provides full IntelliSense and type safety for path, query params, and body\n * based on the freestyle OpenAPI schema.\n *\n * @example\n * ```typescript\n * import { kosServiceRequest } from '../../utils/services/freestyle/1.8.1/service';\n * import { DependencyLifecycle } from '@kosdev-code/kos-ui-sdk';\n *\n * @kosServiceRequest({\n * path: '/api/...',\n * method: 'get',\n * lifecycle: DependencyLifecycle.LOAD\n * })\n * private onDataLoaded(): void {\n * // Fully typed based on freestyle API\n * }\n * ```\n */\nexport function kosServiceRequest<\n Path extends ApiPath,\n Method extends HttpMethod = \"get\",\n Response = any,\n TransformedResponse = Response\n>(\n params: IKosServiceRequestParams<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >\n) {\n return baseKosServiceRequest<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >(params);\n}\n\n/**\n * Create an API client for freestyle\n */\nexport const api = createClient<paths>();\n\nexport default api;\n","import {\n kosServiceRequest as baseKosServiceRequest,\n createClient,\n type ClientResponse,\n type HttpMethod,\n type IKosServiceRequestParams,\n type KosExecutionContext,\n type PathsByMethod,\n} from \"@kosdev-code/kos-ui-sdk\"\nimport type { paths } from \"./openapi\";\n\n/**\n * Type aliases for freestyle API\n */\nexport type Api = paths;\nexport type ApiPath = keyof paths;\nexport type ValidPaths = PathsByMethod<paths>;\n\n/**\n * Get client response type for freestyle API\n */\nexport type ApiResponse<\n Path extends ApiPath,\n Method extends \"get\" | \"post\" | \"put\" | \"delete\" = \"get\"\n> = ClientResponse<paths, Path, Method>;\n\n/**\n * Get execution context type for freestyle API\n */\nexport type ExecutionContext<\n Path extends ApiPath = ApiPath,\n Method extends HttpMethod = \"get\"\n> = KosExecutionContext<paths, Path, Method>;\n\n/**\n * Typed decorator factory for @kosServiceRequest with freestyle API types\n *\n * Provides full IntelliSense and type safety for path, query params, and body\n * based on the freestyle OpenAPI schema.\n *\n * @example\n * ```typescript\n * import { kosServiceRequest } from '../../utils/services/freestyle/daily/service';\n * import { DependencyLifecycle } from '@kosdev-code/kos-ui-sdk';\n *\n * @kosServiceRequest({\n * path: '/api/...',\n * method: 'get',\n * lifecycle: DependencyLifecycle.LOAD\n * })\n * private onDataLoaded(): void {\n * // Fully typed based on freestyle API\n * }\n * ```\n */\nexport function kosServiceRequest<\n Path extends ApiPath,\n Method extends HttpMethod = \"get\",\n Response = any,\n TransformedResponse = Response\n>(\n params: IKosServiceRequestParams<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >\n) {\n return baseKosServiceRequest<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >(params);\n}\n\n/**\n * Create an API client for freestyle\n */\nexport const api = createClient<paths>();\n\nexport default api;\n","import {\n kosServiceRequest as baseKosServiceRequest,\n createClient,\n type ClientResponse,\n type HttpMethod,\n type IKosServiceRequestParams,\n type KosExecutionContext,\n type PathsByMethod,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { paths } from \"./openapi\";\n\n/**\n * Type aliases for handle API\n */\nexport type Api = paths;\nexport type ApiPath = keyof paths;\nexport type ValidPaths = PathsByMethod<paths>;\n\n/**\n * Get client response type for handle API\n */\nexport type ApiResponse<\n Path extends ApiPath,\n Method extends \"get\" | \"post\" | \"put\" | \"delete\" = \"get\"\n> = ClientResponse<paths, Path, Method>;\n\n/**\n * Get execution context type for handle API\n */\nexport type ExecutionContext<\n Path extends ApiPath = ApiPath,\n Method extends HttpMethod = \"get\"\n> = KosExecutionContext<paths, Path, Method>;\n\n/**\n * Typed decorator factory for @kosServiceRequest with handle API types\n *\n * Provides full IntelliSense and type safety for path, query params, and body\n * based on the handle OpenAPI schema.\n *\n * @example\n * ```typescript\n * import { kosServiceRequest } from '../../utils/services/handle/1.8.1/service';\n * import { DependencyLifecycle } from '@kosdev-code/kos-ui-sdk';\n *\n * @kosServiceRequest({\n * path: '/api/...',\n * method: 'get',\n * lifecycle: DependencyLifecycle.LOAD\n * })\n * private onDataLoaded(): void {\n * // Fully typed based on handle API\n * }\n * ```\n */\nexport function kosServiceRequest<\n Path extends ApiPath,\n Method extends HttpMethod = \"get\",\n Response = any,\n TransformedResponse = Response\n>(\n params: IKosServiceRequestParams<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >\n) {\n return baseKosServiceRequest<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >(params);\n}\n\n/**\n * Create an API client for handle\n */\nexport const api = createClient<paths>();\n\nexport default api;\n","import {\n kosServiceRequest as baseKosServiceRequest,\n createClient,\n type ClientResponse,\n type HttpMethod,\n type IKosServiceRequestParams,\n type KosExecutionContext,\n type PathsByMethod,\n} from \"@kosdev-code/kos-ui-sdk\"\nimport type { paths } from \"./openapi\";\n\n/**\n * Type aliases for handle API\n */\nexport type Api = paths;\nexport type ApiPath = keyof paths;\nexport type ValidPaths = PathsByMethod<paths>;\n\n/**\n * Get client response type for handle API\n */\nexport type ApiResponse<\n Path extends ApiPath,\n Method extends \"get\" | \"post\" | \"put\" | \"delete\" = \"get\"\n> = ClientResponse<paths, Path, Method>;\n\n/**\n * Get execution context type for handle API\n */\nexport type ExecutionContext<\n Path extends ApiPath = ApiPath,\n Method extends HttpMethod = \"get\"\n> = KosExecutionContext<paths, Path, Method>;\n\n/**\n * Typed decorator factory for @kosServiceRequest with handle API types\n *\n * Provides full IntelliSense and type safety for path, query params, and body\n * based on the handle OpenAPI schema.\n *\n * @example\n * ```typescript\n * import { kosServiceRequest } from '../../utils/services/handle/daily/service';\n * import { DependencyLifecycle } from '@kosdev-code/kos-ui-sdk';\n *\n * @kosServiceRequest({\n * path: '/api/...',\n * method: 'get',\n * lifecycle: DependencyLifecycle.LOAD\n * })\n * private onDataLoaded(): void {\n * // Fully typed based on handle API\n * }\n * ```\n */\nexport function kosServiceRequest<\n Path extends ApiPath,\n Method extends HttpMethod = \"get\",\n Response = any,\n TransformedResponse = Response\n>(\n params: IKosServiceRequestParams<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >\n) {\n return baseKosServiceRequest<\n paths,\n Path,\n Method,\n Response,\n TransformedResponse\n >(params);\n}\n\n/**\n * Create an API client for handle\n */\nexport const api = createClient<paths>();\n\nexport default api;\n"],"names":["URL","resolveServiceUrl","postModel","ServiceFactory","KosLog","testCarbTank","path","tracker","response","MODEL_TYPE","PROP_STATE_PATH","createPropKey","CarbAgitatorModelImpl","modelId","options","context","__publicField","_a","statePath","__decorateClass","kosStateProp","kosConfigProperty","kosStateEntry","kosStateExit","kosStateGuard","kosFuture","kosModel","kosLoggerAware","kosCompanion","DependencyLifecycle","kosFutureAware","kosStateMachine","CarbAgitator","CartridgeAgitatorContainerModelImpl","KosModelContainer","id","model","kosChild","agitate","CartridgeAgitatorEvents","PROP_PATH","CartridgeAgitatorModelImpl","EventBus","kosModelEffect","CartridgeAgitator","KosModelRegistrationFactory","CartridgeAgitatorContainer","SingletonKosModelRegistrationFactory","CgpPumpModelImpl","CgpPump","log","performElectricalTest","error","FetchError","errorCode","_c","_b","_d","_e","performPreCalibrate","pump","FutureManager","futureResponse","FutureEndState","performCalibrate","performVerify","volume","processResponse","performComplete","volume1","volume2","FcmPumpModelImpl","FutureHandler","props","data","FcmPump","FEATURE_SUPPORTS_ICE","FEATURE_SUPPORTS_CARB","FEATURE_SUPPORTS_REMOTE_TRAYS","FreestyleAssemblyModelImpl","group","nozzlePath","KosFeatureFlags","_carbTank","getKosCompanionModel","kosParentAware","FreestyleAssembly","PROP_CONFIG_PATH","RemoteTrayModelImpl","_options","getKosModelSync","RemoteTray","RemoteTrayContainerModelImpl","kosContainerAware","RemoteTrayContainer","resolveFreestyleAssembly","KosContextManager","freestyleAssembly","futureDelegate","method","FreestyleHolderModelImpl","remoteTrayId","remoteTray","FreestyleHolder","getOne","NutritionInfoError","message","InvalidRequestError","getFreestyleNutritionInfo","nozzleUrlPrefix","beverageId","volumes","baseUrl","FreestyleNozzleModelImpl","cupSizes","prefix","kosAction","FreestyleNozzle","replacePump","pumpId","code","FreestylePumpModelImpl","FreestylePump","getAll","getIceTypes","updateIceType","agitator","type","resetIceSetting","pour","testGate","IceAgitatorEvents","IceAgitatorModelImpl","PourState","currentState","nextState","result","e","iceTypes","KOS_MODEL_ID","kosMultipleFutureAware","IceAgitator","LfcvPumpModelImpl","LfcvPump","getLfcvPumps","payload","SpmPumpModelImpl","SpmPump","agitationModelFactory","troubleModel","AGITATION_REQUIRED_TROUBLE","AgitationRequiredTroubleModelImpl","holderPath","holderModel","hasInsufficientAgitationTrouble","kosTopicHandler","modelTypeEventTopicFactory","Assembly","AgitationRequiredTrouble","AGITATOR_KEYS","AGITATOR_FACTORY_MAP","logger","freestyleAssemblyDataMapper","cartridgeAgitators","remoteTrays","acc","assembly","key","factory","cartridgeAgitatorData","cartridgeAgitator","tray","trayId","trayModel","supportsIce","supportsCarb","registerFreestyleModels","root","registerCoreModels","registerDispenseModels","RegistrationManager","Nozzle","Trouble","Pump","Holder","ExtensionManager","EXTENSION_TROUBLE_DATA_MAPPER","trouble","enjoyByDate","_trouble","pumpContainer","PumpContainer","PumpIndex","pumpModel","ingredientModel","_KosModelRegistry","DispenseModelRegistration","KosModelRegistry","kosServiceRequest","params","baseKosServiceRequest","api","createClient"],"mappings":"+QAYM,KAAEA,EAAA,EAAQC,EAAAA,kBAAkB,sBAAsB,EAClD,WAAEC,EAAA,EAAcC,EAAAA,eAAe,MAAM,CACzC,SAAU,GAAGH,EAAG,wBAClB,CAAC,EAEWI,EAAAA,OAAO,aAAa,CAC9B,KAAM,oBACN,MAAO,UACT,CAAC,EA2BM,MAAMC,GAAe,MAAOC,EAAcC,IAAoB,CACnE,MAAMC,EACJ,MAAMN,GAAU,CACd,MAAO,CAAA,EACP,QAAAK,EACA,YAAa,GAAGP,EAAG,eAAeM,CAAI,OAAA,CACvC,EAEH,GAAI,EAACE,GAAA,MAAAA,EAAU,MACb,MAAM,IAAI,MAAM,yBAAyB,EAE3C,OAAOA,GAAA,YAAAA,EAAU,IACnB,yTCfO,MAAMC,GAAa,sBAOpBC,GAAkBC,EAAAA,cAAiC,WAAW,EA4J7D,IAAMC,EAAN,KAAqD,CAqF1D,YACEC,EACAC,EACAC,EACA,CAzEFC,EAAA,WAKAA,EAAA,aAKAA,EAAA,aAKAA,EAAA,kBAWAA,EAAA,qBAWAA,EAAA,oBAWAA,EAAA,gBAYAA,EAAA,sBAcE,KAAK,GAAKH,EACV,KAAK,KAAOC,EAAQ,KACpB,KAAK,OAAOG,EAAAF,EAAQ,WAAW,IAAI,2BAA2B,IAAlD,YAAAE,EAAqD,OAAQ,GAEzE,MAAMC,EAAYH,EAAQ,WAAW,IAAI,8BA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