@kosdev-code/kos-dispense-sdk 0.1.0-dev.5873 → 0.1.0-next.1000
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/.kos.json +129 -0
- package/{dispense-registration-manager-ukk4OBeX.cjs → dispense-registration-manager-CfWgJqfq.cjs} +807 -445
- package/dispense-registration-manager-CfWgJqfq.cjs.map +1 -0
- package/{dispense-registration-manager-C4XZ_c3x.js → dispense-registration-manager-DtN0T_JG.js} +846 -484
- package/dispense-registration-manager-DtN0T_JG.js.map +1 -0
- package/{extension-utils-CMVLCSA8.cjs → extension-utils-BWYG2dYG.cjs} +52 -194
- package/extension-utils-BWYG2dYG.cjs.map +1 -0
- package/{extension-utils-FxS68Xu9.js → extension-utils-BoXtjU5_.js} +58 -200
- package/extension-utils-BoXtjU5_.js.map +1 -0
- package/extensions/control-pour-extension.d.ts +8 -9
- package/extensions/control-pour-extension.d.ts.map +1 -1
- package/extensions/index.d.ts.map +1 -1
- package/index.cjs +31 -11
- package/index.cjs.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +118 -98
- package/index.js.map +1 -1
- package/models/constants/constants.d.ts +14 -178
- package/models/constants/constants.d.ts.map +1 -1
- package/models/constants/index.d.ts.map +1 -1
- package/models/index.d.ts.map +1 -1
- package/models/models/assembly/assembly-model.d.ts +12 -5
- package/models/models/assembly/assembly-model.d.ts.map +1 -1
- package/models/models/assembly/assembly-registration.d.ts +12 -71
- package/models/models/assembly/assembly-registration.d.ts.map +1 -1
- package/models/models/assembly/board-utils.d.ts +1 -2
- package/models/models/assembly/board-utils.d.ts.map +1 -1
- package/models/models/assembly/holder-utils.d.ts +1 -2
- package/models/models/assembly/holder-utils.d.ts.map +1 -1
- package/models/models/assembly/index.d.ts.map +1 -1
- package/models/models/assembly/nozzle-utils.d.ts +1 -2
- package/models/models/assembly/nozzle-utils.d.ts.map +1 -1
- package/models/models/assembly/pump-utils.d.ts +2 -3
- package/models/models/assembly/pump-utils.d.ts.map +1 -1
- package/models/models/assembly/services/assembly-services.d.ts +0 -1
- package/models/models/assembly/services/assembly-services.d.ts.map +1 -1
- package/models/models/assembly/services/index.d.ts.map +1 -1
- package/models/models/assembly/types/index.d.ts +8 -3
- package/models/models/availability/availability-model.d.ts +13 -78
- package/models/models/availability/availability-model.d.ts.map +1 -1
- package/models/models/availability/index.d.ts.map +1 -1
- package/models/models/availability/types/index.d.ts +7 -13
- package/models/models/board/board-container-model.d.ts +10 -3
- package/models/models/board/board-container-model.d.ts.map +1 -1
- package/models/models/board/board-container-registration.d.ts +13 -77
- package/models/models/board/board-container-registration.d.ts.map +1 -1
- package/models/models/board/board-model.d.ts +1 -2
- package/models/models/board/board-model.d.ts.map +1 -1
- package/models/models/board/board-registration.d.ts +12 -74
- package/models/models/board/board-registration.d.ts.map +1 -1
- package/models/models/board/index.d.ts.map +1 -1
- package/models/models/board/types/index.d.ts +12 -2
- package/models/models/board/types/services.d.ts.map +1 -1
- package/models/models/board/utils/board-trouble-data-mapper.d.ts +1 -2
- package/models/models/board/utils/board-trouble-data-mapper.d.ts.map +1 -1
- package/models/models/board/utils/board-trouble-resolver.d.ts +0 -1
- package/models/models/board/utils/board-trouble-resolver.d.ts.map +1 -1
- package/models/models/cui-kit-state/cui-kit-state-model.d.ts +133 -0
- package/models/models/cui-kit-state/cui-kit-state-model.d.ts.map +1 -0
- package/models/models/cui-kit-state/index.d.ts +4 -0
- package/models/models/cui-kit-state/index.d.ts.map +1 -0
- package/models/models/cui-kit-state/types/index.d.ts +82 -0
- package/models/models/device-assembly/device-assembly-model.d.ts +6 -3
- package/models/models/device-assembly/device-assembly-model.d.ts.map +1 -1
- package/models/models/device-assembly/device-assembly-registration.d.ts +14 -79
- package/models/models/device-assembly/device-assembly-registration.d.ts.map +1 -1
- package/models/models/device-assembly/index.d.ts.map +1 -1
- package/models/models/device-assembly/types/index.d.ts +4 -0
- package/models/models/generic-pour/generic-pour-model.d.ts +19 -4
- package/models/models/generic-pour/generic-pour-model.d.ts.map +1 -1
- package/models/models/generic-pour/generic-pour-registration.d.ts +13 -75
- package/models/models/generic-pour/generic-pour-registration.d.ts.map +1 -1
- package/models/models/generic-pour/index.d.ts.map +1 -1
- package/models/models/generic-pour/services/generic-pour-services.d.ts.map +1 -1
- package/models/models/generic-pour/services/index.d.ts.map +1 -1
- package/models/models/generic-pour/types/index.d.ts +4 -0
- package/models/models/holder/holder-model.d.ts +16 -75
- package/models/models/holder/holder-model.d.ts.map +1 -1
- package/models/models/holder/index.d.ts.map +1 -1
- package/models/models/holder/services/assignment-services.d.ts.map +1 -1
- package/models/models/holder/services/holder-services.d.ts.map +1 -1
- package/models/models/holder/services/index.d.ts.map +1 -1
- package/models/models/holder/types/index.d.ts +11 -7
- package/models/models/holder/utils/holder-utils.d.ts +0 -1
- package/models/models/holder/utils/holder-utils.d.ts.map +1 -1
- package/models/models/holder-container/holder-container-model.d.ts +12 -70
- package/models/models/holder-container/holder-container-model.d.ts.map +1 -1
- package/models/models/holder-container/index.d.ts.map +1 -1
- package/models/models/holder-container/types/index.d.ts +16 -5
- package/models/models/index.d.ts +1 -0
- package/models/models/index.d.ts.map +1 -1
- package/models/models/ingredient/index.d.ts.map +1 -1
- package/models/models/ingredient/ingredient-model.d.ts +12 -76
- package/models/models/ingredient/ingredient-model.d.ts.map +1 -1
- package/models/models/ingredient/services/index.d.ts.map +1 -1
- package/models/models/ingredient/services/ingredient-services.d.ts.map +1 -1
- package/models/models/ingredient/types/index.d.ts +7 -13
- package/models/models/ingredient-container/index.d.ts.map +1 -1
- package/models/models/ingredient-container/ingredient-container-model.d.ts +12 -70
- package/models/models/ingredient-container/ingredient-container-model.d.ts.map +1 -1
- package/models/models/ingredient-container/types/index.d.ts +7 -3
- package/models/models/nozzle/index.d.ts.map +1 -1
- package/models/models/nozzle/nozzle-model.d.ts +20 -81
- package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
- package/models/models/nozzle/services/index.d.ts.map +1 -1
- package/models/models/nozzle/services/nozzle-services.d.ts +11 -65
- package/models/models/nozzle/services/nozzle-services.d.ts.map +1 -1
- package/models/models/nozzle/types/index.d.ts +7 -3
- package/models/models/pump/index.d.ts.map +1 -1
- package/models/models/pump/pump-model.d.ts +12 -81
- package/models/models/pump/pump-model.d.ts.map +1 -1
- package/models/models/pump/services/index.d.ts.map +1 -1
- package/models/models/pump/services/pump-services.d.ts +3 -5
- package/models/models/pump/services/pump-services.d.ts.map +1 -1
- package/models/models/pump/types/index.d.ts +7 -3
- package/models/models/pump/utils/pump-trouble-resolver.d.ts +0 -1
- package/models/models/pump/utils/pump-trouble-resolver.d.ts.map +1 -1
- package/models/models/pump-container/index.d.ts.map +1 -1
- package/models/models/pump-container/pump-container-model.d.ts +16 -70
- package/models/models/pump-container/pump-container-model.d.ts.map +1 -1
- package/models/models/pump-container/types/index.d.ts +7 -3
- package/models/models/types/assembly.d.ts.map +1 -1
- package/models/models/types/index.d.ts.map +1 -1
- package/models/models/types/intent.d.ts +11 -79
- package/models/models/types/intent.d.ts.map +1 -1
- package/models/models/types/pouring.d.ts.map +1 -1
- package/models/utils/dispense-registration-manager.d.ts +34 -10
- package/models/utils/dispense-registration-manager.d.ts.map +1 -1
- package/models/utils/extension-utils.d.ts +66 -173
- package/models/utils/extension-utils.d.ts.map +1 -1
- package/models/utils/openapi-index.d.ts +1 -1
- package/models/utils/openapi-index.d.ts.map +1 -1
- package/models/utils/pour-context.d.ts +8 -0
- package/models/utils/pour-context.d.ts.map +1 -0
- package/models/utils/registration.d.ts +0 -1
- package/models/utils/registration.d.ts.map +1 -1
- package/models/utils/service.d.ts +34 -35
- package/models/utils/service.d.ts.map +1 -1
- package/models/utils/services/dispense/1.6.5/service.d.ts +34 -35
- package/models/utils/services/dispense/1.6.5/service.d.ts.map +1 -1
- package/models/utils/services/dispense/1.8.1/service.d.ts +34 -35
- package/models/utils/services/dispense/1.8.1/service.d.ts.map +1 -1
- package/models/utils/services/dispense/daily/openapi.d.ts +1941 -1812
- package/models/utils/services/dispense/daily/service.d.ts +127 -37
- package/models/utils/services/dispense/daily/service.d.ts.map +1 -1
- package/models/utils/services-index.d.ts +1 -1
- package/models/utils/services-index.d.ts.map +1 -1
- package/models.cjs +4 -5
- package/models.cjs.map +1 -1
- package/models.d.ts +1 -0
- package/models.js +29 -30
- package/models.js.map +1 -1
- package/package.json +11 -12
- package/{pump-provider-BAQXIUuP.cjs → pump-provider-B4WR3LiY.cjs} +480 -544
- package/pump-provider-B4WR3LiY.cjs.map +1 -0
- package/{pump-provider-9rUgev7q.js → pump-provider-CPUsLke5.js} +541 -605
- package/pump-provider-CPUsLke5.js.map +1 -0
- package/ui/contexts/assembly/assembly-provider.d.ts +9 -2
- package/ui/contexts/assembly/assembly-provider.d.ts.map +1 -1
- package/ui/contexts/assembly/index.d.ts.map +1 -1
- package/ui/contexts/availability/availability-provider.d.ts +9 -2
- package/ui/contexts/availability/availability-provider.d.ts.map +1 -1
- package/ui/contexts/availability/index.d.ts.map +1 -1
- package/ui/contexts/board/board-provider.d.ts +9 -2
- package/ui/contexts/board/board-provider.d.ts.map +1 -1
- package/ui/contexts/board/index.d.ts.map +1 -1
- package/ui/contexts/board-container/board-container-provider.d.ts +9 -2
- package/ui/contexts/board-container/board-container-provider.d.ts.map +1 -1
- package/ui/contexts/board-container/index.d.ts.map +1 -1
- package/ui/contexts/cui-kit/cui-kit.d.ts +17 -3
- package/ui/contexts/cui-kit/cui-kit.d.ts.map +1 -1
- package/ui/contexts/cui-kit/index.d.ts.map +1 -1
- package/ui/contexts/device-assembly/device-assembly-provider.d.ts +9 -2
- package/ui/contexts/device-assembly/device-assembly-provider.d.ts.map +1 -1
- package/ui/contexts/device-assembly/index.d.ts.map +1 -1
- package/ui/contexts/holder/holder-provider.d.ts +9 -2
- package/ui/contexts/holder/holder-provider.d.ts.map +1 -1
- package/ui/contexts/holder/index.d.ts.map +1 -1
- package/ui/contexts/holder-container/holder-container-provider.d.ts +9 -2
- package/ui/contexts/holder-container/holder-container-provider.d.ts.map +1 -1
- package/ui/contexts/holder-container/index.d.ts.map +1 -1
- package/ui/contexts/index.d.ts.map +1 -1
- package/ui/contexts/ingredient/index.d.ts.map +1 -1
- package/ui/contexts/ingredient/ingredient-provider.d.ts +9 -2
- package/ui/contexts/ingredient/ingredient-provider.d.ts.map +1 -1
- package/ui/contexts/ingredient-container/index.d.ts.map +1 -1
- package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts +9 -2
- package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts.map +1 -1
- package/ui/contexts/nozzle/index.d.ts.map +1 -1
- package/ui/contexts/nozzle/nozzle-provider.d.ts +9 -2
- package/ui/contexts/nozzle/nozzle-provider.d.ts.map +1 -1
- package/ui/contexts/pump/index.d.ts.map +1 -1
- package/ui/contexts/pump/pump-provider.d.ts +9 -2
- package/ui/contexts/pump/pump-provider.d.ts.map +1 -1
- package/ui/hooks/assembly/index.d.ts.map +1 -1
- package/ui/hooks/assembly/use-assembly.d.ts +5 -2
- package/ui/hooks/assembly/use-assembly.d.ts.map +1 -1
- package/ui/hooks/assembly/with-assembly.d.ts +4 -1
- package/ui/hooks/assembly/with-assembly.d.ts.map +1 -1
- package/ui/hooks/availability/index.d.ts.map +1 -1
- package/ui/hooks/availability/use-availability.d.ts +5 -2
- package/ui/hooks/availability/use-availability.d.ts.map +1 -1
- package/ui/hooks/availability/with-availability.d.ts +0 -1
- package/ui/hooks/availability/with-availability.d.ts.map +1 -1
- package/ui/hooks/board/index.d.ts.map +1 -1
- package/ui/hooks/board/use-board.d.ts +5 -2
- package/ui/hooks/board/use-board.d.ts.map +1 -1
- package/ui/hooks/board/with-board.d.ts +4 -1
- package/ui/hooks/board/with-board.d.ts.map +1 -1
- package/ui/hooks/board-container/index.d.ts.map +1 -1
- package/ui/hooks/board-container/use-board-container.d.ts +5 -2
- package/ui/hooks/board-container/use-board-container.d.ts.map +1 -1
- package/ui/hooks/board-container/with-board-container.d.ts +4 -1
- package/ui/hooks/board-container/with-board-container.d.ts.map +1 -1
- package/ui/hooks/cui-kit/dispense-topics.d.ts +0 -1
- package/ui/hooks/cui-kit/dispense-topics.d.ts.map +1 -1
- package/ui/hooks/cui-kit/index.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-ambient-attract-timers.d.ts +0 -1
- package/ui/hooks/cui-kit/use-ambient-attract-timers.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-beverages.d.ts +1 -2
- package/ui/hooks/cui-kit/use-beverages.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-brands.d.ts +1 -2
- package/ui/hooks/cui-kit/use-brands.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-cui-kit.d.ts +51 -7
- package/ui/hooks/cui-kit/use-cui-kit.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts +16 -44
- package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts +0 -1
- package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-dispense-timers.d.ts +0 -1
- package/ui/hooks/cui-kit/use-dispense-timers.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-flavors.d.ts +1 -2
- package/ui/hooks/cui-kit/use-flavors.d.ts.map +1 -1
- package/ui/hooks/device-assembly/index.d.ts.map +1 -1
- package/ui/hooks/device-assembly/use-device-assembly.d.ts +5 -2
- package/ui/hooks/device-assembly/use-device-assembly.d.ts.map +1 -1
- package/ui/hooks/device-assembly/with-device-assembly.d.ts +4 -1
- package/ui/hooks/device-assembly/with-device-assembly.d.ts.map +1 -1
- package/ui/hooks/generic-pour/index.d.ts.map +1 -1
- package/ui/hooks/generic-pour/use-generic-pour.d.ts +6 -3
- package/ui/hooks/generic-pour/use-generic-pour.d.ts.map +1 -1
- package/ui/hooks/generic-pour/with-generic-pour.d.ts +5 -2
- package/ui/hooks/generic-pour/with-generic-pour.d.ts.map +1 -1
- package/ui/hooks/holder/index.d.ts.map +1 -1
- package/ui/hooks/holder/use-holder.d.ts +5 -2
- package/ui/hooks/holder/use-holder.d.ts.map +1 -1
- package/ui/hooks/holder/with-holder.d.ts +4 -1
- package/ui/hooks/holder/with-holder.d.ts.map +1 -1
- package/ui/hooks/holder-container/index.d.ts.map +1 -1
- package/ui/hooks/holder-container/use-holder-container.d.ts +7 -4
- package/ui/hooks/holder-container/use-holder-container.d.ts.map +1 -1
- package/ui/hooks/holder-container/with-holder-container.d.ts +4 -1
- package/ui/hooks/holder-container/with-holder-container.d.ts.map +1 -1
- package/ui/hooks/index.d.ts.map +1 -1
- package/ui/hooks/ingredient/index.d.ts.map +1 -1
- package/ui/hooks/ingredient/use-ingredient-pour.d.ts +16 -22
- package/ui/hooks/ingredient/use-ingredient-pour.d.ts.map +1 -1
- package/ui/hooks/ingredient/use-ingredient.d.ts +5 -2
- package/ui/hooks/ingredient/use-ingredient.d.ts.map +1 -1
- package/ui/hooks/ingredient/with-ingredient.d.ts +4 -1
- package/ui/hooks/ingredient/with-ingredient.d.ts.map +1 -1
- package/ui/hooks/ingredient-container/index.d.ts.map +1 -1
- package/ui/hooks/ingredient-container/use-ingredient-container.d.ts +5 -2
- package/ui/hooks/ingredient-container/use-ingredient-container.d.ts.map +1 -1
- package/ui/hooks/ingredient-container/with-ingredient-container.d.ts +4 -1
- package/ui/hooks/ingredient-container/with-ingredient-container.d.ts.map +1 -1
- package/ui/hooks/nozzle/index.d.ts.map +1 -1
- package/ui/hooks/nozzle/use-dispense-kit.d.ts +0 -1
- package/ui/hooks/nozzle/use-dispense-kit.d.ts.map +1 -1
- package/ui/hooks/nozzle/use-nozzle.d.ts +5 -2
- package/ui/hooks/nozzle/use-nozzle.d.ts.map +1 -1
- package/ui/hooks/nozzle/with-nozzle.d.ts +4 -1
- package/ui/hooks/nozzle/with-nozzle.d.ts.map +1 -1
- package/ui/hooks/nozzle-pour/index.d.ts.map +1 -1
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts +16 -22
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts.map +1 -1
- package/ui/hooks/pour/index.d.ts.map +1 -1
- package/ui/hooks/pour/use-pour.d.ts +11 -23
- package/ui/hooks/pour/use-pour.d.ts.map +1 -1
- package/ui/hooks/pump/index.d.ts.map +1 -1
- package/ui/hooks/pump/use-pump.d.ts +1 -2
- package/ui/hooks/pump/use-pump.d.ts.map +1 -1
- package/ui/hooks/pump/with-pump.d.ts +0 -1
- package/ui/hooks/pump/with-pump.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts +5 -2
- package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts +4 -1
- package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/index.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts +11 -2
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts +5 -2
- package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts +5 -2
- package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts +4 -1
- package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts.map +1 -1
- package/ui/index.d.ts.map +1 -1
- package/ui/utils/pour-context.d.ts +1 -7
- package/ui/utils/pour-context.d.ts.map +1 -1
- package/ui.cjs +3 -7
- package/ui.cjs.map +1 -1
- package/ui.d.ts +1 -0
- package/ui.js +64 -68
- package/ui.js.map +1 -1
- package/dispense-registration-manager-C4XZ_c3x.js.map +0 -1
- package/dispense-registration-manager-ukk4OBeX.cjs.map +0 -1
- package/extension-utils-CMVLCSA8.cjs.map +0 -1
- package/extension-utils-FxS68Xu9.js.map +0 -1
- package/kos-models.json +0 -180
- package/pump-provider-9rUgev7q.js.map +0 -1
- package/pump-provider-BAQXIUuP.cjs.map +0 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { HolderModel, HolderOptions } from './types';
|
|
2
1
|
import { KosModelRegistrationBean } from '@kosdev-code/kos-ui-sdk';
|
|
3
|
-
|
|
2
|
+
import { HolderModel, HolderOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @kosService dispense.holder
|
|
5
|
+
* @kosApiLevel 2
|
|
6
|
+
*/
|
|
4
7
|
export interface HolderTroubleData {
|
|
5
8
|
holderPaths: string[];
|
|
6
9
|
holderNames: string[];
|
|
@@ -10,84 +13,22 @@ export interface ContainerTroubleData {
|
|
|
10
13
|
unknonwnIngredientId?: string;
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
|
-
*
|
|
16
|
+
* Registration bean for {@link HolderModel}.
|
|
14
17
|
*
|
|
15
|
-
*
|
|
18
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
19
|
+
* - `factory`: curried factory, `Holder.factory(id)(options)`. Returns the existing model when the id is already in use and ignores the options.
|
|
20
|
+
* - `predicate`: type guard that narrows an `IKosDataModel` to `HolderModel`.
|
|
21
|
+
* - `registration`: registry entry that can be spread into an `IKosRegistry["models"]` map.
|
|
16
22
|
*
|
|
17
|
-
*
|
|
18
|
-
* The type property is a string that identifies the model type.
|
|
19
|
-
* 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
|
|
20
|
-
* used when declaring dependencies on models.
|
|
23
|
+
* Holder is not a singleton: each id has its own instance. `KosModelRegistry.dispense.models()` registers it.
|
|
21
24
|
*
|
|
22
25
|
* @example
|
|
23
26
|
* ```typescript
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* private holderModel: HolderModel;
|
|
27
|
+
* @kosDependency({ modelType: Holder.type, id: "holderId" })
|
|
28
|
+
* private holder!: HolderModel;
|
|
27
29
|
* ```
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
*
|
|
32
|
-
* The factory method creates a factory function that can be used to create new HolderModel instances.
|
|
33
|
-
*
|
|
34
|
-
* The factory function is a curried function that takes the model id as the first argument and the options as the second argument.
|
|
35
|
-
*
|
|
36
|
-
* If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored
|
|
37
|
-
* in this case and the existing model will be returned in its current state.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
*
|
|
41
|
-
* ```typescript
|
|
42
|
-
* const model = Holder.factory("S1")({
|
|
43
|
-
* path: "core.dispenser.holder.s1",
|
|
44
|
-
* name: "S1",
|
|
45
|
-
* ingredientId: "1234532",
|
|
46
|
-
* assemblyName: "",
|
|
47
|
-
* type: "syrup",
|
|
48
|
-
* });
|
|
49
|
-
* ```
|
|
50
|
-
*
|
|
51
|
-
* ## predicate
|
|
52
|
-
*
|
|
53
|
-
* [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 HolderModel.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
*
|
|
58
|
-
* const model: IKosDataModel = ...; // some model
|
|
59
|
-
*
|
|
60
|
-
* if (Holder.predicate(model)) {
|
|
61
|
-
* // if the function evaluates to true, the model is narrowed down to HolderModel
|
|
62
|
-
* // and the compiler will know that the model has the HolderModel interface
|
|
63
|
-
* model.updateAvailability(false);
|
|
64
|
-
* }
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* ## registration
|
|
68
|
-
*
|
|
69
|
-
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
70
|
-
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
*
|
|
75
|
-
* In an application registration file you can declare the model registration as follows:
|
|
76
|
-
*
|
|
77
|
-
* **registration.ts**
|
|
78
|
-
* ```typescript
|
|
79
|
-
* import { Holder } from "@kosdev-code/kos-dispense-sdk";
|
|
80
|
-
* ...
|
|
81
|
-
* import { IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
82
|
-
* export const kosModels: IKosRegistry["models"] = {
|
|
83
|
-
* ...Holder.registration,
|
|
84
|
-
* };
|
|
85
|
-
* ```
|
|
86
|
-
*
|
|
87
|
-
* ## registration.singleton
|
|
88
|
-
*
|
|
89
|
-
* The holder 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.
|
|
90
|
-
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
91
|
-
* */
|
|
30
|
+
* @kosService dispense.holder
|
|
31
|
+
* @kosApiLevel 2
|
|
32
|
+
*/
|
|
92
33
|
export declare const Holder: Readonly<KosModelRegistrationBean<HolderModel, HolderOptions>>;
|
|
93
34
|
//# sourceMappingURL=holder-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holder-model.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"holder-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/holder/holder-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,wBAAwB,EAGzB,MAAM,yBAAyB,CAAC;AAkCjC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAS1D;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAsZD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,MAAM,EAAE,QAAQ,CAC3B,wBAAwB,CAAC,WAAW,EAAE,aAAa,CAAC,CAWrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/holder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,cAAc,MAAM,YAAY,CAAC;AAC7C,mBAAmB,SAAS,CAAC;AAC7B,cAAc,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assignment-services.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"assignment-services.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-dispense-sdk/src/models/models/holder/services/assignment-services.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AACD;;;GAGG;AACH,eAAO,MAAM,cAAc,+FAG1B,CAAC;AACF,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,YAAY,GACZ,aAAa,GACb,eAAe,GACf,WAAW,GACX,YAAY,GACZ,cAAc,CAAC;AACnB,KAAK,kBAAkB,GAAG;IACxB,mBAAmB,GAAG,SAAS;IAC/B,UAAU,GAAG,SAAS;CACvB,CAAC;AACF,eAAO,MAAM,gBAAgB,GAC3B,YAAY,MAAM,EAClB,WAAW,GAAG,KACb,OAAO,CAAC,kBAAkB,CAsB5B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,YAAY,UAAU,mFAUzD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,IAAI,MAAM,uFAGhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holder-services.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"holder-services.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-dispense-sdk/src/models/models/holder/services/holder-services.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,IAAI;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD;;;GAGG;AACH,eAAO,MAAM,UAAU,mGAGtB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,YAAY,MAAM,EAClB,cAAc,MAAM,mFAYrB,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAU,YAAY,MAAM,uFAWhE,CAAC;AAEF,eAAO,MAAM,WAAW,GAAU,YAAY,MAAM,mFAanD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-dispense-sdk/src/models/models/holder/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Assignment } from '../services';
|
|
2
|
-
import { IntentAware } from '../../types/intent';
|
|
3
|
-
import { HolderSlice } from '../../types/assembly';
|
|
4
|
-
import { PumpModel } from '../../pump/types';
|
|
5
|
-
import { IngredientModel } from '../../ingredient';
|
|
6
1
|
import { IKosDataModel, IKosModelContainer, TroubleAware } from '@kosdev-code/kos-ui-sdk';
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { IngredientModel } from '../../ingredient';
|
|
3
|
+
import { PumpModel } from '../../pump/types';
|
|
4
|
+
import { HolderSlice } from '../../types/assembly';
|
|
5
|
+
import { IntentAware } from '../../types/intent';
|
|
6
|
+
import { Assignment } from '../services';
|
|
7
|
+
/**
|
|
8
|
+
* @kosService dispense.holder
|
|
9
|
+
* @kosApiLevel 2
|
|
10
|
+
*/
|
|
9
11
|
export interface HolderOptions<AdditionalData extends object = any> {
|
|
10
12
|
path: string;
|
|
11
13
|
name: string;
|
|
@@ -27,6 +29,8 @@ export interface HolderOptions<AdditionalData extends object = any> {
|
|
|
27
29
|
* state about the availability of a pump to pump the connected ingredient.
|
|
28
30
|
*
|
|
29
31
|
* @category Model
|
|
32
|
+
* @kosService dispense.holder
|
|
33
|
+
* @kosApiLevel 2
|
|
30
34
|
*/
|
|
31
35
|
export interface HolderModel<AdditionalData extends object = any>
|
|
32
36
|
extends IKosDataModel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holder-utils.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"holder-utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-dispense-sdk/src/models/models/holder/utils/holder-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,iBAAiB,GAAI,QAAQ,WAAW;;;;;CA8CpD,CAAC"}
|
|
@@ -1,80 +1,22 @@
|
|
|
1
|
-
import { HolderContainerModel, HolderContainerOptions } from './types';
|
|
2
1
|
import { SingletonKosModelRegistrationBean } from '@kosdev-code/kos-ui-sdk';
|
|
3
|
-
|
|
2
|
+
import { HolderContainerModel, HolderContainerOptions } from './types';
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Registration bean for {@link HolderContainerModel}.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
6
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
7
|
+
* - `factory`: `HolderContainer.factory(options)` returns the single instance, creating it on the first call.
|
|
8
|
+
* - `predicate`: type guard that narrows an `IKosDataModel` to `HolderContainerModel`.
|
|
9
|
+
* - `registration`: registry entry that can be spread into an `IKosRegistry["models"]` map.
|
|
8
10
|
*
|
|
9
|
-
*
|
|
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.
|
|
11
|
+
* HolderContainer is a singleton. `KosModelRegistry.dispense.models()` registers it.
|
|
13
12
|
*
|
|
14
13
|
* @example
|
|
15
14
|
* ```typescript
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* private holderContainerModel: HolderContainerModel;
|
|
15
|
+
* @kosDependency({ modelType: HolderContainer.type })
|
|
16
|
+
* private holderContainer!: HolderContainerModel;
|
|
19
17
|
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
* The factory function that can be used to create new HolderContainerModel instances.
|
|
25
|
-
*
|
|
26
|
-
* As this is a singleton model, the factory function accepts the model options as its argument.
|
|
27
|
-
*
|
|
28
|
-
* If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored
|
|
29
|
-
* in this case and the existing model will be returned in its current state.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
*
|
|
34
|
-
* ```typescript
|
|
35
|
-
* const model = HolderContainer.factory({ });
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* ## predicate
|
|
39
|
-
*
|
|
40
|
-
* [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 HolderContainerModel.
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```typescript
|
|
44
|
-
*
|
|
45
|
-
* const model: IKosDataModel = ...; // some model
|
|
46
|
-
*
|
|
47
|
-
* if (HolderContainer.predicate(model)) {
|
|
48
|
-
* // if the function evaluates to true, the model is narrowed down to HolderContainerModel
|
|
49
|
-
* // and the compiler will know that the model has the HolderContainerModel interface
|
|
50
|
-
* model.updateAvailability(false);
|
|
51
|
-
* }
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
* ## registration
|
|
55
|
-
*
|
|
56
|
-
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
57
|
-
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
*
|
|
62
|
-
* In an application registration file you can declare the model registration as follows:
|
|
63
|
-
*
|
|
64
|
-
* **registration.ts**
|
|
65
|
-
* ```typescript
|
|
66
|
-
* import { HolderContainer } from "@kosdev-code/kos-dispense-sdk";
|
|
67
|
-
* ...
|
|
68
|
-
* import { IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
69
|
-
* export const kosModels: IKosRegistry["models"] = {
|
|
70
|
-
* ...HolderContainer.registration,
|
|
71
|
-
* };
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
* ## registration.singleton
|
|
75
|
-
* The HolderContainer model is a singleton. This means that each time the factory function is called , the same instance will be returned.
|
|
76
|
-
* If the model does not yet exist, it will be created passing in the provided options to initialize it.
|
|
77
|
-
*
|
|
78
|
-
* * */
|
|
18
|
+
* @kosService dispense.holder
|
|
19
|
+
* @kosApiLevel 2
|
|
20
|
+
*/
|
|
79
21
|
export declare const HolderContainer: SingletonKosModelRegistrationBean<HolderContainerModel, HolderContainerOptions>;
|
|
80
22
|
//# sourceMappingURL=holder-container-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holder-container-model.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"holder-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/holder-container/holder-container-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,iCAAiC,EAClC,MAAM,yBAAyB,CAAC;AAYjC,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EAGvB,MAAM,SAAS,CAAC;AAkIjB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,EAAE,iCAAiC,CAC7D,oBAAoB,EACpB,sBAAsB,CAavB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/holder-container/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,mBAAmB,SAAS,CAAC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { HolderModel } from '../../holder/types';
|
|
2
1
|
import { IKosDataModel, IKosModelContainer } from '@kosdev-code/kos-ui-sdk';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { HolderModel } from '../../holder/types';
|
|
3
|
+
/**
|
|
4
|
+
* @kosService dispense.holder
|
|
5
|
+
* @kosApiLevel 2
|
|
6
|
+
*/
|
|
5
7
|
export interface HolderContainerOptions {}
|
|
6
8
|
|
|
7
9
|
export interface PathAware {
|
|
8
10
|
path: string;
|
|
9
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* @kosService dispense.holder
|
|
14
|
+
* @kosApiLevel 2
|
|
15
|
+
*/
|
|
10
16
|
export interface HolderPathAware extends PathAware {
|
|
11
17
|
slice: {
|
|
12
18
|
pos: number;
|
|
@@ -28,9 +34,10 @@ export interface HolderPathAware extends PathAware {
|
|
|
28
34
|
*
|
|
29
35
|
*
|
|
30
36
|
* @category Model
|
|
37
|
+
* @kosService dispense.holder
|
|
38
|
+
* @kosApiLevel 2
|
|
31
39
|
*/
|
|
32
|
-
export interface HolderContainerModel
|
|
33
|
-
extends IKosDataModel {
|
|
40
|
+
export interface HolderContainerModel extends IKosDataModel {
|
|
34
41
|
/** the unique identifier for the model */
|
|
35
42
|
id: string;
|
|
36
43
|
|
|
@@ -41,6 +48,10 @@ export interface HolderContainerModel<T extends object = any>
|
|
|
41
48
|
updateModel(options: HolderContainerOptions): void;
|
|
42
49
|
}
|
|
43
50
|
|
|
51
|
+
/**
|
|
52
|
+
* @kosService dispense.pump
|
|
53
|
+
* @kosApiLevel 2
|
|
54
|
+
*/
|
|
44
55
|
export interface InsertionPump {
|
|
45
56
|
inserted: boolean;
|
|
46
57
|
type: string;
|
package/models/models/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-dispense-sdk/src/models/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/ingredient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,mBAAmB,SAAS,CAAC;AAC7B,OAAO,KAAK,kBAAkB,MAAM,YAAY,CAAC"}
|
|
@@ -1,86 +1,22 @@
|
|
|
1
|
-
import { IngredientModel, IngredientOptions } from './types';
|
|
2
1
|
import { KosModelRegistrationBean } from '@kosdev-code/kos-ui-sdk';
|
|
3
|
-
|
|
2
|
+
import { IngredientModel, IngredientOptions } from './types';
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* The registration bean includes convenience methods for creating and working with IngredientModel 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: Ingredient.type, id: "ingredientId"})
|
|
18
|
-
* private ingredientModel: IngredientModel;
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## factory
|
|
23
|
-
*
|
|
24
|
-
* The factory method creates a factory function that can be used to create new IngredientModel instances.
|
|
25
|
-
*
|
|
26
|
-
* The factory function is a curried function that takes the model id as the first argument and the options as the second argument.
|
|
27
|
-
*
|
|
28
|
-
* If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored
|
|
29
|
-
* in this case and the existing model will be returned in its current state.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
4
|
+
* Registration bean for {@link IngredientModel}.
|
|
32
5
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* type: "syrup",
|
|
38
|
-
* data: {
|
|
39
|
-
* // mapped from an extension point
|
|
40
|
-
* }
|
|
41
|
-
* });
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* ## predicate
|
|
45
|
-
*
|
|
46
|
-
* [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 IngredientModel.
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```typescript
|
|
50
|
-
*
|
|
51
|
-
* const model: IKosDataModel = ...; // some model
|
|
52
|
-
*
|
|
53
|
-
* if (Ingredient.predicate(model)) {
|
|
54
|
-
* // if the function evaluates to true, the model is narrowed down to IngredientModel
|
|
55
|
-
* // and the compiler will know that the model has the IngredientModel interface
|
|
56
|
-
* model.updateAvailability(false);
|
|
57
|
-
* }
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* ## registration
|
|
61
|
-
*
|
|
62
|
-
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
63
|
-
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
6
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
7
|
+
* - `factory`: curried factory, `Ingredient.factory(id)(options)`. Returns the existing model when the id is already in use and ignores the options.
|
|
8
|
+
* - `predicate`: type guard that narrows an `IKosDataModel` to `IngredientModel`.
|
|
9
|
+
* - `registration`: registry entry that can be spread into an `IKosRegistry["models"]` map.
|
|
64
10
|
*
|
|
11
|
+
* Ingredient is not a singleton: each id has its own instance. `KosModelRegistry.dispense.models()` registers it.
|
|
65
12
|
*
|
|
66
13
|
* @example
|
|
67
|
-
*
|
|
68
|
-
* In an application registration file you can declare the model registration as follows:
|
|
69
|
-
*
|
|
70
|
-
* **registration.ts**
|
|
71
14
|
* ```typescript
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* import { IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
75
|
-
* export const kosModels: IKosRegistry["models"] = {
|
|
76
|
-
* ...Ingredient.registration,
|
|
77
|
-
* };
|
|
15
|
+
* @kosDependency({ modelType: Ingredient.type, id: "ingredientId" })
|
|
16
|
+
* private ingredient!: IngredientModel;
|
|
78
17
|
* ```
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
|
|
82
|
-
* The ingredient 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.
|
|
83
|
-
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
84
|
-
* */
|
|
18
|
+
* @kosService dispense.ingredient
|
|
19
|
+
* @kosApiLevel 2
|
|
20
|
+
*/
|
|
85
21
|
export declare const Ingredient: Readonly<KosModelRegistrationBean<IngredientModel, IngredientOptions>>;
|
|
86
22
|
//# sourceMappingURL=ingredient-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingredient-model.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"ingredient-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/ingredient/ingredient-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,EAGzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAuDlE;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAC/B,wBAAwB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAW7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-dispense-sdk/src/models/models/ingredient/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingredient-services.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"ingredient-services.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-dispense-sdk/src/models/models/ingredient/services/ingredient-services.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAChC;AACD;;;KAGK;AACL,MAAM,WAAW,kBAAkB;IACjC,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AACD;;;GAGG;AACH,eAAO,MAAM,cAAc,mGAK1B,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { IKosDataModel } from '@kosdev-code/kos-ui-sdk';
|
|
2
|
-
|
|
3
|
-
|
|
4
2
|
/**
|
|
5
3
|
* Represents the options for creating an ingredient.
|
|
6
|
-
*
|
|
4
|
+
* @kosService dispense.ingredient
|
|
5
|
+
* @kosApiLevel 2
|
|
7
6
|
*/
|
|
8
7
|
export interface IngredientOptions<AdditionalData extends object = any> {
|
|
9
8
|
/**
|
|
@@ -27,18 +26,13 @@ export interface IngredientOptions<AdditionalData extends object = any> {
|
|
|
27
26
|
*
|
|
28
27
|
* These will typically be created as part of the overall dispenser lifecycle as part of the Nozzle model.
|
|
29
28
|
*
|
|
30
|
-
* @typeParam AdditionalData -
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* a given implementation might extend the Ingredient node to include additional data, such as the image url.
|
|
34
|
-
* This additional data would be added to the model and would be represented by the AdditionalData type parameter.
|
|
35
|
-
* ```typescript
|
|
36
|
-
* const model: IngredientModel<{icon: string}> = ...;
|
|
37
|
-
* ```
|
|
38
|
-
* would allow for visibility of all the base properties as well as the additional data (icon) that might be on the message payload from
|
|
39
|
-
* the backend.
|
|
29
|
+
* @typeParam AdditionalData - Application data added to an ingredient by the
|
|
30
|
+
* {@link ExtensionType.IngredientMapper} extension point, such as an image url. It is exposed on
|
|
31
|
+
* `data`, so `IngredientModel<{ icon: string }>` types `model.data.icon`.
|
|
40
32
|
*
|
|
41
33
|
* @category Model
|
|
34
|
+
* @kosService dispense.ingredient
|
|
35
|
+
* @kosApiLevel 2
|
|
42
36
|
*/
|
|
43
37
|
export interface IngredientModel<AdditionalData extends object = any>
|
|
44
38
|
extends IKosDataModel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/ingredient-container/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,mBAAmB,SAAS,CAAC"}
|
|
@@ -1,80 +1,22 @@
|
|
|
1
|
-
import { IngredientContainerModel, IngredientContainerOptions } from './types';
|
|
2
1
|
import { SingletonKosModelRegistrationBean } from '@kosdev-code/kos-ui-sdk';
|
|
3
|
-
|
|
2
|
+
import { IngredientContainerModel, IngredientContainerOptions } from './types';
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Registration bean for {@link IngredientContainerModel}.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
6
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
7
|
+
* - `factory`: `IngredientContainer.factory(options)` returns the single instance, creating it on the first call.
|
|
8
|
+
* - `predicate`: type guard that narrows an `IKosDataModel` to `IngredientContainerModel`.
|
|
9
|
+
* - `registration`: registry entry that can be spread into an `IKosRegistry["models"]` map.
|
|
8
10
|
*
|
|
9
|
-
*
|
|
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.
|
|
11
|
+
* IngredientContainer is a singleton. `KosModelRegistry.dispense.models()` registers it.
|
|
13
12
|
*
|
|
14
13
|
* @example
|
|
15
14
|
* ```typescript
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* private holderContainerModel: IngredientContainerModel;
|
|
15
|
+
* @kosDependency({ modelType: IngredientContainer.type })
|
|
16
|
+
* private ingredientContainer!: IngredientContainerModel;
|
|
19
17
|
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
* The factory function that can be used to create new IngredientContainerModel instances.
|
|
25
|
-
*
|
|
26
|
-
* As this is a singleton model, the factory function accepts the model options as its argument.
|
|
27
|
-
*
|
|
28
|
-
* If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored
|
|
29
|
-
* in this case and the existing model will be returned in its current state.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
*
|
|
34
|
-
* ```typescript
|
|
35
|
-
* const model = IngredientContainer.factory({ });
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* ## predicate
|
|
39
|
-
*
|
|
40
|
-
* [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 IngredientContainerModel.
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```typescript
|
|
44
|
-
*
|
|
45
|
-
* const model: IKosDataModel = ...; // some model
|
|
46
|
-
*
|
|
47
|
-
* if (IngredientContainer.predicate(model)) {
|
|
48
|
-
* // if the function evaluates to true, the model is narrowed down to IngredientContainerModel
|
|
49
|
-
* // and the compiler will know that the model has the IngredientContainerModel interface
|
|
50
|
-
* model.updateAvailability(false);
|
|
51
|
-
* }
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
* ## registration
|
|
55
|
-
*
|
|
56
|
-
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
57
|
-
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
*
|
|
62
|
-
* In an application registration file you can declare the model registration as follows:
|
|
63
|
-
*
|
|
64
|
-
* **registration.ts**
|
|
65
|
-
* ```typescript
|
|
66
|
-
* import { IngredientContainer } from "@kosdev-code/kos-dispense-sdk";
|
|
67
|
-
* ...
|
|
68
|
-
* import { IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
69
|
-
* export const kosModels: IKosRegistry["models"] = {
|
|
70
|
-
* ...IngredientContainer.registration,
|
|
71
|
-
* };
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
* ## registration.singleton
|
|
75
|
-
* The IngredientContainer model is a singleton. This means that each time the factory function is called , the same instance will be returned.
|
|
76
|
-
* If the model does not yet exist, it will be created passing in the provided options to initialize it.
|
|
77
|
-
*
|
|
78
|
-
* * */
|
|
18
|
+
* @kosService dispense.ingredient
|
|
19
|
+
* @kosApiLevel 2
|
|
20
|
+
*/
|
|
79
21
|
export declare const IngredientContainer: SingletonKosModelRegistrationBean<IngredientContainerModel, IngredientContainerOptions>;
|
|
80
22
|
//# sourceMappingURL=ingredient-container-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingredient-container-model.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"ingredient-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/ingredient-container/ingredient-container-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,iCAAiC,EAClC,MAAM,yBAAyB,CAAC;AAcjC,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AA2FjB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB,EAAE,iCAAiC,CACjE,wBAAwB,EACxB,0BAA0B,CAc3B,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { IngredientModel } from '../../ingredient/types';
|
|
2
1
|
import { IKosDataModel, IKosModelContainer } from '@kosdev-code/kos-ui-sdk';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { IngredientModel } from '../../ingredient/types';
|
|
3
|
+
/**
|
|
4
|
+
* @kosService dispense.ingredient
|
|
5
|
+
* @kosApiLevel 2
|
|
6
|
+
*/
|
|
5
7
|
export interface IngredientContainerOptions {}
|
|
6
8
|
|
|
7
9
|
/**
|
|
@@ -43,6 +45,8 @@ export interface IngredientContainerOptions {}
|
|
|
43
45
|
* @see {@link IngredientContainer}
|
|
44
46
|
*
|
|
45
47
|
* @category Model
|
|
48
|
+
* @kosService dispense.ingredient
|
|
49
|
+
* @kosApiLevel 2
|
|
46
50
|
*/
|
|
47
51
|
export interface IngredientContainerModel<AdditionalData extends object = {}>
|
|
48
52
|
extends IngredientContainerOptions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/nozzle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC1D,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAEjB,6BAA6B;AAC7B,OAAO,KAAK,cAAc,MAAM,YAAY,CAAC"}
|