@kosdev-code/kos-dispense-sdk 2.1.39 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/{dispense-registration-manager-C6k10ipu.cjs → dispense-registration-manager-BH0mkCQx.cjs} +227 -253
  2. package/dispense-registration-manager-BH0mkCQx.cjs.map +1 -0
  3. package/{dispense-registration-manager-lJlcyq5G.js → dispense-registration-manager-BSKa5Oi9.js} +244 -270
  4. package/dispense-registration-manager-BSKa5Oi9.js.map +1 -0
  5. package/{extension-utils-DNbm2KRk.cjs → extension-utils-FKfiDSbi.cjs} +14 -25
  6. package/extension-utils-FKfiDSbi.cjs.map +1 -0
  7. package/{extension-utils-AS0Z5eod.js → extension-utils-jntF0-vN.js} +20 -31
  8. package/extension-utils-jntF0-vN.js.map +1 -0
  9. package/extensions/control-pour-extension.d.ts +8 -9
  10. package/extensions/control-pour-extension.d.ts.map +1 -1
  11. package/extensions/index.d.ts.map +1 -1
  12. package/index.cjs +3 -6
  13. package/index.cjs.map +1 -1
  14. package/index.d.ts.map +1 -1
  15. package/index.js +89 -92
  16. package/index.js.map +1 -1
  17. package/models/constants/constants.d.ts.map +1 -1
  18. package/models/constants/index.d.ts.map +1 -1
  19. package/models/index.d.ts.map +1 -1
  20. package/models/models/assembly/assembly-model.d.ts +4 -5
  21. package/models/models/assembly/assembly-model.d.ts.map +1 -1
  22. package/models/models/assembly/assembly-registration.d.ts +1 -2
  23. package/models/models/assembly/assembly-registration.d.ts.map +1 -1
  24. package/models/models/assembly/board-utils.d.ts +1 -2
  25. package/models/models/assembly/board-utils.d.ts.map +1 -1
  26. package/models/models/assembly/holder-utils.d.ts +1 -2
  27. package/models/models/assembly/holder-utils.d.ts.map +1 -1
  28. package/models/models/assembly/index.d.ts.map +1 -1
  29. package/models/models/assembly/nozzle-utils.d.ts +1 -2
  30. package/models/models/assembly/nozzle-utils.d.ts.map +1 -1
  31. package/models/models/assembly/pump-utils.d.ts +2 -3
  32. package/models/models/assembly/pump-utils.d.ts.map +1 -1
  33. package/models/models/assembly/services/assembly-services.d.ts +0 -1
  34. package/models/models/assembly/services/assembly-services.d.ts.map +1 -1
  35. package/models/models/assembly/services/index.d.ts.map +1 -1
  36. package/models/models/assembly/types/index.d.ts +2 -3
  37. package/models/models/availability/availability-model.d.ts +1 -2
  38. package/models/models/availability/availability-model.d.ts.map +1 -1
  39. package/models/models/availability/index.d.ts.map +1 -1
  40. package/models/models/availability/types/index.d.ts +0 -1
  41. package/models/models/board/board-container-model.d.ts +2 -3
  42. package/models/models/board/board-container-model.d.ts.map +1 -1
  43. package/models/models/board/board-container-registration.d.ts +2 -3
  44. package/models/models/board/board-container-registration.d.ts.map +1 -1
  45. package/models/models/board/board-model.d.ts +1 -2
  46. package/models/models/board/board-model.d.ts.map +1 -1
  47. package/models/models/board/board-registration.d.ts +1 -2
  48. package/models/models/board/board-registration.d.ts.map +1 -1
  49. package/models/models/board/index.d.ts.map +1 -1
  50. package/models/models/board/types/index.d.ts +0 -2
  51. package/models/models/board/types/services.d.ts.map +1 -1
  52. package/models/models/board/utils/board-trouble-data-mapper.d.ts +1 -2
  53. package/models/models/board/utils/board-trouble-data-mapper.d.ts.map +1 -1
  54. package/models/models/board/utils/board-trouble-resolver.d.ts +0 -1
  55. package/models/models/board/utils/board-trouble-resolver.d.ts.map +1 -1
  56. package/models/models/device-assembly/device-assembly-model.d.ts +2 -3
  57. package/models/models/device-assembly/device-assembly-model.d.ts.map +1 -1
  58. package/models/models/device-assembly/device-assembly-registration.d.ts +2 -3
  59. package/models/models/device-assembly/device-assembly-registration.d.ts.map +1 -1
  60. package/models/models/device-assembly/index.d.ts.map +1 -1
  61. package/models/models/generic-pour/generic-pour-model.d.ts +3 -4
  62. package/models/models/generic-pour/generic-pour-model.d.ts.map +1 -1
  63. package/models/models/generic-pour/generic-pour-registration.d.ts +2 -3
  64. package/models/models/generic-pour/generic-pour-registration.d.ts.map +1 -1
  65. package/models/models/generic-pour/index.d.ts.map +1 -1
  66. package/models/models/generic-pour/services/generic-pour-services.d.ts.map +1 -1
  67. package/models/models/generic-pour/services/index.d.ts.map +1 -1
  68. package/models/models/holder/holder-model.d.ts +1 -2
  69. package/models/models/holder/holder-model.d.ts.map +1 -1
  70. package/models/models/holder/index.d.ts.map +1 -1
  71. package/models/models/holder/services/assignment-services.d.ts.map +1 -1
  72. package/models/models/holder/services/holder-services.d.ts.map +1 -1
  73. package/models/models/holder/services/index.d.ts.map +1 -1
  74. package/models/models/holder/types/index.d.ts +5 -7
  75. package/models/models/holder/utils/holder-utils.d.ts +0 -1
  76. package/models/models/holder/utils/holder-utils.d.ts.map +1 -1
  77. package/models/models/holder-container/holder-container-model.d.ts +1 -2
  78. package/models/models/holder-container/holder-container-model.d.ts.map +1 -1
  79. package/models/models/holder-container/index.d.ts.map +1 -1
  80. package/models/models/holder-container/types/index.d.ts +1 -3
  81. package/models/models/index.d.ts.map +1 -1
  82. package/models/models/ingredient/index.d.ts.map +1 -1
  83. package/models/models/ingredient/ingredient-model.d.ts +1 -2
  84. package/models/models/ingredient/ingredient-model.d.ts.map +1 -1
  85. package/models/models/ingredient/services/index.d.ts.map +1 -1
  86. package/models/models/ingredient/services/ingredient-services.d.ts.map +1 -1
  87. package/models/models/ingredient/types/index.d.ts +0 -2
  88. package/models/models/ingredient-container/index.d.ts.map +1 -1
  89. package/models/models/ingredient-container/ingredient-container-model.d.ts +1 -2
  90. package/models/models/ingredient-container/ingredient-container-model.d.ts.map +1 -1
  91. package/models/models/ingredient-container/types/index.d.ts +1 -3
  92. package/models/models/nozzle/index.d.ts.map +1 -1
  93. package/models/models/nozzle/nozzle-model.d.ts +6 -7
  94. package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
  95. package/models/models/nozzle/services/index.d.ts.map +1 -1
  96. package/models/models/nozzle/services/nozzle-services.d.ts.map +1 -1
  97. package/models/models/nozzle/types/index.d.ts +1 -3
  98. package/models/models/pump/index.d.ts.map +1 -1
  99. package/models/models/pump/pump-model.d.ts +1 -2
  100. package/models/models/pump/pump-model.d.ts.map +1 -1
  101. package/models/models/pump/services/index.d.ts.map +1 -1
  102. package/models/models/pump/services/pump-services.d.ts +3 -5
  103. package/models/models/pump/services/pump-services.d.ts.map +1 -1
  104. package/models/models/pump/types/index.d.ts +1 -3
  105. package/models/models/pump/utils/pump-trouble-resolver.d.ts +0 -1
  106. package/models/models/pump/utils/pump-trouble-resolver.d.ts.map +1 -1
  107. package/models/models/pump-container/index.d.ts.map +1 -1
  108. package/models/models/pump-container/pump-container-model.d.ts +1 -2
  109. package/models/models/pump-container/pump-container-model.d.ts.map +1 -1
  110. package/models/models/pump-container/types/index.d.ts +1 -3
  111. package/models/models/types/assembly.d.ts.map +1 -1
  112. package/models/models/types/index.d.ts.map +1 -1
  113. package/models/models/types/intent.d.ts +0 -1
  114. package/models/models/types/intent.d.ts.map +1 -1
  115. package/models/models/types/pouring.d.ts.map +1 -1
  116. package/models/utils/dispense-registration-manager.d.ts +5 -6
  117. package/models/utils/dispense-registration-manager.d.ts.map +1 -1
  118. package/models/utils/extension-utils.d.ts +6 -7
  119. package/models/utils/extension-utils.d.ts.map +1 -1
  120. package/models/utils/openapi-index.d.ts.map +1 -1
  121. package/models/utils/registration.d.ts +0 -1
  122. package/models/utils/registration.d.ts.map +1 -1
  123. package/models/utils/service.d.ts +34 -35
  124. package/models/utils/service.d.ts.map +1 -1
  125. package/models/utils/services/dispense/1.6.5/service.d.ts +34 -35
  126. package/models/utils/services/dispense/1.6.5/service.d.ts.map +1 -1
  127. package/models/utils/services/dispense/1.8.1/service.d.ts +34 -35
  128. package/models/utils/services/dispense/1.8.1/service.d.ts.map +1 -1
  129. package/models/utils/services/dispense/daily/service.d.ts +34 -35
  130. package/models/utils/services/dispense/daily/service.d.ts.map +1 -1
  131. package/models/utils/services-index.d.ts.map +1 -1
  132. package/models.cjs +2 -4
  133. package/models.cjs.map +1 -1
  134. package/models.d.ts +1 -0
  135. package/models.js +25 -27
  136. package/models.js.map +1 -1
  137. package/package.json +10 -11
  138. package/{pump-provider-D4Ed_gH6.cjs → pump-provider-D4iVLU-o.cjs} +154 -175
  139. package/pump-provider-D4iVLU-o.cjs.map +1 -0
  140. package/{pump-provider-BSEusYig.js → pump-provider-ntLT8vr7.js} +217 -238
  141. package/pump-provider-ntLT8vr7.js.map +1 -0
  142. package/ui/contexts/assembly/assembly-provider.d.ts +1 -2
  143. package/ui/contexts/assembly/assembly-provider.d.ts.map +1 -1
  144. package/ui/contexts/assembly/index.d.ts.map +1 -1
  145. package/ui/contexts/availability/availability-provider.d.ts +1 -2
  146. package/ui/contexts/availability/availability-provider.d.ts.map +1 -1
  147. package/ui/contexts/availability/index.d.ts.map +1 -1
  148. package/ui/contexts/board/board-provider.d.ts +1 -2
  149. package/ui/contexts/board/board-provider.d.ts.map +1 -1
  150. package/ui/contexts/board/index.d.ts.map +1 -1
  151. package/ui/contexts/board-container/board-container-provider.d.ts +1 -2
  152. package/ui/contexts/board-container/board-container-provider.d.ts.map +1 -1
  153. package/ui/contexts/board-container/index.d.ts.map +1 -1
  154. package/ui/contexts/cui-kit/cui-kit.d.ts +1 -2
  155. package/ui/contexts/cui-kit/cui-kit.d.ts.map +1 -1
  156. package/ui/contexts/cui-kit/index.d.ts.map +1 -1
  157. package/ui/contexts/device-assembly/device-assembly-provider.d.ts +1 -2
  158. package/ui/contexts/device-assembly/device-assembly-provider.d.ts.map +1 -1
  159. package/ui/contexts/device-assembly/index.d.ts.map +1 -1
  160. package/ui/contexts/holder/holder-provider.d.ts +1 -2
  161. package/ui/contexts/holder/holder-provider.d.ts.map +1 -1
  162. package/ui/contexts/holder/index.d.ts.map +1 -1
  163. package/ui/contexts/holder-container/holder-container-provider.d.ts +1 -2
  164. package/ui/contexts/holder-container/holder-container-provider.d.ts.map +1 -1
  165. package/ui/contexts/holder-container/index.d.ts.map +1 -1
  166. package/ui/contexts/index.d.ts.map +1 -1
  167. package/ui/contexts/ingredient/index.d.ts.map +1 -1
  168. package/ui/contexts/ingredient/ingredient-provider.d.ts +1 -2
  169. package/ui/contexts/ingredient/ingredient-provider.d.ts.map +1 -1
  170. package/ui/contexts/ingredient-container/index.d.ts.map +1 -1
  171. package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts +1 -2
  172. package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts.map +1 -1
  173. package/ui/contexts/nozzle/index.d.ts.map +1 -1
  174. package/ui/contexts/nozzle/nozzle-provider.d.ts +1 -2
  175. package/ui/contexts/nozzle/nozzle-provider.d.ts.map +1 -1
  176. package/ui/contexts/pump/index.d.ts.map +1 -1
  177. package/ui/contexts/pump/pump-provider.d.ts +1 -2
  178. package/ui/contexts/pump/pump-provider.d.ts.map +1 -1
  179. package/ui/hooks/assembly/index.d.ts.map +1 -1
  180. package/ui/hooks/assembly/use-assembly.d.ts +1 -2
  181. package/ui/hooks/assembly/use-assembly.d.ts.map +1 -1
  182. package/ui/hooks/assembly/with-assembly.d.ts +0 -1
  183. package/ui/hooks/assembly/with-assembly.d.ts.map +1 -1
  184. package/ui/hooks/availability/index.d.ts.map +1 -1
  185. package/ui/hooks/availability/use-availability.d.ts +1 -2
  186. package/ui/hooks/availability/use-availability.d.ts.map +1 -1
  187. package/ui/hooks/availability/with-availability.d.ts +0 -1
  188. package/ui/hooks/availability/with-availability.d.ts.map +1 -1
  189. package/ui/hooks/board/index.d.ts.map +1 -1
  190. package/ui/hooks/board/use-board.d.ts +1 -2
  191. package/ui/hooks/board/use-board.d.ts.map +1 -1
  192. package/ui/hooks/board/with-board.d.ts +0 -1
  193. package/ui/hooks/board/with-board.d.ts.map +1 -1
  194. package/ui/hooks/board-container/index.d.ts.map +1 -1
  195. package/ui/hooks/board-container/use-board-container.d.ts +1 -2
  196. package/ui/hooks/board-container/use-board-container.d.ts.map +1 -1
  197. package/ui/hooks/board-container/with-board-container.d.ts +0 -1
  198. package/ui/hooks/board-container/with-board-container.d.ts.map +1 -1
  199. package/ui/hooks/cui-kit/dispense-topics.d.ts +0 -1
  200. package/ui/hooks/cui-kit/dispense-topics.d.ts.map +1 -1
  201. package/ui/hooks/cui-kit/index.d.ts.map +1 -1
  202. package/ui/hooks/cui-kit/use-ambient-attract-timers.d.ts +0 -1
  203. package/ui/hooks/cui-kit/use-ambient-attract-timers.d.ts.map +1 -1
  204. package/ui/hooks/cui-kit/use-beverages.d.ts +1 -2
  205. package/ui/hooks/cui-kit/use-beverages.d.ts.map +1 -1
  206. package/ui/hooks/cui-kit/use-brands.d.ts +1 -2
  207. package/ui/hooks/cui-kit/use-brands.d.ts.map +1 -1
  208. package/ui/hooks/cui-kit/use-cui-kit.d.ts +3 -4
  209. package/ui/hooks/cui-kit/use-cui-kit.d.ts.map +1 -1
  210. package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts +0 -1
  211. package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts.map +1 -1
  212. package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts +0 -1
  213. package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts.map +1 -1
  214. package/ui/hooks/cui-kit/use-dispense-timers.d.ts +0 -1
  215. package/ui/hooks/cui-kit/use-dispense-timers.d.ts.map +1 -1
  216. package/ui/hooks/cui-kit/use-flavors.d.ts +1 -2
  217. package/ui/hooks/cui-kit/use-flavors.d.ts.map +1 -1
  218. package/ui/hooks/device-assembly/index.d.ts.map +1 -1
  219. package/ui/hooks/device-assembly/use-device-assembly.d.ts +1 -2
  220. package/ui/hooks/device-assembly/use-device-assembly.d.ts.map +1 -1
  221. package/ui/hooks/device-assembly/with-device-assembly.d.ts +0 -1
  222. package/ui/hooks/device-assembly/with-device-assembly.d.ts.map +1 -1
  223. package/ui/hooks/generic-pour/index.d.ts.map +1 -1
  224. package/ui/hooks/generic-pour/use-generic-pour.d.ts +2 -3
  225. package/ui/hooks/generic-pour/use-generic-pour.d.ts.map +1 -1
  226. package/ui/hooks/generic-pour/with-generic-pour.d.ts +0 -1
  227. package/ui/hooks/generic-pour/with-generic-pour.d.ts.map +1 -1
  228. package/ui/hooks/holder/index.d.ts.map +1 -1
  229. package/ui/hooks/holder/use-holder.d.ts +1 -2
  230. package/ui/hooks/holder/use-holder.d.ts.map +1 -1
  231. package/ui/hooks/holder/with-holder.d.ts +0 -1
  232. package/ui/hooks/holder/with-holder.d.ts.map +1 -1
  233. package/ui/hooks/holder-container/index.d.ts.map +1 -1
  234. package/ui/hooks/holder-container/use-holder-container.d.ts +1 -2
  235. package/ui/hooks/holder-container/use-holder-container.d.ts.map +1 -1
  236. package/ui/hooks/holder-container/with-holder-container.d.ts +0 -1
  237. package/ui/hooks/holder-container/with-holder-container.d.ts.map +1 -1
  238. package/ui/hooks/index.d.ts.map +1 -1
  239. package/ui/hooks/ingredient/index.d.ts.map +1 -1
  240. package/ui/hooks/ingredient/use-ingredient-pour.d.ts +2 -3
  241. package/ui/hooks/ingredient/use-ingredient-pour.d.ts.map +1 -1
  242. package/ui/hooks/ingredient/use-ingredient.d.ts +1 -2
  243. package/ui/hooks/ingredient/use-ingredient.d.ts.map +1 -1
  244. package/ui/hooks/ingredient/with-ingredient.d.ts +0 -1
  245. package/ui/hooks/ingredient/with-ingredient.d.ts.map +1 -1
  246. package/ui/hooks/ingredient-container/index.d.ts.map +1 -1
  247. package/ui/hooks/ingredient-container/use-ingredient-container.d.ts +1 -2
  248. package/ui/hooks/ingredient-container/use-ingredient-container.d.ts.map +1 -1
  249. package/ui/hooks/ingredient-container/with-ingredient-container.d.ts +0 -1
  250. package/ui/hooks/ingredient-container/with-ingredient-container.d.ts.map +1 -1
  251. package/ui/hooks/nozzle/index.d.ts.map +1 -1
  252. package/ui/hooks/nozzle/use-dispense-kit.d.ts +0 -1
  253. package/ui/hooks/nozzle/use-dispense-kit.d.ts.map +1 -1
  254. package/ui/hooks/nozzle/use-nozzle.d.ts +1 -2
  255. package/ui/hooks/nozzle/use-nozzle.d.ts.map +1 -1
  256. package/ui/hooks/nozzle/with-nozzle.d.ts +0 -1
  257. package/ui/hooks/nozzle/with-nozzle.d.ts.map +1 -1
  258. package/ui/hooks/nozzle-pour/index.d.ts.map +1 -1
  259. package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts +3 -4
  260. package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts.map +1 -1
  261. package/ui/hooks/pour/index.d.ts.map +1 -1
  262. package/ui/hooks/pour/use-pour.d.ts +4 -5
  263. package/ui/hooks/pour/use-pour.d.ts.map +1 -1
  264. package/ui/hooks/pump/index.d.ts.map +1 -1
  265. package/ui/hooks/pump/use-pump.d.ts +1 -2
  266. package/ui/hooks/pump/use-pump.d.ts.map +1 -1
  267. package/ui/hooks/pump/with-pump.d.ts +0 -1
  268. package/ui/hooks/pump/with-pump.d.ts.map +1 -1
  269. package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts +1 -2
  270. package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts.map +1 -1
  271. package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts +0 -1
  272. package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts.map +1 -1
  273. package/ui/hooks/utils/pour-strategy/index.d.ts.map +1 -1
  274. package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts +1 -2
  275. package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts.map +1 -1
  276. package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts +1 -2
  277. package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts.map +1 -1
  278. package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts +1 -2
  279. package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts.map +1 -1
  280. package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts +0 -1
  281. package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts.map +1 -1
  282. package/ui/index.d.ts.map +1 -1
  283. package/ui/utils/pour-context.d.ts.map +1 -1
  284. package/ui.cjs +1 -5
  285. package/ui.cjs.map +1 -1
  286. package/ui.d.ts +1 -0
  287. package/ui.js +64 -68
  288. package/ui.js.map +1 -1
  289. package/dispense-registration-manager-C6k10ipu.cjs.map +0 -1
  290. package/dispense-registration-manager-lJlcyq5G.js.map +0 -1
  291. package/extension-utils-AS0Z5eod.js.map +0 -1
  292. package/extension-utils-DNbm2KRk.cjs.map +0 -1
  293. package/kos-models.json +0 -180
  294. package/pump-provider-BSEusYig.js.map +0 -1
  295. package/pump-provider-D4Ed_gH6.cjs.map +0 -1
@@ -1,11 +1,5 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
- var __publicField = (obj, key, value) => {
5
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
- return value;
7
- };
8
- const dispenseRegistrationManager = require("./dispense-registration-manager-C6k10ipu.cjs");
2
+ const dispenseRegistrationManager = require("./dispense-registration-manager-BH0mkCQx.cjs");
9
3
  const kosUiSdk = require("@kosdev-code/kos-ui-sdk");
10
4
  const React = require("react");
11
5
  const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -48,18 +42,17 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
48
42
  pourOnTarget: dispenseRegistrationManager.pourOnTarget
49
43
  }, Symbol.toStringTag, { value: "Module" }));
50
44
  const getFuelGaugeValue = (holder) => {
51
- var _a, _b, _c, _d;
52
45
  const [maxVolume, setMaxVolume] = React.useState(
53
- ((_a = holder == null ? void 0 : holder.slice) == null ? void 0 : _a.maxVolMl) ?? 0
46
+ holder?.slice?.maxVolMl ?? 0
54
47
  );
55
48
  const [remainingVolume, setRemainingVolume] = React.useState(
56
- ((_b = holder == null ? void 0 : holder.slice) == null ? void 0 : _b.currentVolMl) ?? 0
49
+ holder?.slice?.currentVolMl ?? 0
57
50
  );
58
51
  const [hasMaxVolume, setHasMaxVolume] = React.useState(
59
- ((_c = holder == null ? void 0 : holder.slice) == null ? void 0 : _c.maxVolMl) !== void 0
52
+ holder?.slice?.maxVolMl !== void 0
60
53
  );
61
54
  const [hasRemainingVolume, setHasRemainingVolume] = React.useState(
62
- ((_d = holder == null ? void 0 : holder.slice) == null ? void 0 : _d.currentVolMl) !== void 0
55
+ holder?.slice?.currentVolMl !== void 0
63
56
  );
64
57
  const [fillPercent, setFillPercent] = React.useState(
65
58
  remainingVolume <= 0 ? 0 : Math.floor((remainingVolume || 1) / (maxVolume || 1) * 100)
@@ -69,11 +62,10 @@ const getFuelGaugeValue = (holder) => {
69
62
  );
70
63
  React.useEffect(() => {
71
64
  const disposer = kosUiSdk.kosAutoEffect(() => {
72
- var _a2, _b2, _c2, _d2;
73
- setMaxVolume(((_a2 = holder == null ? void 0 : holder.slice) == null ? void 0 : _a2.maxVolMl) ?? 0);
74
- setRemainingVolume(((_b2 = holder == null ? void 0 : holder.slice) == null ? void 0 : _b2.currentVolMl) ?? 0);
75
- setHasMaxVolume(((_c2 = holder == null ? void 0 : holder.slice) == null ? void 0 : _c2.maxVolMl) !== void 0);
76
- setHasRemainingVolume(((_d2 = holder == null ? void 0 : holder.slice) == null ? void 0 : _d2.currentVolMl) !== void 0);
65
+ setMaxVolume(holder?.slice?.maxVolMl ?? 0);
66
+ setRemainingVolume(holder?.slice?.currentVolMl ?? 0);
67
+ setHasMaxVolume(holder?.slice?.maxVolMl !== void 0);
68
+ setHasRemainingVolume(holder?.slice?.currentVolMl !== void 0);
77
69
  setFillPercent(
78
70
  remainingVolume <= 0 ? 0 : Math.floor((remainingVolume || 1) / (maxVolume || 1) * 100)
79
71
  );
@@ -86,9 +78,7 @@ const getFuelGaugeValue = (holder) => {
86
78
  return { maxVolume, remainingVolume, fillPercent, hasFuelGuage };
87
79
  };
88
80
  class DispenseExtensionManager {
89
- constructor() {
90
- __publicField(this, "core", new kosUiSdk.CoreExtensionManager());
91
- }
81
+ core = new kosUiSdk.CoreExtensionManager();
92
82
  /**
93
83
  * Maps data into the {@link IngredientModel}
94
84
  *
@@ -471,8 +461,7 @@ class DispenseExtensionManager {
471
461
  return this;
472
462
  }
473
463
  registerAssemblyFeatureFlagResolver(assemblyFeatureFlagResolver) {
474
- var _a;
475
- (_a = kosUiSdk.ExtensionManager[kosUiSdk.EXTENSION_FEATURE_FLAG_RESOLVER]) == null ? void 0 : _a.register(
464
+ kosUiSdk.ExtensionManager[kosUiSdk.EXTENSION_FEATURE_FLAG_RESOLVER]?.register(
476
465
  dispenseRegistrationManager.ExtensionType.AssemblyFeatureFlags,
477
466
  assemblyFeatureFlagResolver
478
467
  );
@@ -480,9 +469,9 @@ class DispenseExtensionManager {
480
469
  }
481
470
  }
482
471
  class KosExtensionManager {
472
+ dispense;
473
+ core;
483
474
  constructor() {
484
- __publicField(this, "dispense");
485
- __publicField(this, "core");
486
475
  this.dispense = new DispenseExtensionManager();
487
476
  this.core = new kosUiSdk.CoreExtensionManager();
488
477
  }
@@ -497,4 +486,4 @@ exports.index$2 = index$4;
497
486
  exports.index$3 = index$5;
498
487
  exports.index$4 = index$1;
499
488
  exports.index$5 = index$2;
500
- //# sourceMappingURL=extension-utils-DNbm2KRk.cjs.map
489
+ //# sourceMappingURL=extension-utils-FKfiDSbi.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-utils-FKfiDSbi.cjs","sources":["../../../packages/kos-dispense-sdk/src/models/models/holder/utils/holder-utils.ts","../../../packages/kos-dispense-sdk/src/models/utils/extension-utils.ts"],"sourcesContent":["import { kosAutoEffect } from \"@kosdev-code/kos-ui-sdk\";\nimport { useEffect, useState } from \"react\";\nimport type { HolderModel } from \"../types\";\n\nexport const getFuelGaugeValue = (holder: HolderModel) => {\n const [maxVolume, setMaxVolume] = useState<number>(\n holder?.slice?.maxVolMl ?? 0\n );\n const [remainingVolume, setRemainingVolume] = useState<number>(\n holder?.slice?.currentVolMl ?? 0\n );\n\n const [hasMaxVolume, setHasMaxVolume] = useState<boolean>(\n holder?.slice?.maxVolMl !== undefined\n );\n\n const [hasRemainingVolume, setHasRemainingVolume] = useState<boolean>(\n holder?.slice?.currentVolMl !== undefined\n );\n\n const [fillPercent, setFillPercent] = useState<number>(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n\n const [hasFuelGuage, setHasFuelGuage] = useState<boolean>(\n hasMaxVolume && hasRemainingVolume\n );\n\n useEffect(() => {\n const disposer = kosAutoEffect(() => {\n setMaxVolume(holder?.slice?.maxVolMl ?? 0);\n setRemainingVolume(holder?.slice?.currentVolMl ?? 0);\n setHasMaxVolume(holder?.slice?.maxVolMl !== undefined);\n setHasRemainingVolume(holder?.slice?.currentVolMl !== undefined);\n setFillPercent(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n setHasFuelGuage(hasMaxVolume && hasRemainingVolume);\n });\n\n return () => {\n disposer();\n };\n }, [holder]);\n\n return { maxVolume, remainingVolume, fillPercent, hasFuelGuage };\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n CoreExtensionManager,\n DataLoader,\n DataMapper,\n EXTENSION_FEATURE_FLAG_RESOLVER,\n ExtensionManager,\n ExtensionOptions,\n IndexExtension,\n PropertyMapper,\n type FlagResolver,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { ExtensionType } from \"../constants\";\nimport { AssemblyTypes, type AssemblyModel } from \"../models\";\nimport type { HolderResponse } from \"../models/holder/services\";\nimport type { HolderModel } from \"../models/holder/types\";\nimport type { IngredientResponse } from \"../models/ingredient/services\";\nimport type { BeverageResponse } from \"../models/nozzle/services\";\nimport type { SelectedPourable } from \"../models/nozzle/types\";\n\nexport type IngredientDataMapper<\n AdditionalData extends object = Record<string, any>\n> = DataMapper<IngredientResponse, AdditionalData, any>;\n\n/**\n * Mapping function that maps an ingredient response into the type property of\n * the {@link IngredientModel}.\n */\nexport type IngredientTypeMapper<\n T extends IngredientResponse = IngredientResponse\n> = PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderTypeMapper<T extends HolderResponse = HolderResponse> =\n PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderDataMapper<\n AdditionalData extends object = Record<string, any>,\n HolderData extends HolderResponse = HolderResponse\n> = DataMapper<HolderData, AdditionalData, any>;\n\nexport type GroupBeverageResponse = BeverageResponse & { groupId: string };\nexport type AvailabilityDataMapper<\n AdditionalData extends object = Record<string, any>,\n AvailabilityData extends GroupBeverageResponse = GroupBeverageResponse\n> = DataMapper<AvailabilityData, AdditionalData, any>;\n\nexport type SelectedPourableMapper = DataMapper<SelectedPourable, any>;\n\nexport type BoardDataMapper<\n AdditionalData extends object = Record<string, any>,\n BoardData extends AssemblyTypes.AssemblyBoard<any> = AssemblyTypes.AssemblyBoard<any>\n> = DataMapper<BoardData, AdditionalData, any>;\n\nexport type AssemblyMapper<\n AdditionalData extends object = Record<string, any>,\n AssemblyResponseData extends AssemblyTypes.AssemblyResponse<any> = AssemblyTypes.AssemblyResponse<any>\n> = DataMapper<AssemblyResponseData, AdditionalData, any>;\n/**\n * The DispenseExtensionManager is responsible for managing the extension points that are specific to the Dispense application.\n */\nexport class DispenseExtensionManager {\n core: CoreExtensionManager = new CoreExtensionManager();\n /**\n * Maps data into the {@link IngredientModel}\n *\n * It is common for the ingredient data provided by the ingredient service to be augmented with additional properties that are\n * not provided by the base KOS Ingredient model. The {@link IngredientMapper} extension point allows for the data to be mapped\n * into the {@link IngredientModel} and the {@link IngredientModel.data} property to be augmented with additional properties.\n *\n * @param ingredientDataMapper - Mapping function that maps an {@link IngredientResponse} into additional model data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\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(\n ingredientDataMapper: IngredientDataMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.IngredientMapper,\n ingredientDataMapper,\n options\n );\n\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link IngredientMapper}.\n *\n * @param ingredientLoader - Async function that loads and returns ingredient context data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on loader failure.\n * Set to `\"continue\"` to log the error and return `undefined` instead.\n * @returns this instance for chaining\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(\n ingredientLoader: DataLoader,\n options?: ExtensionOptions\n ) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.IngredientLoader,\n ingredientLoader,\n options\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 property mapper that derives the `type` property of the {@link IngredientModel}\n * from an {@link IngredientResponse}.\n *\n * @param ingredientTypeMapper - Mapping function that extracts a type string from an {@link IngredientResponse}\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and return a fallback value instead.\n * @returns this instance for chaining\n * */\n registerIngredientTypeMapper(\n ingredientTypeMapper: IngredientTypeMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.IngredientTypeMapper,\n ingredientTypeMapper,\n options\n );\n return this;\n }\n\n /**\n * Registers a data mapper for the {@link HolderModel} model.\n *\n * @param holderDataMapper - Mapping function that maps additional data from a {@link HolderResponse}\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\n */\n registerHolderDataMapper(\n holderDataMapper: HolderDataMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.HolderMapper,\n holderDataMapper,\n options\n );\n return this;\n }\n\n /**\n * Registers a property mapper that derives the `type` property of the {@link HolderModel}\n * from a {@link HolderResponse}.\n *\n * @param holderTypeMapper - Mapping function that extracts a type string from a {@link HolderResponse}\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and return a fallback value instead.\n * @returns this instance for chaining\n */\n registerHolderTypeMapper(\n holderTypeMapper: HolderTypeMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper,\n options\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 * @param holderTypeMapper - Mapping function that extracts the ingredientId from a {@link HolderResponse}\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and return a fallback value instead.\n * @returns this instance for chaining\n * */\n registerHolderIngredientMapper(\n holderTypeMapper: HolderTypeMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper,\n options\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 * @param availabilityMapper - Mapping function that maps a {@link GroupBeverageResponse} into additional availability data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\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(\n availabilityMapper: AvailabilityDataMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AvailabilityMapper,\n availabilityMapper,\n options\n );\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link AvailabilityMapper}.\n *\n * @param availabilityLoader - Async function that loads and returns availability context data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on loader failure.\n * Set to `\"continue\"` to log the error and return `undefined` instead.\n * @returns this instance for chaining\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(\n availabilityLoader: DataLoader,\n options?: ExtensionOptions\n ) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.AvailabilityLoader,\n availabilityLoader,\n options\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 * @param selectedPourableMapper - Mapping function that transforms {@link SelectedPourable} data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\n * */\n registerSelectedPourableDataMapper(\n selectedPourableMapper: SelectedPourableMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.SelectedPourableMapper,\n selectedPourableMapper,\n options\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 * @param assemblyDataMapper - Mapping function that maps an {@link AssemblyTypes.AssemblyResponse} into additional assembly data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\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(\n assemblyDataMapper: AssemblyMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AssemblyMapper,\n assemblyDataMapper,\n options\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 /**\n * Registers a data mapper for the board model within an assembly.\n *\n * @param boardDataMapper - Mapping function that maps an {@link AssemblyTypes.AssemblyBoard} into additional board data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\n */\n registerBoardDataMapper(\n boardDataMapper: BoardDataMapper<any, any>,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.BoardMapper,\n boardDataMapper,\n options\n );\n return this;\n }\n\n registerAssemblyFeatureFlagResolver(\n assemblyFeatureFlagResolver: FlagResolver<AssemblyModel>\n ) {\n ExtensionManager[EXTENSION_FEATURE_FLAG_RESOLVER]?.register(\n ExtensionType.AssemblyFeatureFlags,\n assemblyFeatureFlagResolver\n );\n return this;\n }\n}\n\n/**\n * The KosExtensionManager provides access to the extension points that are provided in the SDK for Dispense applications.\n *\n * The extension points are divided into two categories:\n *\n * @param core - The core extension {@link CoreExtensionManager} points are used to extend the base models that are provided by the SDK.\n * @param dispense - The dispense extension {@link DispenseExtensionManager} points are used to extend the models that are specific to the Dispense SDK.\n */\nexport class KosExtensionManager {\n dispense: DispenseExtensionManager;\n core: CoreExtensionManager;\n constructor() {\n this.dispense = new DispenseExtensionManager();\n this.core = new CoreExtensionManager();\n }\n}\n"],"names":["useState","useEffect","kosAutoEffect","CoreExtensionManager","ExtensionManager","ExtensionType","EXTENSION_FEATURE_FLAG_RESOLVER"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,MAAM,oBAAoB,CAAC,WAAwB;AACxD,QAAM,CAAC,WAAW,YAAY,IAAIA,MAAAA;AAAAA,IAChC,QAAQ,OAAO,YAAY;AAAA,EAAA;AAE7B,QAAM,CAAC,iBAAiB,kBAAkB,IAAIA,MAAAA;AAAAA,IAC5C,QAAQ,OAAO,gBAAgB;AAAA,EAAA;AAGjC,QAAM,CAAC,cAAc,eAAe,IAAIA,MAAAA;AAAAA,IACtC,QAAQ,OAAO,aAAa;AAAA,EAAA;AAG9B,QAAM,CAAC,oBAAoB,qBAAqB,IAAIA,MAAAA;AAAAA,IAClD,QAAQ,OAAO,iBAAiB;AAAA,EAAA;AAGlC,QAAM,CAAC,aAAa,cAAc,IAAIA,MAAAA;AAAAA,IACpC,mBAAmB,IACf,IACA,KAAK,OAAQ,mBAAmB,MAAM,aAAa,KAAM,GAAG;AAAA,EAAA;AAGlE,QAAM,CAAC,cAAc,eAAe,IAAIA,MAAA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AAAA;AAAA;AAAA;AAAA,EAqEA,2BACE,oBACA,SACA;AACAD,aAAAA,iBAAiB,WAAW;AAAA,MAC1BC,4BAAAA,cAAc;AAAA,MACd;AAAA,MACA;AAAA,IAAA;AAEF,WAAO;AAAA,EACT;AAAA,EAEA,mBAAmB,YAA4B;AAC7CD,aAAAA,iBAAiB,eAAe;AAAA,MAC9BC,4BAAAA,cAAc;AAAA,MACd;AAAA,IAAA;AAEF,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,wBACE,iBACA,SACA;AACAD,aAAAA,iBAAiB,WAAW;AAAA,MAC1BC,4BAAAA,cAAc;AAAA,MACd;AAAA,MACA;AAAA,IAAA;AAEF,WAAO;AAAA,EACT;AAAA,EAEA,oCACE,6BACA;AACAD,aAAAA,iBAAiBE,SAAAA,+BAA+B,GAAG;AAAA,MACjDD,4BAAAA,cAAc;AAAA,MACd;AAAA,IAAA;AAEF,WAAO;AAAA,EACT;AACF;AAUO,MAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,cAAc;AACZ,SAAK,WAAW,IAAI,yBAAA;AACpB,SAAK,OAAO,IAAIF,8BAAA;AAAA,EAClB;AACF;;;;;;;;;;;"}
@@ -1,10 +1,4 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import { p as getIngredients, q as addAssignment, s as assignHolderIngredient, t as deleteAssignment, u as getAssignments, v as getHolders, w as replaceLine, x as sendRfidOverride, y as unassignHolderIngredient, z as getAssembly, F as getIntentVolume, J as sendIntent, L as clearPourable, M as getAvailability, O as pourNamedPourable, Q as pourPourable, R as selectPourable, S as pourOnTarget, E as ExtensionType } from "./dispense-registration-manager-lJlcyq5G.js";
1
+ import { p as getIngredients, q as addAssignment, s as assignHolderIngredient, t as deleteAssignment, u as getAssignments, v as getHolders, w as replaceLine, x as sendRfidOverride, y as unassignHolderIngredient, z as getAssembly, F as getIntentVolume, J as sendIntent, L as clearPourable, M as getAvailability, O as pourNamedPourable, Q as pourPourable, R as selectPourable, S as pourOnTarget, E as ExtensionType } from "./dispense-registration-manager-BSKa5Oi9.js";
8
2
  import { kosAutoEffect, CoreExtensionManager, ExtensionManager, EXTENSION_FEATURE_FLAG_RESOLVER } from "@kosdev-code/kos-ui-sdk";
9
3
  import { useState, useEffect } from "react";
10
4
  const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -47,18 +41,17 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
47
41
  pourOnTarget
48
42
  }, Symbol.toStringTag, { value: "Module" }));
49
43
  const getFuelGaugeValue = (holder) => {
50
- var _a, _b, _c, _d;
51
44
  const [maxVolume, setMaxVolume] = useState(
52
- ((_a = holder == null ? void 0 : holder.slice) == null ? void 0 : _a.maxVolMl) ?? 0
45
+ holder?.slice?.maxVolMl ?? 0
53
46
  );
54
47
  const [remainingVolume, setRemainingVolume] = useState(
55
- ((_b = holder == null ? void 0 : holder.slice) == null ? void 0 : _b.currentVolMl) ?? 0
48
+ holder?.slice?.currentVolMl ?? 0
56
49
  );
57
50
  const [hasMaxVolume, setHasMaxVolume] = useState(
58
- ((_c = holder == null ? void 0 : holder.slice) == null ? void 0 : _c.maxVolMl) !== void 0
51
+ holder?.slice?.maxVolMl !== void 0
59
52
  );
60
53
  const [hasRemainingVolume, setHasRemainingVolume] = useState(
61
- ((_d = holder == null ? void 0 : holder.slice) == null ? void 0 : _d.currentVolMl) !== void 0
54
+ holder?.slice?.currentVolMl !== void 0
62
55
  );
63
56
  const [fillPercent, setFillPercent] = useState(
64
57
  remainingVolume <= 0 ? 0 : Math.floor((remainingVolume || 1) / (maxVolume || 1) * 100)
@@ -68,11 +61,10 @@ const getFuelGaugeValue = (holder) => {
68
61
  );
69
62
  useEffect(() => {
70
63
  const disposer = kosAutoEffect(() => {
71
- var _a2, _b2, _c2, _d2;
72
- setMaxVolume(((_a2 = holder == null ? void 0 : holder.slice) == null ? void 0 : _a2.maxVolMl) ?? 0);
73
- setRemainingVolume(((_b2 = holder == null ? void 0 : holder.slice) == null ? void 0 : _b2.currentVolMl) ?? 0);
74
- setHasMaxVolume(((_c2 = holder == null ? void 0 : holder.slice) == null ? void 0 : _c2.maxVolMl) !== void 0);
75
- setHasRemainingVolume(((_d2 = holder == null ? void 0 : holder.slice) == null ? void 0 : _d2.currentVolMl) !== void 0);
64
+ setMaxVolume(holder?.slice?.maxVolMl ?? 0);
65
+ setRemainingVolume(holder?.slice?.currentVolMl ?? 0);
66
+ setHasMaxVolume(holder?.slice?.maxVolMl !== void 0);
67
+ setHasRemainingVolume(holder?.slice?.currentVolMl !== void 0);
76
68
  setFillPercent(
77
69
  remainingVolume <= 0 ? 0 : Math.floor((remainingVolume || 1) / (maxVolume || 1) * 100)
78
70
  );
@@ -85,9 +77,7 @@ const getFuelGaugeValue = (holder) => {
85
77
  return { maxVolume, remainingVolume, fillPercent, hasFuelGuage };
86
78
  };
87
79
  class DispenseExtensionManager {
88
- constructor() {
89
- __publicField(this, "core", new CoreExtensionManager());
90
- }
80
+ core = new CoreExtensionManager();
91
81
  /**
92
82
  * Maps data into the {@link IngredientModel}
93
83
  *
@@ -470,8 +460,7 @@ class DispenseExtensionManager {
470
460
  return this;
471
461
  }
472
462
  registerAssemblyFeatureFlagResolver(assemblyFeatureFlagResolver) {
473
- var _a;
474
- (_a = ExtensionManager[EXTENSION_FEATURE_FLAG_RESOLVER]) == null ? void 0 : _a.register(
463
+ ExtensionManager[EXTENSION_FEATURE_FLAG_RESOLVER]?.register(
475
464
  ExtensionType.AssemblyFeatureFlags,
476
465
  assemblyFeatureFlagResolver
477
466
  );
@@ -479,9 +468,9 @@ class DispenseExtensionManager {
479
468
  }
480
469
  }
481
470
  class KosExtensionManager {
471
+ dispense;
472
+ core;
482
473
  constructor() {
483
- __publicField(this, "dispense");
484
- __publicField(this, "core");
485
474
  this.dispense = new DispenseExtensionManager();
486
475
  this.core = new CoreExtensionManager();
487
476
  }
@@ -489,13 +478,13 @@ class KosExtensionManager {
489
478
  export {
490
479
  DispenseExtensionManager as D,
491
480
  KosExtensionManager as K,
492
- index as a,
493
- index$4 as b,
494
- index$5 as c,
495
- index$1 as d,
496
- index$2 as e,
497
- assembly as f,
481
+ assembly as a,
482
+ index as b,
483
+ index$4 as c,
484
+ index$5 as d,
485
+ index$1 as e,
486
+ index$2 as f,
498
487
  getFuelGaugeValue as g,
499
488
  index$3 as i
500
489
  };
501
- //# sourceMappingURL=extension-utils-AS0Z5eod.js.map
490
+ //# sourceMappingURL=extension-utils-jntF0-vN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-utils-jntF0-vN.js","sources":["../../../packages/kos-dispense-sdk/src/models/models/holder/utils/holder-utils.ts","../../../packages/kos-dispense-sdk/src/models/utils/extension-utils.ts"],"sourcesContent":["import { kosAutoEffect } from \"@kosdev-code/kos-ui-sdk\";\nimport { useEffect, useState } from \"react\";\nimport type { HolderModel } from \"../types\";\n\nexport const getFuelGaugeValue = (holder: HolderModel) => {\n const [maxVolume, setMaxVolume] = useState<number>(\n holder?.slice?.maxVolMl ?? 0\n );\n const [remainingVolume, setRemainingVolume] = useState<number>(\n holder?.slice?.currentVolMl ?? 0\n );\n\n const [hasMaxVolume, setHasMaxVolume] = useState<boolean>(\n holder?.slice?.maxVolMl !== undefined\n );\n\n const [hasRemainingVolume, setHasRemainingVolume] = useState<boolean>(\n holder?.slice?.currentVolMl !== undefined\n );\n\n const [fillPercent, setFillPercent] = useState<number>(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n\n const [hasFuelGuage, setHasFuelGuage] = useState<boolean>(\n hasMaxVolume && hasRemainingVolume\n );\n\n useEffect(() => {\n const disposer = kosAutoEffect(() => {\n setMaxVolume(holder?.slice?.maxVolMl ?? 0);\n setRemainingVolume(holder?.slice?.currentVolMl ?? 0);\n setHasMaxVolume(holder?.slice?.maxVolMl !== undefined);\n setHasRemainingVolume(holder?.slice?.currentVolMl !== undefined);\n setFillPercent(\n remainingVolume <= 0\n ? 0\n : Math.floor(((remainingVolume || 1) / (maxVolume || 1)) * 100)\n );\n setHasFuelGuage(hasMaxVolume && hasRemainingVolume);\n });\n\n return () => {\n disposer();\n };\n }, [holder]);\n\n return { maxVolume, remainingVolume, fillPercent, hasFuelGuage };\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n CoreExtensionManager,\n DataLoader,\n DataMapper,\n EXTENSION_FEATURE_FLAG_RESOLVER,\n ExtensionManager,\n ExtensionOptions,\n IndexExtension,\n PropertyMapper,\n type FlagResolver,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { ExtensionType } from \"../constants\";\nimport { AssemblyTypes, type AssemblyModel } from \"../models\";\nimport type { HolderResponse } from \"../models/holder/services\";\nimport type { HolderModel } from \"../models/holder/types\";\nimport type { IngredientResponse } from \"../models/ingredient/services\";\nimport type { BeverageResponse } from \"../models/nozzle/services\";\nimport type { SelectedPourable } from \"../models/nozzle/types\";\n\nexport type IngredientDataMapper<\n AdditionalData extends object = Record<string, any>\n> = DataMapper<IngredientResponse, AdditionalData, any>;\n\n/**\n * Mapping function that maps an ingredient response into the type property of\n * the {@link IngredientModel}.\n */\nexport type IngredientTypeMapper<\n T extends IngredientResponse = IngredientResponse\n> = PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderTypeMapper<T extends HolderResponse = HolderResponse> =\n PropertyMapper<T, string>;\n\n/**\n * Mapping function that maps additional data from holder service response\n * into the {@link HolderModel} data.\n */\nexport type HolderDataMapper<\n AdditionalData extends object = Record<string, any>,\n HolderData extends HolderResponse = HolderResponse\n> = DataMapper<HolderData, AdditionalData, any>;\n\nexport type GroupBeverageResponse = BeverageResponse & { groupId: string };\nexport type AvailabilityDataMapper<\n AdditionalData extends object = Record<string, any>,\n AvailabilityData extends GroupBeverageResponse = GroupBeverageResponse\n> = DataMapper<AvailabilityData, AdditionalData, any>;\n\nexport type SelectedPourableMapper = DataMapper<SelectedPourable, any>;\n\nexport type BoardDataMapper<\n AdditionalData extends object = Record<string, any>,\n BoardData extends AssemblyTypes.AssemblyBoard<any> = AssemblyTypes.AssemblyBoard<any>\n> = DataMapper<BoardData, AdditionalData, any>;\n\nexport type AssemblyMapper<\n AdditionalData extends object = Record<string, any>,\n AssemblyResponseData extends AssemblyTypes.AssemblyResponse<any> = AssemblyTypes.AssemblyResponse<any>\n> = DataMapper<AssemblyResponseData, AdditionalData, any>;\n/**\n * The DispenseExtensionManager is responsible for managing the extension points that are specific to the Dispense application.\n */\nexport class DispenseExtensionManager {\n core: CoreExtensionManager = new CoreExtensionManager();\n /**\n * Maps data into the {@link IngredientModel}\n *\n * It is common for the ingredient data provided by the ingredient service to be augmented with additional properties that are\n * not provided by the base KOS Ingredient model. The {@link IngredientMapper} extension point allows for the data to be mapped\n * into the {@link IngredientModel} and the {@link IngredientModel.data} property to be augmented with additional properties.\n *\n * @param ingredientDataMapper - Mapping function that maps an {@link IngredientResponse} into additional model data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\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(\n ingredientDataMapper: IngredientDataMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.IngredientMapper,\n ingredientDataMapper,\n options\n );\n\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link IngredientMapper}.\n *\n * @param ingredientLoader - Async function that loads and returns ingredient context data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on loader failure.\n * Set to `\"continue\"` to log the error and return `undefined` instead.\n * @returns this instance for chaining\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(\n ingredientLoader: DataLoader,\n options?: ExtensionOptions\n ) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.IngredientLoader,\n ingredientLoader,\n options\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 property mapper that derives the `type` property of the {@link IngredientModel}\n * from an {@link IngredientResponse}.\n *\n * @param ingredientTypeMapper - Mapping function that extracts a type string from an {@link IngredientResponse}\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and return a fallback value instead.\n * @returns this instance for chaining\n * */\n registerIngredientTypeMapper(\n ingredientTypeMapper: IngredientTypeMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.IngredientTypeMapper,\n ingredientTypeMapper,\n options\n );\n return this;\n }\n\n /**\n * Registers a data mapper for the {@link HolderModel} model.\n *\n * @param holderDataMapper - Mapping function that maps additional data from a {@link HolderResponse}\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\n */\n registerHolderDataMapper(\n holderDataMapper: HolderDataMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.HolderMapper,\n holderDataMapper,\n options\n );\n return this;\n }\n\n /**\n * Registers a property mapper that derives the `type` property of the {@link HolderModel}\n * from a {@link HolderResponse}.\n *\n * @param holderTypeMapper - Mapping function that extracts a type string from a {@link HolderResponse}\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and return a fallback value instead.\n * @returns this instance for chaining\n */\n registerHolderTypeMapper(\n holderTypeMapper: HolderTypeMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper,\n options\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 * @param holderTypeMapper - Mapping function that extracts the ingredientId from a {@link HolderResponse}\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and return a fallback value instead.\n * @returns this instance for chaining\n * */\n registerHolderIngredientMapper(\n holderTypeMapper: HolderTypeMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.propertyMapper.registerPropertyMapper(\n ExtensionType.HolderTypeMapper,\n holderTypeMapper,\n options\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 * @param availabilityMapper - Mapping function that maps a {@link GroupBeverageResponse} into additional availability data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\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(\n availabilityMapper: AvailabilityDataMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AvailabilityMapper,\n availabilityMapper,\n options\n );\n return this;\n }\n\n /**\n * Loads data that will be provided as context into the {@link AvailabilityMapper}.\n *\n * @param availabilityLoader - Async function that loads and returns availability context data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on loader failure.\n * Set to `\"continue\"` to log the error and return `undefined` instead.\n * @returns this instance for chaining\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(\n availabilityLoader: DataLoader,\n options?: ExtensionOptions\n ) {\n ExtensionManager.loader.registerLoader(\n ExtensionType.AvailabilityLoader,\n availabilityLoader,\n options\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 * @param selectedPourableMapper - Mapping function that transforms {@link SelectedPourable} data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\n * */\n registerSelectedPourableDataMapper(\n selectedPourableMapper: SelectedPourableMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.SelectedPourableMapper,\n selectedPourableMapper,\n options\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 * @param assemblyDataMapper - Mapping function that maps an {@link AssemblyTypes.AssemblyResponse} into additional assembly data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\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(\n assemblyDataMapper: AssemblyMapper,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.AssemblyMapper,\n assemblyDataMapper,\n options\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 /**\n * Registers a data mapper for the board model within an assembly.\n *\n * @param boardDataMapper - Mapping function that maps an {@link AssemblyTypes.AssemblyBoard} into additional board data\n * @param options - Optional {@link ExtensionOptions} to control failure behavior.\n * Defaults to `failurePolicy: \"throw\"`, which throws an {@link ExtensionException} on mapper failure.\n * Set to `\"continue\"` to log the error and continue processing remaining mappers.\n * @returns this instance for chaining\n */\n registerBoardDataMapper(\n boardDataMapper: BoardDataMapper<any, any>,\n options?: ExtensionOptions\n ) {\n ExtensionManager.dataMapper.registerDataMapper(\n ExtensionType.BoardMapper,\n boardDataMapper,\n options\n );\n return this;\n }\n\n registerAssemblyFeatureFlagResolver(\n assemblyFeatureFlagResolver: FlagResolver<AssemblyModel>\n ) {\n ExtensionManager[EXTENSION_FEATURE_FLAG_RESOLVER]?.register(\n ExtensionType.AssemblyFeatureFlags,\n assemblyFeatureFlagResolver\n );\n return this;\n }\n}\n\n/**\n * The KosExtensionManager provides access to the extension points that are provided in the SDK for Dispense applications.\n *\n * The extension points are divided into two categories:\n *\n * @param core - The core extension {@link CoreExtensionManager} points are used to extend the base models that are provided by the SDK.\n * @param dispense - The dispense extension {@link DispenseExtensionManager} points are used to extend the models that are specific to the Dispense SDK.\n */\nexport class KosExtensionManager {\n dispense: DispenseExtensionManager;\n core: CoreExtensionManager;\n constructor() {\n this.dispense = new DispenseExtensionManager();\n this.core = new CoreExtensionManager();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,MAAM,oBAAoB,CAAC,WAAwB;AACxD,QAAM,CAAC,WAAW,YAAY,IAAI;AAAA,IAChC,QAAQ,OAAO,YAAY;AAAA,EAAA;AAE7B,QAAM,CAAC,iBAAiB,kBAAkB,IAAI;AAAA,IAC5C,QAAQ,OAAO,gBAAgB;AAAA,EAAA;AAGjC,QAAM,CAAC,cAAc,eAAe,IAAI;AAAA,IACtC,QAAQ,OAAO,aAAa;AAAA,EAAA;AAG9B,QAAM,CAAC,oBAAoB,qBAAqB,IAAI;AAAA,IAClD,QAAQ,OAAO,iBAAiB;AAAA,EAAA;AAGlC,QAAM,CAAC,aAAa,cAAc,IAAI;AAAA,IACpC,mBAAmB,IACf,IACA,KAAK,OAAQ,mBAAmB,MAAM,aAAa,KAAM,GAAG;AAAA,EAAA;AAGlE,QAAM,CAAC,cAAc,eAAe,IAAI;AAAA,IACtC,gBAAgB;AAAA,EAAA;AAGlB,YAAU,MAAM;AACd,UAAM,WAAW,cAAc,MAAM;AACnC,mBAAa,QAAQ,OAAO,YAAY,CAAC;AACzC,yBAAmB,QAAQ,OAAO,gBAAgB,CAAC;AACnD,sBAAgB,QAAQ,OAAO,aAAa,MAAS;AACrD,4BAAsB,QAAQ,OAAO,iBAAiB,MAAS;AAC/D;AAAA,QACE,mBAAmB,IACf,IACA,KAAK,OAAQ,mBAAmB,MAAM,aAAa,KAAM,GAAG;AAAA,MAAA;AAElE,sBAAgB,gBAAgB,kBAAkB;AAAA,IACpD,CAAC;AAED,WAAO,MAAM;AACX,eAAA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAE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;AACF;"}
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
-
3
2
  declare const ControlPourSchema: z.ZodObject<{
4
3
  id: z.ZodString;
5
4
  title: z.ZodString;
@@ -14,25 +13,25 @@ declare const ControlPourSchema: z.ZodObject<{
14
13
  rank: z.ZodOptional<z.ZodNumber>;
15
14
  }), z.UnknownKeysParam, z.ZodTypeAny, {
16
15
  id: string;
17
- experienceId: string;
18
16
  title: string;
19
17
  namespace: string;
18
+ experienceId: string;
20
19
  } | {
21
20
  id: string;
22
- experienceId: string;
23
21
  title: string;
24
22
  namespace: string;
23
+ experienceId: string;
25
24
  rank?: unknown;
26
25
  }, {
27
26
  id: string;
28
- experienceId: string;
29
27
  title: string;
30
28
  namespace: string;
29
+ experienceId: string;
31
30
  } | {
32
31
  id: string;
33
- experienceId: string;
34
32
  title: string;
35
33
  namespace: string;
34
+ experienceId: string;
36
35
  rank?: unknown;
37
36
  }>;
38
37
  type ControlPourDefinition = z.infer<typeof ControlPourSchema>;
@@ -44,25 +43,25 @@ type ControlPourDefinition = z.infer<typeof ControlPourSchema>;
44
43
  */
45
44
  export declare const ControlPourExtension: import('@kosdev-code/kos-ui-plugin/utilities').ViewExtensionPointDefinition<{
46
45
  id: string;
47
- experienceId: string;
48
46
  title: string;
49
47
  namespace: string;
48
+ experienceId: string;
50
49
  } | {
51
50
  id: string;
52
- experienceId: string;
53
51
  title: string;
54
52
  namespace: string;
53
+ experienceId: string;
55
54
  rank?: unknown;
56
55
  }, {
57
56
  id: string;
58
- experienceId: string;
59
57
  title: string;
60
58
  namespace: string;
59
+ experienceId: string;
61
60
  } | {
62
61
  id: string;
63
- experienceId: string;
64
62
  title: string;
65
63
  namespace: string;
64
+ experienceId: string;
66
65
  rank?: unknown;
67
66
  }, any>;
68
67
  export declare const EXTENSION_POINT_CONTROL_POUR: string;
@@ -1 +1 @@
1
- {"version":3,"file":"control-pour-extension.d.ts","sourceRoot":"","sources":["../../../../../packages/sdk/kos-dispense-sdk/src/extensions/control-pour-extension.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiD,CAAC;AAGzE,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAI/D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;OAyB/B,CAAC;AAGH,eAAO,MAAM,4BAA4B,QAAe,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"control-pour-extension.d.ts","sourceRoot":"","sources":["../../../../packages/kos-dispense-sdk/src/extensions/control-pour-extension.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiD,CAAC;AAGzE,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAI/D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;OAyB/B,CAAC;AAGH,eAAO,MAAM,4BAA4B,QAAe,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/sdk/kos-dispense-sdk/src/extensions/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/kos-dispense-sdk/src/extensions/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
package/index.cjs CHANGED
@@ -2,12 +2,9 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const kosApiLevels = require("@kosdev-code/kos-api-levels");
4
4
  const utilities = require("@kosdev-code/kos-ui-plugin/utilities");
5
- const dispenseRegistrationManager = require("./dispense-registration-manager-C6k10ipu.cjs");
6
- const extensionUtils = require("./extension-utils-DNbm2KRk.cjs");
7
- const pumpProvider = require("./pump-provider-D4Ed_gH6.cjs");
8
- require("@kosdev-code/kos-ui-sdk");
9
- require("react");
10
- require("@emotion/react/jsx-runtime");
5
+ const dispenseRegistrationManager = require("./dispense-registration-manager-BH0mkCQx.cjs");
6
+ const extensionUtils = require("./extension-utils-FKfiDSbi.cjs");
7
+ const pumpProvider = require("./pump-provider-D4iVLU-o.cjs");
11
8
  const ControlPourSchema = utilities.createExtensionSchema({}, { rankable: false });
12
9
  const EXTENSION_ID = utilities.extensionPointId("cui", "control", "pour");
13
10
  const ControlPourExtension = utilities.defineExtensionPoint({
package/index.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../packages/sdk/kos-dispense-sdk/src/extensions/control-pour-extension.ts","../../../../packages/sdk/kos-dispense-sdk/src/index.ts"],"sourcesContent":["// eslint-disable-next-line @nx/enforce-module-boundaries\nimport type { ValidationContext } from \"@kosdev-code/kos-ui-plugin/utilities\";\nimport {\n createExtensionSchema,\n extensionPointId,\n createViewAwareTransform,\n defineExtensionPoint,\n validateWithSchema,\n} from \"@kosdev-code/kos-ui-plugin/utilities\";\nimport { z } from \"zod\";\n\n// Define the Zod schema for Control Pour contributions\nconst ControlPourSchema = createExtensionSchema({}, { rankable: false });\n\n// Define the control pour types locally\ntype ControlPourDefinition = z.infer<typeof ControlPourSchema>;\n\nconst EXTENSION_ID = extensionPointId(\"cui\", \"control\", \"pour\");\n\n/**\n * Control Pour extension point for beverage dispensing interfaces\n *\n * Allows plugin developers to contribute controlled pour functionality\n * to CUI applications that register this extension point.\n */\nexport const ControlPourExtension = defineExtensionPoint<\n ControlPourDefinition,\n ControlPourDefinition\n>({\n id: EXTENSION_ID,\n contributionKey: \"controlPour\",\n displayName: \"Control Pour\",\n description:\n \"Extension point for controlled pour plugin configurations with view support\",\n hasView: true,\n isRankable: false,\n\n schema: ControlPourSchema,\n metadata: {\n exportName: \"ControlPourExtension\",\n category: \"Dispense\",\n tags: [\"pour\", \"control\", \"beverage\"],\n },\n\n validate: (data: ControlPourDefinition, context: ValidationContext) => {\n // Use Zod validation\n validateWithSchema(ControlPourSchema, data, context);\n },\n\n transform: createViewAwareTransform<ControlPourDefinition>(),\n});\n\n// Export constants for backward compatibility\nexport const EXTENSION_POINT_CONTROL_POUR = EXTENSION_ID;\nexport type { ControlPourDefinition };\n","import { registerApiLevels } from \"@kosdev-code/kos-api-levels\";\n\n// Registers the package-level API integer for this SDK.\n// The per-service catalog (which services changed and why) lives in\n// kos-api-levels/generated/api-archaeology-report.md, produced by the archaeology scanner.\nregisterApiLevels({ \"kos-dispense-sdk\": 16 });\n\nexport * from \"./extensions\";\nexport * from \"./models\";\nexport { kosModels as DispenserModels } from \"./models\";\nexport * from \"./models/models/generic-pour\";\nexport * from \"./ui\";\n"],"names":["createExtensionSchema","extensionPointId","defineExtensionPoint","validateWithSchema","createViewAwareTransform","registerApiLevels"],"mappings":";;;;;;;;;;AAYA,MAAM,oBAAoBA,UAAAA,sBAAsB,CAAA,GAAI,EAAE,UAAU,OAAO;AAKvE,MAAM,eAAeC,UAAAA,iBAAiB,OAAO,WAAW,MAAM;AAQvD,MAAM,uBAAuBC,UAAAA,qBAGlC;AAAA,EACA,IAAI;AAAA,EACJ,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,aACE;AAAA,EACF,SAAS;AAAA,EACT,YAAY;AAAA,EAEZ,QAAQ;AAAA,EACR,UAAU;AAAA,IACR,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,MAAM,CAAC,QAAQ,WAAW,UAAU;AAAA,EAAA;AAAA,EAGtC,UAAU,CAAC,MAA6B,YAA+B;AAErEC,iCAAmB,mBAAmB,MAAM,OAAO;AAAA,EACrD;AAAA,EAEA,WAAWC,UAAAA,yBAAA;AACb,CAAC;AAGM,MAAM,+BAA+B;AChD5CC,aAAAA,kBAAkB,EAAE,oBAAoB,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../packages/kos-dispense-sdk/src/extensions/control-pour-extension.ts","../../../packages/kos-dispense-sdk/src/index.ts"],"sourcesContent":["// eslint-disable-next-line @nx/enforce-module-boundaries\nimport type { ValidationContext } from \"@kosdev-code/kos-ui-plugin/utilities\";\nimport {\n createExtensionSchema,\n extensionPointId,\n createViewAwareTransform,\n defineExtensionPoint,\n validateWithSchema,\n} from \"@kosdev-code/kos-ui-plugin/utilities\";\nimport { z } from \"zod\";\n\n// Define the Zod schema for Control Pour contributions\nconst ControlPourSchema = createExtensionSchema({}, { rankable: false });\n\n// Define the control pour types locally\ntype ControlPourDefinition = z.infer<typeof ControlPourSchema>;\n\nconst EXTENSION_ID = extensionPointId(\"cui\", \"control\", \"pour\");\n\n/**\n * Control Pour extension point for beverage dispensing interfaces\n *\n * Allows plugin developers to contribute controlled pour functionality\n * to CUI applications that register this extension point.\n */\nexport const ControlPourExtension = defineExtensionPoint<\n ControlPourDefinition,\n ControlPourDefinition\n>({\n id: EXTENSION_ID,\n contributionKey: \"controlPour\",\n displayName: \"Control Pour\",\n description:\n \"Extension point for controlled pour plugin configurations with view support\",\n hasView: true,\n isRankable: false,\n\n schema: ControlPourSchema,\n metadata: {\n exportName: \"ControlPourExtension\",\n category: \"Dispense\",\n tags: [\"pour\", \"control\", \"beverage\"],\n },\n\n validate: (data: ControlPourDefinition, context: ValidationContext) => {\n // Use Zod validation\n validateWithSchema(ControlPourSchema, data, context);\n },\n\n transform: createViewAwareTransform<ControlPourDefinition>(),\n});\n\n// Export constants for backward compatibility\nexport const EXTENSION_POINT_CONTROL_POUR = EXTENSION_ID;\nexport type { ControlPourDefinition };\n","import { registerApiLevels } from \"@kosdev-code/kos-api-levels\";\n\n// Registers the package-level API integer for this SDK.\n// The per-service catalog (which services changed and why) lives in\n// kos-api-levels/generated/api-archaeology-report.md, produced by the archaeology scanner.\nregisterApiLevels({ \"kos-dispense-sdk\": 16 });\n\nexport * from \"./extensions\";\nexport * from \"./models\";\nexport { kosModels as DispenserModels } from \"./models\";\nexport * from \"./models/models/generic-pour\";\nexport * from \"./ui\";\n"],"names":["createExtensionSchema","extensionPointId","defineExtensionPoint","validateWithSchema","createViewAwareTransform","registerApiLevels"],"mappings":";;;;;;;AAYA,MAAM,oBAAoBA,UAAAA,sBAAsB,CAAA,GAAI,EAAE,UAAU,OAAO;AAKvE,MAAM,eAAeC,UAAAA,iBAAiB,OAAO,WAAW,MAAM;AAQvD,MAAM,uBAAuBC,UAAAA,qBAGlC;AAAA,EACA,IAAI;AAAA,EACJ,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,aACE;AAAA,EACF,SAAS;AAAA,EACT,YAAY;AAAA,EAEZ,QAAQ;AAAA,EACR,UAAU;AAAA,IACR,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,MAAM,CAAC,QAAQ,WAAW,UAAU;AAAA,EAAA;AAAA,EAGtC,UAAU,CAAC,MAA6B,YAA+B;AAErEC,iCAAmB,mBAAmB,MAAM,OAAO;AAAA,EACrD;AAAA,EAEA,WAAWC,UAAAA,yBAAA;AACb,CAAC;AAGM,MAAM,+BAA+B;AChD5CC,aAAAA,kBAAkB,EAAE,oBAAoB,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/sdk/kos-dispense-sdk/src/index.ts"],"names":[],"mappings":"AAOA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/kos-dispense-sdk/src/index.ts"],"names":[],"mappings":"AAOA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,MAAM,CAAC"}