@kosdev-code/kos-dispense-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/dispense-registration-manager-Da9CW_cN.js.map +1 -1
- package/dispense-registration-manager-Dtb31fcI.cjs.map +1 -1
- package/{extension-utils-CwctwFhK.cjs → extension-utils-Cfhe358W.cjs} +39 -166
- package/extension-utils-Cfhe358W.cjs.map +1 -0
- package/{extension-utils-C_pwmFbZ.js → extension-utils-D_dnBLH6.js} +39 -166
- package/extension-utils-D_dnBLH6.js.map +1 -0
- package/index.cjs +2 -2
- package/index.js +2 -2
- package/models/constants/constants.d.ts +14 -178
- package/models/constants/constants.d.ts.map +1 -1
- package/models/models/assembly/assembly-registration.d.ts +9 -69
- package/models/models/assembly/assembly-registration.d.ts.map +1 -1
- package/models/models/availability/availability-model.d.ts +10 -76
- package/models/models/availability/availability-model.d.ts.map +1 -1
- package/models/models/availability/types/index.d.ts +3 -12
- package/models/models/board/board-container-registration.d.ts +9 -74
- package/models/models/board/board-container-registration.d.ts.map +1 -1
- package/models/models/board/board-registration.d.ts +9 -72
- package/models/models/board/board-registration.d.ts.map +1 -1
- package/models/models/device-assembly/device-assembly-registration.d.ts +10 -76
- package/models/models/device-assembly/device-assembly-registration.d.ts.map +1 -1
- package/models/models/generic-pour/generic-pour-registration.d.ts +9 -72
- package/models/models/generic-pour/generic-pour-registration.d.ts.map +1 -1
- package/models/models/holder/holder-model.d.ts +9 -73
- package/models/models/holder/holder-model.d.ts.map +1 -1
- package/models/models/holder-container/holder-container-model.d.ts +9 -68
- package/models/models/holder-container/holder-container-model.d.ts.map +1 -1
- package/models/models/ingredient/ingredient-model.d.ts +9 -74
- package/models/models/ingredient/ingredient-model.d.ts.map +1 -1
- package/models/models/ingredient/types/index.d.ts +3 -10
- package/models/models/ingredient-container/ingredient-container-model.d.ts +9 -68
- package/models/models/ingredient-container/ingredient-container-model.d.ts.map +1 -1
- package/models/models/nozzle/nozzle-model.d.ts +10 -72
- package/models/models/nozzle/nozzle-model.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/pump/pump-model.d.ts +9 -79
- package/models/models/pump/pump-model.d.ts.map +1 -1
- package/models/models/pump-container/pump-container-model.d.ts +9 -68
- package/models/models/pump-container/pump-container-model.d.ts.map +1 -1
- package/models/models/types/intent.d.ts +11 -78
- package/models/models/types/intent.d.ts.map +1 -1
- package/models/utils/extension-utils.d.ts +38 -165
- package/models/utils/extension-utils.d.ts.map +1 -1
- package/models/utils/services/dispense/daily/service.d.ts +1 -1
- package/models/utils/services/dispense/daily/service.d.ts.map +1 -1
- package/models.cjs +1 -1
- package/models.js +1 -1
- package/package.json +2 -2
- package/{pump-provider-CAKW652V.js → pump-provider-BQmCKz7S.js} +3 -5
- package/pump-provider-BQmCKz7S.js.map +1 -0
- package/{pump-provider-SXrqGmxO.cjs → pump-provider-uNNMh9uh.cjs} +3 -5
- package/pump-provider-uNNMh9uh.cjs.map +1 -0
- package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts +16 -43
- package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts.map +1 -1
- package/ui/hooks/ingredient/use-ingredient-pour.d.ts +7 -18
- package/ui/hooks/ingredient/use-ingredient-pour.d.ts.map +1 -1
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts +6 -17
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts.map +1 -1
- package/ui/hooks/pour/use-pour.d.ts +7 -18
- package/ui/hooks/pour/use-pour.d.ts.map +1 -1
- package/ui.cjs +1 -1
- package/ui.js +1 -1
- package/extension-utils-C_pwmFbZ.js.map +0 -1
- package/extension-utils-CwctwFhK.cjs.map +0 -1
- package/pump-provider-CAKW652V.js.map +0 -1
- package/pump-provider-SXrqGmxO.cjs.map +0 -1
|
@@ -1,83 +1,20 @@
|
|
|
1
1
|
import { KosModelRegistrationBean } from '@kosdev-code/kos-ui-sdk';
|
|
2
2
|
import { BoardModel, BoardOptions } from './types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Registration bean for {@link BoardModel}.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
7
|
+
* - `factory`: curried factory, `Board.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 `BoardModel`.
|
|
9
|
+
* - `registration`: registry entry that can be spread into an `IKosRegistry["models"]` map.
|
|
7
10
|
*
|
|
8
|
-
*
|
|
9
|
-
* The type property is a string that identifies the model type.
|
|
10
|
-
* 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
|
|
11
|
-
* used when declaring dependencies on models.
|
|
11
|
+
* Board is not a singleton: each id has its own instance. `KosModelRegistry.dispense.models()` registers it.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```typescript
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* private boardModel: BoardModel;
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* ## factory
|
|
22
|
-
*
|
|
23
|
-
* The factory method creates a factory function that can be used to create new BoardModel instances.
|
|
24
|
-
*
|
|
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
|
|
32
|
-
* ```typescript
|
|
33
|
-
* const model = Board.factory("boardId")({
|
|
34
|
-
* // Add option data
|
|
35
|
-
* });
|
|
36
|
-
* ```
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
* ## predicate
|
|
41
|
-
*
|
|
42
|
-
* [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 BoardModel.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```typescript
|
|
46
|
-
*
|
|
47
|
-
* const model: IKosDataModel = ...; // some model
|
|
48
|
-
*
|
|
49
|
-
* if (Board.predicate(model)) {
|
|
50
|
-
* // if the function evaluates to true, the model is narrowed down to BoardModel
|
|
51
|
-
* // and the compiler will know that the model has the BoardModel interface
|
|
52
|
-
* model.updateAvailability(false);
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* ## registration
|
|
57
|
-
*
|
|
58
|
-
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
59
|
-
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
*
|
|
64
|
-
* In an application registration file you can declare the model registration as follows:
|
|
65
|
-
*
|
|
66
|
-
* **registration.ts**
|
|
67
|
-
* ```typescript
|
|
68
|
-
* import { Board } from "@kosdev-code/kos-dispense-sdk";
|
|
69
|
-
* ...
|
|
70
|
-
* import { ExtensionManager, IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
71
|
-
* export const kosModels: IKosRegistry["models"] = {
|
|
72
|
-
* ...Board.registration,
|
|
73
|
-
* };
|
|
15
|
+
* @kosDependency({ modelType: Board.type, id: "boardId" })
|
|
16
|
+
* private board!: BoardModel;
|
|
74
17
|
* ```
|
|
75
|
-
|
|
76
|
-
* ## registration.singleton
|
|
77
|
-
|
|
78
|
-
* The board 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.
|
|
79
|
-
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
80
|
-
|
|
81
|
-
* */
|
|
18
|
+
*/
|
|
82
19
|
export declare const Board: Readonly<KosModelRegistrationBean<BoardModel, BoardOptions>>;
|
|
83
20
|
//# sourceMappingURL=board-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/board/board-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGxE,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"board-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/board/board-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGxE,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,KAAK,EAAE,QAAQ,CAC1B,wBAAwB,CAAC,UAAU,EAAE,YAAY,CAAC,CAWnD,CAAC"}
|
|
@@ -2,87 +2,21 @@ import { SingletonKosModelRegistrationFactory } from '@kosdev-code/kos-ui-sdk';
|
|
|
2
2
|
import { DeviceAssemblyModel } from './device-assembly-model';
|
|
3
3
|
import { DeviceAssemblyOptions } from './types';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Registration bean for {@link DeviceAssemblyModel}.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
8
|
+
* - `factory`: `DeviceAssembly.factory(options)` returns the single instance, creating it on the first call.
|
|
9
|
+
* - `guard`: type guard that narrows an `IKosDataModel` to `DeviceAssemblyModel`.
|
|
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
|
+
* DeviceAssembly is a singleton. `KosModelRegistry.dispense.models()` registers it.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```typescript
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* private deviceAssemblyModel: DeviceAssemblyModel;
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## factory
|
|
23
|
-
*
|
|
24
|
-
* The factory method creates a factory function that can be used to create new DeviceAssemblyModel 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 = DeviceAssembly.factory({
|
|
35
|
-
* // Add option data
|
|
36
|
-
* });
|
|
17
|
+
* @kosDependency({ modelType: DeviceAssembly.type })
|
|
18
|
+
* private deviceAssembly!: DeviceAssemblyModel;
|
|
37
19
|
* ```
|
|
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 DeviceAssemblyModel.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
*
|
|
48
|
-
* const model: IKosDataModel = ...; // some model
|
|
49
|
-
*
|
|
50
|
-
* if (DeviceAssembly.predicate(model)) {
|
|
51
|
-
* // if the function evaluates to true, the model is narrowed down to DeviceAssemblyModel
|
|
52
|
-
* // and the compiler will know that the model has the DeviceAssemblyModel 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 { DeviceAssembly } 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(DeviceAssembly);
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* ## registration.singleton
|
|
80
|
-
|
|
81
|
-
* The deviceAssembly model is a singleton model. This means that each time the factory function is called , the same instance will be returned.
|
|
82
|
-
* If the model does not yet exist, it will be created passing in the provided options to initialize it.
|
|
83
|
-
*
|
|
84
|
-
* Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.
|
|
85
|
-
|
|
86
|
-
* */
|
|
20
|
+
*/
|
|
87
21
|
export declare const DeviceAssembly: SingletonKosModelRegistrationFactory<DeviceAssemblyModel, DeviceAssemblyOptions>;
|
|
88
22
|
//# sourceMappingURL=device-assembly-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-assembly-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/device-assembly/device-assembly-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"device-assembly-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/device-assembly/device-assembly-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,cAAc,kFAMzB,CAAC"}
|
|
@@ -2,85 +2,22 @@ import { KosModelRegistrationFactory } from '@kosdev-code/kos-ui-sdk';
|
|
|
2
2
|
import { GenericPourOptions } from './types';
|
|
3
3
|
import { GenericPourModel } from './generic-pour-model';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Registration bean for {@link GenericPourModel}.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
8
|
+
* - `factory`: curried factory, `GenericPour.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 `GenericPourModel`.
|
|
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
|
+
* GenericPour is not a singleton: each id has its own instance.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```typescript
|
|
16
|
-
*
|
|
17
|
-
* @kosDependency({modelType: GenericPour.type, id: "genericPourId"})
|
|
18
|
-
* private genericPourModel: GenericPourModel;
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## factory
|
|
23
|
-
*
|
|
24
|
-
* The factory method creates a factory function that can be used to create new GenericPourModel 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 = GenericPour.factory("genericPourId")({
|
|
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 GenericPourModel.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
*
|
|
48
|
-
* const model: IKosDataModel = ...; // some model
|
|
49
|
-
*
|
|
50
|
-
* if (GenericPour.predicate(model)) {
|
|
51
|
-
* // if the function evaluates to true, the model is narrowed down to GenericPourModel
|
|
52
|
-
* // and the compiler will know that the model has the GenericPourModel 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 { GenericPour } from "@kos-ui/project-models";
|
|
70
17
|
* import { KosModelRegistry } from "@kosdev-code/kos-dispense-sdk";
|
|
71
18
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* KosModelRegistry.dispense
|
|
75
|
-
* .models()
|
|
76
|
-
* .model(GenericPour);
|
|
19
|
+
* KosModelRegistry.dispense.models().model(GenericPour);
|
|
77
20
|
* ```
|
|
78
|
-
|
|
79
|
-
* ## registration.singleton
|
|
80
|
-
|
|
81
|
-
* The genericPour 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
|
-
* */
|
|
21
|
+
*/
|
|
85
22
|
export declare const GenericPour: KosModelRegistrationFactory<GenericPourModel, GenericPourOptions>;
|
|
86
23
|
//# sourceMappingURL=generic-pour-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-pour-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/generic-pour/generic-pour-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D
|
|
1
|
+
{"version":3,"file":"generic-pour-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-dispense-sdk/src/models/models/generic-pour/generic-pour-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW,mEAMtB,CAAC"}
|
|
@@ -9,84 +9,20 @@ export interface ContainerTroubleData {
|
|
|
9
9
|
unknonwnIngredientId?: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Registration bean for {@link HolderModel}.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* - `type`: the model type, used by the model registry and in `@kosDependency` declarations.
|
|
15
|
+
* - `factory`: curried factory, `Holder.factory(id)(options)`. Returns the existing model when the id is already in use and ignores the options.
|
|
16
|
+
* - `predicate`: type guard that narrows an `IKosDataModel` to `HolderModel`.
|
|
17
|
+
* - `registration`: registry entry that can be spread into an `IKosRegistry["models"]` map.
|
|
15
18
|
*
|
|
16
|
-
*
|
|
17
|
-
* The type property is a string that identifies the model type.
|
|
18
|
-
* 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
|
|
19
|
-
* used when declaring dependencies on models.
|
|
19
|
+
* Holder is not a singleton: each id has its own instance. `KosModelRegistry.dispense.models()` registers it.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```typescript
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* private holderModel: HolderModel;
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* ## factory
|
|
30
|
-
*
|
|
31
|
-
* The factory method creates a factory function that can be used to create new HolderModel instances.
|
|
32
|
-
*
|
|
33
|
-
* The factory function is a curried function that takes the model id as the first argument and the options as the second argument.
|
|
34
|
-
*
|
|
35
|
-
* If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored
|
|
36
|
-
* in this case and the existing model will be returned in its current state.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
*
|
|
40
|
-
* ```typescript
|
|
41
|
-
* const model = Holder.factory("S1")({
|
|
42
|
-
* path: "core.dispenser.holder.s1",
|
|
43
|
-
* name: "S1",
|
|
44
|
-
* ingredientId: "1234532",
|
|
45
|
-
* assemblyName: "",
|
|
46
|
-
* type: "syrup",
|
|
47
|
-
* });
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* ## predicate
|
|
51
|
-
*
|
|
52
|
-
* [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.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```typescript
|
|
56
|
-
*
|
|
57
|
-
* const model: IKosDataModel = ...; // some model
|
|
58
|
-
*
|
|
59
|
-
* if (Holder.predicate(model)) {
|
|
60
|
-
* // if the function evaluates to true, the model is narrowed down to HolderModel
|
|
61
|
-
* // and the compiler will know that the model has the HolderModel interface
|
|
62
|
-
* model.updateAvailability(false);
|
|
63
|
-
* }
|
|
23
|
+
* @kosDependency({ modelType: Holder.type, id: "holderId" })
|
|
24
|
+
* private holder!: HolderModel;
|
|
64
25
|
* ```
|
|
65
|
-
|
|
66
|
-
* ## registration
|
|
67
|
-
*
|
|
68
|
-
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
69
|
-
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
*
|
|
74
|
-
* In an application registration file you can declare the model registration as follows:
|
|
75
|
-
*
|
|
76
|
-
* **registration.ts**
|
|
77
|
-
* ```typescript
|
|
78
|
-
* import { Holder } from "@kosdev-code/kos-dispense-sdk";
|
|
79
|
-
* ...
|
|
80
|
-
* import { IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
81
|
-
* export const kosModels: IKosRegistry["models"] = {
|
|
82
|
-
* ...Holder.registration,
|
|
83
|
-
* };
|
|
84
|
-
* ```
|
|
85
|
-
*
|
|
86
|
-
* ## registration.singleton
|
|
87
|
-
*
|
|
88
|
-
* 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.
|
|
89
|
-
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
90
|
-
* */
|
|
26
|
+
*/
|
|
91
27
|
export declare const Holder: Readonly<KosModelRegistrationBean<HolderModel, HolderOptions>>;
|
|
92
28
|
//# sourceMappingURL=holder-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;AAiCjC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM1D,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
|
|
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;AAiCjC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM1D,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;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,EAAE,QAAQ,CAC3B,wBAAwB,CAAC,WAAW,EAAE,aAAa,CAAC,CAWrD,CAAC"}
|
|
@@ -1,79 +1,20 @@
|
|
|
1
1
|
import { SingletonKosModelRegistrationBean } from '@kosdev-code/kos-ui-sdk';
|
|
2
2
|
import { HolderContainerModel, HolderContainerOptions } from './types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Registration bean for {@link HolderContainerModel}.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
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.
|
|
7
10
|
*
|
|
8
|
-
*
|
|
9
|
-
* The type property is a string that identifies the model type.
|
|
10
|
-
* 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
|
|
11
|
-
* used when declaring dependencies on models.
|
|
11
|
+
* HolderContainer is a singleton. `KosModelRegistry.dispense.models()` registers it.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```typescript
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* private holderContainerModel: HolderContainerModel;
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* ## factory
|
|
22
|
-
*
|
|
23
|
-
* The factory function that can be used to create new HolderContainerModel instances.
|
|
24
|
-
*
|
|
25
|
-
* As this is a singleton model, the factory function accepts the model options as its argument.
|
|
26
|
-
*
|
|
27
|
-
* If a model with the same model type 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
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
*
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const model = HolderContainer.factory({ });
|
|
15
|
+
* @kosDependency({ modelType: HolderContainer.type })
|
|
16
|
+
* private holderContainer!: HolderContainerModel;
|
|
35
17
|
* ```
|
|
36
|
-
|
|
37
|
-
* ## predicate
|
|
38
|
-
*
|
|
39
|
-
* [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.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```typescript
|
|
43
|
-
*
|
|
44
|
-
* const model: IKosDataModel = ...; // some model
|
|
45
|
-
*
|
|
46
|
-
* if (HolderContainer.predicate(model)) {
|
|
47
|
-
* // if the function evaluates to true, the model is narrowed down to HolderContainerModel
|
|
48
|
-
* // and the compiler will know that the model has the HolderContainerModel interface
|
|
49
|
-
* model.updateAvailability(false);
|
|
50
|
-
* }
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* ## registration
|
|
54
|
-
*
|
|
55
|
-
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
56
|
-
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
*
|
|
61
|
-
* In an application registration file you can declare the model registration as follows:
|
|
62
|
-
*
|
|
63
|
-
* **registration.ts**
|
|
64
|
-
* ```typescript
|
|
65
|
-
* import { HolderContainer } from "@kosdev-code/kos-dispense-sdk";
|
|
66
|
-
* ...
|
|
67
|
-
* import { IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
68
|
-
* export const kosModels: IKosRegistry["models"] = {
|
|
69
|
-
* ...HolderContainer.registration,
|
|
70
|
-
* };
|
|
71
|
-
* ```
|
|
72
|
-
*
|
|
73
|
-
* ## registration.singleton
|
|
74
|
-
* The HolderContainer model is a singleton. This means that each time the factory function is called , the same instance will be returned.
|
|
75
|
-
* If the model does not yet exist, it will be created passing in the provided options to initialize it.
|
|
76
|
-
*
|
|
77
|
-
* * */
|
|
18
|
+
*/
|
|
78
19
|
export declare const HolderContainer: SingletonKosModelRegistrationBean<HolderContainerModel, HolderContainerOptions>;
|
|
79
20
|
//# sourceMappingURL=holder-container-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;AA4HjB
|
|
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;AA4HjB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,EAAE,iCAAiC,CAC7D,oBAAoB,EACpB,sBAAsB,CAavB,CAAC"}
|
|
@@ -1,85 +1,20 @@
|
|
|
1
1
|
import { KosModelRegistrationBean } from '@kosdev-code/kos-ui-sdk';
|
|
2
2
|
import { IngredientModel, IngredientOptions } from './types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Registration bean for {@link IngredientModel}.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
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.
|
|
7
10
|
*
|
|
8
|
-
*
|
|
9
|
-
* The type property is a string that identifies the model type.
|
|
10
|
-
* 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
|
|
11
|
-
* used when declaring dependencies on models.
|
|
11
|
+
* Ingredient is not a singleton: each id has its own instance. `KosModelRegistry.dispense.models()` registers it.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```typescript
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* private ingredientModel: IngredientModel;
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* ## factory
|
|
22
|
-
*
|
|
23
|
-
* The factory method creates a factory function that can be used to create new IngredientModel 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 model = Ingredient.factory("S1")({
|
|
34
|
-
* name: "S1",
|
|
35
|
-
* ingredientId: "1234532",
|
|
36
|
-
* type: "syrup",
|
|
37
|
-
* data: {
|
|
38
|
-
* // mapped from an extension point
|
|
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 IngredientModel.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
*
|
|
50
|
-
* const model: IKosDataModel = ...; // some model
|
|
51
|
-
*
|
|
52
|
-
* if (Ingredient.predicate(model)) {
|
|
53
|
-
* // if the function evaluates to true, the model is narrowed down to IngredientModel
|
|
54
|
-
* // and the compiler will know that the model has the IngredientModel interface
|
|
55
|
-
* model.updateAvailability(false);
|
|
56
|
-
* }
|
|
15
|
+
* @kosDependency({ modelType: Ingredient.type, id: "ingredientId" })
|
|
16
|
+
* private ingredient!: IngredientModel;
|
|
57
17
|
* ```
|
|
58
|
-
|
|
59
|
-
* ## registration
|
|
60
|
-
*
|
|
61
|
-
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
62
|
-
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
*
|
|
67
|
-
* In an application registration file you can declare the model registration as follows:
|
|
68
|
-
*
|
|
69
|
-
* **registration.ts**
|
|
70
|
-
* ```typescript
|
|
71
|
-
* import { Ingredient } from "@kosdev-code/kos-dispense-sdk";
|
|
72
|
-
* ...
|
|
73
|
-
* import { IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
74
|
-
* export const kosModels: IKosRegistry["models"] = {
|
|
75
|
-
* ...Ingredient.registration,
|
|
76
|
-
* };
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* ## registration.singleton
|
|
80
|
-
*
|
|
81
|
-
* 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.
|
|
82
|
-
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
83
|
-
* */
|
|
18
|
+
*/
|
|
84
19
|
export declare const Ingredient: Readonly<KosModelRegistrationBean<IngredientModel, IngredientOptions>>;
|
|
85
20
|
//# sourceMappingURL=ingredient-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAC/B,wBAAwB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAW7D,CAAC"}
|
|
@@ -25,16 +25,9 @@ export interface IngredientOptions<AdditionalData extends object = any> {
|
|
|
25
25
|
*
|
|
26
26
|
* These will typically be created as part of the overall dispenser lifecycle as part of the Nozzle model.
|
|
27
27
|
*
|
|
28
|
-
* @typeParam AdditionalData -
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* a given implementation might extend the Ingredient node to include additional data, such as the image url.
|
|
32
|
-
* This additional data would be added to the model and would be represented by the AdditionalData type parameter.
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const model: IngredientModel<{icon: string}> = ...;
|
|
35
|
-
* ```
|
|
36
|
-
* would allow for visibility of all the base properties as well as the additional data (icon) that might be on the message payload from
|
|
37
|
-
* the backend.
|
|
28
|
+
* @typeParam AdditionalData - Application data added to an ingredient by the
|
|
29
|
+
* {@link ExtensionType.IngredientMapper} extension point, such as an image url. It is exposed on
|
|
30
|
+
* `data`, so `IngredientModel<{ icon: string }>` types `model.data.icon`.
|
|
38
31
|
*
|
|
39
32
|
* @category Model
|
|
40
33
|
*/
|