@kosdev-code/kos-dispense-sdk 2.0.2
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 +1759 -0
- package/dispense-registration-manager-DxIbOft8.js.map +1 -0
- package/dispense-registration-manager-aM9RAFHn.cjs +2 -0
- package/dispense-registration-manager-aM9RAFHn.cjs.map +1 -0
- package/extension-utils-hWIrDMX4.cjs +2 -0
- package/extension-utils-hWIrDMX4.cjs.map +1 -0
- package/extension-utils-qcU_4sXo.js +370 -0
- package/extension-utils-qcU_4sXo.js.map +1 -0
- package/index.cjs +2 -0
- package/index.cjs.map +1 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -0
- package/index.js +103 -0
- package/index.js.map +1 -0
- package/models/constants/constants.d.ts +229 -0
- package/models/constants/constants.d.ts.map +1 -0
- package/models/constants/index.d.ts +2 -0
- package/models/constants/index.d.ts.map +1 -0
- package/models/index.d.ts +6 -0
- package/models/index.d.ts.map +1 -0
- package/models/models/assembly/assembly-model.d.ts +40 -0
- package/models/models/assembly/assembly-model.d.ts.map +1 -0
- package/models/models/assembly/assembly-registration.d.ts +81 -0
- package/models/models/assembly/assembly-registration.d.ts.map +1 -0
- package/models/models/assembly/board-utils.d.ts +6 -0
- package/models/models/assembly/board-utils.d.ts.map +1 -0
- package/models/models/assembly/holder-utils.d.ts +5 -0
- package/models/models/assembly/holder-utils.d.ts.map +1 -0
- package/models/models/assembly/index.d.ts +4 -0
- package/models/models/assembly/index.d.ts.map +1 -0
- package/models/models/assembly/nozzle-utils.d.ts +6 -0
- package/models/models/assembly/nozzle-utils.d.ts.map +1 -0
- package/models/models/assembly/pump-utils.d.ts +7 -0
- package/models/models/assembly/pump-utils.d.ts.map +1 -0
- package/models/models/assembly/services/assembly-services.d.ts +8 -0
- package/models/models/assembly/services/assembly-services.d.ts.map +1 -0
- package/models/models/assembly/services/index.d.ts +2 -0
- package/models/models/assembly/services/index.d.ts.map +1 -0
- package/models/models/assembly/types/index.d.ts +64 -0
- package/models/models/availability/availability-model.d.ts +89 -0
- package/models/models/availability/availability-model.d.ts.map +1 -0
- package/models/models/availability/index.d.ts +3 -0
- package/models/models/availability/index.d.ts.map +1 -0
- package/models/models/availability/types/index.d.ts +71 -0
- package/models/models/board/board-container-model.d.ts +23 -0
- package/models/models/board/board-container-model.d.ts.map +1 -0
- package/models/models/board/board-container-registration.d.ts +87 -0
- package/models/models/board/board-container-registration.d.ts.map +1 -0
- package/models/models/board/board-model.d.ts +18 -0
- package/models/models/board/board-model.d.ts.map +1 -0
- package/models/models/board/board-registration.d.ts +84 -0
- package/models/models/board/board-registration.d.ts.map +1 -0
- package/models/models/board/index.d.ts +5 -0
- package/models/models/board/index.d.ts.map +1 -0
- package/models/models/board/types/index.d.ts +36 -0
- package/models/models/board/types/services.d.ts +12 -0
- package/models/models/board/types/services.d.ts.map +1 -0
- package/models/models/board/utils/board-trouble-data-mapper.d.ts +7 -0
- package/models/models/board/utils/board-trouble-data-mapper.d.ts.map +1 -0
- package/models/models/board/utils/board-trouble-resolver.d.ts +7 -0
- package/models/models/board/utils/board-trouble-resolver.d.ts.map +1 -0
- package/models/models/device-assembly/device-assembly-model.d.ts +17 -0
- package/models/models/device-assembly/device-assembly-model.d.ts.map +1 -0
- package/models/models/device-assembly/device-assembly-registration.d.ts +89 -0
- package/models/models/device-assembly/device-assembly-registration.d.ts.map +1 -0
- package/models/models/device-assembly/index.d.ts +4 -0
- package/models/models/device-assembly/index.d.ts.map +1 -0
- package/models/models/device-assembly/types/index.d.ts +1 -0
- package/models/models/holder/holder-model.d.ts +93 -0
- package/models/models/holder/holder-model.d.ts.map +1 -0
- package/models/models/holder/index.d.ts +5 -0
- package/models/models/holder/index.d.ts.map +1 -0
- package/models/models/holder/services/assignment-services.d.ts +25 -0
- package/models/models/holder/services/assignment-services.d.ts.map +1 -0
- package/models/models/holder/services/holder-services.d.ts +28 -0
- package/models/models/holder/services/holder-services.d.ts.map +1 -0
- package/models/models/holder/services/index.d.ts +3 -0
- package/models/models/holder/services/index.d.ts.map +1 -0
- package/models/models/holder/types/index.d.ts +163 -0
- package/models/models/holder/utils/holder-utils.d.ts +9 -0
- package/models/models/holder/utils/holder-utils.d.ts.map +1 -0
- package/models/models/holder-container/holder-container-model.d.ts +80 -0
- package/models/models/holder-container/holder-container-model.d.ts.map +1 -0
- package/models/models/holder-container/index.d.ts +3 -0
- package/models/models/holder-container/index.d.ts.map +1 -0
- package/models/models/holder-container/types/index.d.ts +69 -0
- package/models/models/index.d.ts +13 -0
- package/models/models/index.d.ts.map +1 -0
- package/models/models/ingredient/index.d.ts +4 -0
- package/models/models/ingredient/index.d.ts.map +1 -0
- package/models/models/ingredient/ingredient-model.d.ts +86 -0
- package/models/models/ingredient/ingredient-model.d.ts.map +1 -0
- package/models/models/ingredient/services/index.d.ts +2 -0
- package/models/models/ingredient/services/index.d.ts.map +1 -0
- package/models/models/ingredient/services/ingredient-services.d.ts +30 -0
- package/models/models/ingredient/services/ingredient-services.d.ts.map +1 -0
- package/models/models/ingredient/types/index.d.ts +67 -0
- package/models/models/ingredient-container/index.d.ts +3 -0
- package/models/models/ingredient-container/index.d.ts.map +1 -0
- package/models/models/ingredient-container/ingredient-container-model.d.ts +80 -0
- package/models/models/ingredient-container/ingredient-container-model.d.ts.map +1 -0
- package/models/models/ingredient-container/types/index.d.ts +67 -0
- package/models/models/nozzle/index.d.ts +5 -0
- package/models/models/nozzle/index.d.ts.map +1 -0
- package/models/models/nozzle/nozzle-model.d.ts +257 -0
- package/models/models/nozzle/nozzle-model.d.ts.map +1 -0
- package/models/models/nozzle/services/index.d.ts +2 -0
- package/models/models/nozzle/services/index.d.ts.map +1 -0
- package/models/models/nozzle/services/nozzle-services.d.ts +181 -0
- package/models/models/nozzle/services/nozzle-services.d.ts.map +1 -0
- package/models/models/nozzle/types/index.d.ts +85 -0
- package/models/models/pump/index.d.ts +4 -0
- package/models/models/pump/index.d.ts.map +1 -0
- package/models/models/pump/pump-model.d.ts +91 -0
- package/models/models/pump/pump-model.d.ts.map +1 -0
- package/models/models/pump/services/index.d.ts +2 -0
- package/models/models/pump/services/index.d.ts.map +1 -0
- package/models/models/pump/services/pump-services.d.ts +27 -0
- package/models/models/pump/services/pump-services.d.ts.map +1 -0
- package/models/models/pump/types/index.d.ts +55 -0
- package/models/models/pump/utils/pump-trouble-resolver.d.ts +8 -0
- package/models/models/pump/utils/pump-trouble-resolver.d.ts.map +1 -0
- package/models/models/pump-container/index.d.ts +3 -0
- package/models/models/pump-container/index.d.ts.map +1 -0
- package/models/models/pump-container/pump-container-model.d.ts +85 -0
- package/models/models/pump-container/pump-container-model.d.ts.map +1 -0
- package/models/models/pump-container/types/index.d.ts +31 -0
- package/models/models/types/assembly.d.ts +83 -0
- package/models/models/types/assembly.d.ts.map +1 -0
- package/models/models/types/index.d.ts +4 -0
- package/models/models/types/index.d.ts.map +1 -0
- package/models/models/types/intent.d.ts +19 -0
- package/models/models/types/intent.d.ts.map +1 -0
- package/models/models/types/pouring.d.ts +9 -0
- package/models/models/types/pouring.d.ts.map +1 -0
- package/models/utils/dispense-registration-manager.d.ts +28 -0
- package/models/utils/dispense-registration-manager.d.ts.map +1 -0
- package/models/utils/extension-utils.d.ts +265 -0
- package/models/utils/extension-utils.d.ts.map +1 -0
- package/models/utils/openapi.d.ts +9276 -0
- package/models/utils/registration.d.ts +4 -0
- package/models/utils/registration.d.ts.map +1 -0
- package/models/utils/service.d.ts +64 -0
- package/models/utils/service.d.ts.map +1 -0
- package/models.cjs +2 -0
- package/models.cjs.map +1 -0
- package/models.d.ts +1 -0
- package/models.js +38 -0
- package/models.js.map +1 -0
- package/package.json +36 -0
- package/pump-provider-COTqsOH-.js +1013 -0
- package/pump-provider-COTqsOH-.js.map +1 -0
- package/pump-provider-D2HzZ2Bj.cjs +2 -0
- package/pump-provider-D2HzZ2Bj.cjs.map +1 -0
- package/ui/contexts/assembly/assembly-provider.d.ts +12 -0
- package/ui/contexts/assembly/assembly-provider.d.ts.map +1 -0
- package/ui/contexts/assembly/index.d.ts +2 -0
- package/ui/contexts/assembly/index.d.ts.map +1 -0
- package/ui/contexts/availability/availability-provider.d.ts +13 -0
- package/ui/contexts/availability/availability-provider.d.ts.map +1 -0
- package/ui/contexts/availability/index.d.ts +2 -0
- package/ui/contexts/availability/index.d.ts.map +1 -0
- package/ui/contexts/board/board-provider.d.ts +13 -0
- package/ui/contexts/board/board-provider.d.ts.map +1 -0
- package/ui/contexts/board/index.d.ts +2 -0
- package/ui/contexts/board/index.d.ts.map +1 -0
- package/ui/contexts/board-container/board-container-provider.d.ts +12 -0
- package/ui/contexts/board-container/board-container-provider.d.ts.map +1 -0
- package/ui/contexts/board-container/index.d.ts +2 -0
- package/ui/contexts/board-container/index.d.ts.map +1 -0
- package/ui/contexts/cui-kit/cui-kit.d.ts +22 -0
- package/ui/contexts/cui-kit/cui-kit.d.ts.map +1 -0
- package/ui/contexts/cui-kit/index.d.ts +2 -0
- package/ui/contexts/cui-kit/index.d.ts.map +1 -0
- package/ui/contexts/device-assembly/device-assembly-provider.d.ts +12 -0
- package/ui/contexts/device-assembly/device-assembly-provider.d.ts.map +1 -0
- package/ui/contexts/device-assembly/index.d.ts +2 -0
- package/ui/contexts/device-assembly/index.d.ts.map +1 -0
- package/ui/contexts/holder/holder-provider.d.ts +13 -0
- package/ui/contexts/holder/holder-provider.d.ts.map +1 -0
- package/ui/contexts/holder/index.d.ts +2 -0
- package/ui/contexts/holder/index.d.ts.map +1 -0
- package/ui/contexts/holder-container/holder-container-provider.d.ts +13 -0
- package/ui/contexts/holder-container/holder-container-provider.d.ts.map +1 -0
- package/ui/contexts/holder-container/index.d.ts +2 -0
- package/ui/contexts/holder-container/index.d.ts.map +1 -0
- package/ui/contexts/index.d.ts +13 -0
- package/ui/contexts/index.d.ts.map +1 -0
- package/ui/contexts/ingredient/index.d.ts +2 -0
- package/ui/contexts/ingredient/index.d.ts.map +1 -0
- package/ui/contexts/ingredient/ingredient-provider.d.ts +13 -0
- package/ui/contexts/ingredient/ingredient-provider.d.ts.map +1 -0
- package/ui/contexts/ingredient-container/index.d.ts +2 -0
- package/ui/contexts/ingredient-container/index.d.ts.map +1 -0
- package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts +13 -0
- package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts.map +1 -0
- package/ui/contexts/nozzle/index.d.ts +2 -0
- package/ui/contexts/nozzle/index.d.ts.map +1 -0
- package/ui/contexts/nozzle/nozzle-provider.d.ts +13 -0
- package/ui/contexts/nozzle/nozzle-provider.d.ts.map +1 -0
- package/ui/contexts/pump/index.d.ts +2 -0
- package/ui/contexts/pump/index.d.ts.map +1 -0
- package/ui/contexts/pump/pump-provider.d.ts +13 -0
- package/ui/contexts/pump/pump-provider.d.ts.map +1 -0
- package/ui/hooks/assembly/index.d.ts +3 -0
- package/ui/hooks/assembly/index.d.ts.map +1 -0
- package/ui/hooks/assembly/use-assembly.d.ts +14 -0
- package/ui/hooks/assembly/use-assembly.d.ts.map +1 -0
- package/ui/hooks/assembly/with-assembly.d.ts +8 -0
- package/ui/hooks/assembly/with-assembly.d.ts.map +1 -0
- package/ui/hooks/availability/index.d.ts +3 -0
- package/ui/hooks/availability/index.d.ts.map +1 -0
- package/ui/hooks/availability/use-availability.d.ts +14 -0
- package/ui/hooks/availability/use-availability.d.ts.map +1 -0
- package/ui/hooks/availability/with-availability.d.ts +8 -0
- package/ui/hooks/availability/with-availability.d.ts.map +1 -0
- package/ui/hooks/board/index.d.ts +3 -0
- package/ui/hooks/board/index.d.ts.map +1 -0
- package/ui/hooks/board/use-board.d.ts +14 -0
- package/ui/hooks/board/use-board.d.ts.map +1 -0
- package/ui/hooks/board/with-board.d.ts +8 -0
- package/ui/hooks/board/with-board.d.ts.map +1 -0
- package/ui/hooks/board-container/index.d.ts +3 -0
- package/ui/hooks/board-container/index.d.ts.map +1 -0
- package/ui/hooks/board-container/use-board-container.d.ts +14 -0
- package/ui/hooks/board-container/use-board-container.d.ts.map +1 -0
- package/ui/hooks/board-container/with-board-container.d.ts +8 -0
- package/ui/hooks/board-container/with-board-container.d.ts.map +1 -0
- package/ui/hooks/cui-kit/index.d.ts +8 -0
- package/ui/hooks/cui-kit/index.d.ts.map +1 -0
- package/ui/hooks/cui-kit/use-ambient-attract-timers.d.ts +18 -0
- package/ui/hooks/cui-kit/use-ambient-attract-timers.d.ts.map +1 -0
- package/ui/hooks/cui-kit/use-beverages.d.ts +17 -0
- package/ui/hooks/cui-kit/use-beverages.d.ts.map +1 -0
- package/ui/hooks/cui-kit/use-brands.d.ts +17 -0
- package/ui/hooks/cui-kit/use-brands.d.ts.map +1 -0
- package/ui/hooks/cui-kit/use-cui-kit.d.ts +127 -0
- package/ui/hooks/cui-kit/use-cui-kit.d.ts.map +1 -0
- package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts +88 -0
- package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts.map +1 -0
- package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts +19 -0
- package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts.map +1 -0
- package/ui/hooks/cui-kit/use-dispense-timers.d.ts +17 -0
- package/ui/hooks/cui-kit/use-dispense-timers.d.ts.map +1 -0
- package/ui/hooks/cui-kit/use-flavors.d.ts +17 -0
- package/ui/hooks/cui-kit/use-flavors.d.ts.map +1 -0
- package/ui/hooks/device-assembly/index.d.ts +3 -0
- package/ui/hooks/device-assembly/index.d.ts.map +1 -0
- package/ui/hooks/device-assembly/use-device-assembly.d.ts +14 -0
- package/ui/hooks/device-assembly/use-device-assembly.d.ts.map +1 -0
- package/ui/hooks/device-assembly/with-device-assembly.d.ts +9 -0
- package/ui/hooks/device-assembly/with-device-assembly.d.ts.map +1 -0
- package/ui/hooks/holder/index.d.ts +3 -0
- package/ui/hooks/holder/index.d.ts.map +1 -0
- package/ui/hooks/holder/use-holder.d.ts +14 -0
- package/ui/hooks/holder/use-holder.d.ts.map +1 -0
- package/ui/hooks/holder/with-holder.d.ts +8 -0
- package/ui/hooks/holder/with-holder.d.ts.map +1 -0
- package/ui/hooks/holder-container/index.d.ts +3 -0
- package/ui/hooks/holder-container/index.d.ts.map +1 -0
- package/ui/hooks/holder-container/use-holder-container.d.ts +14 -0
- package/ui/hooks/holder-container/use-holder-container.d.ts.map +1 -0
- package/ui/hooks/holder-container/with-holder-container.d.ts +8 -0
- package/ui/hooks/holder-container/with-holder-container.d.ts.map +1 -0
- package/ui/hooks/index.d.ts +14 -0
- package/ui/hooks/index.d.ts.map +1 -0
- package/ui/hooks/ingredient/index.d.ts +4 -0
- package/ui/hooks/ingredient/index.d.ts.map +1 -0
- package/ui/hooks/ingredient/use-ingredient-pour.d.ts +49 -0
- package/ui/hooks/ingredient/use-ingredient-pour.d.ts.map +1 -0
- package/ui/hooks/ingredient/use-ingredient.d.ts +14 -0
- package/ui/hooks/ingredient/use-ingredient.d.ts.map +1 -0
- package/ui/hooks/ingredient/with-ingredient.d.ts +8 -0
- package/ui/hooks/ingredient/with-ingredient.d.ts.map +1 -0
- package/ui/hooks/ingredient-container/index.d.ts +3 -0
- package/ui/hooks/ingredient-container/index.d.ts.map +1 -0
- package/ui/hooks/ingredient-container/use-ingredient-container.d.ts +14 -0
- package/ui/hooks/ingredient-container/use-ingredient-container.d.ts.map +1 -0
- package/ui/hooks/ingredient-container/with-ingredient-container.d.ts +8 -0
- package/ui/hooks/ingredient-container/with-ingredient-container.d.ts.map +1 -0
- package/ui/hooks/nozzle/index.d.ts +3 -0
- package/ui/hooks/nozzle/index.d.ts.map +1 -0
- package/ui/hooks/nozzle/use-dispense-kit.d.ts +22 -0
- package/ui/hooks/nozzle/use-dispense-kit.d.ts.map +1 -0
- package/ui/hooks/nozzle/use-nozzle.d.ts +14 -0
- package/ui/hooks/nozzle/use-nozzle.d.ts.map +1 -0
- package/ui/hooks/nozzle/with-nozzle.d.ts +8 -0
- package/ui/hooks/nozzle/with-nozzle.d.ts.map +1 -0
- package/ui/hooks/nozzle-pour/index.d.ts +2 -0
- package/ui/hooks/nozzle-pour/index.d.ts.map +1 -0
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts +48 -0
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts.map +1 -0
- package/ui/hooks/pump/index.d.ts +3 -0
- package/ui/hooks/pump/index.d.ts.map +1 -0
- package/ui/hooks/pump/use-pump.d.ts +14 -0
- package/ui/hooks/pump/use-pump.d.ts.map +1 -0
- package/ui/hooks/pump/with-pump.d.ts +8 -0
- package/ui/hooks/pump/with-pump.d.ts.map +1 -0
- package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts +5 -0
- package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts.map +1 -0
- package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts +4 -0
- package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts.map +1 -0
- package/ui/hooks/utils/pour-strategy/index.d.ts +7 -0
- package/ui/hooks/utils/pour-strategy/index.d.ts.map +1 -0
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts +8 -0
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts.map +1 -0
- package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts +13 -0
- package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts.map +1 -0
- package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts +5 -0
- package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts.map +1 -0
- package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts +4 -0
- package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts.map +1 -0
- package/ui/index.d.ts +3 -0
- package/ui/index.d.ts.map +1 -0
- package/ui.cjs +2 -0
- package/ui.cjs.map +1 -0
- package/ui.d.ts +1 -0
- package/ui.js +70 -0
- package/ui.js.map +1 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension point exposed by the kOS Dispense SDK models
|
|
3
|
+
* */
|
|
4
|
+
export declare enum ExtensionType {
|
|
5
|
+
/**
|
|
6
|
+
* Loads data that will be provided as context into the {@link IngredientMapper}
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* The following example shows how to load the brandset data, normalize it into a map and then provide it back to the framework
|
|
10
|
+
* where it can be used by the other extension points.
|
|
11
|
+
*
|
|
12
|
+
* In the ingredient container model, the data is provided to the {@link IngredientMapper} extension point in order to augment ingredient data
|
|
13
|
+
* and also loaded into the ingredient container model context in order to make the data available throughout the code.
|
|
14
|
+
*
|
|
15
|
+
* ```typescript
|
|
16
|
+
* export const ingredientContextLoader = async (): Promise<BeverageContext> => {
|
|
17
|
+
* const response = await kosFetch('kos:/system/some/ingredient/endpoint.json');
|
|
18
|
+
*
|
|
19
|
+
* if (response.status !== 200) {
|
|
20
|
+
* KosLog.error('Failed to load ingredient data');
|
|
21
|
+
* return {};
|
|
22
|
+
* }
|
|
23
|
+
* const json = await response.json();
|
|
24
|
+
* return json;
|
|
25
|
+
* };
|
|
26
|
+
* ```
|
|
27
|
+
* */
|
|
28
|
+
IngredientLoader = "kos.ingredient.loader",
|
|
29
|
+
/**
|
|
30
|
+
* Maps data into the {@link IngredientModel}
|
|
31
|
+
*
|
|
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 kOS Ingredient model. The {@link IngredientMapper} extension point allows for the data to be mapped
|
|
34
|
+
* into the {@link IngredientModel} and the {@link IngredientModel.data} property to be augmented with additional properties.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* The following example shows how to map the data from the service response into the {@link IngredientModel}.
|
|
38
|
+
* The context is provided by the {@link IngredientLoader} extension point with its data being used to optionally augment the
|
|
39
|
+
* ingredient data.
|
|
40
|
+
*
|
|
41
|
+
* The result of the mapping will be available in the `data` property of the {@link IngredientModel}.
|
|
42
|
+
*
|
|
43
|
+
* In this case the `IngedientReponseData` interface represents the data being returned by the ingredient service and the
|
|
44
|
+
* `IngredientData` interface represents the data that will be available in the {@link IngredientModel.data} property. The `ingredientDataMapper`
|
|
45
|
+
* is responsible for mapping from one format to the other.
|
|
46
|
+
*
|
|
47
|
+
* ```typescript
|
|
48
|
+
*
|
|
49
|
+
* interface IngredientResponseData extends NozzleServices.IngredientResponse {
|
|
50
|
+
* chilled: boolean;
|
|
51
|
+
* carbonated: boolean;
|
|
52
|
+
* highYield: boolean;
|
|
53
|
+
* }
|
|
54
|
+
*
|
|
55
|
+
* interface IngredientData {
|
|
56
|
+
* chilled: boolean;
|
|
57
|
+
* carbonated: boolean;
|
|
58
|
+
* highYield: boolean;
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* export const ingredientDataMapper = async (
|
|
62
|
+
* data: IngredientResponseData,
|
|
63
|
+
* context: IngredientContext
|
|
64
|
+
* ): Promise<IngredientData> => {
|
|
65
|
+
* return {
|
|
66
|
+
* chilled: data.chilled,
|
|
67
|
+
* carbonated: data.carbonated,
|
|
68
|
+
* highYield: data.highYield,
|
|
69
|
+
* }
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
* */
|
|
73
|
+
IngredientMapper = "kos.ingredient.mapper",
|
|
74
|
+
IngredientIndex = "kos.ingredient.index",
|
|
75
|
+
/**
|
|
76
|
+
* Maps the type property of the ingredient into the {@link IngredientModel}
|
|
77
|
+
* */
|
|
78
|
+
IngredientTypeMapper = "kos.ingredient.type.mapper",
|
|
79
|
+
/**
|
|
80
|
+
* Maps the type property of the holder into the {@link HolderModel}
|
|
81
|
+
* */
|
|
82
|
+
HolderTypeMapper = "kos.holder.type.mapper",
|
|
83
|
+
HolderMapper = "kos.holder.mapper",
|
|
84
|
+
HolderIndex = "kos.holder.index",
|
|
85
|
+
/**
|
|
86
|
+
* Maps the ingredientId property of the holder into the {@link HolderModel}.
|
|
87
|
+
* If not provided, the ingredientId will assume that the value is mapped from the
|
|
88
|
+
* ingredientId property of the service response.
|
|
89
|
+
* */
|
|
90
|
+
HolderIngredientMapper = "kos.holder.ingredient.mapper",
|
|
91
|
+
/**
|
|
92
|
+
* Maps data into the {@link AvailabilityModel}
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* The following example shows how to map the data from the service response into the {@link AvailabilityModel}.
|
|
96
|
+
* The context is provided by the {@link AvailabilityLoader} extension point with its data being used to augment the
|
|
97
|
+
* availability data.
|
|
98
|
+
*
|
|
99
|
+
* The result of the mapping will be available in the `data` property of the {@link AvailabilityModel}.
|
|
100
|
+
*
|
|
101
|
+
* ```typescript
|
|
102
|
+
* export const beverageDataMapper = async (
|
|
103
|
+
* data: NozzleServices.BeverageResponse,
|
|
104
|
+
* context: BeverageContext
|
|
105
|
+
* ): Promise<BeverageData> => {
|
|
106
|
+
* const id = data.altId;
|
|
107
|
+
* const iconUrl = encodeURI(
|
|
108
|
+
* `http://localhost:8081/system/brandset/${context?.[id]?.icon}`
|
|
109
|
+
* );
|
|
110
|
+
* const cuiColorCode = context?.[id]?.cuiColorCode
|
|
111
|
+
* ? context?.[id]?.cuiColorCode
|
|
112
|
+
* : '';
|
|
113
|
+
* return { iconUrl, cuiColorCode };
|
|
114
|
+
* };
|
|
115
|
+
* ```
|
|
116
|
+
* */
|
|
117
|
+
AvailabilityMapper = "kos.availability.mapper",
|
|
118
|
+
/**
|
|
119
|
+
* Loads data that will be provided as context into the {@link AvailabilityMapper}
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* A common use case is to load brandset data that is UI specific and not provided directly by the Java service.
|
|
123
|
+
*
|
|
124
|
+
* The following example shows how to load the brandset data, normalize it into a map and then provide it back to the framework
|
|
125
|
+
* where it can be used by the other extension points.
|
|
126
|
+
*
|
|
127
|
+
* In the nozzle model, the data is provided to the {@link AvailabilityMapper} extension point in order to augment availability data
|
|
128
|
+
* and also loaded into the nozzle model context in order to make the data available throughout the code.
|
|
129
|
+
*
|
|
130
|
+
* ```typescript
|
|
131
|
+
* export const beverageContextLoader = async (): Promise<BeverageContext> => {
|
|
132
|
+
* const response = await kosFetch('kos:/system/brandset/brandset.json');
|
|
133
|
+
*
|
|
134
|
+
* if (response.status !== 200) {
|
|
135
|
+
* KosLog.error('Failed to load beverage data');
|
|
136
|
+
* return {};
|
|
137
|
+
* }
|
|
138
|
+
* const json: BrandsetResponse | null = await response.json();
|
|
139
|
+
* const initialBeverages: Record<string, BrandsetIngredient> = {};
|
|
140
|
+
* const beverages = json?.ingredients?.reduce((acc, beverage) => {
|
|
141
|
+
* acc[beverage.ingredientId] = beverage;
|
|
142
|
+
* return acc;
|
|
143
|
+
* }, initialBeverages);
|
|
144
|
+
* return beverages;
|
|
145
|
+
* };
|
|
146
|
+
* ```
|
|
147
|
+
* */
|
|
148
|
+
AvailabilityLoader = "kos.availability.loader",
|
|
149
|
+
/**
|
|
150
|
+
* Maps the abstract {@link SelectedPourable} data into a format that is specific to the nozzle.
|
|
151
|
+
* */
|
|
152
|
+
SelectedPourableMapper = "kos.selected.pourable.mapper",
|
|
153
|
+
/**
|
|
154
|
+
* Maps data into the {@link AssemblyModel} data.
|
|
155
|
+
* Used in cases where the base assembly has been extended with additional properties in the backend. This extension
|
|
156
|
+
* point allows for the data to be mapped into the {@link AssemblyModel} and augmented with additional properties.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
*
|
|
160
|
+
* In this example of an implementation of a {@link AssemblyMapper}, the {@link AssemblyResponse} data is mapped into
|
|
161
|
+
* a {@link FreestyleAssembly} object.
|
|
162
|
+
*
|
|
163
|
+
* The {@link FreestyleAssemblyResponse} interface represents the additional data being returned by the assembly service and is
|
|
164
|
+
* merged into the {@link AssemblyResponse} interface.
|
|
165
|
+
*
|
|
166
|
+
* The {@link FreestyleAssembly} interface represents the additional data, beyond the base data set, that will be merged into the {@link AssemblyModel}.
|
|
167
|
+
*
|
|
168
|
+
* The mapper is responsible for mapping from the {@link FreestyleAssemblyResponse} format to the {@link FreestyleAssembly} format.
|
|
169
|
+
* ```typescript
|
|
170
|
+
* import { AssemblyTypes } from "@kosdev-code/kos-dispense-sdk";
|
|
171
|
+
* import { DataMapper } from "@kosdev-code/kos-ui-sdk";
|
|
172
|
+
*
|
|
173
|
+
* // define the additional data being returned by the assembly service
|
|
174
|
+
* export interface FreestyleAssemblyResponse {
|
|
175
|
+
* iceAgitator?: {
|
|
176
|
+
* name: "iceAgitator";
|
|
177
|
+
* path: string;
|
|
178
|
+
* };
|
|
179
|
+
* }
|
|
180
|
+
*
|
|
181
|
+
* // define the additional data structure that will be merged into the assembly model
|
|
182
|
+
* export interface FreestyleAssembly {
|
|
183
|
+
* iceAgitator: {
|
|
184
|
+
* path: string;
|
|
185
|
+
* };
|
|
186
|
+
* carbAgitator: {
|
|
187
|
+
* path: string;
|
|
188
|
+
* };
|
|
189
|
+
* }
|
|
190
|
+
*
|
|
191
|
+
*
|
|
192
|
+
* // define the mapper that will map the data from the service response into the additional data structure
|
|
193
|
+
* // that will be merged into the assembly model.
|
|
194
|
+
* // In this case the mapper is responsible for mapping from the {@link FreestyleAssemblyResponse} format to the {@link FreestyleAssembly} format.
|
|
195
|
+
* export const assemblyDataMapper: DataMapper<
|
|
196
|
+
* AssemblyTypes.AssemblyResponse<FreestyleAssemblyResponse>,
|
|
197
|
+
* FreestyleAssembly
|
|
198
|
+
* > = async (data) => {
|
|
199
|
+
* const response = data.assemblies.reduce((acc, assembly) => {
|
|
200
|
+
* const agitatorKeys = ["iceAgitator", "carbAgitator"];
|
|
201
|
+
* agitatorKeys.forEach((key) => {
|
|
202
|
+
* const agitator = assembly[key];
|
|
203
|
+
* if (agitator) {
|
|
204
|
+
* acc[key] = agitator;
|
|
205
|
+
* }
|
|
206
|
+
* });
|
|
207
|
+
*
|
|
208
|
+
* return acc;
|
|
209
|
+
* }, {} as FreestyleAssembly);
|
|
210
|
+
* return response;
|
|
211
|
+
* };
|
|
212
|
+
*```
|
|
213
|
+
*/
|
|
214
|
+
AssemblyMapper = "kos.assembly.mapper",
|
|
215
|
+
BoardMapper = "kos.board.mapper",
|
|
216
|
+
BoardIndex = "kos.board.index",
|
|
217
|
+
PumpIndex = "kos.pump.index"
|
|
218
|
+
}
|
|
219
|
+
export declare enum DispenseModelType {
|
|
220
|
+
Nozzle = "nozzle-model",
|
|
221
|
+
Availability = "availability-model",
|
|
222
|
+
Holder = "holder-model",
|
|
223
|
+
HolderContainer = "holder-container-model",
|
|
224
|
+
IngredientContainer = "ingredient-container-model",
|
|
225
|
+
Ingredient = "ingredient-model",
|
|
226
|
+
Pump = "pump-model",
|
|
227
|
+
PumpContainer = "pump-container-model"
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-dispense-sdk/src/models/constants/constants.ts"],"names":[],"mappings":"AAAA;;KAEK;AACL,oBAAY,aAAa;IACvB;;;;;;;;;;;;;;;;;;;;;;SAsBK;IACL,gBAAgB,0BAA0B;IAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA2CK;IACL,gBAAgB,0BAA0B;IAE1C,eAAe,yBAAyB;IACxC;;SAEK;IACL,oBAAoB,+BAA+B;IAEnD;;SAEK;IACL,gBAAgB,2BAA2B;IAE3C,YAAY,sBAAsB;IAElC,WAAW,qBAAqB;IAChC;;;;SAIK;IACL,sBAAsB,iCAAiC;IAEvD;;;;;;;;;;;;;;;;;;;;;;;;;SAyBK;IACL,kBAAkB,4BAA4B;IAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA6BK;IACL,kBAAkB,4BAA4B;IAE9C;;SAEK;IACL,sBAAsB,iCAAiC;IAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4DG;IACH,cAAc,wBAAwB;IACtC,WAAW,qBAAqB;IAChC,UAAU,oBAAoB;IAC9B,SAAS,mBAAmB;CAC7B;AAED,oBAAY,iBAAiB;IAC3B,MAAM,iBAAiB;IACvB,YAAY,uBAAuB;IACnC,MAAM,iBAAiB;IACvB,eAAe,2BAA2B;IAC1C,mBAAmB,+BAA+B;IAClD,UAAU,qBAAqB;IAC/B,IAAI,eAAe;IACnB,aAAa,yBAAyB;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-dispense-sdk/src/models/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/sdk/kos-dispense-sdk/src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,uCAAuC,CAAC;AACtD,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PumpModel } from '../pump';
|
|
2
|
+
import { HolderModel } from '../holder';
|
|
3
|
+
import { BoardModel } from '../board';
|
|
4
|
+
import { AssemblyModel, AssemblyOptions } from './types';
|
|
5
|
+
import { IKosModelLogger, KosContext, KosContextLogger, KosCreationContext } from '@kosdev-code/kos-ui-sdk';
|
|
6
|
+
|
|
7
|
+
export declare const MODEL_TYPE = "assembly-model";
|
|
8
|
+
export declare const CONTEXT_ASSEMBLY_DATA = "assembly-data";
|
|
9
|
+
export declare class AssemblyModelImpl<AssemblyExt extends object = any, HolderExt extends object = any> implements AssemblyModel<AssemblyExt>, IKosModelLogger {
|
|
10
|
+
id: string;
|
|
11
|
+
private _nozzlePaths;
|
|
12
|
+
private troubleContainer;
|
|
13
|
+
private holderContainer;
|
|
14
|
+
private boardContainer;
|
|
15
|
+
private pumpContainer;
|
|
16
|
+
logger: KosContextLogger;
|
|
17
|
+
constructor(modelId: string, _options: AssemblyOptions, context: KosCreationContext);
|
|
18
|
+
updateModel(_options: AssemblyOptions): void;
|
|
19
|
+
get allHolders(): HolderModel<HolderExt>[];
|
|
20
|
+
get holderGroups(): string[];
|
|
21
|
+
get nozzlePaths(): string[];
|
|
22
|
+
getHoldersByGroup(group: string): HolderModel<HolderExt>[];
|
|
23
|
+
getHoldersByNozzle(nozzlePath: string): HolderModel<HolderExt>[];
|
|
24
|
+
/**
|
|
25
|
+
* Returns a map of the pumps associated with each nozzle
|
|
26
|
+
*
|
|
27
|
+
* Can be used in conjunction with the nozzlePaths to get the pumps associated with each nozzle
|
|
28
|
+
* @returns Record<string, PumpModel[]>
|
|
29
|
+
*/
|
|
30
|
+
get pumpsByNozzle(): Record<string, PumpModel<any>[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns a list of all fo the pumps paths across the entire assembly.
|
|
33
|
+
*/
|
|
34
|
+
get pumpPaths(): string[];
|
|
35
|
+
get boards(): BoardModel<any>[];
|
|
36
|
+
init(): Promise<void>;
|
|
37
|
+
ready(): Promise<void>;
|
|
38
|
+
load(context: KosContext): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=assembly-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembly-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/assembly-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAYjC,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG9D,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAK7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAMzC,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AACrD,qBACa,iBAAiB,CAC5B,WAAW,SAAS,MAAM,GAAG,GAAG,EAChC,SAAS,SAAS,MAAM,GAAG,GAAG,CAC9B,YAAW,aAAa,CAAC,WAAW,CAAC,EAAE,eAAe;IAEtD,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,YAAY,CAAqB;IAEzC,OAAO,CAAC,gBAAgB,CAAyB;IAEvC,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,aAAa,CAAqB;IACpD,MAAM,EAAE,gBAAgB,CAAC;gBAEvB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,kBAAkB;IAS7B,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAI5C,IAAI,UAAU,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE,CAEzC;IAED,IAAI,YAAY,IAAI,MAAM,EAAE,CAE3B;IAED,IAAI,WAAW,IAAI,MAAM,EAAE,CAE1B;IACD,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC,EAAE;IAI1D,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC,EAAE;IAIhE;;;;;OAKG;IACH,IAAI,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAEpD;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,EAAE,CAExB;IAED,IAAI,MAAM,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAE9B;IAIK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,KAAK;IAIL,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAyE/C"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { AssemblyModel, AssemblyOptions } from './types';
|
|
2
|
+
import { SingletonKosModelRegistrationBean } from '@kosdev-code/kos-ui-sdk';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* # Assembly
|
|
6
|
+
*
|
|
7
|
+
* The registration bean includes convenience methods for creating and working with AssemblyModel instances.
|
|
8
|
+
*
|
|
9
|
+
* ## type
|
|
10
|
+
* The type property is a string that identifies the model type.
|
|
11
|
+
* The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently
|
|
12
|
+
* used when declaring dependencies on models.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
*
|
|
17
|
+
* @kosDependency({modelType: Assembly.type, id: "assemblyId"})
|
|
18
|
+
* private assemblyModel: AssemblyModel;
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
* ## factory
|
|
23
|
+
*
|
|
24
|
+
* The factory method creates a factory function that can be used to create new AssemblyModel instances.
|
|
25
|
+
*
|
|
26
|
+
|
|
27
|
+
* The factory function is a curried function that takes the model id as the first argument and the options as the second argument.
|
|
28
|
+
*
|
|
29
|
+
* If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored
|
|
30
|
+
* in this case and the existing model will be returned in its current state.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const model = Assembly.factory("assemblyId")({
|
|
35
|
+
* // Add option data
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
*
|
|
41
|
+
* ## predicate
|
|
42
|
+
*
|
|
43
|
+
* [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a AssemblyModel.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
*
|
|
48
|
+
* const model: IKosDataModel = ...; // some model
|
|
49
|
+
*
|
|
50
|
+
* if (Assembly.predicate(model)) {
|
|
51
|
+
* // if the function evaluates to true, the model is narrowed down to AssemblyModel
|
|
52
|
+
* // and the compiler will know that the model has the AssemblyModel interface
|
|
53
|
+
* model.updateAvailability(false);
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* ## registration
|
|
58
|
+
*
|
|
59
|
+
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
60
|
+
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
61
|
+
*
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
*
|
|
65
|
+
* In an application registration file you can declare the model registration as follows:
|
|
66
|
+
*
|
|
67
|
+
* **registration.ts**
|
|
68
|
+
* ```typescript
|
|
69
|
+
* import { Assembly } from "@kosdev-code/kos-dispense-sdk";
|
|
70
|
+
* ...
|
|
71
|
+
* import { ExtensionManager, IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
72
|
+
* export const kosModels: IKosRegistry["models"] = {
|
|
73
|
+
* ...Assembly.registration,
|
|
74
|
+
* };
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* ## registration.singleton
|
|
78
|
+
* The assembly model is a singleton model. This means that each time the factory function the same instance of the model will be returned.
|
|
79
|
+
* */
|
|
80
|
+
export declare const Assembly: Readonly<SingletonKosModelRegistrationBean<AssemblyModel, AssemblyOptions>>;
|
|
81
|
+
//# sourceMappingURL=assembly-registration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembly-registration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/assembly-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAGjF,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2EK;AACL,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAC7B,iCAAiC,CAAC,aAAa,EAAE,eAAe,CAAC,CAWlE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AssemblyBoard } from '../types/assembly';
|
|
2
|
+
import { BoardContainerModel } from '../board';
|
|
3
|
+
|
|
4
|
+
export declare const mapAssemblyBoardToModel: <AssemblyBoardResponseExt extends object = any, BoardExt extends object = any>(board: AssemblyBoard<AssemblyBoardResponseExt>) => Promise<import('../board').BoardModel<{}>>;
|
|
5
|
+
export declare const assemblyBoardMap: (boardContainer: BoardContainerModel) => (board: AssemblyBoard) => Promise<void>;
|
|
6
|
+
//# sourceMappingURL=board-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"board-utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/board-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,mBAAmB,EAAqB,MAAM,UAAU,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD,eAAO,MAAM,uBAAuB,wFAI3B,cAAc,wBAAwB,CAAC,+CA0B/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,mBACV,mBAAmB,aAAmB,aAAa,kBAInE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AssemblyHolder } from '../types/assembly';
|
|
2
|
+
import { HolderModel } from '../holder/types';
|
|
3
|
+
|
|
4
|
+
export declare const mapAssemblyHolderToModel: <AssemblyHolderResponseExt extends object = any, HolderExt extends object = any>(group: string, holderData: AssemblyHolder<AssemblyHolderResponseExt>) => Promise<HolderModel<HolderExt>>;
|
|
5
|
+
//# sourceMappingURL=holder-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"holder-utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/holder-utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAiB,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,wBAAwB,0FAI5B,MAAM,cACD,eAAe,yBAAyB,CAAC,oCA2CtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,mBAAmB,SAAS,CAAC;AAC7B,OAAO,KAAK,gBAAgB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AssemblyBoard } from '../types/assembly';
|
|
2
|
+
import { BoardContainerModel } from '../board';
|
|
3
|
+
|
|
4
|
+
export declare const mapAssemblyBoardToModel: (board: AssemblyBoard) => import('../board').BoardModel<{}>;
|
|
5
|
+
export declare const assemblyBoardMap: (boardContainer: BoardContainerModel) => (board: AssemblyBoard) => void;
|
|
6
|
+
//# sourceMappingURL=nozzle-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nozzle-utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/nozzle-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,mBAAmB,EAAqB,MAAM,UAAU,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD,eAAO,MAAM,uBAAuB,UAAW,aAAa,sCAc3D,CAAC;AAEF,eAAO,MAAM,gBAAgB,mBACV,mBAAmB,aAAa,aAAa,SAI7D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AssemblyNozzle, AssemblyPump } from '../types/assembly';
|
|
2
|
+
import { PumpContainerModel } from '../pump-container';
|
|
3
|
+
import { HolderContainerModel } from '../holder-container';
|
|
4
|
+
|
|
5
|
+
export declare const mapAssemblyPumpToModel: (nozzlePath: string, pump: AssemblyPump) => import('../pump').PumpModel<any>;
|
|
6
|
+
export declare const assemblyPumpMap: (pumpContainer: PumpContainerModel) => (holderContainer: HolderContainerModel) => (nozzle: AssemblyNozzle) => (assemblyPump: AssemblyPump) => void;
|
|
7
|
+
//# sourceMappingURL=pump-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pump-utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/pump-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtE,eAAO,MAAM,sBAAsB,eACrB,MAAM,QACZ,YAAY,qCAqBnB,CAAC;AAEF,eAAO,MAAM,eAAe,kBACV,kBAAkB,uBAChB,oBAAoB,cAC7B,cAAc,oBACR,YAAY,SAqB1B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AssemblyResponse } from '../../types/assembly';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @category Service
|
|
5
|
+
* Retrieves the initial assembly data.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getAssembly: () => Promise<import('@kosdev-code/kos-ui-sdk').KosServiceResponse<AssemblyResponse<{}>> | undefined>;
|
|
8
|
+
//# sourceMappingURL=assembly-services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembly-services.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/services/assembly-services.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAW7D;;;GAGG;AACH,eAAO,MAAM,WAAW,uGAIvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/assembly/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { HolderModel } from '../../holder/types';
|
|
2
|
+
import { BoardModel } from '../../board/types';
|
|
3
|
+
import { IKosDataModel } from '@kosdev-code/kos-ui-sdk';
|
|
4
|
+
|
|
5
|
+
export interface AssemblyOptions {}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* Represents the union of device assemblies including all of the boards, holders, pumps and nozzles defined
|
|
11
|
+
* on the device.
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* @category Model
|
|
15
|
+
*/
|
|
16
|
+
export interface AssemblyModel<
|
|
17
|
+
AssemblyExt extends object = any,
|
|
18
|
+
HolderExt extends object = any
|
|
19
|
+
> extends AdditionalData,
|
|
20
|
+
AssemblyExt,
|
|
21
|
+
IKosDataModel {
|
|
22
|
+
id: string;
|
|
23
|
+
|
|
24
|
+
/** The unique list of holder group names */
|
|
25
|
+
readonly holderGroups: string[];
|
|
26
|
+
|
|
27
|
+
readonly boards: BoardModel<any>[];
|
|
28
|
+
/**
|
|
29
|
+
* The list of all nozzle paths defined on the device. This is useful as a means to discover
|
|
30
|
+
* which nozzles are available on dispensers with multiple nozzles.
|
|
31
|
+
*/
|
|
32
|
+
readonly nozzlePaths: string[];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The list of all holders defined on the device, regardless of group
|
|
36
|
+
*/
|
|
37
|
+
readonly allHolders: HolderModel<HolderExt>[];
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get the holders for a named group.
|
|
41
|
+
* @param group - the group name to filter the holders by.
|
|
42
|
+
*/
|
|
43
|
+
getHoldersByGroup(group: string): HolderModel<HolderExt>[];
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Get the holders mapped to a given nozzle.
|
|
47
|
+
* @param nozzlePath - the nozzle path to filter the holders by.
|
|
48
|
+
*/
|
|
49
|
+
getHoldersByNozzle(nozzlePath: string): HolderModel<HolderExt>[];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Returns a map of the pumps associated with each nozzle
|
|
53
|
+
*
|
|
54
|
+
* Can be used in conjunction with the nozzlePaths to get the pumps associated with each nozzle
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
readonly pumpsByNozzle: Record<string, PumpModel<any>[]>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Returns a list of all fo the pumps paths across the entire assembly.
|
|
61
|
+
*/
|
|
62
|
+
readonly pumpPaths: string[];
|
|
63
|
+
updateModel(options: AssemblyOptions): void;
|
|
64
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { AvailabilityModel, AvailabilityOptions } from './types';
|
|
2
|
+
import { KosModelRegistrationBean } from '@kosdev-code/kos-ui-sdk';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* # Availability
|
|
6
|
+
*
|
|
7
|
+
* The registration bean includes convenience methods for creating and working with AvailabilityModel instances.
|
|
8
|
+
*
|
|
9
|
+
* ## type
|
|
10
|
+
* The type property is a string that identifies the model type.
|
|
11
|
+
* The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently
|
|
12
|
+
* used when declaring dependencies on models.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
*
|
|
17
|
+
* @kosDependency({modelType: Availability.type, id: "beverageId"})
|
|
18
|
+
* private beverageModel: AvailabilityModel;
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* ## factory
|
|
22
|
+
*
|
|
23
|
+
* The factory method creates a factory function that can be used to create new AvailabilityModel instances.
|
|
24
|
+
*
|
|
25
|
+
* The factory function is a curried function that takes the model id as the first argument and the options as the second argument.
|
|
26
|
+
*
|
|
27
|
+
* If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored
|
|
28
|
+
* in this case and the existing model will be returned in its current state.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
*
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const cherryFlavor = Availability.factory("beverageId")({
|
|
34
|
+
* groupId: "flavor",
|
|
35
|
+
* rawId: "cherry",
|
|
36
|
+
* altId: "cherry",
|
|
37
|
+
* available: true,
|
|
38
|
+
* visible: true,
|
|
39
|
+
* // this data is added via extension point
|
|
40
|
+
* data: {
|
|
41
|
+
* name: "Cherry",
|
|
42
|
+
* description: "Cherry flavor",
|
|
43
|
+
* },
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @param predicate
|
|
48
|
+
*
|
|
49
|
+
* [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a AvailabilityModel.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
*
|
|
54
|
+
* const model: IKosDataModel = ...; // some model
|
|
55
|
+
*
|
|
56
|
+
* if (Availability.predicate(model)) {
|
|
57
|
+
* // if the function evaluates to true, the model is narrowed down to AvailabilityModel
|
|
58
|
+
* // and the compiler will know that the model has the AvailabilityModel interface
|
|
59
|
+
* model.updateAvailability(false);
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* ## registration
|
|
64
|
+
*
|
|
65
|
+
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
66
|
+
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
67
|
+
*
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
*
|
|
71
|
+
* In an application registration file you can declare the model registration as follows:
|
|
72
|
+
*
|
|
73
|
+
* **registration.ts**
|
|
74
|
+
* ```typescript
|
|
75
|
+
* import { Availability } from "@kosdev-code/kos-dispense-sdk";
|
|
76
|
+
* ...
|
|
77
|
+
* import { ExtensionManager, IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
78
|
+
* export const kosModels: IKosRegistry["models"] = {
|
|
79
|
+
* ...Availability.registration,
|
|
80
|
+
* };
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* ## registration.singleton
|
|
84
|
+
*
|
|
85
|
+
* The beverage 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.
|
|
86
|
+
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
87
|
+
* */
|
|
88
|
+
export declare const Availability: Readonly<KosModelRegistrationBean<AvailabilityModel, AvailabilityOptions>>;
|
|
89
|
+
//# sourceMappingURL=availability-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availability-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/availability/availability-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,wBAAwB,EAC9B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA4DtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmFK;AACL,eAAO,MAAM,YAAY,EAAE,QAAQ,CACjC,wBAAwB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAgBjE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-dispense-sdk/src/models/models/availability/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
|