@kosdev-code/kos-freestyle-sdk 3.0.25 → 3.0.27
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/{extension-utils-oabjo9KD.cjs → extension-utils-D847XVCc.cjs} +2 -2
- package/{extension-utils-oabjo9KD.cjs.map → extension-utils-D847XVCc.cjs.map} +1 -1
- package/{extension-utils-BJAnNxer.js → extension-utils-H-ll8ljh.js} +2 -2
- package/{extension-utils-BJAnNxer.js.map → extension-utils-H-ll8ljh.js.map} +1 -1
- package/index.cjs +3 -3
- package/index.js +3 -3
- package/models/models/agitation-required-trouble/agitation-required-trouble-model.d.ts +12 -77
- package/models/models/agitation-required-trouble/agitation-required-trouble-model.d.ts.map +1 -1
- package/models/models/carb-agitator/carb-agitator-model.d.ts +1 -20
- package/models/models/carb-agitator/carb-agitator-model.d.ts.map +1 -1
- package/models/models/carb-agitator/services/carb-tank-services.d.ts +1 -14
- package/models/models/carb-agitator/services/carb-tank-services.d.ts.map +1 -1
- package/models/models/cartridge-agitator/cartridge-agitator-container-registration.d.ts +10 -74
- package/models/models/cartridge-agitator/cartridge-agitator-container-registration.d.ts.map +1 -1
- package/models/models/cartridge-agitator/cartridge-agitator-registration.d.ts +10 -76
- package/models/models/cartridge-agitator/cartridge-agitator-registration.d.ts.map +1 -1
- package/models/models/fcm-pump/fcm-pump-registration.d.ts +10 -74
- package/models/models/fcm-pump/fcm-pump-registration.d.ts.map +1 -1
- package/models/models/freestyle-assembly/freestyle-assembly-registration.d.ts +10 -76
- package/models/models/freestyle-assembly/freestyle-assembly-registration.d.ts.map +1 -1
- package/models/models/freestyle-holder/freestyle-holder-registration.d.ts +10 -74
- package/models/models/freestyle-holder/freestyle-holder-registration.d.ts.map +1 -1
- package/models/models/freestyle-nozzle/freestyle-nozzle-registration.d.ts +10 -74
- package/models/models/freestyle-nozzle/freestyle-nozzle-registration.d.ts.map +1 -1
- package/models/models/freestyle-pump/freestyle-pump-registration.d.ts +10 -74
- package/models/models/freestyle-pump/freestyle-pump-registration.d.ts.map +1 -1
- package/models/models/remote-tray/remote-tray-container-registration.d.ts +10 -74
- package/models/models/remote-tray/remote-tray-container-registration.d.ts.map +1 -1
- package/models/models/remote-tray/remote-tray-model.d.ts +8 -89
- package/models/models/remote-tray/remote-tray-model.d.ts.map +1 -1
- package/models/models/remote-tray/remote-tray-registration.d.ts +10 -77
- package/models/models/remote-tray/remote-tray-registration.d.ts.map +1 -1
- package/models/models/spm-pump/spm-pump-registration.d.ts +10 -74
- package/models/models/spm-pump/spm-pump-registration.d.ts.map +1 -1
- package/models/utils/extensions/assembly/types.d.ts +4 -87
- package/models/utils/extensions/assembly/types.d.ts.map +1 -1
- package/models/utils/services/freestyle/daily/service.d.ts +1 -1
- package/models/utils/services/freestyle/daily/service.d.ts.map +1 -1
- package/models/utils/services/handle/daily/service.d.ts +1 -1
- package/models/utils/services/handle/daily/service.d.ts.map +1 -1
- package/models.cjs +2 -2
- package/models.js +2 -2
- package/package.json +2 -2
- package/{service-eFbVjaFu.js → service-BDbUdYS7.js} +10 -28
- package/service-BDbUdYS7.js.map +1 -0
- package/{service-D4aX0z2P.cjs → service-C8lk9GgD.cjs} +10 -28
- package/service-C8lk9GgD.cjs.map +1 -0
- package/ui.cjs +1 -1
- package/ui.js +1 -1
- package/{use-nutrition-info-DaIOuGK6.js → use-nutrition-info-CFICkr6p.js} +2 -2
- package/{use-nutrition-info-DaIOuGK6.js.map → use-nutrition-info-CFICkr6p.js.map} +1 -1
- package/{use-nutrition-info-aDjHqQeW.cjs → use-nutrition-info-Cy9rRWLz.cjs} +2 -2
- package/{use-nutrition-info-aDjHqQeW.cjs.map → use-nutrition-info-Cy9rRWLz.cjs.map} +1 -1
- package/service-D4aX0z2P.cjs.map +0 -1
- package/service-eFbVjaFu.js.map +0 -1
|
@@ -2,85 +2,21 @@ import { KosModelRegistrationFactory } from '@kosdev-code/kos-ui-sdk';
|
|
|
2
2
|
import { FreestylePumpModel } from './freestyle-pump-model';
|
|
3
3
|
import { FreestylePumpOptions } from './types';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Registration bean for {@link FreestylePumpModel}.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
8
|
+
* - `factory`: curried factory, `FreestylePump.factory(id)(options)`. Returns the existing model when the id is already in use and ignores the options.
|
|
9
|
+
* - `guard`: type guard that narrows an `IKosDataModel` to `FreestylePumpModel`.
|
|
10
|
+
* - `instance(id)`: reads the model, or builds it from options.
|
|
11
|
+
* - `register()`: registers the model, and any related models, with the model registry.
|
|
8
12
|
*
|
|
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.
|
|
13
|
+
* FreestylePump is not a singleton: each id has its own instance. `KosModelRegistry.freestyle.models()` registers it.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```typescript
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* private freestylePumpModel: FreestylePumpModel;
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## factory
|
|
23
|
-
*
|
|
24
|
-
* The factory method creates a factory function that can be used to create new FreestylePumpModel 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 = FreestylePump.factory("freestylePumpId")({
|
|
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 FreestylePumpModel.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
*
|
|
48
|
-
* const model: IKosDataModel = ...; // some model
|
|
49
|
-
*
|
|
50
|
-
* if (FreestylePump.predicate(model)) {
|
|
51
|
-
* // if the function evaluates to true, the model is narrowed down to FreestylePumpModel
|
|
52
|
-
* // and the compiler will know that the model has the FreestylePumpModel interface
|
|
53
|
-
* model.updateAvailability(false);
|
|
54
|
-
* }
|
|
17
|
+
* @kosDependency({ modelType: FreestylePump.type, id: "freestylePumpId" })
|
|
18
|
+
* private freestylePump!: FreestylePumpModel;
|
|
55
19
|
* ```
|
|
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 { FreestylePump } from "@kos-ui/project-models";
|
|
70
|
-
* import { KosModelRegistry } from "@kosdev-code/kos-dispense-sdk";
|
|
71
|
-
*
|
|
72
|
-
* import { initKosProvider } from "@kosdev-code/kos-ui-sdk";
|
|
73
|
-
*
|
|
74
|
-
* KosModelRegistry.dispense
|
|
75
|
-
* .models()
|
|
76
|
-
* .model(FreestylePump);
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* ## registration.singleton
|
|
80
|
-
|
|
81
|
-
* The freestylePump 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.
|
|
82
|
-
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
83
|
-
|
|
84
|
-
* */
|
|
20
|
+
*/
|
|
85
21
|
export declare const FreestylePump: KosModelRegistrationFactory<FreestylePumpModel, FreestylePumpOptions>;
|
|
86
22
|
//# sourceMappingURL=freestyle-pump-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"freestyle-pump-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-freestyle-sdk/src/models/models/freestyle-pump/freestyle-pump-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"freestyle-pump-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-freestyle-sdk/src/models/models/freestyle-pump/freestyle-pump-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,uEAMxB,CAAC"}
|
|
@@ -2,85 +2,21 @@ import { SingletonKosModelRegistrationFactory } from '@kosdev-code/kos-ui-sdk';
|
|
|
2
2
|
import { RemoteTrayContainerOptions } from './types';
|
|
3
3
|
import { RemoteTrayContainerModel } from './remote-tray-container-model';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Registration bean for {@link RemoteTrayContainerModel}.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
8
|
+
* - `factory`: `RemoteTrayContainer.factory(options)` returns the single instance, creating it on the first call.
|
|
9
|
+
* - `guard`: type guard that narrows an `IKosDataModel` to `RemoteTrayContainerModel`.
|
|
10
|
+
* - `instance()`: reads the model, or builds it from options.
|
|
11
|
+
* - `register()`: registers the model, and any related models, with the model registry.
|
|
8
12
|
*
|
|
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.
|
|
13
|
+
* RemoteTrayContainer is a singleton. `KosModelRegistry.freestyle.models()` registers it.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```typescript
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* private remoteTrayContainerModel: RemoteTrayContainerModel;
|
|
17
|
+
* @kosDependency({ modelType: RemoteTrayContainer.type })
|
|
18
|
+
* private remoteTrayContainer!: RemoteTrayContainerModel;
|
|
19
19
|
* ```
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
* ## factory
|
|
23
|
-
*
|
|
24
|
-
* The factory method creates a factory function that can be used to create new RemoteTrayContainerModel instances.
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
* As this is a singleton model, the factory function accepts the model options as its argument.
|
|
28
|
-
*
|
|
29
|
-
* If a model with the same model type 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 = RemoteTrayContainer.factory({
|
|
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 RemoteTrayContainerModel.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
*
|
|
48
|
-
* const model: IKosDataModel = ...; // some model
|
|
49
|
-
*
|
|
50
|
-
* if (RemoteTrayContainer.predicate(model)) {
|
|
51
|
-
* // if the function evaluates to true, the model is narrowed down to RemoteTrayContainerModel
|
|
52
|
-
* // and the compiler will know that the model has the RemoteTrayContainerModel 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 { RemoteTrayContainer } from "@kosdev-code/kos-freestyle-sdk";
|
|
70
|
-
* ...
|
|
71
|
-
* import { ExtensionManager, IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
72
|
-
* export const kosModels: IKosRegistry["models"] = {
|
|
73
|
-
* ...RemoteTrayContainer.registration,
|
|
74
|
-
* };
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* ## registration.singleton
|
|
78
|
-
|
|
79
|
-
* The remoteTrayContainer model is a singleton model. This means that each time the factory function is called , the same instance will be returned.
|
|
80
|
-
* If the model does not yet exist, it will be created passing in the provided options to initialize it.
|
|
81
|
-
*
|
|
82
|
-
* Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.
|
|
83
|
-
|
|
84
|
-
* */
|
|
20
|
+
*/
|
|
85
21
|
export declare const RemoteTrayContainer: SingletonKosModelRegistrationFactory<RemoteTrayContainerModel, RemoteTrayContainerOptions>;
|
|
86
22
|
//# sourceMappingURL=remote-tray-container-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-tray-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAM1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9E
|
|
1
|
+
{"version":3,"file":"remote-tray-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAM1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9E;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,4FAM9B,CAAC"}
|
|
@@ -4,85 +4,12 @@ import { ActiveAware } from '../types/assembly';
|
|
|
4
4
|
import { RemoteTrayOptions } from './types';
|
|
5
5
|
export declare const MODEL_TYPE = "remote-tray-model";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* A remote tray represents a physical or virtual tray that can be enabled/disabled
|
|
10
|
-
* remotely and is associated with a holder in the dispensing system. This model
|
|
11
|
-
* manages the tray's configuration, activation state, and trouble propagation
|
|
12
|
-
* from its associated holder.
|
|
13
|
-
*
|
|
14
|
-
* ## Key Features
|
|
15
|
-
* - Remote enable/disable capability through configuration properties
|
|
16
|
-
* - Automatic trouble propagation from associated holder
|
|
17
|
-
* - Active state management based on configuration
|
|
18
|
-
* - Integration with the KOS dispensing system through holder references
|
|
19
|
-
*
|
|
20
|
-
* ## Properties
|
|
21
|
-
* - `id` - Unique identifier for the remote tray
|
|
22
|
-
* - `name` - Display name of the tray
|
|
23
|
-
* - `holderPath` - Path reference to the associated holder model
|
|
24
|
-
* - `configPath` - Configuration path for tray settings
|
|
25
|
-
* - `remoteTrayEnabled` - Configuration property controlling tray activation
|
|
26
|
-
* - `active` - Computed property indicating if the tray is currently active
|
|
27
|
-
* - `holder` - Reference to the associated holder model
|
|
28
|
-
* - `troubles` - Propagated troubles from the associated holder
|
|
29
|
-
*
|
|
30
|
-
* ## Methods
|
|
31
|
-
* - `updateModel(options)` - Updates the model with new configuration options
|
|
32
|
-
* - `init()` - Initializes the remote tray model
|
|
33
|
-
* - `load()` - Loads the remote tray configuration and data
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* // Create a new remote tray instance
|
|
38
|
-
* const remoteTray = RemoteTray.instance('tray-1')
|
|
39
|
-
* .options({
|
|
40
|
-
* name: 'Remote Tray 1',
|
|
41
|
-
* holderPath: '/holders/holder-1',
|
|
42
|
-
* configPath: '/config/trays/tray-1'
|
|
43
|
-
* })
|
|
44
|
-
* .build();
|
|
45
|
-
*
|
|
46
|
-
* // Check if tray is active
|
|
47
|
-
* if (remoteTray.active) {
|
|
48
|
-
* console.log(`${remoteTray.name} is enabled`);
|
|
49
|
-
* }
|
|
50
|
-
*
|
|
51
|
-
* // Access associated holder
|
|
52
|
-
* const holder = remoteTray.holder;
|
|
53
|
-
* console.log(`Holder status: ${holder?.status}`);
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```typescript
|
|
58
|
-
* // Monitor trouble states
|
|
59
|
-
* const TrayStatus = ({ tray }: { tray: RemoteTrayModel }) => {
|
|
60
|
-
* const troubles = tray.troubles;
|
|
61
|
-
* const isEnabled = tray.remoteTrayEnabled.value;
|
|
62
|
-
*
|
|
63
|
-
* return (
|
|
64
|
-
* <div>
|
|
65
|
-
* <h3>{tray.name}</h3>
|
|
66
|
-
* <p>Status: {isEnabled ? 'Enabled' : 'Disabled'}</p>
|
|
67
|
-
* {troubles.length > 0 && (
|
|
68
|
-
* <Alert severity="warning">
|
|
69
|
-
* {troubles.length} issue(s) detected
|
|
70
|
-
* </Alert>
|
|
71
|
-
* )}
|
|
72
|
-
* </div>
|
|
73
|
-
* );
|
|
74
|
-
* };
|
|
75
|
-
* ```
|
|
7
|
+
* A tray that can be enabled or disabled remotely and is associated with a holder. The tray is
|
|
8
|
+
* active when its `enabled` config property is set, and it reports its holder's troubles as its own.
|
|
76
9
|
*
|
|
77
10
|
* @example
|
|
78
11
|
* ```typescript
|
|
79
|
-
*
|
|
80
|
-
* async function toggleRemoteTray(tray: RemoteTrayModel) {
|
|
81
|
-
* const currentState = tray.remoteTrayEnabled.value;
|
|
82
|
-
* await tray.remoteTrayEnabled.setValue(!currentState);
|
|
83
|
-
*
|
|
84
|
-
* console.log(`Tray ${tray.name} is now ${!currentState ? 'enabled' : 'disabled'}`);
|
|
85
|
-
* }
|
|
12
|
+
* tray.remoteTrayEnabled.updateProperty(!tray.active);
|
|
86
13
|
* ```
|
|
87
14
|
*
|
|
88
15
|
* @category KOS Model
|
|
@@ -121,8 +48,7 @@ export declare class RemoteTrayModelImpl implements IKosDataModel, IKosIdentifia
|
|
|
121
48
|
*/
|
|
122
49
|
get troubles(): TroubleModel<any>[];
|
|
123
50
|
/**
|
|
124
|
-
*
|
|
125
|
-
* Currently returns empty string as troubles are managed by the holder.
|
|
51
|
+
* Always an empty string; trouble status is reported by the holder.
|
|
126
52
|
*
|
|
127
53
|
* @returns Empty string (trouble status handled by holder)
|
|
128
54
|
*/
|
|
@@ -134,38 +60,31 @@ export declare class RemoteTrayModelImpl implements IKosDataModel, IKosIdentifia
|
|
|
134
60
|
*/
|
|
135
61
|
get troublesByType(): Record<string, TroubleModel<any>[]>;
|
|
136
62
|
/**
|
|
137
|
-
*
|
|
138
|
-
* Can be used to modify the holder path, config path, or name after initialization.
|
|
63
|
+
* Accepts updated options. The tray keeps its original holder path, config path and name.
|
|
139
64
|
*
|
|
140
65
|
* @param _options - New configuration options for the remote tray
|
|
141
66
|
*/
|
|
142
67
|
updateModel(_options: RemoteTrayOptions): void;
|
|
143
68
|
/**
|
|
144
|
-
*
|
|
145
|
-
* Uses synchronous model lookup to retrieve the holder by path.
|
|
69
|
+
* The holder model referenced by `holderPath`.
|
|
146
70
|
*
|
|
147
71
|
* @returns The HolderModel instance referenced by holderPath, or undefined if not found
|
|
148
72
|
*/
|
|
149
73
|
get holder(): HolderModel<any>;
|
|
150
74
|
/**
|
|
151
|
-
*
|
|
152
|
-
* Active state is based on the remoteTrayEnabled configuration property.
|
|
75
|
+
* Whether the tray is enabled, from the `remoteTrayEnabled` config property.
|
|
153
76
|
*
|
|
154
77
|
* @returns true if the tray is enabled, false otherwise
|
|
155
78
|
*/
|
|
156
79
|
get active(): boolean;
|
|
157
80
|
/**
|
|
158
81
|
* Initializes the remote tray model.
|
|
159
|
-
* Called during the model lifecycle initialization phase.
|
|
160
|
-
* Sets up initial state and prepares the model for use.
|
|
161
82
|
*
|
|
162
83
|
* @returns Promise that resolves when initialization is complete
|
|
163
84
|
*/
|
|
164
85
|
init(): Promise<void>;
|
|
165
86
|
/**
|
|
166
|
-
* Loads the remote tray
|
|
167
|
-
* Called during the model lifecycle load phase.
|
|
168
|
-
* Typically loads configuration settings and establishes holder references.
|
|
87
|
+
* Loads the remote tray model.
|
|
169
88
|
*
|
|
170
89
|
* @returns Promise that resolves when loading is complete
|
|
171
90
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-tray-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAEjB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACb,MAAM,yBAAyB,CAAC;AAQjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,eAAO,MAAM,UAAU,sBAAsB,CAAC;AAE9C
|
|
1
|
+
{"version":3,"file":"remote-tray-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAEjB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACb,MAAM,yBAAyB,CAAC;AAQjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,eAAO,MAAM,UAAU,sBAAsB,CAAC;AAE9C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;AAKxE;;;;;;GAMG;AACH,qBACa,mBACX,YAAW,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY;IAErE,qDAAqD;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,MAAM,CAAmB;IAEjC,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAKhF,iBAAiB,EAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBAG7C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,kBAAkB;IAU7B;;;;;OAKG;IACH,IAAI,QAAQ,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE,CAElC;IAED;;;;OAIG;IACH,IAAI,aAAa,WAEhB;IAED;;;;OAIG;IACH,IAAI,cAAc,wCAEjB;IAED;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAI9C;;;;OAIG;IACH,IAAI,MAAM,qBAET;IAED;;;;OAIG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAID;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B"}
|
|
@@ -2,88 +2,21 @@ import { KosModelRegistrationFactory } from '@kosdev-code/kos-ui-sdk';
|
|
|
2
2
|
import { RemoteTrayOptions } from './types';
|
|
3
3
|
import { RemoteTrayModel } from './remote-tray-model';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Registration bean for {@link RemoteTrayModel}.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
|
|
7
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
8
|
+
* - `factory`: curried factory, `RemoteTray.factory(id)(options)`. Returns the existing model when the id is already in use and ignores the options.
|
|
9
|
+
* - `guard`: type guard that narrows an `IKosDataModel` to `RemoteTrayModel`.
|
|
10
|
+
* - `instance(id)`: reads the model, or builds it from options.
|
|
11
|
+
* - `register()`: registers the model, and any related models, with the model registry.
|
|
9
12
|
*
|
|
10
|
-
*
|
|
11
|
-
* The type property is a string that identifies the model type.
|
|
12
|
-
* 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
|
|
13
|
-
* used when declaring dependencies on models.
|
|
13
|
+
* RemoteTray is not a singleton: each id has its own instance. `KosModelRegistry.freestyle.models()` registers it.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* private remoteTrayModel: RemoteTrayModel;
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* ## factory
|
|
24
|
-
*
|
|
25
|
-
* The factory method creates a factory function that can be used to create new RemoteTrayModel instances.
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
* The factory function is a curried function that takes the model id as the first argument and the options as the second argument.
|
|
29
|
-
*
|
|
30
|
-
* If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored
|
|
31
|
-
* in this case and the existing model will be returned in its current state.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```typescript
|
|
35
|
-
* const model = RemoteTray.factory("remoteTrayId")({
|
|
36
|
-
* // Add option data
|
|
37
|
-
* });
|
|
38
|
-
|
|
39
|
-
* ```
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
* ## predicate
|
|
44
|
-
*
|
|
45
|
-
* [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 RemoteTrayModel.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
*
|
|
50
|
-
* const model: IKosDataModel = ...; // some model
|
|
51
|
-
*
|
|
52
|
-
* if (RemoteTray.predicate(model)) {
|
|
53
|
-
* // if the function evaluates to true, the model is narrowed down to RemoteTrayModel
|
|
54
|
-
* // and the compiler will know that the model has the RemoteTrayModel interface
|
|
55
|
-
* model.updateAvailability(false);
|
|
56
|
-
|
|
57
|
-
* }
|
|
17
|
+
* @kosDependency({ modelType: RemoteTray.type, id: "remoteTrayId" })
|
|
18
|
+
* private remoteTray!: RemoteTrayModel;
|
|
58
19
|
* ```
|
|
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.
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
*
|
|
68
|
-
* In an application registration file you can declare the model registration as follows:
|
|
69
|
-
*
|
|
70
|
-
* **registration.ts**
|
|
71
|
-
* ```typescript
|
|
72
|
-
* import { RemoteTray } from "@kos-ui/project-models";
|
|
73
|
-
* import { KosModelRegistry } from "@kosdev-code/kos-dispense-sdk";
|
|
74
|
-
*
|
|
75
|
-
* import { initKosProvider } from "@kosdev-code/kos-ui-sdk";
|
|
76
|
-
*
|
|
77
|
-
* KosModelRegistry.dispense
|
|
78
|
-
* .models()
|
|
79
|
-
* .model(RemoteTray);
|
|
80
|
-
* ```
|
|
81
|
-
*
|
|
82
|
-
* ## registration.singleton
|
|
83
|
-
|
|
84
|
-
* The remoteTray 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.
|
|
85
|
-
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
86
|
-
|
|
87
|
-
* */
|
|
20
|
+
*/
|
|
88
21
|
export declare const RemoteTray: KosModelRegistrationFactory<RemoteTrayModel, RemoteTrayOptions>;
|
|
89
22
|
//# sourceMappingURL=remote-tray-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-tray-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAGL,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAE7B
|
|
1
|
+
{"version":3,"file":"remote-tray-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-freestyle-sdk/src/models/models/remote-tray/remote-tray-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAGL,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,UAAU,iEAMrB,CAAC"}
|
|
@@ -2,85 +2,21 @@ import { KosModelRegistrationFactory } from '@kosdev-code/kos-ui-sdk';
|
|
|
2
2
|
import { SpmPumpOptions } from './types';
|
|
3
3
|
import { SpmPumpModel } from './spm-pump-model';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Registration bean for {@link SpmPumpModel}.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
8
|
+
* - `factory`: curried factory, `SpmPump.factory(id)(options)`. Returns the existing model when the id is already in use and ignores the options.
|
|
9
|
+
* - `guard`: type guard that narrows an `IKosDataModel` to `SpmPumpModel`.
|
|
10
|
+
* - `instance(id)`: reads the model, or builds it from options.
|
|
11
|
+
* - `register()`: registers the model, and any related models, with the model registry.
|
|
8
12
|
*
|
|
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.
|
|
13
|
+
* SpmPump is not a singleton: each id has its own instance. `KosModelRegistry.freestyle.models()` registers it.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```typescript
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* private spmPumpModel: SpmPumpModel;
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## factory
|
|
23
|
-
*
|
|
24
|
-
* The factory method creates a factory function that can be used to create new SpmPumpModel 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 = SpmPump.factory("spmPumpId")({
|
|
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 SpmPumpModel.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
*
|
|
48
|
-
* const model: IKosDataModel = ...; // some model
|
|
49
|
-
*
|
|
50
|
-
* if (SpmPump.predicate(model)) {
|
|
51
|
-
* // if the function evaluates to true, the model is narrowed down to SpmPumpModel
|
|
52
|
-
* // and the compiler will know that the model has the SpmPumpModel interface
|
|
53
|
-
* model.updateAvailability(false);
|
|
54
|
-
* }
|
|
17
|
+
* @kosDependency({ modelType: SpmPump.type, id: "spmPumpId" })
|
|
18
|
+
* private spmPump!: SpmPumpModel;
|
|
55
19
|
* ```
|
|
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 { SpmPump } from "@kos-ui/project-models";
|
|
70
|
-
* import { KosModelRegistry } from "@kosdev-code/kos-dispense-sdk";
|
|
71
|
-
*
|
|
72
|
-
* import { initKosProvider } from "@kosdev-code/kos-ui-sdk";
|
|
73
|
-
*
|
|
74
|
-
* KosModelRegistry.dispense
|
|
75
|
-
* .models()
|
|
76
|
-
* .model(SpmPump);
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* ## registration.singleton
|
|
80
|
-
|
|
81
|
-
* The spmPump 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.
|
|
82
|
-
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
83
|
-
|
|
84
|
-
* */
|
|
20
|
+
*/
|
|
85
21
|
export declare const SpmPump: KosModelRegistrationFactory<SpmPumpModel, SpmPumpOptions>;
|
|
86
22
|
//# sourceMappingURL=spm-pump-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spm-pump-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-freestyle-sdk/src/models/models/spm-pump/spm-pump-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"spm-pump-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-freestyle-sdk/src/models/models/spm-pump/spm-pump-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,OAAO,2DAMlB,CAAC"}
|
|
@@ -4,39 +4,8 @@ import { IceAgitatorModel } from '../../../models/ice-agitator';
|
|
|
4
4
|
export type AgitatorModel = CarbAgitatorModel | IceAgitatorModel;
|
|
5
5
|
export type AgitatorTypes = "iceAgitator" | "carbAgitator";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```json
|
|
12
|
-
* {
|
|
13
|
-
"assemblies": [
|
|
14
|
-
{
|
|
15
|
-
"boards": [
|
|
16
|
-
...
|
|
17
|
-
],
|
|
18
|
-
"holders": {
|
|
19
|
-
...
|
|
20
|
-
},
|
|
21
|
-
"nozzles": [
|
|
22
|
-
...
|
|
23
|
-
],
|
|
24
|
-
"core": true,
|
|
25
|
-
"name": "core",
|
|
26
|
-
"path": "assembly.core",
|
|
27
|
-
// extra properties added to the assembly
|
|
28
|
-
"carbAgitator": {
|
|
29
|
-
"name": "carbAgitator",
|
|
30
|
-
"path": "assembly.core.board:ksm.carbAgitator"
|
|
31
|
-
},
|
|
32
|
-
"iceAgitator": {
|
|
33
|
-
"name": "iceAgitator",
|
|
34
|
-
"path": "assembly.core.board:ksm.iceAgitator"
|
|
35
|
-
},
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
```
|
|
7
|
+
* Freestyle properties added to each assembly in the backend assembly response: the ice and carb
|
|
8
|
+
* agitators, cartridge agitators and remote trays.
|
|
40
9
|
*/
|
|
41
10
|
export interface FreestyleResponseExt {
|
|
42
11
|
iceAgitator?: {
|
|
@@ -69,60 +38,8 @@ export interface FreestyleResponseExt {
|
|
|
69
38
|
export interface FreestyleNozzleExt {
|
|
70
39
|
}
|
|
71
40
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
*
|
|
77
|
-
* In this example, the maxVolumeML and remainingVolumeML are added to the holder.
|
|
78
|
-
* ```json
|
|
79
|
-
* {
|
|
80
|
-
"assemblies": [
|
|
81
|
-
{
|
|
82
|
-
"boards": [
|
|
83
|
-
...
|
|
84
|
-
],
|
|
85
|
-
"holders": {
|
|
86
|
-
"carb": [
|
|
87
|
-
...
|
|
88
|
-
],
|
|
89
|
-
"ns": [
|
|
90
|
-
...
|
|
91
|
-
],
|
|
92
|
-
"micros.0": [
|
|
93
|
-
{
|
|
94
|
-
"agitated": false,
|
|
95
|
-
"ingredientId": "1048588",
|
|
96
|
-
"name": "S1",
|
|
97
|
-
"maxVolumeML": 680,
|
|
98
|
-
"remainingVolumeML": 520,
|
|
99
|
-
"path": "assembly.core.holder:S1"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"agitated": false,
|
|
103
|
-
"ingredientId": "1050608",
|
|
104
|
-
"name": "S2",
|
|
105
|
-
"maxVolumeML": 680,
|
|
106
|
-
"remainingVolumeML": 520,
|
|
107
|
-
"path": "assembly.core.holder:S2"
|
|
108
|
-
},
|
|
109
|
-
...
|
|
110
|
-
],
|
|
111
|
-
"micros.1": [
|
|
112
|
-
...
|
|
113
|
-
|
|
114
|
-
],
|
|
115
|
-
"water": [
|
|
116
|
-
...
|
|
117
|
-
]
|
|
118
|
-
},
|
|
119
|
-
"nozzles": [],
|
|
120
|
-
...
|
|
121
|
-
}
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
*/
|
|
41
|
+
* Freestyle properties added to each holder in the backend assembly response.
|
|
42
|
+
*/
|
|
126
43
|
export interface FreestyleHolderExt {
|
|
127
44
|
agitated?: boolean;
|
|
128
45
|
}
|