@kosdev-code/kos-dispense-sdk 2.1.17 → 2.1.18

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.
Files changed (35) hide show
  1. package/dispense-registration-manager-DDyKjPWB.cjs +2 -0
  2. package/dispense-registration-manager-DDyKjPWB.cjs.map +1 -0
  3. package/{dispense-registration-manager-CB_nSTZw.js → dispense-registration-manager-DgMTZL-g.js} +812 -713
  4. package/dispense-registration-manager-DgMTZL-g.js.map +1 -0
  5. package/{extension-utils-DUel3wIz.cjs → extension-utils-BceaRPqX.cjs} +2 -2
  6. package/{extension-utils-DUel3wIz.cjs.map → extension-utils-BceaRPqX.cjs.map} +1 -1
  7. package/{extension-utils-CkYqorcG.js → extension-utils-mvxA4D4h.js} +2 -2
  8. package/{extension-utils-CkYqorcG.js.map → extension-utils-mvxA4D4h.js.map} +1 -1
  9. package/index.cjs +1 -1
  10. package/index.js +3 -3
  11. package/models/models/assembly/assembly-model.d.ts.map +1 -1
  12. package/models/models/assembly/pump-utils.d.ts.map +1 -1
  13. package/models/models/generic-pour/generic-pour-model.d.ts +10 -5
  14. package/models/models/generic-pour/generic-pour-model.d.ts.map +1 -1
  15. package/models/models/nozzle/nozzle-model.d.ts +10 -6
  16. package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
  17. package/models/models/pump/pump-model.d.ts.map +1 -1
  18. package/models/models/pump/types/index.d.ts +4 -0
  19. package/models/models/types/assembly.d.ts +4 -0
  20. package/models/models/types/assembly.d.ts.map +1 -1
  21. package/models/models/types/pouring.d.ts +1 -3
  22. package/models/models/types/pouring.d.ts.map +1 -1
  23. package/models/utils/service.d.ts +8 -8
  24. package/models.cjs +1 -1
  25. package/models.js +2 -2
  26. package/package.json +2 -2
  27. package/{pump-provider-86479YU2.cjs → pump-provider-BSdtHuOD.cjs} +2 -2
  28. package/{pump-provider-86479YU2.cjs.map → pump-provider-BSdtHuOD.cjs.map} +1 -1
  29. package/{pump-provider-DSyiDoPF.js → pump-provider-C-Zclv9X.js} +2 -2
  30. package/{pump-provider-DSyiDoPF.js.map → pump-provider-C-Zclv9X.js.map} +1 -1
  31. package/ui.cjs +1 -1
  32. package/ui.js +2 -2
  33. package/dispense-registration-manager-BZ5L3AWX.cjs +0 -2
  34. package/dispense-registration-manager-BZ5L3AWX.cjs.map +0 -1
  35. package/dispense-registration-manager-CB_nSTZw.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"extension-utils-DUel3wIz.cjs","sources":["../../../../packages/sdk/kos-dispense-sdk/src/models/models/holder/utils/holder-utils.ts","../../../../packages/sdk/kos-dispense-sdk/src/models/utils/extension-utils.ts"],"sourcesContent":["import { kosAutoEffect } from \"@kosdev-code/kos-ui-sdk\";\nimport { useEffect, useState } from \"react\";\nimport type { HolderModel } from \"../types\";\n\nexport const getFuelGaugeValue = (holder: HolderModel) => {\n const [maxVolume, setMaxVolume] = useState<number>(\n holder?.slice?.maxVolMl ?? 0\n );\n const [remainingVolume, setRemainingVolume] = useState<number>(\n holder?.slice?.currentVolMl ?? 0\n );\n\n const [hasMaxVolume, setHasMaxVolume] = useState<boolean>(\n holder?.slice?.maxVolMl !== undefined\n );\n\n const [hasRemainingVolume, setHasRemainingVolume] = useState<boolean>(\n holder?.slice?.currentVolMl !== undefined\n );\n\n const [fillPercent, setFillPercent] = useState<number>(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n\n const [hasFuelGuage, setHasFuelGuage] = useState<boolean>(\n hasMaxVolume && hasRemainingVolume\n );\n\n useEffect(() => {\n const disposer = kosAutoEffect(() => {\n setMaxVolume(holder?.slice?.maxVolMl ?? 0);\n setRemainingVolume(holder?.slice?.currentVolMl ?? 0);\n setHasMaxVolume(holder?.slice?.maxVolMl !== undefined);\n setHasRemainingVolume(holder?.slice?.currentVolMl !== undefined);\n setFillPercent(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n setHasFuelGuage(hasMaxVolume && hasRemainingVolume);\n });\n\n return () => {\n disposer();\n };\n }, [holder]);\n\n return { maxVolume, remainingVolume, fillPercent, hasFuelGuage };\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n CoreExtensionManager,\n DataLoader,\n DataMapper,\n EXTENSION_FEATURE_FLAG_RESOLVER,\n ExtensionManager,\n IndexExtension,\n PropertyMapper,\n type FlagResolver,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { ExtensionType } from \"../constants\";\nimport { AssemblyTypes, type AssemblyModel } from \"../models\";\nimport type { HolderResponse } from \"../models/holder/services\";\nimport type { HolderModel } from \"../models/holder/types\";\nimport type { IngredientResponse } from \"../models/ingredient/services\";\nimport type { BeverageResponse } from \"../models/nozzle/services\";\nimport type { SelectedPourable } from \"../models/nozzle/types\";\n\nexport type IngredientDataMapper<\n AdditionalData extends object = Record<string, any>\n> = DataMapper<IngredientResponse, AdditionalData, any>;\n\n/**\n * Mapping function that maps an ingredient response into the type property of\n * the {@link IngredientModel}.\n */\nexport type IngredientTypeMapper<\n T extends IngredientResponse = IngredientResponse\n> = PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderTypeMapper<T extends HolderResponse = HolderResponse> =\n PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderDataMapper<\n AdditionalData extends object = Record<string, any>,\n HolderData extends HolderResponse = HolderResponse\n> = DataMapper<HolderData, AdditionalData, any>;\n\nexport type GroupBeverageResponse = BeverageResponse & { groupId: string };\nexport type AvailabilityDataMapper<\n AdditionalData extends object = Record<string, any>,\n AvailabilityData extends GroupBeverageResponse = GroupBeverageResponse\n> = DataMapper<AvailabilityData, AdditionalData, any>;\n\nexport type SelectedPourableMapper = DataMapper<SelectedPourable, any>;\n\nexport type BoardDataMapper<\n AdditionalData extends object = Record<string, any>,\n BoardData extends AssemblyTypes.AssemblyBoard<any> = AssemblyTypes.AssemblyBoard<any>\n> = DataMapper<BoardData, AdditionalData, any>;\n\nexport type AssemblyMapper<\n AdditionalData extends object = Record<string, any>,\n AssemblyResponseData extends AssemblyTypes.AssemblyResponse<any> = AssemblyTypes.AssemblyResponse<any>\n> = DataMapper<AssemblyResponseData, AdditionalData, any>;\n/**\n * The DispenseExtensionManager is responsible for managing the extension points that are specific to the Dispense application.\n */\nexport class DispenseExtensionManager {\n core: CoreExtensionManager = new CoreExtensionManager();\n /**\n * Maps data into the {@link IngredientModel}\n *\n * It is common for the ingredient data provided by the ingredient service to be augmented with additional properties that are\n * not provided by the base KOS Ingredient model. The {@link IngredientMapper} extension point allows for the data to be mapped\n * into the {@link IngredientModel} and the {@link IngredientModel.data} property to be augmented with additional properties.\n *\n * @example\n * The following example shows how to map the data from the service response into the {@link IngredientModel}.\n * The context is provided by the {@link IngredientLoader} extension point with its data being used to optionally augment the\n * ingredient data.\n *\n * The result of the mapping will be available in the `data` property of the {@link IngredientModel}.\n *\n * In this case the `IngedientReponseData` interface represents the data being returned by the ingredient service and the\n * `IngredientData` interface represents the data that will be available in the {@link IngredientModel.data} property. The `ingredientDataMapper`\n * is responsible for mapping from one format to the other.\n *\n * ```typescript\n *\n * interface IngredientResponseData extends NozzleServices.IngredientResponse {\n * chilled: boolean;\n * carbonated: boolean;\n * highYield: boolean;\n * }\n *\n * interface IngredientData {\n * chilled: boolean;\n * carbonated: boolean;\n * highYield: boolean;\n * }\n *\n * export const ingredientDataMapper = async (\n * data: IngredientResponseData,\n * context: IngredientContext\n * ): Promise<IngredientData> => {\n * return {\n * chilled: data.chilled,\n * carbonated: data.carbonated,\n * highYield: data.highYield,\n * }\n * }\n * ```\n * */\n registerIngredientDataMapper(ingredientDataMapper: IngredientDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.IngredientMapper,\n ingredientDataMapper\n );\n\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link IngredientMapper}\n *\n * @example\n * The following example shows how to load the brandset data, normalize it into a map and then provide it back to the framework\n * where it can be used by the other extension points.\n *\n * In the ingredient container model, the data is provided to the {@link IngredientMapper} extension point in order to augment ingredient data\n * and also loaded into the ingredient container model context in order to make the data available throughout the code.\n *\n * ```typescript\n * export const ingredientContextLoader = async (): Promise<BeverageContext> => {\n * const response = await kosFetch('kos:/system/some/ingredient/endpoint.json');\n *\n * if (response.status !== 200) {\n * KosLog.error('Failed to load ingredient data');\n * return {};\n * }\n * const json = await response.json();\n * return json;\n * };\n * ```\n * */\n registerIngredientLoader(ingredientLoader: DataLoader) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.IngredientLoader,\n ingredientLoader\n );\n return this;\n }\n\n registerIngredientIndex(ingredientIndex: IndexExtension) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.IngredientIndex,\n ingredientIndex\n );\n return this;\n }\n\n /**\n * Registers a data mapper for the {@link IngredientModel}\n * */\n registerIngredientTypeMapper(ingredientTypeMapper: IngredientTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.IngredientTypeMapper,\n ingredientTypeMapper\n );\n return this;\n }\n\n /**\n * Registers a data mapper for the {@link HolderModel} model.\n * @param holderDataMapper - Mapping function that maps additional data from holder service response\n * @returns\n */\n registerHolderDataMapper(holderDataMapper: HolderDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.HolderMapper,\n holderDataMapper\n );\n return this;\n }\n\n registerHolderTypeMapper(holderTypeMapper: HolderTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper\n );\n return this;\n }\n\n /**\n * Maps the ingredientId property of the holder into the {@link HolderModel}.\n * If not provided, the ingredientId will assume that the value is mapped from the\n * ingredientId property of the service response.\n * */\n registerHolderIngredientMapper(holderTypeMapper: HolderTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper\n );\n return this;\n }\n\n registerHolderIndex<T extends HolderModel = HolderModel>(\n holderIndex: IndexExtension<T>\n ) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.HolderIndex,\n holderIndex\n );\n return this;\n }\n\n /**\n * Maps data into the {@link AvailabilityModel}\n *\n * @example\n * The following example shows how to map the data from the service response into the {@link AvailabilityModel}.\n * The context is provided by the {@link AvailabilityLoader} extension point with its data being used to augment the\n * availability data.\n *\n * The result of the mapping will be available in the `data` property of the {@link AvailabilityModel}.\n *\n * ```typescript\n * export const beverageDataMapper = async (\n * data: NozzleServices.BeverageResponse,\n * context: BeverageContext\n * ): Promise<BeverageData> => {\n * const id = data.altId;\n * const iconUrl = encodeURI(\n * `http://localhost:8081/system/brandset/${context?.[id]?.icon}`\n * );\n * const cuiColorCode = context?.[id]?.cuiColorCode\n * ? context?.[id]?.cuiColorCode\n * : '';\n * return { iconUrl, cuiColorCode };\n * };\n * ```\n * */\n registerAvailabilityDataMapper(availabilityMapper: AvailabilityDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AvailabilityMapper,\n availabilityMapper\n );\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link AvailabilityMapper}\n *\n * @example\n * A common use case is to load brandset data that is UI specific and not provided directly by the Java service.\n *\n * The following example shows how to load the brandset data, normalize it into a map and then provide it back to the framework\n * where it can be used by the other extension points.\n *\n * In the nozzle model, the data is provided to the {@link AvailabilityMapper} extension point in order to augment availability data\n * and also loaded into the nozzle model context in order to make the data available throughout the code.\n *\n * ```typescript\n * export const beverageContextLoader = async (): Promise<BeverageContext> => {\n * const response = await kosFetch('kos:/system/brandset/brandset.json');\n *\n * if (response.status !== 200) {\n * KosLog.error('Failed to load beverage data');\n * return {};\n * }\n * const json: BrandsetResponse | null = await response.json();\n * const initialBeverages: Record<string, BrandsetIngredient> = {};\n * const beverages = json?.ingredients?.reduce((acc, beverage) => {\n * acc[beverage.ingredientId] = beverage;\n * return acc;\n * }, initialBeverages);\n * return beverages;\n * };\n * ```\n * */\n registerAvailabilityLoader(availabilityLoader: DataLoader) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.AvailabilityLoader,\n availabilityLoader\n );\n return this;\n }\n\n /**\n * Maps the abstract {@link SelectedPourable} data into a format that is specific to the nozzle.\n * */\n registerSelectedPourableDataMapper(\n selectedPourableMapper: SelectedPourableMapper\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.SelectedPourableMapper,\n selectedPourableMapper\n );\n return this;\n }\n\n /**\n * Maps data into the {@link AssemblyModel} data.\n * Used in cases where the base assembly has been extended with additional properties in the backend. This extension\n * point allows for the data to be mapped into the {@link AssemblyModel} and augmented with additional properties.\n *\n * @example\n *\n * In this example of an implementation of a {@link AssemblyMapper}, the {@link AssemblyResponse} data is mapped into\n * a {@link FreestyleAssembly} object.\n *\n * The {@link FreestyleAssemblyResponse} interface represents the additional data being returned by the assembly service and is\n * merged into the {@link AssemblyResponse} interface.\n *\n * The {@link FreestyleAssembly} interface represents the additional data, beyond the base data set, that will be merged into the {@link AssemblyModel}.\n *\n * The mapper is responsible for mapping from the {@link FreestyleAssemblyResponse} format to the {@link FreestyleAssembly} format.\n * ```typescript\n * import { AssemblyTypes } from \"@kosdev-code/kos-dispense-sdk\";\n * import { DataMapper } from \"@kosdev-code/kos-ui-sdk\";\n *\n * // define the additional data being returned by the assembly service\n * export interface FreestyleAssemblyResponse {\n * iceAgitator?: {\n * name: \"iceAgitator\";\n * path: string;\n * };\n * }\n *\n * // define the additional data structure that will be merged into the assembly model\n * export interface FreestyleAssembly {\n * iceAgitator: {\n * path: string;\n * };\n * carbAgitator: {\n * path: string;\n * };\n * }\n *\n *\n * // define the mapper that will map the data from the service response into the additional data structure\n * // that will be merged into the assembly model.\n * // In this case the mapper is responsible for mapping from the {@link FreestyleAssemblyResponse} format to the {@link FreestyleAssembly} format.\n * export const assemblyDataMapper: DataMapper<\n * AssemblyTypes.AssemblyResponse<FreestyleAssemblyResponse>,\n * FreestyleAssembly\n * > = async (data) => {\n * const response = data.assemblies.reduce((acc, assembly) => {\n * const agitatorKeys = [\"iceAgitator\", \"carbAgitator\"];\n * agitatorKeys.forEach((key) => {\n * const agitator = assembly[key];\n * if (agitator) {\n * acc[key] = agitator;\n * }\n * });\n *\n * return acc;\n * }, {} as FreestyleAssembly);\n * return response;\n * };\n *```\n */\n registerAssemblyDataMapper(assemblyDataMapper: AssemblyMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AssemblyMapper,\n assemblyDataMapper\n );\n return this;\n }\n\n registerBoardIndex(boardIndex: IndexExtension) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.BoardIndex,\n boardIndex\n );\n return this;\n }\n\n registerBoardDataMapper(boardDataMapper: BoardDataMapper<any, any>) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.BoardMapper,\n boardDataMapper\n );\n return this;\n }\n\n registerAssemblyFeatureFlagResolver(\n assemblyFeatureFlagResolver: FlagResolver<AssemblyModel>\n ) {\n ExtensionManager[EXTENSION_FEATURE_FLAG_RESOLVER]?.register(\n ExtensionType.AssemblyFeatureFlags,\n assemblyFeatureFlagResolver\n );\n return this;\n }\n}\n\n/**\n * The KosExtensionManager provides access to the extension points that are provided in the SDK for Dispense applications.\n *\n * The extension points are divided into two categories:\n *\n * @param core - The core extension {@link CoreExtensionManager} points are used to extend the base models that are provided by the SDK.\n * @param dispense - The dispense extension {@link DispenseExtensionManager} points are used to extend the models that are specific to the Dispense SDK.\n */\nexport class KosExtensionManager {\n dispense: DispenseExtensionManager;\n core: CoreExtensionManager;\n constructor() {\n this.dispense = new DispenseExtensionManager();\n this.core = new CoreExtensionManager();\n }\n}\n"],"names":["getFuelGaugeValue","holder","maxVolume","setMaxVolume","useState","_a","remainingVolume","setRemainingVolume","_b","hasMaxVolume","setHasMaxVolume","_c","hasRemainingVolume","setHasRemainingVolume","_d","fillPercent","setFillPercent","hasFuelGuage","setHasFuelGuage","useEffect","disposer","kosAutoEffect","DispenseExtensionManager","__publicField","CoreExtensionManager","ingredientDataMapper","ExtensionManager","ExtensionType","ingredientLoader","ingredientIndex","ingredientTypeMapper","holderDataMapper","holderTypeMapper","holderIndex","availabilityMapper","availabilityLoader","selectedPourableMapper","assemblyDataMapper","boardIndex","boardDataMapper","assemblyFeatureFlagResolver","EXTENSION_FEATURE_FLAG_RESOLVER","KosExtensionManager"],"mappings":"sgDAIaA,EAAqBC,GAAwB,aACxD,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAAA,WAChCC,EAAAJ,GAAA,YAAAA,EAAQ,QAAR,YAAAI,EAAe,WAAY,CAAA,EAEvB,CAACC,EAAiBC,CAAkB,EAAIH,EAAAA,WAC5CI,EAAAP,GAAA,YAAAA,EAAQ,QAAR,YAAAO,EAAe,eAAgB,CAAA,EAG3B,CAACC,EAAcC,CAAe,EAAIN,EAAAA,WACtCO,EAAAV,GAAA,YAAAA,EAAQ,QAAR,YAAAU,EAAe,YAAa,MAAA,EAGxB,CAACC,EAAoBC,CAAqB,EAAIT,EAAAA,WAClDU,EAAAb,GAAA,YAAAA,EAAQ,QAAR,YAAAa,EAAe,gBAAiB,MAAA,EAG5B,CAACC,EAAaC,CAAc,EAAIZ,EAAAA,SACpCE,GAAmB,EACf,EACA,KAAK,OAAQA,GAAmB,IAAMJ,GAAa,GAAM,GAAG,CAAA,EAG5D,CAACe,EAAcC,CAAe,EAAId,EAAAA,SACtCK,GAAgBG,CAAA,EAGlBO,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAWC,EAAAA,cAAc,IAAM,aACnClB,IAAaE,EAAAJ,GAAA,YAAAA,EAAQ,QAAR,YAAAI,EAAe,WAAY,CAAC,EACzCE,IAAmBC,EAAAP,GAAA,YAAAA,EAAQ,QAAR,YAAAO,EAAe,eAAgB,CAAC,EACnDE,IAAgBC,EAAAV,GAAA,YAAAA,EAAQ,QAAR,YAAAU,EAAe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AAA,cAAc,YACdM,CAAA,EAEK,IACT,CA4BA,+BAA+BC,EAA4C,CACzER,OAAAA,EAAAA,iBAAiB,WAAW,mBAC1BC,EAAAA,cAAc,mBACdO,CAAA,EAEK,IACT,CAgCA,2BAA2BC,EAAgC,CACzDT,OAAAA,EAAAA,iBAAiB,OAAO,eACtBC,EAAAA,cAAc,mBACdQ,CAAA,EAEK,IACT,CAKA,mCACEC,EACA,CACAV,OAAAA,EAAAA,iBAAiB,WAAW,mBAC1BC,EAAAA,cAAc,uBACdS,CAAA,EAEK,IACT,CA+DA,2BAA2BC,EAAoC,CAC7DX,OAAAA,EAAAA,iBAAiB,WAAW,mBAC1BC,EAAAA,cAAc,eACdU,CAAA,EAEK,IACT,CAEA,mBAAmBC,EAA4B,CAC7CZ,OAAAA,EAAAA,iBAAiB,eAAe,uBAC9BC,EAAAA,cAAc,WACdW,CAAA,EAEK,IACT,CAEA,wBAAwBC,EAA4C,CAClEb,OAAAA,EAAAA,iBAAiB,WAAW,mBAC1BC,EAAAA,cAAc,YACdY,CAAA,EAEK,IACT,CAEA,oCACEC,EACA,OACAd,OAAAA,EAAAA,EAAAA,iBAAiBe,EAAAA,+BAA+B,IAAhDf,MAAAA,EAAmD,SACjDC,EAAAA,cAAc,qBACda,GAEK,IACT,CACF,CAUO,MAAME,CAAoB,CAG/B,aAAc,CAFdnB,EAAA,iBACAA,EAAA,aAEE,KAAK,SAAW,IAAID,EACpB,KAAK,KAAO,IAAIE,sBAClB,CACF"}
1
+ {"version":3,"file":"extension-utils-BceaRPqX.cjs","sources":["../../../../packages/sdk/kos-dispense-sdk/src/models/models/holder/utils/holder-utils.ts","../../../../packages/sdk/kos-dispense-sdk/src/models/utils/extension-utils.ts"],"sourcesContent":["import { kosAutoEffect } from \"@kosdev-code/kos-ui-sdk\";\nimport { useEffect, useState } from \"react\";\nimport type { HolderModel } from \"../types\";\n\nexport const getFuelGaugeValue = (holder: HolderModel) => {\n const [maxVolume, setMaxVolume] = useState<number>(\n holder?.slice?.maxVolMl ?? 0\n );\n const [remainingVolume, setRemainingVolume] = useState<number>(\n holder?.slice?.currentVolMl ?? 0\n );\n\n const [hasMaxVolume, setHasMaxVolume] = useState<boolean>(\n holder?.slice?.maxVolMl !== undefined\n );\n\n const [hasRemainingVolume, setHasRemainingVolume] = useState<boolean>(\n holder?.slice?.currentVolMl !== undefined\n );\n\n const [fillPercent, setFillPercent] = useState<number>(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n\n const [hasFuelGuage, setHasFuelGuage] = useState<boolean>(\n hasMaxVolume && hasRemainingVolume\n );\n\n useEffect(() => {\n const disposer = kosAutoEffect(() => {\n setMaxVolume(holder?.slice?.maxVolMl ?? 0);\n setRemainingVolume(holder?.slice?.currentVolMl ?? 0);\n setHasMaxVolume(holder?.slice?.maxVolMl !== undefined);\n setHasRemainingVolume(holder?.slice?.currentVolMl !== undefined);\n setFillPercent(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n setHasFuelGuage(hasMaxVolume && hasRemainingVolume);\n });\n\n return () => {\n disposer();\n };\n }, [holder]);\n\n return { maxVolume, remainingVolume, fillPercent, hasFuelGuage };\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n CoreExtensionManager,\n DataLoader,\n DataMapper,\n EXTENSION_FEATURE_FLAG_RESOLVER,\n ExtensionManager,\n IndexExtension,\n PropertyMapper,\n type FlagResolver,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { ExtensionType } from \"../constants\";\nimport { AssemblyTypes, type AssemblyModel } from \"../models\";\nimport type { HolderResponse } from \"../models/holder/services\";\nimport type { HolderModel } from \"../models/holder/types\";\nimport type { IngredientResponse } from \"../models/ingredient/services\";\nimport type { BeverageResponse } from \"../models/nozzle/services\";\nimport type { SelectedPourable } from \"../models/nozzle/types\";\n\nexport type IngredientDataMapper<\n AdditionalData extends object = Record<string, any>\n> = DataMapper<IngredientResponse, AdditionalData, any>;\n\n/**\n * Mapping function that maps an ingredient response into the type property of\n * the {@link IngredientModel}.\n */\nexport type IngredientTypeMapper<\n T extends IngredientResponse = IngredientResponse\n> = PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderTypeMapper<T extends HolderResponse = HolderResponse> =\n PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderDataMapper<\n AdditionalData extends object = Record<string, any>,\n HolderData extends HolderResponse = HolderResponse\n> = DataMapper<HolderData, AdditionalData, any>;\n\nexport type GroupBeverageResponse = BeverageResponse & { groupId: string };\nexport type AvailabilityDataMapper<\n AdditionalData extends object = Record<string, any>,\n AvailabilityData extends GroupBeverageResponse = GroupBeverageResponse\n> = DataMapper<AvailabilityData, AdditionalData, any>;\n\nexport type SelectedPourableMapper = DataMapper<SelectedPourable, any>;\n\nexport type BoardDataMapper<\n AdditionalData extends object = Record<string, any>,\n BoardData extends AssemblyTypes.AssemblyBoard<any> = AssemblyTypes.AssemblyBoard<any>\n> = DataMapper<BoardData, AdditionalData, any>;\n\nexport type AssemblyMapper<\n AdditionalData extends object = Record<string, any>,\n AssemblyResponseData extends AssemblyTypes.AssemblyResponse<any> = AssemblyTypes.AssemblyResponse<any>\n> = DataMapper<AssemblyResponseData, AdditionalData, any>;\n/**\n * The DispenseExtensionManager is responsible for managing the extension points that are specific to the Dispense application.\n */\nexport class DispenseExtensionManager {\n core: CoreExtensionManager = new CoreExtensionManager();\n /**\n * Maps data into the {@link IngredientModel}\n *\n * It is common for the ingredient data provided by the ingredient service to be augmented with additional properties that are\n * not provided by the base KOS Ingredient model. The {@link IngredientMapper} extension point allows for the data to be mapped\n * into the {@link IngredientModel} and the {@link IngredientModel.data} property to be augmented with additional properties.\n *\n * @example\n * The following example shows how to map the data from the service response into the {@link IngredientModel}.\n * The context is provided by the {@link IngredientLoader} extension point with its data being used to optionally augment the\n * ingredient data.\n *\n * The result of the mapping will be available in the `data` property of the {@link IngredientModel}.\n *\n * In this case the `IngedientReponseData` interface represents the data being returned by the ingredient service and the\n * `IngredientData` interface represents the data that will be available in the {@link IngredientModel.data} property. The `ingredientDataMapper`\n * is responsible for mapping from one format to the other.\n *\n * ```typescript\n *\n * interface IngredientResponseData extends NozzleServices.IngredientResponse {\n * chilled: boolean;\n * carbonated: boolean;\n * highYield: boolean;\n * }\n *\n * interface IngredientData {\n * chilled: boolean;\n * carbonated: boolean;\n * highYield: boolean;\n * }\n *\n * export const ingredientDataMapper = async (\n * data: IngredientResponseData,\n * context: IngredientContext\n * ): Promise<IngredientData> => {\n * return {\n * chilled: data.chilled,\n * carbonated: data.carbonated,\n * highYield: data.highYield,\n * }\n * }\n * ```\n * */\n registerIngredientDataMapper(ingredientDataMapper: IngredientDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.IngredientMapper,\n ingredientDataMapper\n );\n\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link IngredientMapper}\n *\n * @example\n * The following example shows how to load the brandset data, normalize it into a map and then provide it back to the framework\n * where it can be used by the other extension points.\n *\n * In the ingredient container model, the data is provided to the {@link IngredientMapper} extension point in order to augment ingredient data\n * and also loaded into the ingredient container model context in order to make the data available throughout the code.\n *\n * ```typescript\n * export const ingredientContextLoader = async (): Promise<BeverageContext> => {\n * const response = await kosFetch('kos:/system/some/ingredient/endpoint.json');\n *\n * if (response.status !== 200) {\n * KosLog.error('Failed to load ingredient data');\n * return {};\n * }\n * const json = await response.json();\n * return json;\n * };\n * ```\n * */\n registerIngredientLoader(ingredientLoader: DataLoader) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.IngredientLoader,\n ingredientLoader\n );\n return this;\n }\n\n registerIngredientIndex(ingredientIndex: IndexExtension) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.IngredientIndex,\n ingredientIndex\n );\n return this;\n }\n\n /**\n * Registers a data mapper for the {@link IngredientModel}\n * */\n registerIngredientTypeMapper(ingredientTypeMapper: IngredientTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.IngredientTypeMapper,\n ingredientTypeMapper\n );\n return this;\n }\n\n /**\n * Registers a data mapper for the {@link HolderModel} model.\n * @param holderDataMapper - Mapping function that maps additional data from holder service response\n * @returns\n */\n registerHolderDataMapper(holderDataMapper: HolderDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.HolderMapper,\n holderDataMapper\n );\n return this;\n }\n\n registerHolderTypeMapper(holderTypeMapper: HolderTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper\n );\n return this;\n }\n\n /**\n * Maps the ingredientId property of the holder into the {@link HolderModel}.\n * If not provided, the ingredientId will assume that the value is mapped from the\n * ingredientId property of the service response.\n * */\n registerHolderIngredientMapper(holderTypeMapper: HolderTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper\n );\n return this;\n }\n\n registerHolderIndex<T extends HolderModel = HolderModel>(\n holderIndex: IndexExtension<T>\n ) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.HolderIndex,\n holderIndex\n );\n return this;\n }\n\n /**\n * Maps data into the {@link AvailabilityModel}\n *\n * @example\n * The following example shows how to map the data from the service response into the {@link AvailabilityModel}.\n * The context is provided by the {@link AvailabilityLoader} extension point with its data being used to augment the\n * availability data.\n *\n * The result of the mapping will be available in the `data` property of the {@link AvailabilityModel}.\n *\n * ```typescript\n * export const beverageDataMapper = async (\n * data: NozzleServices.BeverageResponse,\n * context: BeverageContext\n * ): Promise<BeverageData> => {\n * const id = data.altId;\n * const iconUrl = encodeURI(\n * `http://localhost:8081/system/brandset/${context?.[id]?.icon}`\n * );\n * const cuiColorCode = context?.[id]?.cuiColorCode\n * ? context?.[id]?.cuiColorCode\n * : '';\n * return { iconUrl, cuiColorCode };\n * };\n * ```\n * */\n registerAvailabilityDataMapper(availabilityMapper: AvailabilityDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AvailabilityMapper,\n availabilityMapper\n );\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link AvailabilityMapper}\n *\n * @example\n * A common use case is to load brandset data that is UI specific and not provided directly by the Java service.\n *\n * The following example shows how to load the brandset data, normalize it into a map and then provide it back to the framework\n * where it can be used by the other extension points.\n *\n * In the nozzle model, the data is provided to the {@link AvailabilityMapper} extension point in order to augment availability data\n * and also loaded into the nozzle model context in order to make the data available throughout the code.\n *\n * ```typescript\n * export const beverageContextLoader = async (): Promise<BeverageContext> => {\n * const response = await kosFetch('kos:/system/brandset/brandset.json');\n *\n * if (response.status !== 200) {\n * KosLog.error('Failed to load beverage data');\n * return {};\n * }\n * const json: BrandsetResponse | null = await response.json();\n * const initialBeverages: Record<string, BrandsetIngredient> = {};\n * const beverages = json?.ingredients?.reduce((acc, beverage) => {\n * acc[beverage.ingredientId] = beverage;\n * return acc;\n * }, initialBeverages);\n * return beverages;\n * };\n * ```\n * */\n registerAvailabilityLoader(availabilityLoader: DataLoader) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.AvailabilityLoader,\n availabilityLoader\n );\n return this;\n }\n\n /**\n * Maps the abstract {@link SelectedPourable} data into a format that is specific to the nozzle.\n * */\n registerSelectedPourableDataMapper(\n selectedPourableMapper: SelectedPourableMapper\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.SelectedPourableMapper,\n selectedPourableMapper\n );\n return this;\n }\n\n /**\n * Maps data into the {@link AssemblyModel} data.\n * Used in cases where the base assembly has been extended with additional properties in the backend. This extension\n * point allows for the data to be mapped into the {@link AssemblyModel} and augmented with additional properties.\n *\n * @example\n *\n * In this example of an implementation of a {@link AssemblyMapper}, the {@link AssemblyResponse} data is mapped into\n * a {@link FreestyleAssembly} object.\n *\n * The {@link FreestyleAssemblyResponse} interface represents the additional data being returned by the assembly service and is\n * merged into the {@link AssemblyResponse} interface.\n *\n * The {@link FreestyleAssembly} interface represents the additional data, beyond the base data set, that will be merged into the {@link AssemblyModel}.\n *\n * The mapper is responsible for mapping from the {@link FreestyleAssemblyResponse} format to the {@link FreestyleAssembly} format.\n * ```typescript\n * import { AssemblyTypes } from \"@kosdev-code/kos-dispense-sdk\";\n * import { DataMapper } from \"@kosdev-code/kos-ui-sdk\";\n *\n * // define the additional data being returned by the assembly service\n * export interface FreestyleAssemblyResponse {\n * iceAgitator?: {\n * name: \"iceAgitator\";\n * path: string;\n * };\n * }\n *\n * // define the additional data structure that will be merged into the assembly model\n * export interface FreestyleAssembly {\n * iceAgitator: {\n * path: string;\n * };\n * carbAgitator: {\n * path: string;\n * };\n * }\n *\n *\n * // define the mapper that will map the data from the service response into the additional data structure\n * // that will be merged into the assembly model.\n * // In this case the mapper is responsible for mapping from the {@link FreestyleAssemblyResponse} format to the {@link FreestyleAssembly} format.\n * export const assemblyDataMapper: DataMapper<\n * AssemblyTypes.AssemblyResponse<FreestyleAssemblyResponse>,\n * FreestyleAssembly\n * > = async (data) => {\n * const response = data.assemblies.reduce((acc, assembly) => {\n * const agitatorKeys = [\"iceAgitator\", \"carbAgitator\"];\n * agitatorKeys.forEach((key) => {\n * const agitator = assembly[key];\n * if (agitator) {\n * acc[key] = agitator;\n * }\n * });\n *\n * return acc;\n * }, {} as FreestyleAssembly);\n * return response;\n * };\n *```\n */\n registerAssemblyDataMapper(assemblyDataMapper: AssemblyMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AssemblyMapper,\n assemblyDataMapper\n );\n return this;\n }\n\n registerBoardIndex(boardIndex: IndexExtension) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.BoardIndex,\n boardIndex\n );\n return this;\n }\n\n registerBoardDataMapper(boardDataMapper: BoardDataMapper<any, any>) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.BoardMapper,\n boardDataMapper\n );\n return this;\n }\n\n registerAssemblyFeatureFlagResolver(\n assemblyFeatureFlagResolver: FlagResolver<AssemblyModel>\n ) {\n ExtensionManager[EXTENSION_FEATURE_FLAG_RESOLVER]?.register(\n ExtensionType.AssemblyFeatureFlags,\n assemblyFeatureFlagResolver\n );\n return this;\n }\n}\n\n/**\n * The KosExtensionManager provides access to the extension points that are provided in the SDK for Dispense applications.\n *\n * The extension points are divided into two categories:\n *\n * @param core - The core extension {@link CoreExtensionManager} points are used to extend the base models that are provided by the SDK.\n * @param dispense - The dispense extension {@link DispenseExtensionManager} points are used to extend the models that are specific to the Dispense SDK.\n */\nexport class KosExtensionManager {\n dispense: DispenseExtensionManager;\n core: CoreExtensionManager;\n constructor() {\n this.dispense = new DispenseExtensionManager();\n this.core = new CoreExtensionManager();\n }\n}\n"],"names":["getFuelGaugeValue","holder","maxVolume","setMaxVolume","useState","_a","remainingVolume","setRemainingVolume","_b","hasMaxVolume","setHasMaxVolume","_c","hasRemainingVolume","setHasRemainingVolume","_d","fillPercent","setFillPercent","hasFuelGuage","setHasFuelGuage","useEffect","disposer","kosAutoEffect","DispenseExtensionManager","__publicField","CoreExtensionManager","ingredientDataMapper","ExtensionManager","ExtensionType","ingredientLoader","ingredientIndex","ingredientTypeMapper","holderDataMapper","holderTypeMapper","holderIndex","availabilityMapper","availabilityLoader","selectedPourableMapper","assemblyDataMapper","boardIndex","boardDataMapper","assemblyFeatureFlagResolver","EXTENSION_FEATURE_FLAG_RESOLVER","KosExtensionManager"],"mappings":"sgDAIaA,EAAqBC,GAAwB,aACxD,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAAA,WAChCC,EAAAJ,GAAA,YAAAA,EAAQ,QAAR,YAAAI,EAAe,WAAY,CAAA,EAEvB,CAACC,EAAiBC,CAAkB,EAAIH,EAAAA,WAC5CI,EAAAP,GAAA,YAAAA,EAAQ,QAAR,YAAAO,EAAe,eAAgB,CAAA,EAG3B,CAACC,EAAcC,CAAe,EAAIN,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,CAClEb,OAAAA,EAAAA,iBAAiB,WAAW,mBAC1BC,EAAAA,cAAc,YACdY,CAAA,EAEK,IACT,CAEA,oCACEC,EACA,OACAd,OAAAA,EAAAA,EAAAA,iBAAiBe,EAAAA,+BAA+B,IAAhDf,MAAAA,EAAmD,SACjDC,EAAAA,cAAc,qBACda,GAEK,IACT,CACF,CAUO,MAAME,CAAoB,CAG/B,aAAc,CAFdnB,EAAA,iBACAA,EAAA,aAEE,KAAK,SAAW,IAAID,EACpB,KAAK,KAAO,IAAIE,sBAClB,CACF"}
@@ -1,7 +1,7 @@
1
1
  var P = Object.defineProperty;
2
2
  var A = (r, e, s) => e in r ? P(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
3
3
  var p = (r, e, s) => (A(r, typeof e != "symbol" ? e + "" : e, s), s);
4
- import { m as T, n as j, o as D, p as H, q as F, s as L, t as z, u as R, v as $, w, x as B, y as G, z as N, F as K, J as k, L as q, M as C, O as J, E as t } from "./dispense-registration-manager-CB_nSTZw.js";
4
+ import { m as T, n as j, o as D, p as H, q as F, s as L, t as z, u as R, v as $, w, x as B, y as G, z as N, F as K, J as k, L as q, M as C, O as J, E as t } from "./dispense-registration-manager-DgMTZL-g.js";
5
5
  import { kosAutoEffect as U, CoreExtensionManager as y, ExtensionManager as a, EXTENSION_FEATURE_FLAG_RESOLVER as X } from "@kosdev-code/kos-ui-sdk";
6
6
  import { useState as n, useEffect as Q } from "react";
7
7
  const re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -378,4 +378,4 @@ export {
378
378
  oe as g,
379
379
  ae as i
380
380
  };
381
- //# sourceMappingURL=extension-utils-CkYqorcG.js.map
381
+ //# sourceMappingURL=extension-utils-mvxA4D4h.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension-utils-CkYqorcG.js","sources":["../../../../packages/sdk/kos-dispense-sdk/src/models/models/holder/utils/holder-utils.ts","../../../../packages/sdk/kos-dispense-sdk/src/models/utils/extension-utils.ts"],"sourcesContent":["import { kosAutoEffect } from \"@kosdev-code/kos-ui-sdk\";\nimport { useEffect, useState } from \"react\";\nimport type { HolderModel } from \"../types\";\n\nexport const getFuelGaugeValue = (holder: HolderModel) => {\n const [maxVolume, setMaxVolume] = useState<number>(\n holder?.slice?.maxVolMl ?? 0\n );\n const [remainingVolume, setRemainingVolume] = useState<number>(\n holder?.slice?.currentVolMl ?? 0\n );\n\n const [hasMaxVolume, setHasMaxVolume] = useState<boolean>(\n holder?.slice?.maxVolMl !== undefined\n );\n\n const [hasRemainingVolume, setHasRemainingVolume] = useState<boolean>(\n holder?.slice?.currentVolMl !== undefined\n );\n\n const [fillPercent, setFillPercent] = useState<number>(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n\n const [hasFuelGuage, setHasFuelGuage] = useState<boolean>(\n hasMaxVolume && hasRemainingVolume\n );\n\n useEffect(() => {\n const disposer = kosAutoEffect(() => {\n setMaxVolume(holder?.slice?.maxVolMl ?? 0);\n setRemainingVolume(holder?.slice?.currentVolMl ?? 0);\n setHasMaxVolume(holder?.slice?.maxVolMl !== undefined);\n setHasRemainingVolume(holder?.slice?.currentVolMl !== undefined);\n setFillPercent(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n setHasFuelGuage(hasMaxVolume && hasRemainingVolume);\n });\n\n return () => {\n disposer();\n };\n }, [holder]);\n\n return { maxVolume, remainingVolume, fillPercent, hasFuelGuage };\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n CoreExtensionManager,\n DataLoader,\n DataMapper,\n EXTENSION_FEATURE_FLAG_RESOLVER,\n ExtensionManager,\n IndexExtension,\n PropertyMapper,\n type FlagResolver,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { ExtensionType } from \"../constants\";\nimport { AssemblyTypes, type AssemblyModel } from \"../models\";\nimport type { HolderResponse } from \"../models/holder/services\";\nimport type { HolderModel } from \"../models/holder/types\";\nimport type { IngredientResponse } from \"../models/ingredient/services\";\nimport type { BeverageResponse } from \"../models/nozzle/services\";\nimport type { SelectedPourable } from \"../models/nozzle/types\";\n\nexport type IngredientDataMapper<\n AdditionalData extends object = Record<string, any>\n> = DataMapper<IngredientResponse, AdditionalData, any>;\n\n/**\n * Mapping function that maps an ingredient response into the type property of\n * the {@link IngredientModel}.\n */\nexport type IngredientTypeMapper<\n T extends IngredientResponse = IngredientResponse\n> = PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderTypeMapper<T extends HolderResponse = HolderResponse> =\n PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderDataMapper<\n AdditionalData extends object = Record<string, any>,\n HolderData extends HolderResponse = HolderResponse\n> = DataMapper<HolderData, AdditionalData, any>;\n\nexport type GroupBeverageResponse = BeverageResponse & { groupId: string };\nexport type AvailabilityDataMapper<\n AdditionalData extends object = Record<string, any>,\n AvailabilityData extends GroupBeverageResponse = GroupBeverageResponse\n> = DataMapper<AvailabilityData, AdditionalData, any>;\n\nexport type SelectedPourableMapper = DataMapper<SelectedPourable, any>;\n\nexport type BoardDataMapper<\n AdditionalData extends object = Record<string, any>,\n BoardData extends AssemblyTypes.AssemblyBoard<any> = AssemblyTypes.AssemblyBoard<any>\n> = DataMapper<BoardData, AdditionalData, any>;\n\nexport type AssemblyMapper<\n AdditionalData extends object = Record<string, any>,\n AssemblyResponseData extends AssemblyTypes.AssemblyResponse<any> = AssemblyTypes.AssemblyResponse<any>\n> = DataMapper<AssemblyResponseData, AdditionalData, any>;\n/**\n * The DispenseExtensionManager is responsible for managing the extension points that are specific to the Dispense application.\n */\nexport class DispenseExtensionManager {\n core: CoreExtensionManager = new CoreExtensionManager();\n /**\n * Maps data into the {@link IngredientModel}\n *\n * It is common for the ingredient data provided by the ingredient service to be augmented with additional properties that are\n * not provided by the base KOS Ingredient model. The {@link IngredientMapper} extension point allows for the data to be mapped\n * into the {@link IngredientModel} and the {@link IngredientModel.data} property to be augmented with additional properties.\n *\n * @example\n * The following example shows how to map the data from the service response into the {@link IngredientModel}.\n * The context is provided by the {@link IngredientLoader} extension point with its data being used to optionally augment the\n * ingredient data.\n *\n * The result of the mapping will be available in the `data` property of the {@link IngredientModel}.\n *\n * In this case the `IngedientReponseData` interface represents the data being returned by the ingredient service and the\n * `IngredientData` interface represents the data that will be available in the {@link IngredientModel.data} property. The `ingredientDataMapper`\n * is responsible for mapping from one format to the other.\n *\n * ```typescript\n *\n * interface IngredientResponseData extends NozzleServices.IngredientResponse {\n * chilled: boolean;\n * carbonated: boolean;\n * highYield: boolean;\n * }\n *\n * interface IngredientData {\n * chilled: boolean;\n * carbonated: boolean;\n * highYield: boolean;\n * }\n *\n * export const ingredientDataMapper = async (\n * data: IngredientResponseData,\n * context: IngredientContext\n * ): Promise<IngredientData> => {\n * return {\n * chilled: data.chilled,\n * carbonated: data.carbonated,\n * highYield: data.highYield,\n * }\n * }\n * ```\n * */\n registerIngredientDataMapper(ingredientDataMapper: IngredientDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.IngredientMapper,\n ingredientDataMapper\n );\n\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link IngredientMapper}\n *\n * @example\n * The following example shows how to load the brandset data, normalize it into a map and then provide it back to the framework\n * where it can be used by the other extension points.\n *\n * In the ingredient container model, the data is provided to the {@link IngredientMapper} extension point in order to augment ingredient data\n * and also loaded into the ingredient container model context in order to make the data available throughout the code.\n *\n * ```typescript\n * export const ingredientContextLoader = async (): Promise<BeverageContext> => {\n * const response = await kosFetch('kos:/system/some/ingredient/endpoint.json');\n *\n * if (response.status !== 200) {\n * KosLog.error('Failed to load ingredient data');\n * return {};\n * }\n * const json = await response.json();\n * return json;\n * };\n * ```\n * */\n registerIngredientLoader(ingredientLoader: DataLoader) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.IngredientLoader,\n ingredientLoader\n );\n return this;\n }\n\n registerIngredientIndex(ingredientIndex: IndexExtension) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.IngredientIndex,\n ingredientIndex\n );\n return this;\n }\n\n /**\n * Registers a data mapper for the {@link IngredientModel}\n * */\n registerIngredientTypeMapper(ingredientTypeMapper: IngredientTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.IngredientTypeMapper,\n ingredientTypeMapper\n );\n return this;\n }\n\n /**\n * Registers a data mapper for the {@link HolderModel} model.\n * @param holderDataMapper - Mapping function that maps additional data from holder service response\n * @returns\n */\n registerHolderDataMapper(holderDataMapper: HolderDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.HolderMapper,\n holderDataMapper\n );\n return this;\n }\n\n registerHolderTypeMapper(holderTypeMapper: HolderTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper\n );\n return this;\n }\n\n /**\n * Maps the ingredientId property of the holder into the {@link HolderModel}.\n * If not provided, the ingredientId will assume that the value is mapped from the\n * ingredientId property of the service response.\n * */\n registerHolderIngredientMapper(holderTypeMapper: HolderTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper\n );\n return this;\n }\n\n registerHolderIndex<T extends HolderModel = HolderModel>(\n holderIndex: IndexExtension<T>\n ) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.HolderIndex,\n holderIndex\n );\n return this;\n }\n\n /**\n * Maps data into the {@link AvailabilityModel}\n *\n * @example\n * The following example shows how to map the data from the service response into the {@link AvailabilityModel}.\n * The context is provided by the {@link AvailabilityLoader} extension point with its data being used to augment the\n * availability data.\n *\n * The result of the mapping will be available in the `data` property of the {@link AvailabilityModel}.\n *\n * ```typescript\n * export const beverageDataMapper = async (\n * data: NozzleServices.BeverageResponse,\n * context: BeverageContext\n * ): Promise<BeverageData> => {\n * const id = data.altId;\n * const iconUrl = encodeURI(\n * `http://localhost:8081/system/brandset/${context?.[id]?.icon}`\n * );\n * const cuiColorCode = context?.[id]?.cuiColorCode\n * ? context?.[id]?.cuiColorCode\n * : '';\n * return { iconUrl, cuiColorCode };\n * };\n * ```\n * */\n registerAvailabilityDataMapper(availabilityMapper: AvailabilityDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AvailabilityMapper,\n availabilityMapper\n );\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link AvailabilityMapper}\n *\n * @example\n * A common use case is to load brandset data that is UI specific and not provided directly by the Java service.\n *\n * The following example shows how to load the brandset data, normalize it into a map and then provide it back to the framework\n * where it can be used by the other extension points.\n *\n * In the nozzle model, the data is provided to the {@link AvailabilityMapper} extension point in order to augment availability data\n * and also loaded into the nozzle model context in order to make the data available throughout the code.\n *\n * ```typescript\n * export const beverageContextLoader = async (): Promise<BeverageContext> => {\n * const response = await kosFetch('kos:/system/brandset/brandset.json');\n *\n * if (response.status !== 200) {\n * KosLog.error('Failed to load beverage data');\n * return {};\n * }\n * const json: BrandsetResponse | null = await response.json();\n * const initialBeverages: Record<string, BrandsetIngredient> = {};\n * const beverages = json?.ingredients?.reduce((acc, beverage) => {\n * acc[beverage.ingredientId] = beverage;\n * return acc;\n * }, initialBeverages);\n * return beverages;\n * };\n * ```\n * */\n registerAvailabilityLoader(availabilityLoader: DataLoader) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.AvailabilityLoader,\n availabilityLoader\n );\n return this;\n }\n\n /**\n * Maps the abstract {@link SelectedPourable} data into a format that is specific to the nozzle.\n * */\n registerSelectedPourableDataMapper(\n selectedPourableMapper: SelectedPourableMapper\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.SelectedPourableMapper,\n selectedPourableMapper\n );\n return this;\n }\n\n /**\n * Maps data into the {@link AssemblyModel} data.\n * Used in cases where the base assembly has been extended with additional properties in the backend. This extension\n * point allows for the data to be mapped into the {@link AssemblyModel} and augmented with additional properties.\n *\n * @example\n *\n * In this example of an implementation of a {@link AssemblyMapper}, the {@link AssemblyResponse} data is mapped into\n * a {@link FreestyleAssembly} object.\n *\n * The {@link FreestyleAssemblyResponse} interface represents the additional data being returned by the assembly service and is\n * merged into the {@link AssemblyResponse} interface.\n *\n * The {@link FreestyleAssembly} interface represents the additional data, beyond the base data set, that will be merged into the {@link AssemblyModel}.\n *\n * The mapper is responsible for mapping from the {@link FreestyleAssemblyResponse} format to the {@link FreestyleAssembly} format.\n * ```typescript\n * import { AssemblyTypes } from \"@kosdev-code/kos-dispense-sdk\";\n * import { DataMapper } from \"@kosdev-code/kos-ui-sdk\";\n *\n * // define the additional data being returned by the assembly service\n * export interface FreestyleAssemblyResponse {\n * iceAgitator?: {\n * name: \"iceAgitator\";\n * path: string;\n * };\n * }\n *\n * // define the additional data structure that will be merged into the assembly model\n * export interface FreestyleAssembly {\n * iceAgitator: {\n * path: string;\n * };\n * carbAgitator: {\n * path: string;\n * };\n * }\n *\n *\n * // define the mapper that will map the data from the service response into the additional data structure\n * // that will be merged into the assembly model.\n * // In this case the mapper is responsible for mapping from the {@link FreestyleAssemblyResponse} format to the {@link FreestyleAssembly} format.\n * export const assemblyDataMapper: DataMapper<\n * AssemblyTypes.AssemblyResponse<FreestyleAssemblyResponse>,\n * FreestyleAssembly\n * > = async (data) => {\n * const response = data.assemblies.reduce((acc, assembly) => {\n * const agitatorKeys = [\"iceAgitator\", \"carbAgitator\"];\n * agitatorKeys.forEach((key) => {\n * const agitator = assembly[key];\n * if (agitator) {\n * acc[key] = agitator;\n * }\n * });\n *\n * return acc;\n * }, {} as FreestyleAssembly);\n * return response;\n * };\n *```\n */\n registerAssemblyDataMapper(assemblyDataMapper: AssemblyMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AssemblyMapper,\n assemblyDataMapper\n );\n return this;\n }\n\n registerBoardIndex(boardIndex: IndexExtension) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.BoardIndex,\n boardIndex\n );\n return this;\n }\n\n registerBoardDataMapper(boardDataMapper: BoardDataMapper<any, any>) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.BoardMapper,\n boardDataMapper\n );\n return this;\n }\n\n registerAssemblyFeatureFlagResolver(\n assemblyFeatureFlagResolver: FlagResolver<AssemblyModel>\n ) {\n ExtensionManager[EXTENSION_FEATURE_FLAG_RESOLVER]?.register(\n ExtensionType.AssemblyFeatureFlags,\n assemblyFeatureFlagResolver\n );\n return this;\n }\n}\n\n/**\n * The KosExtensionManager provides access to the extension points that are provided in the SDK for Dispense applications.\n *\n * The extension points are divided into two categories:\n *\n * @param core - The core extension {@link CoreExtensionManager} points are used to extend the base models that are provided by the SDK.\n * @param dispense - The dispense extension {@link DispenseExtensionManager} points are used to extend the models that are specific to the Dispense SDK.\n */\nexport class KosExtensionManager {\n dispense: DispenseExtensionManager;\n core: CoreExtensionManager;\n constructor() {\n this.dispense = new DispenseExtensionManager();\n this.core = new CoreExtensionManager();\n }\n}\n"],"names":["getFuelGaugeValue","holder","maxVolume","setMaxVolume","useState","_a","remainingVolume","setRemainingVolume","_b","hasMaxVolume","setHasMaxVolume","_c","hasRemainingVolume","setHasRemainingVolume","_d","fillPercent","setFillPercent","hasFuelGuage","setHasFuelGuage","useEffect","disposer","kosAutoEffect","DispenseExtensionManager","__publicField","CoreExtensionManager","ingredientDataMapper","ExtensionManager","ExtensionType","ingredientLoader","ingredientIndex","ingredientTypeMapper","holderDataMapper","holderTypeMapper","holderIndex","availabilityMapper","availabilityLoader","selectedPourableMapper","assemblyDataMapper","boardIndex","boardDataMapper","assemblyFeatureFlagResolver","EXTENSION_FEATURE_FLAG_RESOLVER","KosExtensionManager"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAIaA,KAAoB,CAACC,MAAwB;;AACxD,QAAM,CAACC,GAAWC,CAA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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA+DA,2BAA2BC,GAAoC;AAC7D,WAAAX,EAAiB,WAAW;AAAA,MAC1BC,EAAc;AAAA,MACdU;AAAA,IAAA,GAEK;AAAA,EACT;AAAA,EAEA,mBAAmBC,GAA4B;AAC7C,WAAAZ,EAAiB,eAAe;AAAA,MAC9BC,EAAc;AAAA,MACdW;AAAA,IAAA,GAEK;AAAA,EACT;AAAA,EAEA,wBAAwBC,GAA4C;AAClE,WAAAb,EAAiB,WAAW;AAAA,MAC1BC,EAAc;AAAA,MACdY;AAAA,IAAA,GAEK;AAAA,EACT;AAAA,EAEA,oCACEC,GACA;;AACA,YAAAnC,IAAAqB,EAAiBe,CAA+B,MAAhD,QAAApC,EAAmD;AAAA,MACjDsB,EAAc;AAAA,MACda;AAAA,OAEK;AAAA,EACT;AACF;AAUO,MAAME,GAAoB;AAAA,EAG/B,cAAc;AAFd,IAAAnB,EAAA;AACA,IAAAA,EAAA;AAEE,SAAK,WAAW,IAAID,EAAA,GACpB,KAAK,OAAO,IAAIE,EAAA;AAAA,EAClB;AACF;"}
1
+ {"version":3,"file":"extension-utils-mvxA4D4h.js","sources":["../../../../packages/sdk/kos-dispense-sdk/src/models/models/holder/utils/holder-utils.ts","../../../../packages/sdk/kos-dispense-sdk/src/models/utils/extension-utils.ts"],"sourcesContent":["import { kosAutoEffect } from \"@kosdev-code/kos-ui-sdk\";\nimport { useEffect, useState } from \"react\";\nimport type { HolderModel } from \"../types\";\n\nexport const getFuelGaugeValue = (holder: HolderModel) => {\n const [maxVolume, setMaxVolume] = useState<number>(\n holder?.slice?.maxVolMl ?? 0\n );\n const [remainingVolume, setRemainingVolume] = useState<number>(\n holder?.slice?.currentVolMl ?? 0\n );\n\n const [hasMaxVolume, setHasMaxVolume] = useState<boolean>(\n holder?.slice?.maxVolMl !== undefined\n );\n\n const [hasRemainingVolume, setHasRemainingVolume] = useState<boolean>(\n holder?.slice?.currentVolMl !== undefined\n );\n\n const [fillPercent, setFillPercent] = useState<number>(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n\n const [hasFuelGuage, setHasFuelGuage] = useState<boolean>(\n hasMaxVolume && hasRemainingVolume\n );\n\n useEffect(() => {\n const disposer = kosAutoEffect(() => {\n setMaxVolume(holder?.slice?.maxVolMl ?? 0);\n setRemainingVolume(holder?.slice?.currentVolMl ?? 0);\n setHasMaxVolume(holder?.slice?.maxVolMl !== undefined);\n setHasRemainingVolume(holder?.slice?.currentVolMl !== undefined);\n setFillPercent(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n setHasFuelGuage(hasMaxVolume && hasRemainingVolume);\n });\n\n return () => {\n disposer();\n };\n }, [holder]);\n\n return { maxVolume, remainingVolume, fillPercent, hasFuelGuage };\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n CoreExtensionManager,\n DataLoader,\n DataMapper,\n EXTENSION_FEATURE_FLAG_RESOLVER,\n ExtensionManager,\n IndexExtension,\n PropertyMapper,\n type FlagResolver,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { ExtensionType } from \"../constants\";\nimport { AssemblyTypes, type AssemblyModel } from \"../models\";\nimport type { HolderResponse } from \"../models/holder/services\";\nimport type { HolderModel } from \"../models/holder/types\";\nimport type { IngredientResponse } from \"../models/ingredient/services\";\nimport type { BeverageResponse } from \"../models/nozzle/services\";\nimport type { SelectedPourable } from \"../models/nozzle/types\";\n\nexport type IngredientDataMapper<\n AdditionalData extends object = Record<string, any>\n> = DataMapper<IngredientResponse, AdditionalData, any>;\n\n/**\n * Mapping function that maps an ingredient response into the type property of\n * the {@link IngredientModel}.\n */\nexport type IngredientTypeMapper<\n T extends IngredientResponse = IngredientResponse\n> = PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderTypeMapper<T extends HolderResponse = HolderResponse> =\n PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderDataMapper<\n AdditionalData extends object = Record<string, any>,\n HolderData extends HolderResponse = HolderResponse\n> = DataMapper<HolderData, AdditionalData, any>;\n\nexport type GroupBeverageResponse = BeverageResponse & { groupId: string };\nexport type AvailabilityDataMapper<\n AdditionalData extends object = Record<string, any>,\n AvailabilityData extends GroupBeverageResponse = GroupBeverageResponse\n> = DataMapper<AvailabilityData, AdditionalData, any>;\n\nexport type SelectedPourableMapper = DataMapper<SelectedPourable, any>;\n\nexport type BoardDataMapper<\n AdditionalData extends object = Record<string, any>,\n BoardData extends AssemblyTypes.AssemblyBoard<any> = AssemblyTypes.AssemblyBoard<any>\n> = DataMapper<BoardData, AdditionalData, any>;\n\nexport type AssemblyMapper<\n AdditionalData extends object = Record<string, any>,\n AssemblyResponseData extends AssemblyTypes.AssemblyResponse<any> = AssemblyTypes.AssemblyResponse<any>\n> = DataMapper<AssemblyResponseData, AdditionalData, any>;\n/**\n * The DispenseExtensionManager is responsible for managing the extension points that are specific to the Dispense application.\n */\nexport class DispenseExtensionManager {\n core: CoreExtensionManager = new CoreExtensionManager();\n /**\n * Maps data into the {@link IngredientModel}\n *\n * It is common for the ingredient data provided by the ingredient service to be augmented with additional properties that are\n * not provided by the base KOS Ingredient model. The {@link IngredientMapper} extension point allows for the data to be mapped\n * into the {@link IngredientModel} and the {@link IngredientModel.data} property to be augmented with additional properties.\n *\n * @example\n * The following example shows how to map the data from the service response into the {@link IngredientModel}.\n * The context is provided by the {@link IngredientLoader} extension point with its data being used to optionally augment the\n * ingredient data.\n *\n * The result of the mapping will be available in the `data` property of the {@link IngredientModel}.\n *\n * In this case the `IngedientReponseData` interface represents the data being returned by the ingredient service and the\n * `IngredientData` interface represents the data that will be available in the {@link IngredientModel.data} property. The `ingredientDataMapper`\n * is responsible for mapping from one format to the other.\n *\n * ```typescript\n *\n * interface IngredientResponseData extends NozzleServices.IngredientResponse {\n * chilled: boolean;\n * carbonated: boolean;\n * highYield: boolean;\n * }\n *\n * interface IngredientData {\n * chilled: boolean;\n * carbonated: boolean;\n * highYield: boolean;\n * }\n *\n * export const ingredientDataMapper = async (\n * data: IngredientResponseData,\n * context: IngredientContext\n * ): Promise<IngredientData> => {\n * return {\n * chilled: data.chilled,\n * carbonated: data.carbonated,\n * highYield: data.highYield,\n * }\n * }\n * ```\n * */\n registerIngredientDataMapper(ingredientDataMapper: IngredientDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.IngredientMapper,\n ingredientDataMapper\n );\n\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link IngredientMapper}\n *\n * @example\n * The following example shows how to load the brandset data, normalize it into a map and then provide it back to the framework\n * where it can be used by the other extension points.\n *\n * In the ingredient container model, the data is provided to the {@link IngredientMapper} extension point in order to augment ingredient data\n * and also loaded into the ingredient container model context in order to make the data available throughout the code.\n *\n * ```typescript\n * export const ingredientContextLoader = async (): Promise<BeverageContext> => {\n * const response = await kosFetch('kos:/system/some/ingredient/endpoint.json');\n *\n * if (response.status !== 200) {\n * KosLog.error('Failed to load ingredient data');\n * return {};\n * }\n * const json = await response.json();\n * return json;\n * };\n * ```\n * */\n registerIngredientLoader(ingredientLoader: DataLoader) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.IngredientLoader,\n ingredientLoader\n );\n return this;\n }\n\n registerIngredientIndex(ingredientIndex: IndexExtension) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.IngredientIndex,\n ingredientIndex\n );\n return this;\n }\n\n /**\n * Registers a data mapper for the {@link IngredientModel}\n * */\n registerIngredientTypeMapper(ingredientTypeMapper: IngredientTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.IngredientTypeMapper,\n ingredientTypeMapper\n );\n return this;\n }\n\n /**\n * Registers a data mapper for the {@link HolderModel} model.\n * @param holderDataMapper - Mapping function that maps additional data from holder service response\n * @returns\n */\n registerHolderDataMapper(holderDataMapper: HolderDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.HolderMapper,\n holderDataMapper\n );\n return this;\n }\n\n registerHolderTypeMapper(holderTypeMapper: HolderTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper\n );\n return this;\n }\n\n /**\n * Maps the ingredientId property of the holder into the {@link HolderModel}.\n * If not provided, the ingredientId will assume that the value is mapped from the\n * ingredientId property of the service response.\n * */\n registerHolderIngredientMapper(holderTypeMapper: HolderTypeMapper) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper\n );\n return this;\n }\n\n registerHolderIndex<T extends HolderModel = HolderModel>(\n holderIndex: IndexExtension<T>\n ) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.HolderIndex,\n holderIndex\n );\n return this;\n }\n\n /**\n * Maps data into the {@link AvailabilityModel}\n *\n * @example\n * The following example shows how to map the data from the service response into the {@link AvailabilityModel}.\n * The context is provided by the {@link AvailabilityLoader} extension point with its data being used to augment the\n * availability data.\n *\n * The result of the mapping will be available in the `data` property of the {@link AvailabilityModel}.\n *\n * ```typescript\n * export const beverageDataMapper = async (\n * data: NozzleServices.BeverageResponse,\n * context: BeverageContext\n * ): Promise<BeverageData> => {\n * const id = data.altId;\n * const iconUrl = encodeURI(\n * `http://localhost:8081/system/brandset/${context?.[id]?.icon}`\n * );\n * const cuiColorCode = context?.[id]?.cuiColorCode\n * ? context?.[id]?.cuiColorCode\n * : '';\n * return { iconUrl, cuiColorCode };\n * };\n * ```\n * */\n registerAvailabilityDataMapper(availabilityMapper: AvailabilityDataMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AvailabilityMapper,\n availabilityMapper\n );\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link AvailabilityMapper}\n *\n * @example\n * A common use case is to load brandset data that is UI specific and not provided directly by the Java service.\n *\n * The following example shows how to load the brandset data, normalize it into a map and then provide it back to the framework\n * where it can be used by the other extension points.\n *\n * In the nozzle model, the data is provided to the {@link AvailabilityMapper} extension point in order to augment availability data\n * and also loaded into the nozzle model context in order to make the data available throughout the code.\n *\n * ```typescript\n * export const beverageContextLoader = async (): Promise<BeverageContext> => {\n * const response = await kosFetch('kos:/system/brandset/brandset.json');\n *\n * if (response.status !== 200) {\n * KosLog.error('Failed to load beverage data');\n * return {};\n * }\n * const json: BrandsetResponse | null = await response.json();\n * const initialBeverages: Record<string, BrandsetIngredient> = {};\n * const beverages = json?.ingredients?.reduce((acc, beverage) => {\n * acc[beverage.ingredientId] = beverage;\n * return acc;\n * }, initialBeverages);\n * return beverages;\n * };\n * ```\n * */\n registerAvailabilityLoader(availabilityLoader: DataLoader) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.AvailabilityLoader,\n availabilityLoader\n );\n return this;\n }\n\n /**\n * Maps the abstract {@link SelectedPourable} data into a format that is specific to the nozzle.\n * */\n registerSelectedPourableDataMapper(\n selectedPourableMapper: SelectedPourableMapper\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.SelectedPourableMapper,\n selectedPourableMapper\n );\n return this;\n }\n\n /**\n * Maps data into the {@link AssemblyModel} data.\n * Used in cases where the base assembly has been extended with additional properties in the backend. This extension\n * point allows for the data to be mapped into the {@link AssemblyModel} and augmented with additional properties.\n *\n * @example\n *\n * In this example of an implementation of a {@link AssemblyMapper}, the {@link AssemblyResponse} data is mapped into\n * a {@link FreestyleAssembly} object.\n *\n * The {@link FreestyleAssemblyResponse} interface represents the additional data being returned by the assembly service and is\n * merged into the {@link AssemblyResponse} interface.\n *\n * The {@link FreestyleAssembly} interface represents the additional data, beyond the base data set, that will be merged into the {@link AssemblyModel}.\n *\n * The mapper is responsible for mapping from the {@link FreestyleAssemblyResponse} format to the {@link FreestyleAssembly} format.\n * ```typescript\n * import { AssemblyTypes } from \"@kosdev-code/kos-dispense-sdk\";\n * import { DataMapper } from \"@kosdev-code/kos-ui-sdk\";\n *\n * // define the additional data being returned by the assembly service\n * export interface FreestyleAssemblyResponse {\n * iceAgitator?: {\n * name: \"iceAgitator\";\n * path: string;\n * };\n * }\n *\n * // define the additional data structure that will be merged into the assembly model\n * export interface FreestyleAssembly {\n * iceAgitator: {\n * path: string;\n * };\n * carbAgitator: {\n * path: string;\n * };\n * }\n *\n *\n * // define the mapper that will map the data from the service response into the additional data structure\n * // that will be merged into the assembly model.\n * // In this case the mapper is responsible for mapping from the {@link FreestyleAssemblyResponse} format to the {@link FreestyleAssembly} format.\n * export const assemblyDataMapper: DataMapper<\n * AssemblyTypes.AssemblyResponse<FreestyleAssemblyResponse>,\n * FreestyleAssembly\n * > = async (data) => {\n * const response = data.assemblies.reduce((acc, assembly) => {\n * const agitatorKeys = [\"iceAgitator\", \"carbAgitator\"];\n * agitatorKeys.forEach((key) => {\n * const agitator = assembly[key];\n * if (agitator) {\n * acc[key] = agitator;\n * }\n * });\n *\n * return acc;\n * }, {} as FreestyleAssembly);\n * return response;\n * };\n *```\n */\n registerAssemblyDataMapper(assemblyDataMapper: AssemblyMapper) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AssemblyMapper,\n assemblyDataMapper\n );\n return this;\n }\n\n registerBoardIndex(boardIndex: IndexExtension) {\n ExtensionManager.indexExtension.registerIndexExtension(\n ExtensionType.BoardIndex,\n boardIndex\n );\n return this;\n }\n\n registerBoardDataMapper(boardDataMapper: BoardDataMapper<any, any>) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.BoardMapper,\n boardDataMapper\n );\n return this;\n }\n\n registerAssemblyFeatureFlagResolver(\n assemblyFeatureFlagResolver: FlagResolver<AssemblyModel>\n ) {\n ExtensionManager[EXTENSION_FEATURE_FLAG_RESOLVER]?.register(\n ExtensionType.AssemblyFeatureFlags,\n assemblyFeatureFlagResolver\n );\n return this;\n }\n}\n\n/**\n * The KosExtensionManager provides access to the extension points that are provided in the SDK for Dispense applications.\n *\n * The extension points are divided into two categories:\n *\n * @param core - The core extension {@link CoreExtensionManager} points are used to extend the base models that are provided by the SDK.\n * @param dispense - The dispense extension {@link DispenseExtensionManager} points are used to extend the models that are specific to the Dispense SDK.\n */\nexport class KosExtensionManager {\n dispense: DispenseExtensionManager;\n core: CoreExtensionManager;\n constructor() {\n this.dispense = new DispenseExtensionManager();\n this.core = new CoreExtensionManager();\n }\n}\n"],"names":["getFuelGaugeValue","holder","maxVolume","setMaxVolume","useState","_a","remainingVolume","setRemainingVolume","_b","hasMaxVolume","setHasMaxVolume","_c","hasRemainingVolume","setHasRemainingVolume","_d","fillPercent","setFillPercent","hasFuelGuage","setHasFuelGuage","useEffect","disposer","kosAutoEffect","DispenseExtensionManager","__publicField","CoreExtensionManager","ingredientDataMapper","ExtensionManager","ExtensionType","ingredientLoader","ingredientIndex","ingredientTypeMapper","holderDataMapper","holderTypeMapper","holderIndex","availabilityMapper","availabilityLoader","selectedPourableMapper","assemblyDataMapper","boardIndex","boardDataMapper","assemblyFeatureFlagResolver","EXTENSION_FEATURE_FLAG_RESOLVER","KosExtensionManager"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAIaA,KAAoB,CAACC,MAAwB;;AACxD,QAAM,CAACC,GAAWC,CAAY,IAAIC;AAAA,MAChCC,IAAAJ,KAAA,gBAAAA,EAAQ,UAAR,gBAAAI,EAAe,aAAY;AAAA,EAAA,GAEvB,CAACC,GAAiBC,CAAkB,IAAIH;AAAA,MAC5CI,IAAAP,KAAA,gBAAAA,EAAQ,UAAR,gBAAAO,EAAe,iBAAgB;AAAA,EAAA,GAG3B,CAACC,GAAcC,CAAe,IAAIN;AAAA,MACtCO,IAAA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AAAA,MACdU;AAAA,IAAA,GAEK;AAAA,EACT;AAAA,EAEA,mBAAmBC,GAA4B;AAC7C,WAAAZ,EAAiB,eAAe;AAAA,MAC9BC,EAAc;AAAA,MACdW;AAAA,IAAA,GAEK;AAAA,EACT;AAAA,EAEA,wBAAwBC,GAA4C;AAClE,WAAAb,EAAiB,WAAW;AAAA,MAC1BC,EAAc;AAAA,MACdY;AAAA,IAAA,GAEK;AAAA,EACT;AAAA,EAEA,oCACEC,GACA;;AACA,YAAAnC,IAAAqB,EAAiBe,CAA+B,MAAhD,QAAApC,EAAmD;AAAA,MACjDsB,EAAc;AAAA,MACda;AAAA,OAEK;AAAA,EACT;AACF;AAUO,MAAME,GAAoB;AAAA,EAG/B,cAAc;AAFd,IAAAnB,EAAA;AACA,IAAAA,EAAA;AAEE,SAAK,WAAW,IAAID,EAAA,GACpB,KAAK,OAAO,IAAIE,EAAA;AAAA,EAClB;AACF;"}
package/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./dispense-registration-manager-BZ5L3AWX.cjs"),o=require("./extension-utils-DUel3wIz.cjs"),e=require("./pump-provider-86479YU2.cjs"),i=require("@kosdev-code/kos-ui-plugin/utilities");require("@kosdev-code/kos-ui-sdk");require("react");require("@emotion/react/jsx-runtime");require("@kosdev-code/kos-dispense-sdk");const t=i.createExtensionSchema({},{rankable:!1}),n=i.extensionPointId("cui","control","pour"),u=i.defineExtensionPoint({id:n,contributionKey:"controlPour",displayName:"Control Pour",description:"Extension point for controlled pour plugin configurations with view support",hasView:!0,isRankable:!1,schema:t,metadata:{exportName:"ControlPourExtension",category:"Dispense",tags:["pour","control","beverage"]},validate:(s,a)=>{i.validateWithSchema(t,s,a)},transform:i.createViewAwareTransform()}),d=n;exports.Assembly=r.Assembly;exports.Availability=r.Availability;exports.Board=r.Board;exports.BoardContainer=r.BoardContainer;Object.defineProperty(exports,"BoardContainerModel",{enumerable:!0,get:()=>r.BoardContainerModel});exports.CONTEXT_ASSEMBLY_DATA=r.CONTEXT_ASSEMBLY_DATA;exports.CONTEXT_ASSEMBLY_RAW_DATA=r.CONTEXT_ASSEMBLY_RAW_DATA;exports.DeviceAssembly=r.DeviceAssembly;exports.DispenseModelType=r.DispenseModelType;exports.DispenserModels=r.kosModels;exports.ExtensionType=r.ExtensionType;exports.GenericPour=r.GenericPour;exports.Holder=r.Holder;exports.HolderContainer=r.HolderContainer;exports.Ingredient=r.Ingredient;exports.IngredientContainer=r.IngredientContainer;exports.KosModelRegistry=r.KosModelRegistry;exports.Nozzle=r.Nozzle;exports.PourState=r.PourState;exports.Pump=r.Pump;exports.PumpContainer=r.PumpContainer;exports.PumpIndex=r.PumpIndex;exports.TOPIC_BOARD_LINKED=r.TOPIC_BOARD_LINKED;exports.TOPIC_BOARD_UNLINKED=r.TOPIC_BOARD_UNLINKED;exports.kosModels=r.kosModels;exports.registerDispenseModels=r.registerDispenseModels;exports.AssemblyServices=o.index;exports.AssemblyTypes=o.assembly;exports.DispenseExtensionManager=o.DispenseExtensionManager;exports.GenericPourServices=o.index$1;exports.HolderServices=o.index$2;exports.IngredientServices=o.index$3;exports.KosExtensionManager=o.KosExtensionManager;exports.NozzleServices=o.index$4;exports.PumpServices=o.index$5;exports.getFuelGaugeValue=o.getFuelGaugeValue;exports.AssemblyProvider=e.AssemblyProvider;exports.AvailabilityProvider=e.AvailabilityProvider;exports.BoardContainerProvider=e.BoardContainerProvider;exports.BoardProvider=e.BoardProvider;exports.CuiKit=e.CuiKit;exports.CuiKitWrapper=e.CuiKitWrapper;exports.DISPENSE_GROUP_BEVERAGE=e.DISPENSE_GROUP_BEVERAGE;exports.DISPENSE_GROUP_BRAND=e.DISPENSE_GROUP_BRAND;exports.DISPENSE_GROUP_FLAVOR=e.DISPENSE_GROUP_FLAVOR;exports.DeviceAssemblyProvider=e.DeviceAssemblyProvider;exports.HoldToPourIntentStrategy=e.HoldToPourIntentStrategy;exports.HoldToPourStrategy=e.HoldToPourStrategy;exports.HolderContainerProvider=e.HolderContainerProvider;exports.HolderProvider=e.HolderProvider;exports.IngredientContainerProvider=e.IngredientContainerProvider;exports.IngredientProvider=e.IngredientProvider;exports.NozzleProvider=e.NozzleProvider;exports.PourContext=e.PourContext;exports.PumpProvider=e.PumpProvider;exports.TapOrHoldIntentStrategy=e.TapOrHoldIntentStrategy;exports.TapToPourIntentStrategy=e.TapToPourIntentStrategy;exports.TapToPourStrategy=e.TapToPourStrategy;exports.initializeCuiKit=e.initializeCuiKit;exports.useAssembly=e.useAssembly;exports.useAssemblyContext=e.useAssemblyContext;exports.useAvailability=e.useAvailability;exports.useAvailabilityContext=e.useAvailabilityContext;exports.useBeverages=e.useBeverages;exports.useBoard=e.useBoard;exports.useBoardContainer=e.useBoardContainer;exports.useBoardContainerContext=e.useBoardContainerContext;exports.useBoardContext=e.useBoardContext;exports.useBrands=e.useBrands;exports.useCuiKit=e.useCuiKit;exports.useCuiKitTimers=e.useCuiKitTimers;exports.useDefaultCuiKitLifecycle=e.useDefaultCuiKitLifecycle;exports.useDeviceAssembly=e.useDeviceAssembly;exports.useDeviceAssemblyContext=e.useDeviceAssemblyContext;exports.useDispenseLifecycle=e.useDispenseLifecycle;exports.useFlavors=e.useFlavors;exports.useGenericPour=e.useGenericPour;exports.useHolder=e.useHolder;exports.useHolderContainer=e.useHolderContainer;exports.useHolderContainerContext=e.useHolderContainerContext;exports.useHolderContext=e.useHolderContext;exports.useIngredient=e.useIngredient;exports.useIngredientContainer=e.useIngredientContainer;exports.useIngredientContainerContext=e.useIngredientContainerContext;exports.useIngredientContext=e.useIngredientContext;exports.useIngredientPour=e.useIngredientPour;exports.useNozzle=e.useNozzle;exports.useNozzleContext=e.useNozzleContext;exports.useNozzlePour=e.useNozzlePour;exports.usePourTarget=e.usePourTarget;exports.usePumpContext=e.usePumpContext;exports.withAssembly=e.withAssembly;exports.withBeverage=e.withBeverage;exports.withBoard=e.withBoard;exports.withBoardContainer=e.withBoardContainer;exports.withDeviceAssembly=e.withDeviceAssembly;exports.withGenericPour=e.withGenericPour;exports.withHolder=e.withHolder;exports.withHolderContainer=e.withHolderContainer;exports.withIngredient=e.withIngredient;exports.withIngredientContainer=e.withIngredientContainer;exports.withNozzle=e.withNozzle;exports.ControlPourExtension=u;exports.EXTENSION_POINT_CONTROL_POUR=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./dispense-registration-manager-DDyKjPWB.cjs"),o=require("./extension-utils-BceaRPqX.cjs"),e=require("./pump-provider-BSdtHuOD.cjs"),i=require("@kosdev-code/kos-ui-plugin/utilities");require("@kosdev-code/kos-ui-sdk");require("react");require("@emotion/react/jsx-runtime");require("@kosdev-code/kos-dispense-sdk");const t=i.createExtensionSchema({},{rankable:!1}),n=i.extensionPointId("cui","control","pour"),u=i.defineExtensionPoint({id:n,contributionKey:"controlPour",displayName:"Control Pour",description:"Extension point for controlled pour plugin configurations with view support",hasView:!0,isRankable:!1,schema:t,metadata:{exportName:"ControlPourExtension",category:"Dispense",tags:["pour","control","beverage"]},validate:(s,a)=>{i.validateWithSchema(t,s,a)},transform:i.createViewAwareTransform()}),d=n;exports.Assembly=r.Assembly;exports.Availability=r.Availability;exports.Board=r.Board;exports.BoardContainer=r.BoardContainer;Object.defineProperty(exports,"BoardContainerModel",{enumerable:!0,get:()=>r.BoardContainerModel});exports.CONTEXT_ASSEMBLY_DATA=r.CONTEXT_ASSEMBLY_DATA;exports.CONTEXT_ASSEMBLY_RAW_DATA=r.CONTEXT_ASSEMBLY_RAW_DATA;exports.DeviceAssembly=r.DeviceAssembly;exports.DispenseModelType=r.DispenseModelType;exports.DispenserModels=r.kosModels;exports.ExtensionType=r.ExtensionType;exports.GenericPour=r.GenericPour;exports.Holder=r.Holder;exports.HolderContainer=r.HolderContainer;exports.Ingredient=r.Ingredient;exports.IngredientContainer=r.IngredientContainer;exports.KosModelRegistry=r.KosModelRegistry;exports.Nozzle=r.Nozzle;exports.PourState=r.PourState;exports.Pump=r.Pump;exports.PumpContainer=r.PumpContainer;exports.PumpIndex=r.PumpIndex;exports.TOPIC_BOARD_LINKED=r.TOPIC_BOARD_LINKED;exports.TOPIC_BOARD_UNLINKED=r.TOPIC_BOARD_UNLINKED;exports.kosModels=r.kosModels;exports.registerDispenseModels=r.registerDispenseModels;exports.AssemblyServices=o.index;exports.AssemblyTypes=o.assembly;exports.DispenseExtensionManager=o.DispenseExtensionManager;exports.GenericPourServices=o.index$1;exports.HolderServices=o.index$2;exports.IngredientServices=o.index$3;exports.KosExtensionManager=o.KosExtensionManager;exports.NozzleServices=o.index$4;exports.PumpServices=o.index$5;exports.getFuelGaugeValue=o.getFuelGaugeValue;exports.AssemblyProvider=e.AssemblyProvider;exports.AvailabilityProvider=e.AvailabilityProvider;exports.BoardContainerProvider=e.BoardContainerProvider;exports.BoardProvider=e.BoardProvider;exports.CuiKit=e.CuiKit;exports.CuiKitWrapper=e.CuiKitWrapper;exports.DISPENSE_GROUP_BEVERAGE=e.DISPENSE_GROUP_BEVERAGE;exports.DISPENSE_GROUP_BRAND=e.DISPENSE_GROUP_BRAND;exports.DISPENSE_GROUP_FLAVOR=e.DISPENSE_GROUP_FLAVOR;exports.DeviceAssemblyProvider=e.DeviceAssemblyProvider;exports.HoldToPourIntentStrategy=e.HoldToPourIntentStrategy;exports.HoldToPourStrategy=e.HoldToPourStrategy;exports.HolderContainerProvider=e.HolderContainerProvider;exports.HolderProvider=e.HolderProvider;exports.IngredientContainerProvider=e.IngredientContainerProvider;exports.IngredientProvider=e.IngredientProvider;exports.NozzleProvider=e.NozzleProvider;exports.PourContext=e.PourContext;exports.PumpProvider=e.PumpProvider;exports.TapOrHoldIntentStrategy=e.TapOrHoldIntentStrategy;exports.TapToPourIntentStrategy=e.TapToPourIntentStrategy;exports.TapToPourStrategy=e.TapToPourStrategy;exports.initializeCuiKit=e.initializeCuiKit;exports.useAssembly=e.useAssembly;exports.useAssemblyContext=e.useAssemblyContext;exports.useAvailability=e.useAvailability;exports.useAvailabilityContext=e.useAvailabilityContext;exports.useBeverages=e.useBeverages;exports.useBoard=e.useBoard;exports.useBoardContainer=e.useBoardContainer;exports.useBoardContainerContext=e.useBoardContainerContext;exports.useBoardContext=e.useBoardContext;exports.useBrands=e.useBrands;exports.useCuiKit=e.useCuiKit;exports.useCuiKitTimers=e.useCuiKitTimers;exports.useDefaultCuiKitLifecycle=e.useDefaultCuiKitLifecycle;exports.useDeviceAssembly=e.useDeviceAssembly;exports.useDeviceAssemblyContext=e.useDeviceAssemblyContext;exports.useDispenseLifecycle=e.useDispenseLifecycle;exports.useFlavors=e.useFlavors;exports.useGenericPour=e.useGenericPour;exports.useHolder=e.useHolder;exports.useHolderContainer=e.useHolderContainer;exports.useHolderContainerContext=e.useHolderContainerContext;exports.useHolderContext=e.useHolderContext;exports.useIngredient=e.useIngredient;exports.useIngredientContainer=e.useIngredientContainer;exports.useIngredientContainerContext=e.useIngredientContainerContext;exports.useIngredientContext=e.useIngredientContext;exports.useIngredientPour=e.useIngredientPour;exports.useNozzle=e.useNozzle;exports.useNozzleContext=e.useNozzleContext;exports.useNozzlePour=e.useNozzlePour;exports.usePourTarget=e.usePourTarget;exports.usePumpContext=e.usePumpContext;exports.withAssembly=e.withAssembly;exports.withBeverage=e.withBeverage;exports.withBoard=e.withBoard;exports.withBoardContainer=e.withBoardContainer;exports.withDeviceAssembly=e.withDeviceAssembly;exports.withGenericPour=e.withGenericPour;exports.withHolder=e.withHolder;exports.withHolderContainer=e.withHolderContainer;exports.withIngredient=e.withIngredient;exports.withIngredientContainer=e.withIngredientContainer;exports.withNozzle=e.withNozzle;exports.ControlPourExtension=u;exports.EXTENSION_POINT_CONTROL_POUR=d;
2
2
  //# sourceMappingURL=index.cjs.map
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { A as y, b as A, e as I, d as E, B as x, C as S, a as T, f as D, D as N, l as b, E as B, G as h, H as _, g as O, I as f, h as w, K as z, N as H, k as K, P as R, i as G, j as M, T as L, c as U, l as V, r as k } from "./dispense-registration-manager-CB_nSTZw.js";
2
- import { i as F, f as W, D as Y, a as j, b as q, c as J, K as Q, d as Z, e as $, g as ee } from "./extension-utils-CkYqorcG.js";
3
- import { A as ae, a as oe, d as re, B as te, f as ie, C as ne, G as ue, F as le, J as de, D as Pe, a4 as Ce, a5 as ce, j as pe, H as me, m as ge, I as ve, N as ye, ab as Ae, P as Ie, a6 as Ee, a7 as xe, a8 as Se, i as Te, q as De, u as Ne, r as be, b as Be, z as he, t as _e, x as Oe, e as fe, c as we, E as ze, K as He, O as Ke, L as Re, R as Ge, g as Me, M as Le, Q as Ue, a9 as Ve, T as ke, V as Xe, k as Fe, h as We, X as Ye, _ as je, n as qe, l as Je, Y as Qe, a0 as Ze, o as $e, a2 as es, a3 as ss, p as as, w as os, s as rs, v as ts, y as is, S as ns, aa as us, U as ls, W as ds, Z as Ps, $ as Cs, a1 as cs } from "./pump-provider-DSyiDoPF.js";
1
+ import { A as y, b as A, e as I, d as E, B as x, C as S, a as T, f as D, D as N, l as b, E as B, G as h, H as _, g as O, I as f, h as w, K as z, N as H, k as K, P as R, i as G, j as M, T as L, c as U, l as V, r as k } from "./dispense-registration-manager-DgMTZL-g.js";
2
+ import { i as F, f as W, D as Y, a as j, b as q, c as J, K as Q, d as Z, e as $, g as ee } from "./extension-utils-mvxA4D4h.js";
3
+ import { A as ae, a as oe, d as re, B as te, f as ie, C as ne, G as ue, F as le, J as de, D as Pe, a4 as Ce, a5 as ce, j as pe, H as me, m as ge, I as ve, N as ye, ab as Ae, P as Ie, a6 as Ee, a7 as xe, a8 as Se, i as Te, q as De, u as Ne, r as be, b as Be, z as he, t as _e, x as Oe, e as fe, c as we, E as ze, K as He, O as Ke, L as Re, R as Ge, g as Me, M as Le, Q as Ue, a9 as Ve, T as ke, V as Xe, k as Fe, h as We, X as Ye, _ as je, n as qe, l as Je, Y as Qe, a0 as Ze, o as $e, a2 as es, a3 as ss, p as as, w as os, s as rs, v as ts, y as is, S as ns, aa as us, U as ls, W as ds, Z as Ps, $ as Cs, a1 as cs } from "./pump-provider-C-Zclv9X.js";
4
4
  import { createExtensionSchema as r, extensionPointId as t, defineExtensionPoint as i, createViewAwareTransform as n, validateWithSchema as u } from "@kosdev-code/kos-ui-plugin/utilities";
5
5
  import "@kosdev-code/kos-ui-sdk";
6
6
  import "react";
@@ -1 +1 @@
1
- {"version":3,"file":"assembly-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/assembly-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAcjC,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG9D,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAK7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAMzC,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AACrD,eAAO,MAAM,yBAAyB,sBAAsB,CAAC;AAC7D,qBACa,iBAAiB,CAC5B,WAAW,SAAS,MAAM,GAAG,GAAG,EAChC,SAAS,SAAS,MAAM,GAAG,GAAG,CAC9B,YAAW,aAAa,CAAC,WAAW,CAAC,EAAE,eAAe;IAEtD,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,YAAY,CAAqB;IAIzC,OAAO,CAAC,gBAAgB,CAAyB;IAEvC,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,aAAa,CAAqB;IACpD,MAAM,EAAE,gBAAgB,CAAC;gBAEvB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,kBAAkB;IAS7B,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAI5C,IAAI,UAAU,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE,CAEzC;IAED,IAAI,YAAY,IAAI,MAAM,EAAE,CAE3B;IAED,IAAI,WAAW,IAAI,MAAM,EAAE,CAE1B;IACD,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC,EAAE;IAI1D,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC,EAAE;IAIhE;;;;;OAKG;IACH,IAAI,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAEpD;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,EAAE,CAExB;IAED,IAAI,MAAM,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAE9B;IAIK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,KAAK;IAQL,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CA6E/C"}
1
+ {"version":3,"file":"assembly-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/assembly-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAcjC,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG9D,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAK7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAMzC,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,qBAAqB,kBAAkB,CAAC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","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/pump-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtE,eAAO,MAAM,sBAAsB,eACrB,MAAM,QACZ,YAAY,qCAqBnB,CAAC;AAEF,eAAO,MAAM,eAAe,kBACV,kBAAkB,uBAChB,oBAAoB,cAC7B,cAAc,oBACR,YAAY,SAqB1B,CAAC"}
1
+ {"version":3,"file":"pump-utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/pump-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtE,eAAO,MAAM,sBAAsB,eACrB,MAAM,QACZ,YAAY,qCAsBnB,CAAC;AAEF,eAAO,MAAM,eAAe,kBACV,kBAAkB,uBAChB,oBAAoB,cAC7B,cAAc,oBACR,YAAY,SA0B1B,CAAC"}
@@ -1,18 +1,18 @@
1
1
  import { GenericPourOptions } from './types';
2
2
  import { PourState } from '../types';
3
3
  import { PourStrategyAware } from '../../../ui/hooks/utils/pour-strategy';
4
- import { FutureContainer, IFutureModel, IKosDataModel, PublicModelInterface, KosData, KosFutureAwareFull, KosLoggerAware } from '@kosdev-code/kos-ui-sdk';
4
+ import { FutureContainer, IFutureModel, IKosDataModel, PublicModelInterface, KosData, KosFutureAwareFull, KosLoggerAware, KosStateMachineAware } from '@kosdev-code/kos-ui-sdk';
5
5
 
6
6
  export declare const MODEL_TYPE = "generic-pour-model";
7
7
  export type GenericPourModel = PublicModelInterface<GenericPourModelImpl>;
8
8
  export declare const TOPIC_GENERIC_POUR_STARTED = "/kos/generic/pour/started";
9
9
  export declare const TOPIC_GENERIC_POUR_PROGRESS = "/kos/generic/pour/progress";
10
10
  export declare const TOPIC_GENERIC_POUR_CANCEL = "/kos/generic/pour/cancel";
11
- export interface GenericPourModelImpl extends KosLoggerAware, KosFutureAwareFull<any> {
11
+ type PourEvent = "START_POUR" | "POUR_ACTIVE" | "CANCEL_POUR" | "POUR_CANCELED" | "POUR_COMPLETED";
12
+ export interface GenericPourModelImpl extends KosLoggerAware, KosFutureAwareFull<any>, KosStateMachineAware<PourState, PourEvent> {
12
13
  }
13
14
  export declare class GenericPourModelImpl implements IKosDataModel, PourStrategyAware, FutureContainer {
14
15
  id: string;
15
- currentState: PourState;
16
16
  servicePathFactory: (selectedId: string, context?: KosData<Record<string, any>>) => string;
17
17
  pourType: string;
18
18
  selectedId?: string;
@@ -22,6 +22,10 @@ export declare class GenericPourModelImpl implements IKosDataModel, PourStrategy
22
22
  updateContextData(key: string, value: any): void;
23
23
  removeContextData(key: string): void;
24
24
  clearContextData(): void;
25
+ handlePouringStart(): void;
26
+ handlePouringEnd(): void;
27
+ handleCancelStart(): void;
28
+ handleCanceled(): void;
25
29
  /**
26
30
  * An action that will initiate a pour for this nozzle.
27
31
  *
@@ -32,7 +36,6 @@ export declare class GenericPourModelImpl implements IKosDataModel, PourStrategy
32
36
  * */
33
37
  pour(tracker?: string): Promise<void>;
34
38
  cancelPour(): Promise<void>;
35
- private updateIfCurrent;
36
39
  /**
37
40
  * A derived value that indicates if the nozzle is currently pouring a beverage.
38
41
  * @readonly
@@ -41,7 +44,8 @@ export declare class GenericPourModelImpl implements IKosDataModel, PourStrategy
41
44
  /**
42
45
  * A derived value that indicates if the pour target is currently available to pour a beverage.
43
46
  *
44
- * Generally this means that the pour target is currently idle and not in the process of pouring, initiating a pour, or canceling a pour.
47
+ * Generally this means that the pour target is currently idle and not in the process of pouring,
48
+ * initiating a pour, or canceling a pour.
45
49
  * The value is observable and will change when the selected pourable changes or the pour target
46
50
  * starts or stops pouring.
47
51
  * @readonly
@@ -50,4 +54,5 @@ export declare class GenericPourModelImpl implements IKosDataModel, PourStrategy
50
54
  get pourProgress(): number;
51
55
  onFutureUpdate(future: IFutureModel<any>): void;
52
56
  }
57
+ export {};
53
58
  //# sourceMappingURL=generic-pour-model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generic-pour-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/generic-pour/generic-pour-model.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,eAAe,EAGf,YAAY,EACZ,aAAa,EAEb,oBAAoB,EAOpB,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,UAAU,uBAAuB,CAAC;AAE/C,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;AAE1E,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AACtE,eAAO,MAAM,2BAA2B,+BAA+B,CAAC;AACxE,eAAO,MAAM,yBAAyB,6BAA6B,CAAC;AA4BpE,MAAM,WAAW,oBACf,SAAQ,cAAc,EACpB,kBAAkB,CAAC,GAAG,CAAC;CAAG;AAC9B,qBAGa,oBACX,YAAW,aAAa,EAAE,iBAAiB,EAAE,eAAe;IAE5D,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,SAAS,CAAkB;IACzC,kBAAkB,EAAE,CAClB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KACnC,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IAEjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,KAAK,CAA+B;gBAChC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB;IAUxD,IAAI,WAAW,WAKd;IAED,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;IAIzC,iBAAiB,CAAC,GAAG,EAAE,MAAM;IAI7B,gBAAgB;IAGhB;;;;;;;SAOK;IAEQ,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM;IAyCrB,UAAU;IA2BvB,OAAO,CAAC,eAAe;IAQvB;;;OAGG;IACH,IAAI,SAAS,YAOZ;IAED;;;;;;;OAOG;IACH,IAAI,OAAO,YAEV;IAED,IAAI,YAAY,WAEf;IAED,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC;CA0BzC"}
1
+ {"version":3,"file":"generic-pour-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/generic-pour/generic-pour-model.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,eAAe,EAGf,YAAY,EACZ,aAAa,EAEb,oBAAoB,EAWpB,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,UAAU,uBAAuB,CAAC;AAE/C,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;AAE1E,eAAO,MAAM,0BAA0B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
2
2
  import { AvailabilityResponse } from './services';
3
3
  import { PourState } from '../types/pouring';
4
4
  import { AvailabilityModel } from '../availability';
5
- import { FutureAwareContainer, FutureContainer, IFutureModel, IKosDataModel, IKosModelLogger, KosContext, KosContextLogger, KosCreationContext, KosModelRegistrationBean, PublicModelInterface } from '@kosdev-code/kos-ui-sdk';
5
+ import { FutureAwareContainer, FutureContainer, IFutureModel, IKosDataModel, IKosModelLogger, KosContext, KosLoggerAware, KosModelRegistrationBean, KosStateMachineAware, PublicModelInterface } from '@kosdev-code/kos-ui-sdk';
6
6
 
7
7
  export declare const TOPIC_NOZZLE_POUR_STARTED = "/kos/nozzle/pour/started";
8
8
  export declare const TOPIC_NOZZLE_POUR_PROGRESS = "/kos/nozzle/pour/progress";
9
9
  export declare const TOPIC_NOZZLE_POUR_CANCEL = "/kos/nozzle/pour/cancel";
10
+ type PourEvent = "START_POUR" | "POUR_ACTIVE" | "CANCEL_POUR" | "POUR_CANCELED" | "POUR_COMPLETED";
11
+ interface NozzleModelImpl extends IKosModelLogger, IKosDataModel, FutureContainer, KosLoggerAware, KosStateMachineAware<PourState, PourEvent> {
12
+ }
10
13
  /**
11
14
  *
12
15
  */
13
- declare class NozzleModelImpl implements IKosModelLogger, IKosDataModel, FutureContainer {
16
+ declare class NozzleModelImpl {
14
17
  /** the unique identifier for this nozzle.*/
15
18
  id: string;
16
19
  path: string;
17
- logger: KosContextLogger;
18
20
  name: string;
19
21
  private _selectedBeverage?;
20
22
  private _selectedBrand?;
21
23
  private _additionalItems?;
22
24
  private _availabilityItems;
23
25
  futureHandler: FutureAwareContainer;
24
- currentState: PourState;
25
26
  beverageTopicPrefix: string;
26
27
  topicPrefix: string;
27
28
  urlPrefix: string;
@@ -66,7 +67,7 @@ declare class NozzleModelImpl implements IKosModelLogger, IKosDataModel, FutureC
66
67
  };
67
68
  get future(): IFutureModel<Record<string, unknown>> | undefined;
68
69
  get pourProgress(): number;
69
- constructor(modelId: string, options: NozzleOptions, context: KosCreationContext);
70
+ constructor(modelId: string, options: NozzleOptions);
70
71
  updateModel(): void;
71
72
  setSelectedBrand(brand?: AvailabilityModel): void;
72
73
  get selectedBrand(): AvailabilityModel<any, Record<string, any>> | undefined;
@@ -99,7 +100,10 @@ declare class NozzleModelImpl implements IKosModelLogger, IKosDataModel, FutureC
99
100
  * @returns the availability nodes that are tagged with the specified parent id.
100
101
  */
101
102
  getAvailabilityByParent<D extends object = any>(parentId: string): AvailabilityModel<D, Record<string, any>>[];
102
- private updateIfCurrent;
103
+ handlePouringStart(): void;
104
+ handlePouringEnd(): void;
105
+ handleCancelStart(): void;
106
+ handleCanceled(): void;
103
107
  onFutureUpdate(future: IFutureModel<any>): void;
104
108
  /**
105
109
  * An action that will initiate a pour for this nozzle.
@@ -1 +1 @@
1
- {"version":3,"file":"nozzle-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/nozzle/nozzle-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAiBL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,EAElB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,aAAa,EAKb,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAajB,eAAO,MAAM,yBAAyB,6BAA6B,CAAC;AACpE,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AACtE,eAAO,MAAM,wBAAwB,4BAA4B,CAAC;AAClE;;GAEG;AACH,cACM,eACJ,YAAW,eAAe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M;IAOhE,OAAO,CAAC,eAAe;IAQvB,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC;IA2BxC;;;;;;;SAOK;IAEQ,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM;IAuClC;;;;;;;;SAQK;IAEQ,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IA2CrD;;SAEK;IACQ,UAAU;IAwBvB,OAAO,CAAC,kBAAkB;IAe1B,gBAAgB;IACV,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IA6CzC,kBAAkB,CAAC,MAAM,EAAE,oBAAoB;CAkFtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAC,eAAe,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+EK;AACL,eAAO,MAAM,MAAM,EAAE,QAAQ,CAC3B,wBAAwB,CAAC,WAAW,EAAE,aAAa,CAAC,CAWrD,CAAC"}
1
+ {"version":3,"file":"nozzle-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/nozzle/nozzle-model.ts"],"names":[],"mappings":"AACA,OAAO,EAuBL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,EAElB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,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ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/pump/pump-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;AAYjC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAoLtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqFK;AACL,eAAO,MAAM,IAAI,EAAE,QAAQ,CAAC,wBAAwB,CAAC,SAAS,EAAE,WAAW,CAAC,CAWzE,CAAC"}
1
+ {"version":3,"file":"pump-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/pump/pump-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;AAYjC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAuLtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqFK;AACL,eAAO,MAAM,IAAI,EAAE,QAAQ,CAAC,wBAAwB,CAAC,SAAS,EAAE,WAAW,CAAC,CAWzE,CAAC"}
@@ -18,6 +18,10 @@ export interface PumpOptions<AdditionalData extends object = any> {
18
18
  name: string;
19
19
  path: string;
20
20
  prevIngredientId?: string;
21
+ state?: {
22
+ path: string;
23
+ name: string;
24
+ };
21
25
  [key: keyof AdditionalData]: AdditionalData[key];
22
26
  }
23
27
 
@@ -42,6 +42,10 @@ export type AssemblyPump<PumpExt extends object = {}> = {
42
42
  holderPath: string;
43
43
  ingredientId?: string;
44
44
  prevIngredientId?: string;
45
+ state?: {
46
+ path: string;
47
+ name: string;
48
+ };
45
49
  };
46
50
  interface AssemblyPipeline {
47
51
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"assembly.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/types/assembly.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,MAAM,GAAG,EAAE,IAAI;KACvD,GAAG,IAAI,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC;CACvC,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AACD,MAAM,MAAM,cAAc,CAAC,SAAS,SAAS,MAAM,GAAG,EAAE,IAAI;KACzD,GAAG,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC;CACzC,GAAG;IACF,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE;QACV,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC;AACF,MAAM,MAAM,eAAe,CAAC,OAAO,SAAS,MAAM,GAAG,EAAE,IAAI,IAAI,CAC7D,YAAY,CAAC,OAAO,CAAC,EACrB,OAAO,CACR,CAAC;AACF,MAAM,MAAM,YAAY,CAAC,OAAO,SAAS,MAAM,GAAG,EAAE,I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G,CAAC,CAAC,UAAU,CAAC,GAAG,GAAG,EAClD,CAAC,CAAC,SAAS,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,GAAG,CACjD,CAAC"}
1
+ {"version":3,"file":"assembly.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/types/assembly.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,MAAM,GAAG,EAAE,IAAI;KACvD,GAAG,IAAI,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC;CACvC,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AACD,MAAM,MAAM,cAAc,CAAC,SAAS,SAAS,MAAM,GAAG,EAAE,IAAI;KACzD,GAAG,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC;CACzC,GAAG;IACF,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE;QACV,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC;AACF,MAAM,MAAM,eAAe,CAAC,OAAO,SAAS,MAAM,GAAG,EAAE,IAAI,IAA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CAAC,CAAC,WAAW,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,GAAG,EACpD,CAAC,CAAC,WAAW,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,GAAG,EACpD,CAAC,CAAC,UAAU,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,GAAG,EAClD,CAAC,CAAC,SAAS,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,GAAG,CACjD,CAAC"}
@@ -2,8 +2,6 @@ export declare enum PourState {
2
2
  IDLE = "IDLE",
3
3
  POURING = "POURING",
4
4
  POUR_STARTING = "POUR_STARTING",
5
- POUR_CANCELING = "POUR_CANCELING",
6
- POUR_CANCELED = "POUR_CANCELED",
7
- POUR_COMPLETE = "POUR_COMPLETE"
5
+ POUR_CANCELING = "POUR_CANCELING"
8
6
  }
9
7
  //# sourceMappingURL=pouring.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pouring.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/types/pouring.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;CAChC"}
1
+ {"version":3,"file":"pouring.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/types/pouring.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;CAClC"}
@@ -8,10 +8,10 @@ export declare const api: {
8
8
  ordered?: boolean | undefined;
9
9
  tracker?: string | undefined;
10
10
  timeout?: number | undefined;
11
- destinationAddress?: string | undefined;
12
- bridge?: boolean | undefined;
13
11
  headers?: Record<string, string> | undefined;
14
12
  fos?: boolean | undefined;
13
+ bridge?: boolean | undefined;
14
+ destinationAddress?: string | undefined;
15
15
  studio?: boolean | undefined;
16
16
  signal?: AbortSignal | undefined;
17
17
  stream?: boolean | undefined;
@@ -27,10 +27,10 @@ export declare const api: {
27
27
  ordered?: boolean | undefined;
28
28
  tracker?: string | undefined;
29
29
  timeout?: number | undefined;
30
- destinationAddress?: string | undefined;
31
- bridge?: boolean | undefined;
32
30
  headers?: Record<string, string> | undefined;
33
31
  fos?: boolean | undefined;
32
+ bridge?: boolean | undefined;
33
+ destinationAddress?: string | undefined;
34
34
  studio?: boolean | undefined;
35
35
  signal?: AbortSignal | undefined;
36
36
  stream?: boolean | undefined;
@@ -46,10 +46,10 @@ export declare const api: {
46
46
  ordered?: boolean | undefined;
47
47
  tracker?: string | undefined;
48
48
  timeout?: number | undefined;
49
- destinationAddress?: string | undefined;
50
- bridge?: boolean | undefined;
51
49
  headers?: Record<string, string> | undefined;
52
50
  fos?: boolean | undefined;
51
+ bridge?: boolean | undefined;
52
+ destinationAddress?: string | undefined;
53
53
  studio?: boolean | undefined;
54
54
  signal?: AbortSignal | undefined;
55
55
  stream?: boolean | undefined;
@@ -65,10 +65,10 @@ export declare const api: {
65
65
  ordered?: boolean | undefined;
66
66
  tracker?: string | undefined;
67
67
  timeout?: number | undefined;
68
- destinationAddress?: string | undefined;
69
- bridge?: boolean | undefined;
70
68
  headers?: Record<string, string> | undefined;
71
69
  fos?: boolean | undefined;
70
+ bridge?: boolean | undefined;
71
+ destinationAddress?: string | undefined;
72
72
  studio?: boolean | undefined;
73
73
  signal?: AbortSignal | undefined;
74
74
  stream?: boolean | undefined;
package/models.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dispense-registration-manager-BZ5L3AWX.cjs"),n=require("./extension-utils-DUel3wIz.cjs");require("@kosdev-code/kos-ui-sdk");require("react");exports.Assembly=e.Assembly;exports.Availability=e.Availability;exports.Board=e.Board;exports.BoardContainer=e.BoardContainer;Object.defineProperty(exports,"BoardContainerModel",{enumerable:!0,get:()=>e.BoardContainerModel});exports.CONTEXT_ASSEMBLY_DATA=e.CONTEXT_ASSEMBLY_DATA;exports.CONTEXT_ASSEMBLY_RAW_DATA=e.CONTEXT_ASSEMBLY_RAW_DATA;exports.DeviceAssembly=e.DeviceAssembly;exports.DispenseModelType=e.DispenseModelType;exports.ExtensionType=e.ExtensionType;exports.GenericPour=e.GenericPour;exports.Holder=e.Holder;exports.HolderContainer=e.HolderContainer;exports.Ingredient=e.Ingredient;exports.IngredientContainer=e.IngredientContainer;exports.KosModelRegistry=e.KosModelRegistry;exports.Nozzle=e.Nozzle;exports.PourState=e.PourState;exports.Pump=e.Pump;exports.PumpContainer=e.PumpContainer;exports.PumpIndex=e.PumpIndex;exports.TOPIC_BOARD_LINKED=e.TOPIC_BOARD_LINKED;exports.TOPIC_BOARD_UNLINKED=e.TOPIC_BOARD_UNLINKED;exports.kosModels=e.kosModels;exports.registerDispenseModels=e.registerDispenseModels;exports.AssemblyServices=n.index;exports.AssemblyTypes=n.assembly;exports.DispenseExtensionManager=n.DispenseExtensionManager;exports.GenericPourServices=n.index$1;exports.HolderServices=n.index$2;exports.IngredientServices=n.index$3;exports.KosExtensionManager=n.KosExtensionManager;exports.NozzleServices=n.index$4;exports.PumpServices=n.index$5;exports.getFuelGaugeValue=n.getFuelGaugeValue;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dispense-registration-manager-DDyKjPWB.cjs"),n=require("./extension-utils-BceaRPqX.cjs");require("@kosdev-code/kos-ui-sdk");require("react");exports.Assembly=e.Assembly;exports.Availability=e.Availability;exports.Board=e.Board;exports.BoardContainer=e.BoardContainer;Object.defineProperty(exports,"BoardContainerModel",{enumerable:!0,get:()=>e.BoardContainerModel});exports.CONTEXT_ASSEMBLY_DATA=e.CONTEXT_ASSEMBLY_DATA;exports.CONTEXT_ASSEMBLY_RAW_DATA=e.CONTEXT_ASSEMBLY_RAW_DATA;exports.DeviceAssembly=e.DeviceAssembly;exports.DispenseModelType=e.DispenseModelType;exports.ExtensionType=e.ExtensionType;exports.GenericPour=e.GenericPour;exports.Holder=e.Holder;exports.HolderContainer=e.HolderContainer;exports.Ingredient=e.Ingredient;exports.IngredientContainer=e.IngredientContainer;exports.KosModelRegistry=e.KosModelRegistry;exports.Nozzle=e.Nozzle;exports.PourState=e.PourState;exports.Pump=e.Pump;exports.PumpContainer=e.PumpContainer;exports.PumpIndex=e.PumpIndex;exports.TOPIC_BOARD_LINKED=e.TOPIC_BOARD_LINKED;exports.TOPIC_BOARD_UNLINKED=e.TOPIC_BOARD_UNLINKED;exports.kosModels=e.kosModels;exports.registerDispenseModels=e.registerDispenseModels;exports.AssemblyServices=n.index;exports.AssemblyTypes=n.assembly;exports.DispenseExtensionManager=n.DispenseExtensionManager;exports.GenericPourServices=n.index$1;exports.HolderServices=n.index$2;exports.IngredientServices=n.index$3;exports.KosExtensionManager=n.KosExtensionManager;exports.NozzleServices=n.index$4;exports.PumpServices=n.index$5;exports.getFuelGaugeValue=n.getFuelGaugeValue;
2
2
  //# sourceMappingURL=models.cjs.map
package/models.js CHANGED
@@ -1,5 +1,5 @@
1
- import { A as o, b as i, e as n, d as t, B as l, C as d, a as A, f as p, D as m, E as D, G as T, H as c, g, I as S, h as u, K as C, N as E, k as P, P as y, i as I, j as M, T as _, c as v, l as B, r as N } from "./dispense-registration-manager-CB_nSTZw.js";
2
- import { i as x, f as K, D as O, a as f, b as z, c as G, K as H, d as L, e as R, g as k } from "./extension-utils-CkYqorcG.js";
1
+ import { A as o, b as i, e as n, d as t, B as l, C as d, a as A, f as p, D as m, E as D, G as T, H as c, g, I as S, h as u, K as C, N as E, k as P, P as y, i as I, j as M, T as _, c as v, l as B, r as N } from "./dispense-registration-manager-DgMTZL-g.js";
2
+ import { i as x, f as K, D as O, a as f, b as z, c as G, K as H, d as L, e as R, g as k } from "./extension-utils-mvxA4D4h.js";
3
3
  import "@kosdev-code/kos-ui-sdk";
4
4
  import "react";
5
5
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosdev-code/kos-dispense-sdk",
3
- "version": "2.1.17",
3
+ "version": "2.1.18",
4
4
  "type": "module",
5
5
  "types": "./index.d.ts",
6
6
  "main": "./index.js",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "kos": {
35
35
  "build": {
36
- "gitHash": "c98a36c0d6454b4648b4e9d014b0e57fcd1d39a1"
36
+ "gitHash": "a67b416c6600353f7483b900351970722d3e3282"
37
37
  }
38
38
  }
39
39
  }