@kosdev-code/kos-dispense-sdk 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dispense-registration-manager-DxIbOft8.js → dispense-registration-manager-DfKHzcrZ.js} +2 -1
- package/{dispense-registration-manager-DxIbOft8.js.map → dispense-registration-manager-DfKHzcrZ.js.map} +1 -1
- package/{dispense-registration-manager-aM9RAFHn.cjs → dispense-registration-manager-f0b1L6Mt.cjs} +2 -2
- package/{dispense-registration-manager-aM9RAFHn.cjs.map → dispense-registration-manager-f0b1L6Mt.cjs.map} +1 -1
- package/{extension-utils-hWIrDMX4.cjs → extension-utils-Bz00r5LT.cjs} +2 -2
- package/{extension-utils-hWIrDMX4.cjs.map → extension-utils-Bz00r5LT.cjs.map} +1 -1
- package/{extension-utils-qcU_4sXo.js → extension-utils-bU6yk7dw.js} +3 -3
- package/{extension-utils-qcU_4sXo.js.map → extension-utils-bU6yk7dw.js.map} +1 -1
- package/index.cjs +1 -1
- package/index.js +3 -3
- package/models/constants/constants.d.ts +2 -2
- package/models/models/ingredient-container/types/index.d.ts +1 -1
- package/models/models/nozzle/index.d.ts +1 -1
- package/models/models/nozzle/nozzle-model.d.ts +1 -1
- package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
- package/models/models/nozzle/services/nozzle-services.d.ts +5 -5
- package/models/utils/extension-utils.d.ts +1 -1
- package/models/utils/openapi.d.ts +1 -1
- package/models/utils/service.d.ts +3 -3
- package/models.cjs +1 -1
- package/models.js +2 -2
- package/package.json +3 -3
- package/pump-provider-BsCVHaj9.js +1016 -0
- package/pump-provider-BsCVHaj9.js.map +1 -0
- package/pump-provider-DX58hw88.cjs +2 -0
- package/pump-provider-DX58hw88.cjs.map +1 -0
- package/ui/hooks/cui-kit/use-beverages.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-brands.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-cui-kit.d.ts +47 -5
- package/ui/hooks/cui-kit/use-cui-kit.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-dispense-timers.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-flavors.d.ts.map +1 -1
- package/ui.cjs +1 -1
- package/ui.js +2 -2
- package/pump-provider-COTqsOH-.js +0 -1013
- package/pump-provider-COTqsOH-.js.map +0 -1
- package/pump-provider-D2HzZ2Bj.cjs +0 -2
- package/pump-provider-D2HzZ2Bj.cjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty;var A=(t,e,a)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var o=(t,e,a)=>(A(t,typeof e!="symbol"?e+"":e,a),a);const n=require("./dispense-registration-manager-
|
|
2
|
-
//# sourceMappingURL=extension-utils-
|
|
1
|
+
"use strict";var v=Object.defineProperty;var A=(t,e,a)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var o=(t,e,a)=>(A(t,typeof e!="symbol"?e+"":e,a),a);const n=require("./dispense-registration-manager-f0b1L6Mt.cjs"),r=require("@kosdev-code/kos-ui-sdk"),s=require("react"),H=Object.freeze(Object.defineProperty({__proto__:null,getIngredients:n.getIngredients},Symbol.toStringTag,{value:"Module"})),D=Object.freeze(Object.defineProperty({__proto__:null,addAssignment:n.addAssignment,assignHolderIngredient:n.assignHolderIngredient,deleteAssignment:n.deleteAssignment,getAssignments:n.getAssignments,getHolders:n.getHolders,replaceLine:n.replaceLine,sendRfidOverride:n.sendRfidOverride,unassignHolderIngredient:n.unassignHolderIngredient},Symbol.toStringTag,{value:"Module"})),O=Object.freeze(Object.defineProperty({__proto__:null,getAssembly:n.getAssembly},Symbol.toStringTag,{value:"Module"})),j=Object.freeze(Object.defineProperty({__proto__:null,getIntentVolume:n.getIntentVolume,sendIntent:n.sendIntent},Symbol.toStringTag,{value:"Module"})),L=Object.freeze(Object.defineProperty({__proto__:null,clearPourable:n.clearPourable,getAvailability:n.getAvailability,pourNamedPourable:n.pourNamedPourable,pourPourable:n.pourPourable,selectPourable:n.selectPourable},Symbol.toStringTag,{value:"Module"})),$=t=>{var l,u,M,x;const[e,a]=s.useState(((l=t==null?void 0:t.slice)==null?void 0:l.maxVolMl)??0),[i,m]=s.useState(((u=t==null?void 0:t.slice)==null?void 0:u.currentVolMl)??0),[p,I]=s.useState(((M=t==null?void 0:t.slice)==null?void 0:M.maxVolMl)!==void 0),[g,T]=s.useState(((x=t==null?void 0:t.slice)==null?void 0:x.currentVolMl)!==void 0),[_,f]=s.useState(i<=0?0:Math.floor((i||1)/(e||1)*100)),[P,S]=s.useState(p&&g);return s.useEffect(()=>{const V=r.kosAutoEffect(()=>{var d,c,y,E;a(((d=t==null?void 0:t.slice)==null?void 0:d.maxVolMl)??0),m(((c=t==null?void 0:t.slice)==null?void 0:c.currentVolMl)??0),I(((y=t==null?void 0:t.slice)==null?void 0:y.maxVolMl)!==void 0),T(((E=t==null?void 0:t.slice)==null?void 0:E.currentVolMl)!==void 0),f(i<=0?0:Math.floor((i||1)/(e||1)*100)),S(p&&g)});return()=>{V()}},[t]),{maxVolume:e,remainingVolume:i,fillPercent:_,hasFuelGuage:P}},R=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class b{constructor(){o(this,"core",new r.CoreExtensionManager)}registerIngredientDataMapper(e){return r.ExtensionManager.dataMapper.registerDataMapper(n.ExtensionType.IngredientMapper,e),this}registerIngredientLoader(e){return r.ExtensionManager.loader.registerLoader(n.ExtensionType.IngredientLoader,e),this}registerIngredientIndex(e){return r.ExtensionManager.indexExtension.registerIndexExtension(n.ExtensionType.IngredientIndex,e),this}registerIngredientTypeMapper(e){return r.ExtensionManager.propertyMapper.registerPropertyMapper(n.ExtensionType.IngredientTypeMapper,e),this}registerHolderDataMapper(e){return r.ExtensionManager.dataMapper.registerDataMapper(n.ExtensionType.HolderMapper,e),this}registerHolderTypeMapper(e){return r.ExtensionManager.propertyMapper.registerPropertyMapper(n.ExtensionType.HolderTypeMapper,e),this}registerHolderIngredientMapper(e){return r.ExtensionManager.propertyMapper.registerPropertyMapper(n.ExtensionType.HolderTypeMapper,e),this}registerHolderIndex(e){return r.ExtensionManager.indexExtension.registerIndexExtension(n.ExtensionType.HolderIndex,e),this}registerAvailabilityDataMapper(e){return r.ExtensionManager.dataMapper.registerDataMapper(n.ExtensionType.AvailabilityMapper,e),this}registerAvailabilityLoader(e){return r.ExtensionManager.loader.registerLoader(n.ExtensionType.AvailabilityLoader,e),this}registerSelectedPourableDataMapper(e){return r.ExtensionManager.dataMapper.registerDataMapper(n.ExtensionType.SelectedPourableMapper,e),this}registerAssemblyDataMapper(e){return r.ExtensionManager.dataMapper.registerDataMapper(n.ExtensionType.AssemblyMapper,e),this}registerBoardIndex(e){return r.ExtensionManager.indexExtension.registerIndexExtension(n.ExtensionType.BoardIndex,e),this}registerBoardDataMapper(e){return r.ExtensionManager.dataMapper.registerDataMapper(n.ExtensionType.BoardMapper,e),this}}class z{constructor(){o(this,"dispense");o(this,"core");this.dispense=new b,this.core=new r.CoreExtensionManager}}exports.DispenseExtensionManager=b;exports.KosExtensionManager=z;exports.assembly=R;exports.getFuelGaugeValue=$;exports.index=O;exports.index$1=D;exports.index$2=H;exports.index$3=L;exports.index$4=j;
|
|
2
|
+
//# sourceMappingURL=extension-utils-Bz00r5LT.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-utils-hWIrDMX4.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 ExtensionManager,\n IndexExtension,\n PropertyMapper,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { ExtensionType } from \"../constants\";\nimport { AssemblyTypes } 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\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","KosExtensionManager"],"mappings":"gzCAIaA,EAAqBC,GAAwB,aAClD,KAAA,CAACC,EAAWC,CAAY,EAAIC,EAAA,WAChCC,EAAAJ,GAAA,YAAAA,EAAQ,QAAR,YAAAI,EAAe,WAAY,CAAA,EAEvB,CAACC,EAAiBC,CAAkB,EAAIH,EAAA,WAC5CI,EAAAP,GAAA,YAAAA,EAAQ,QAAR,YAAAO,EAAe,eAAgB,CAAA,EAG3B,CAACC,EAAcC,CAAe,EAAIN,EAAA,WACtCO,EAAAV,GAAA,YAAAA,EAAQ,QAAR,YAAAU,EAAe,YAAa,MAAA,EAGxB,CAACC,EAAoBC,CAAqB,EAAIT,EAAA,WAClDU,EAAAb,GAAA,YAAAA,EAAQ,QAAR,YAAAa,EAAe,gBAAiB,MAAA,EAG5B,CAACC,EAAaC,CAAc,EAAIZ,EAAA,SACpCE,GAAmB,EACf,EACA,KAAK,OAAQA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ispense-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 ExtensionManager,\n IndexExtension,\n PropertyMapper,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { ExtensionType } from \"../constants\";\nimport { AssemblyTypes } 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\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","KosExtensionManager"],"mappings":"gzCAIaA,EAAqBC,GAAwB,aAClD,KAAA,CAACC,EAAWC,CAAY,EAAIC,EAAA,WAChCC,EAAAJ,GAAA,YAAAA,EAAQ,QAAR,YAAAI,EAAe,WAAY,CAAA,EAEvB,CAACC,EAAiBC,CAAkB,EAAIH,EAAA,WAC5CI,EAAAP,GAAA,YAAAA,EAAQ,QAAR,YAAAO,EAAe,eAAgB,CAAA,EAG3B,CAACC,EAAcC,CAAe,EAAIN,EAAA,WACtCO,EAAAV,GAAA,YAAAA,EA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,CAAA,EAEK,IACT,CACF,CAUO,MAAMC,CAAoB,CAG/B,aAAc,CAFdjB,EAAA,iBACAA,EAAA,aAEO,KAAA,SAAW,IAAID,EACf,KAAA,KAAO,IAAIE,EAAAA,oBAClB,CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var E = Object.defineProperty;
|
|
2
2
|
var H = (t, e, s) => e in t ? E(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
3
|
var p = (t, e, s) => (H(t, typeof e != "symbol" ? e + "" : e, s), s);
|
|
4
|
-
import { l as O, m as j, n as A, o as T, p as z, q as L, s as F, t as w, u as B, v as G, w as R, x as $, y as C, z as K, C as k, F as q, G as N, E as r } from "./dispense-registration-manager-
|
|
4
|
+
import { l as O, m as j, n as A, o as T, p as z, q as L, s as F, t as w, u as B, v as G, w as R, x as $, y as C, z as K, C as k, F as q, G as N, E as r } from "./dispense-registration-manager-DfKHzcrZ.js";
|
|
5
5
|
import { kosAutoEffect as J, CoreExtensionManager as y, ExtensionManager as a } from "@kosdev-code/kos-ui-sdk";
|
|
6
6
|
import { useState as n, useEffect as Q } from "react";
|
|
7
7
|
const h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -68,7 +68,7 @@ class U {
|
|
|
68
68
|
* Maps data into the {@link IngredientModel}
|
|
69
69
|
*
|
|
70
70
|
* It is common for the ingredient data provided by the ingredient service to be augmented with additional properties that are
|
|
71
|
-
* not provided by the base
|
|
71
|
+
* not provided by the base KOS Ingredient model. The {@link IngredientMapper} extension point allows for the data to be mapped
|
|
72
72
|
* into the {@link IngredientModel} and the {@link IngredientModel.data} property to be augmented with additional properties.
|
|
73
73
|
*
|
|
74
74
|
* @example
|
|
@@ -367,4 +367,4 @@ export {
|
|
|
367
367
|
se as g,
|
|
368
368
|
te as i
|
|
369
369
|
};
|
|
370
|
-
//# sourceMappingURL=extension-utils-
|
|
370
|
+
//# sourceMappingURL=extension-utils-bU6yk7dw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-utils-qcU_4sXo.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 ExtensionManager,\n IndexExtension,\n PropertyMapper,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { ExtensionType } from \"../constants\";\nimport { AssemblyTypes } 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\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","KosExtensionManager"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAIaA,KAAoB,CAACC,MAAwB;;AAClD,QAAA,CAACC,GAAWC,CAAY,IAAIC;AAAA,MAChCC,IAAAJ,KAAA,gBAAAA,EAAQ,UAAR,gBAAAI,EAAe,aAAY;AAAA,EAAA,GAEvB,CAACC,GAAiBC,CA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AAe;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;AACF;AAUO,MAAMC,GAAoB;AAAA,EAG/B,cAAc;AAFd,IAAAjB,EAAA;AACA,IAAAA,EAAA;AAEO,SAAA,WAAW,IAAID,KACf,KAAA,OAAO,IAAIE;EAClB;AACF;"}
|
|
1
|
+
{"version":3,"file":"extension-utils-bU6yk7dw.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 ExtensionManager,\n IndexExtension,\n PropertyMapper,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { ExtensionType } from \"../constants\";\nimport { AssemblyTypes } 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\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","avail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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,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;AACF;AAUO,MAAMC,GAAoB;AAAA,EAG/B,cAAc;AAFd,IAAAjB,EAAA;AACA,IAAAA,EAAA;AAEO,SAAA,WAAW,IAAID,KACf,KAAA,OAAO,IAAIE;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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./dispense-registration-manager-f0b1L6Mt.cjs"),i=require("./extension-utils-Bz00r5LT.cjs"),e=require("./pump-provider-DX58hw88.cjs");require("@kosdev-code/kos-ui-sdk");require("react");require("@emotion/react/jsx-runtime");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.DeviceAssembly=r.DeviceAssembly;exports.DispenseModelType=r.DispenseModelType;exports.DispenserModels=r.kosModels;exports.ExtensionType=r.ExtensionType;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=i.index;exports.AssemblyTypes=i.assembly;exports.DispenseExtensionManager=i.DispenseExtensionManager;exports.HolderServices=i.index$1;exports.IngredientServices=i.index$2;exports.KosExtensionManager=i.KosExtensionManager;exports.NozzleServices=i.index$3;exports.PumpServices=i.index$4;exports.getFuelGaugeValue=i.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.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.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.usePumpContext=e.usePumpContext;exports.withAssembly=e.withAssembly;exports.withBeverage=e.withBeverage;exports.withBoard=e.withBoard;exports.withBoardContainer=e.withBoardContainer;exports.withDeviceAssembly=e.withDeviceAssembly;exports.withHolder=e.withHolder;exports.withHolderContainer=e.withHolderContainer;exports.withIngredient=e.withIngredient;exports.withIngredientContainer=e.withIngredientContainer;exports.withNozzle=e.withNozzle;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as o, a as t, d as n, c as d, B as l, e as u, D as C, k as P, E as v, H as g, f as y, I as m, g as p, K as I, N as A, j as D, P as B, h as b, i as x, T as S, b as c, k as z, r as E } from "./dispense-registration-manager-
|
|
2
|
-
import { i as N, e as T, D as K, a as h, b as w, K as _, c as O, d as R, g as M } from "./extension-utils-
|
|
3
|
-
import { A as G, a as L, d as U, B as k, f as F, C as V, G as j, F as W, J as q, D as J, a3 as Q, a4 as X, j as Y, H as Z, m as $, I as ee, N as se, P as ae, a5 as re, a6 as ie, a7 as oe, i as te, q as ne, u as de, r as le, b as ue, z as Ce, t as Pe, x as ve, e as ge, c as ye, E as me, K as pe, O as Ie, L as Ae, R as De, g as Be, M as be, Q as xe, T as Se, V as ce, k as ze, h as Ee, X as He, _ as Ne, n as Te, l as Ke, Y as he, a0 as we, o as _e, a2 as Oe, p as Re, w as Me, s as fe, v as Ge, y as Le, S as Ue, U as ke, W as Fe, Z as Ve, $ as je, a1 as We } from "./pump-provider-
|
|
1
|
+
import { A as o, a as t, d as n, c as d, B as l, e as u, D as C, k as P, E as v, H as g, f as y, I as m, g as p, K as I, N as A, j as D, P as B, h as b, i as x, T as S, b as c, k as z, r as E } from "./dispense-registration-manager-DfKHzcrZ.js";
|
|
2
|
+
import { i as N, e as T, D as K, a as h, b as w, K as _, c as O, d as R, g as M } from "./extension-utils-bU6yk7dw.js";
|
|
3
|
+
import { A as G, a as L, d as U, B as k, f as F, C as V, G as j, F as W, J as q, D as J, a3 as Q, a4 as X, j as Y, H as Z, m as $, I as ee, N as se, P as ae, a5 as re, a6 as ie, a7 as oe, i as te, q as ne, u as de, r as le, b as ue, z as Ce, t as Pe, x as ve, e as ge, c as ye, E as me, K as pe, O as Ie, L as Ae, R as De, g as Be, M as be, Q as xe, T as Se, V as ce, k as ze, h as Ee, X as He, _ as Ne, n as Te, l as Ke, Y as he, a0 as we, o as _e, a2 as Oe, p as Re, w as Me, s as fe, v as Ge, y as Le, S as Ue, U as ke, W as Fe, Z as Ve, $ as je, a1 as We } from "./pump-provider-BsCVHaj9.js";
|
|
4
4
|
import "@kosdev-code/kos-ui-sdk";
|
|
5
5
|
import "react";
|
|
6
6
|
import "@emotion/react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Extension point exposed by the
|
|
2
|
+
* Extension point exposed by the KOS Dispense SDK models
|
|
3
3
|
* */
|
|
4
4
|
export declare enum ExtensionType {
|
|
5
5
|
/**
|
|
@@ -30,7 +30,7 @@ export declare enum ExtensionType {
|
|
|
30
30
|
* Maps data into the {@link IngredientModel}
|
|
31
31
|
*
|
|
32
32
|
* It is common for the ingredient data provided by the ingredient service to be augmented with additional properties that are
|
|
33
|
-
* not provided by the base
|
|
33
|
+
* not provided by the base KOS Ingredient model. The {@link IngredientMapper} extension point allows for the data to be mapped
|
|
34
34
|
* into the {@link IngredientModel} and the {@link IngredientModel.data} property to be augmented with additional properties.
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
@@ -5,7 +5,7 @@ import { IKosDataModel, IKosModelContainer } from '@kosdev-code/kos-ui-sdk';
|
|
|
5
5
|
export interface IngredientContainerOptions {}
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* The IngredientContainer represents the collection of {@link IngredientModel} entities that are considered as part of the
|
|
8
|
+
* The IngredientContainer represents the collection of {@link IngredientModel} entities that are considered as part of the KOS Beverage Graph.
|
|
9
9
|
*
|
|
10
10
|
* Its primary purpose is expose the set of ingredients that can be used to compose a pourable beverage. The presence or absence
|
|
11
11
|
* of an ingredient in the container will determine if the ingredient is available for use in the beverage graph.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Nozzle, type NozzleModel } from './nozzle-model';
|
|
2
2
|
export type { NozzleOptions, SelectedPourable } from './types';
|
|
3
|
-
/** @category
|
|
3
|
+
/** @category KOS Services */
|
|
4
4
|
export * as NozzleServices from './services';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -250,7 +250,7 @@ export type NozzleModel = PublicModelInterface<NozzleModelImpl>;
|
|
|
250
250
|
* The nozzle model is not a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.
|
|
251
251
|
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
252
252
|
*
|
|
253
|
-
* @category
|
|
253
|
+
* @category KOS Model Registration
|
|
254
254
|
* */
|
|
255
255
|
export declare const Nozzle: Readonly<KosModelRegistrationBean<NozzleModel, NozzleOptions>>;
|
|
256
256
|
export {};
|
|
@@ -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,EAgBL,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,EAAE,aAAa,EAAE,eAAe;IAE1D,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,iBAAiB,CAAC,CAAoB;IAC9C,OAAO,CAAC,cAAc,CAAC,CAAoB;IAC3C,OAAO,CAAC,gBAAgB,CAAC,CAAsB;IACrC,OAAO,CAAC,kBAAkB,CAAwC;IAC5E,aAAa,EAAE,oBAAoB,CAAC;IACpC,YAAY,EAAE,SAAS,CAAkB;IAEzC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,IAAI,SAAS,6BAEZ;IAED;;;OAGG;IACH,IAAI,MAAM,6BAET;IAED,IAAI,aAAa,6BAEhB;IAED,IAAI,gBAAgB,6BAEnB;IAED;;;OAGG;IACH,IAAI,SAAS,YAUZ;IAED;;;;;;;;;SASK;IACL,IAAI,OAAO,YAMV;IAED;;;;;SAKK;IACL,IAAI,gBAAgB;;;MAKnB;IAED,IAAI,MAAM,sDAET;IAED,IAAI,YAAY,WAEf;gBAGC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,kBAAkB;IAuB7B,WAAW,IAAI,IAAI;IAMnB,gBAAgB,CAAC,KAAK,CAAC,EAAE,iBAAiB;IAK1C,IAAI,aAAa,uCAEhB;IACD;;;;;;;SAOK;IACC,mBAAmB,CAAC,EACxB,QAAQ,EACR,UAAU,EACV,OAAO,GACR,EAAE,gBAAgB;
|
|
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,EAgBL,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,EAC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,CAAC,EACxB,QAAQ,EACR,UAAU,EACV,OAAO,GACR,EAAE,gBAAgB;IAoCnB;;;;;;;;SAQK;IACL,yBAAyB,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,EAAE,OAAO,EAAE,MAAM;IAOjE;;;;;;;;OAQG;IACH,uBAAuB,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,EAAE,QAAQ,EAAE,MAAM;IAOhE,OAAO,CAAC,eAAe;IAQvB,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC;IAoBxC;;;;;;;SAOK;IAEQ,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM;IAgClC;;;;;;;;SAQK;IAEQ,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAoCrD;;SAEK;IACQ,UAAU;IAwBvB,OAAO,CAAC,kBAAkB;IAe1B,gBAAgB;IACV,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IA4CzC,kBAAkB,CAAC,MAAM,EAAE,oBAAoB;CAgFtD;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"}
|
|
@@ -59,7 +59,7 @@ export interface AvailabilityResponse {
|
|
|
59
59
|
*
|
|
60
60
|
* Initiates a pour for the specified nozzle.
|
|
61
61
|
*
|
|
62
|
-
* Uses the
|
|
62
|
+
* Uses the KOS endpoint [POST] `${URL}/api/ext/dispense/nozzle/${nozzleId}/pipeline/beverage/pour`
|
|
63
63
|
*
|
|
64
64
|
* @param nozzleId - the nozzle id to pour from.
|
|
65
65
|
* @param tracker - the tracker to use for the pour. It will be returned in the future to allow consumers
|
|
@@ -85,7 +85,7 @@ export declare const pourPourable: (nozzleId: string, tracker: string) => Promis
|
|
|
85
85
|
* dictated by the name.
|
|
86
86
|
*
|
|
87
87
|
*
|
|
88
|
-
* Uses the
|
|
88
|
+
* Uses the KOS endpoint [POST] `${URL}/api/ext/dispense/nozzle/${nozzleId}/pipeline/beverage/fixed/${name}`
|
|
89
89
|
*
|
|
90
90
|
* @param name - name of the fixed pour volume.
|
|
91
91
|
* @param nozzleId - the nozzle id to pour from.
|
|
@@ -107,7 +107,7 @@ export declare const pourNamedPourable: (name: string, nozzleId: string, tracker
|
|
|
107
107
|
/**
|
|
108
108
|
* Retrieves the availability nodes for a specified nozzle.
|
|
109
109
|
*
|
|
110
|
-
* Uses the
|
|
110
|
+
* Uses the KOS endpoint [GET] `${URL}/api/ext/dispense/nozzle/${nozzleId}/pipeline/beverage/availability`
|
|
111
111
|
*
|
|
112
112
|
* @param nozzleId - the nozzle id to retrieve availability for.
|
|
113
113
|
* @returns - the availability nodes for the specified nozzle.
|
|
@@ -128,7 +128,7 @@ export declare const getAvailability: (urlPrefix: string) => Promise<import('@ko
|
|
|
128
128
|
/**
|
|
129
129
|
* Invokes the endpoint to select a pourable for the specified nozzle.
|
|
130
130
|
*
|
|
131
|
-
* Uses the
|
|
131
|
+
* Uses the KOS endpoint [POST] `${URL}/api/ext/dispense/nozzle/${nozzleId}/pipeline/beverage/select`
|
|
132
132
|
*
|
|
133
133
|
*
|
|
134
134
|
* @param nozzleId - the nozzle id to select a pourable for.
|
|
@@ -158,7 +158,7 @@ export declare const getAvailability: (urlPrefix: string) => Promise<import('@ko
|
|
|
158
158
|
export declare const selectPourable: (nozzleId: string, payload: object) => Promise<import('@kosdev-code/kos-ui-sdk').KosServiceResponse<any> | undefined>;
|
|
159
159
|
/**
|
|
160
160
|
* Invokes the endpoint to clear the selected pourable for the specified nozzle.
|
|
161
|
-
* Uses the
|
|
161
|
+
* Uses the KOS endpoint [DELETE] `${URL}/api/ext/dispense/nozzle/${nozzleId}/pipeline/beverage/select`
|
|
162
162
|
*
|
|
163
163
|
* @param nozzleId - the nozzle id to clear the selected pourable for.
|
|
164
164
|
* @category Service
|
|
@@ -38,7 +38,7 @@ export declare class DispenseExtensionManager {
|
|
|
38
38
|
* Maps data into the {@link IngredientModel}
|
|
39
39
|
*
|
|
40
40
|
* It is common for the ingredient data provided by the ingredient service to be augmented with additional properties that are
|
|
41
|
-
* not provided by the base
|
|
41
|
+
* not provided by the base KOS Ingredient model. The {@link IngredientMapper} extension point allows for the data to be mapped
|
|
42
42
|
* into the {@link IngredientModel} and the {@link IngredientModel.data} property to be augmented with additional properties.
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
@@ -3835,7 +3835,7 @@ export interface paths {
|
|
|
3835
3835
|
cookie?: never;
|
|
3836
3836
|
};
|
|
3837
3837
|
/** Return schema data about all known config data. This describes the structure of every known
|
|
3838
|
-
* ConfigBean. This is used by
|
|
3838
|
+
* ConfigBean. This is used by KOS Studio tools. (v1.0) */
|
|
3839
3839
|
get: {
|
|
3840
3840
|
parameters: {
|
|
3841
3841
|
query?: never;
|
|
@@ -2,7 +2,7 @@ import { paths } from './openapi';
|
|
|
2
2
|
import { ClientResponse, DeepRequired, ElementType } from '@kosdev-code/kos-ui-sdk';
|
|
3
3
|
|
|
4
4
|
export declare const api: {
|
|
5
|
-
get: <K extends "/api/
|
|
5
|
+
get: <K extends "/api/kos/browser" | "/api/kos/browser/redirect" | "/api/kos/ota/paused" | "/api/kos/ota/artifacts" | "/api/kos/time/timezone" | "/api/kos/manifest/node" | "/api/kos/manifest/device" | "/api/kos/manifest/info" | "/api/kos/future/traces" | "/api/kos/future/traces/{traceId}/events" | "/api/kos/config/schema" | "/api/kos/config/schema/{path}" | "/api/kos/config/{path}" | "/api/kos/config/details/{options}" | "/api/kos/config/details/{path}/{options}" | "/api/kos/config/value/merged/{scopedPath}/{attr}" | "/api/kos/config/value/{scopedPath}/{attr}" | "/api/kos/config/bean/defaults/{scopedPath}" | "/api/kos/config/bean/merged/{path}" | "/api/kos/config/bean/overrides/{scopedPath}" | "/api/kos/update/available" | "/api/kos/nodeMgr/node/{nodeId}/blockedManifests" | "/api/kos/nodeMgr/blockedManifests" | "/api/kos/localization/context/{*path}" | "/api/kos/localization/contexts" | "/api/kos/openapi/{*baseUrl}" | "/api/kos/regions" | "/api/kos/regions/info" | "/api/kos/device" | "/api/kos/device/assemblies" | "/api/kos/device/serialNumber" | "/api/vfs" | "/api/kos/descriptor/{path}" | "/api/kos/descriptor/{path}/{dotted}" | "/api/kos/troubles" | "/api/kos/troubles/{troubleId}" | "/api/kos/handles" | "/api/kos/handles/{path}" | "/api/kos/handles/{path}/{view}" | "/api/kos/handles/views" | "/api/kos/storage/devices" | "/api/kos/network/interfaces" | "/api/kos/state/paths" | "/api/kos/state/{path}" | "/api/kos/criticalData/sources" | "/api/kos/criticalData/data" | "/api/kos/criticalData/data/{name}" | "/api/ext/freestyle/brandset/nutrition/{bevId}" | "/api/ext/freestyle/brandset/grantProperties" | "/api/ext/freestyle/ice/types" | "/api/app/kosdev.ddk/setup/steps" | "/api/app/kosdev.ddk/setup/steps/reset" | "/api/ext/dispense/soldOuts/troubles" | "/api/ext/dispense/soldOuts/db" | "/api/app/tccc.fits/medusa/profiles" | "/api/app/tccc.fits/medusa/profiles/{profileId}/recipes" | "/api/app/tccc.fits/medusa/profiles/{profileId}/tests" | "/api/app/tccc.fits/medusa/profiles/{profileId}/tests/{testId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/builder/blocks" | "/api/app/tccc.fits/medusa/profiles/{profileId}/builder/bevs" | "/api/app/tccc.fits/medusa/profiles/{profileId}/map" | "/api/app/tccc.fits/medusa/profiles/{profileId}/results" | "/api/app/tccc.fits/medusa/profiles/{profileId}/results/{resultsId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/results/{resultsId}/entries/{startIdx}/{endIdx}" | "/api/app/kosdev.ddk/ncui/plugins" | "/api/app/kosdev.ddk/ncui/open" | "/api/ext/dispense/metrics" | "/api/ext/dispense/metrics/names" | "/api/ext/dispense/metrics/{name}" | "/api/ext/dispense/metrics/{nozzle}/names" | "/api/ext/dispense/metrics/{nozzle}/{name}" | "/api/app/kosdev.ddk/auth/role" | "/api/app/tccc.fits/scales" | "/api/app/tccc.fits/scales/ifaces" | "/api/app/kosdev.ddk/cui" | "/api/app/kosdev.ddk/cui/open" | "/api/app/tccc.fits/persistence/sources" | "/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/intent/{path}/{intent}" | "/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/intent/{path}/{intent}/volume" | "/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/intent/{path}/{intent}/time" | "/api/ext/freestyle/microCalibration/report/{board}" | "/api/ext/freestyle/microCalibration/cal/{pump}" | "/api/ext/dispense/nozzle/nozzle/pipeline/beverage/engine/nutrition/{bevId}" | "/api/ext/freestyle/can/read/float/{boardPath}/{index}/{subIndex}" | "/api/ext/freestyle/can/read/int/{boardPath}/{index}/{subIndex}" | "/api/ext/freestyle/can/stats" | "/api/ext/freestyle/can/stats/raw" | "/api/ext/dispense/ingredients" | "/api/ext/dispense/ingredients/sources" | "/api/app/kosdev.ddk/copyLogs/volumes/size" | "/api/app/kosdev.ddk/copyLogs/files/size" | "/api/ext/dispense/nozzle/nozzle/pipeline/beverage/select" | "/api/ext/dispense/nozzle/nozzle/pipeline/beverage/availability" | "/api/ext/dispense/nozzle/nozzle/pipeline/beverage/availability/groups/{group}" | "/api/ext/dispense/nozzle/nozzle/pipeline/beverage/graph/node/{id}" | "/api/ext/dispense/nozzle/nozzle/pipeline/beverage/graph/beverages" | "/api/ext/dispense/nozzle/nozzle/pipeline/beverage/graph/nodes" | "/api/app/kosdev.ddk/network/reports" | "/api/app/kosdev.ddk/network/tests" | "/api/app/kosdev.ddk/network/tests/run/{id}" | "/api/app/kosdev.ddk/network/tests/run/group/{group}" | "/api/app/tccc.fits/session" | "/api/app/tccc.fits/session/data/{key}" | "/api/ext/freestyle/fcm/calibration/{pump}/baseline" | "/api/ext/dispense/assignments" | "/api/ext/dispense/insertion/filters" | "/api/kos/log/overrides" | "/api/ext/freestyle/fuelGauges/{holder}" | "/api/kos/log/groups" | "/api/kos/log/overrides/{nodeType}" | "/api/kos/log/overrides/{nodeType}/{typePrefix}" | "/api/ext/freestyle/cartridges" | "/api/ext/freestyle/cartridges/{id}">(endpoint: K, params?: (paths[K]["get"] extends {
|
|
6
6
|
parameters: infer P;
|
|
7
7
|
} ? P : never) | undefined, options?: {
|
|
8
8
|
ordered?: boolean | undefined;
|
|
@@ -14,7 +14,7 @@ export declare const api: {
|
|
|
14
14
|
studio?: boolean | undefined;
|
|
15
15
|
signal?: AbortSignal | undefined;
|
|
16
16
|
} | undefined) => Promise<import('@kosdev-code/kos-ui-sdk').ServiceResponse<ClientResponse<paths, K, "get">>>;
|
|
17
|
-
post: <K_1 extends "/api/
|
|
17
|
+
post: <K_1 extends "/api/kos/browser/{nodeId}" | "/api/kos/browser/{nodeId}/{name}" | "/api/kos/browser/intent" | "/api/kos/browser/url" | "/api/kos/ota/resume/{name}" | "/api/kos/ota/cancel" | "/api/kos/ota/cancel/{name}" | "/api/kos/ota/pause/{name}" | "/api/kos/time/date" | "/api/kos/time/timezone" | "/api/kos/time/time" | "/api/kos/future/{futureId}/cancel" | "/api/kos/config/{path}" | "/api/kos/config/bulk" | "/api/kos/update/install" | "/api/kos/nodeMgr/reboot" | "/api/kos/nodeMgr/node/{nodeId}/reboot" | "/api/kos/nodeMgr/node/{nodeId}/blockedManifests/{manifestId}" | "/api/kos/nodeMgr/blockedManifests/{manifestId}" | "/api/kos/device/serialNumber/{serialNum}" | "/api/kos/troubles/resolve" | "/api/kos/troubles/resolve/{troubleId}" | "/api/kos/criticalData/data" | "/api/kos/criticalData/data/{name}" | "/api/ext/freestyle/brandset/grantProperties" | "/api/ext/freestyle/ice/type/{path}/{type}" | "/api/app/kosdev.ddk/setup/complete/{stepName}" | "/api/ext/dispense/soldOuts/container/{pump}/{reason}" | "/api/ext/dispense/soldOuts/slice/{pump}/{reason}" | "/api/app/tccc.fits/medusa/profile" | "/api/app/tccc.fits/medusa/profiles/{profileId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/tests/resume" | "/api/app/tccc.fits/medusa/profiles/{profileId}/tests/exit" | "/api/app/tccc.fits/medusa/profiles/{profileId}/tests/stop" | "/api/app/tccc.fits/medusa/profiles/{profileId}/tests/{testId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/tests/{testId}/json" | "/api/app/tccc.fits/medusa/profiles/{profileId}/tests/{testId}/run" | "/api/app/tccc.fits/medusa/profiles/{profileId}/tests/pause" | "/api/app/tccc.fits/medusa/profiles/{profileId}/test" | "/api/app/tccc.fits/medusa/profiles/{profileId}/activate" | "/api/app/tccc.fits/medusa/profiles/{profileId}/builder/blocks" | "/api/app/tccc.fits/medusa/profiles/{profileId}/builder/bevs/{bevId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/recipe" | "/api/app/tccc.fits/medusa/profiles/{profileId}/mapper/discovery" | "/api/app/tccc.fits/medusa/profiles/{profileId}/mapper/builder" | "/api/app/tccc.fits/medusa/profiles/{profileId}/results/{resultsId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/validate" | "/api/app/tccc.fits/medusa/profiles/{profileId}/validate/all" | "/api/app/kosdev.ddk/ncui/reboot" | "/api/ext/dispense/metrics/{name}" | "/api/ext/dispense/metrics/{nozzle}/{name}" | "/api/app/kosdev.ddk/auth/pincode/{pin}" | "/api/app/tccc.fits/scales/{serialNum}" | "/api/app/tccc.fits/persistence/sources/{storageId}/{name}" | "/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/pour/{path}/{intent}" | "/api/ext/freestyle/microCalibration/cal/{pump}/running/{val}" | "/api/ext/freestyle/microCalibration/cal/{pump}/code/{code}" | "/api/ext/freestyle/microCalibration/cal/{pump}/baseline/{val}" | "/api/ext/freestyle/microCalibration/cal/{pump}/both/{val}" | "/api/ext/freestyle/can/stats" | "/api/ext/freestyle/can/write/byte/{boardPath}/{index}/{subIndex}/{val}" | "/api/ext/freestyle/can/write/short/{boardPath}/{index}/{subIndex}/{val}" | "/api/ext/freestyle/can/write/float/{boardPath}/{index}/{subIndex}/{val}" | "/api/ext/freestyle/can/write/int/{boardPath}/{index}/{subIndex}/{val}" | "/api/app/kosdev.ddk/copyLogs/eraseAndCopy/{id}" | "/api/app/kosdev.ddk/copyLogs/{id}" | "/api/ext/freestyle/fcm/diagnostics/{pump}/pressureTest" | "/api/ext/freestyle/fcm/diagnostics/{pump}/opennessTest" | "/api/ext/freestyle/fcm/diagnostics/{pump}/flowTest" | "/api/ext/freestyle/fcm/diagnostics/{pump}/electricalTest" | "/api/ext/dispense/nozzle/nozzle/pipeline/beverage/select" | "/api/ext/dispense/nozzle/nozzle/pipeline/beverage/pour" | "/api/ext/dispense/nozzle/nozzle/pipeline/beverage/fixed/{name}" | "/api/ext/dispense/pumpEvents/replaceLine/{holder}" | "/api/ext/dispense/pumpEvents/replacePump/{pump}" | "/api/app/tccc.fits/session/pop/all" | "/api/app/tccc.fits/session/pop/include/{type}" | "/api/app/tccc.fits/session/pop/to/{type}" | "/api/app/tccc.fits/session/data/{key}" | "/api/ext/freestyle/fcm/calibration/{pump}/calibrate" | "/api/ext/freestyle/fcm/calibration/{pump}/preCalibrate" | "/api/ext/freestyle/fcm/calibration/{pump}/verify/{calVolume}" | "/api/ext/freestyle/fcm/calibration/{pump}/baseline/{value}" | "/api/ext/freestyle/fcm/calibration/{pump}/complete/{calVolume}/{verifyVolume}" | "/api/handle/assembly:core:board:macro:agitator:agit/test" | "/api/app/kosdev.ddk/lockout/unlock/{pin}" | "/api/ext/dispense/assignments" | "/api/kos/log/overrides" | "/api/ext/freestyle/fuelGauges/{holder}/{val}">(endpoint: K_1, params?: (paths[K_1]["post"] extends {
|
|
18
18
|
parameters: infer P_1;
|
|
19
19
|
} ? P_1 : never) | undefined, body?: (paths[K_1]["post"] extends {
|
|
20
20
|
requestBody: {
|
|
@@ -46,7 +46,7 @@ export declare const api: {
|
|
|
46
46
|
studio?: boolean | undefined;
|
|
47
47
|
signal?: AbortSignal | undefined;
|
|
48
48
|
} | undefined) => Promise<import('@kosdev-code/kos-ui-sdk').ServiceResponse<ClientResponse<paths, K_2, "put">>>;
|
|
49
|
-
delete: <K_3 extends "/api/kos/criticalData/data/{name}" | "/api/app/tccc.fits/medusa/profiles/{profileId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/recipes/{name}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/tests/{testId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/builder/blocks" | "/api/app/tccc.fits/medusa/profiles/{profileId}/builder/bevs/{bevId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/results/{resultsId}" | "/api/
|
|
49
|
+
delete: <K_3 extends "/api/kos/nodeMgr/node/{nodeId}/blockedManifests" | "/api/kos/nodeMgr/node/{nodeId}/blockedManifests/{manifestId}" | "/api/kos/nodeMgr/blockedManifests/{manifestId}" | "/api/kos/criticalData/data/{name}" | "/api/app/tccc.fits/medusa/profiles/{profileId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/recipes/{name}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/tests/{testId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/builder/blocks" | "/api/app/tccc.fits/medusa/profiles/{profileId}/builder/bevs/{bevId}" | "/api/app/tccc.fits/medusa/profiles/{profileId}/results/{resultsId}" | "/api/ext/dispense/metrics/{name}" | "/api/ext/dispense/metrics/{nozzle}/{name}" | "/api/app/tccc.fits/scales/{serialNum}" | "/api/app/kosdev.ddk/copyLogs/{id}" | "/api/ext/dispense/nozzle/nozzle/pipeline/beverage/select" | "/api/app/tccc.fits/session/data/{key}" | "/api/ext/dispense/assignments/{holderPath}" | "/api/kos/log/overrides">(endpoint: K_3, params?: (paths[K_3]["delete"] extends {
|
|
50
50
|
parameters: infer P_3;
|
|
51
51
|
} ? P_3 : never) | undefined, options?: {
|
|
52
52
|
ordered?: 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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dispense-registration-manager-f0b1L6Mt.cjs"),n=require("./extension-utils-Bz00r5LT.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.DeviceAssembly=e.DeviceAssembly;exports.DispenseModelType=e.DispenseModelType;exports.ExtensionType=e.ExtensionType;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.HolderServices=n.index$1;exports.IngredientServices=n.index$2;exports.KosExtensionManager=n.KosExtensionManager;exports.NozzleServices=n.index$3;exports.PumpServices=n.index$4;exports.getFuelGaugeValue=n.getFuelGaugeValue;
|
|
2
2
|
//# sourceMappingURL=models.cjs.map
|
package/models.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as o, a as i, d as n, c as t, B as l, e as d, D as p, E as m, H as g, f as D, I as y, g as I, K as c, N as u, j as A, P, h as b, i as v, T as C, b as M, k as x, r as B } from "./dispense-registration-manager-
|
|
2
|
-
import { i as K, e as N, D as S, a as T, b as z, K as H, c as O, d as _, g as f } from "./extension-utils-
|
|
1
|
+
import { A as o, a as i, d as n, c as t, B as l, e as d, D as p, E as m, H as g, f as D, I as y, g as I, K as c, N as u, j as A, P, h as b, i as v, T as C, b as M, k as x, r as B } from "./dispense-registration-manager-DfKHzcrZ.js";
|
|
2
|
+
import { i as K, e as N, D as S, a as T, b as z, K as H, c as O, d as _, g as f } from "./extension-utils-bU6yk7dw.js";
|
|
3
3
|
import "@kosdev-code/kos-ui-sdk";
|
|
4
4
|
import "react";
|
|
5
5
|
export {
|