@kosdev-code/kos-dispense-sdk 3.0.26 → 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.
Files changed (65) hide show
  1. package/dispense-registration-manager-Da9CW_cN.js.map +1 -1
  2. package/dispense-registration-manager-Dtb31fcI.cjs.map +1 -1
  3. package/{extension-utils-CwctwFhK.cjs → extension-utils-Cfhe358W.cjs} +39 -166
  4. package/extension-utils-Cfhe358W.cjs.map +1 -0
  5. package/{extension-utils-C_pwmFbZ.js → extension-utils-D_dnBLH6.js} +39 -166
  6. package/extension-utils-D_dnBLH6.js.map +1 -0
  7. package/index.cjs +2 -2
  8. package/index.js +2 -2
  9. package/models/constants/constants.d.ts +14 -178
  10. package/models/constants/constants.d.ts.map +1 -1
  11. package/models/models/assembly/assembly-registration.d.ts +9 -69
  12. package/models/models/assembly/assembly-registration.d.ts.map +1 -1
  13. package/models/models/availability/availability-model.d.ts +10 -76
  14. package/models/models/availability/availability-model.d.ts.map +1 -1
  15. package/models/models/availability/types/index.d.ts +3 -12
  16. package/models/models/board/board-container-registration.d.ts +9 -74
  17. package/models/models/board/board-container-registration.d.ts.map +1 -1
  18. package/models/models/board/board-registration.d.ts +9 -72
  19. package/models/models/board/board-registration.d.ts.map +1 -1
  20. package/models/models/device-assembly/device-assembly-registration.d.ts +10 -76
  21. package/models/models/device-assembly/device-assembly-registration.d.ts.map +1 -1
  22. package/models/models/generic-pour/generic-pour-registration.d.ts +9 -72
  23. package/models/models/generic-pour/generic-pour-registration.d.ts.map +1 -1
  24. package/models/models/holder/holder-model.d.ts +9 -73
  25. package/models/models/holder/holder-model.d.ts.map +1 -1
  26. package/models/models/holder-container/holder-container-model.d.ts +9 -68
  27. package/models/models/holder-container/holder-container-model.d.ts.map +1 -1
  28. package/models/models/ingredient/ingredient-model.d.ts +9 -74
  29. package/models/models/ingredient/ingredient-model.d.ts.map +1 -1
  30. package/models/models/ingredient/types/index.d.ts +3 -10
  31. package/models/models/ingredient-container/ingredient-container-model.d.ts +9 -68
  32. package/models/models/ingredient-container/ingredient-container-model.d.ts.map +1 -1
  33. package/models/models/nozzle/nozzle-model.d.ts +10 -72
  34. package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
  35. package/models/models/nozzle/services/nozzle-services.d.ts +11 -65
  36. package/models/models/nozzle/services/nozzle-services.d.ts.map +1 -1
  37. package/models/models/pump/pump-model.d.ts +9 -79
  38. package/models/models/pump/pump-model.d.ts.map +1 -1
  39. package/models/models/pump-container/pump-container-model.d.ts +9 -68
  40. package/models/models/pump-container/pump-container-model.d.ts.map +1 -1
  41. package/models/models/types/intent.d.ts +11 -78
  42. package/models/models/types/intent.d.ts.map +1 -1
  43. package/models/utils/extension-utils.d.ts +38 -165
  44. package/models/utils/extension-utils.d.ts.map +1 -1
  45. package/models.cjs +1 -1
  46. package/models.js +1 -1
  47. package/package.json +2 -2
  48. package/{pump-provider-CAKW652V.js → pump-provider-BQmCKz7S.js} +3 -5
  49. package/pump-provider-BQmCKz7S.js.map +1 -0
  50. package/{pump-provider-SXrqGmxO.cjs → pump-provider-uNNMh9uh.cjs} +3 -5
  51. package/pump-provider-uNNMh9uh.cjs.map +1 -0
  52. package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts +16 -43
  53. package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts.map +1 -1
  54. package/ui/hooks/ingredient/use-ingredient-pour.d.ts +7 -18
  55. package/ui/hooks/ingredient/use-ingredient-pour.d.ts.map +1 -1
  56. package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts +6 -17
  57. package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts.map +1 -1
  58. package/ui/hooks/pour/use-pour.d.ts +7 -18
  59. package/ui/hooks/pour/use-pour.d.ts.map +1 -1
  60. package/ui.cjs +1 -1
  61. package/ui.js +1 -1
  62. package/extension-utils-C_pwmFbZ.js.map +0 -1
  63. package/extension-utils-CwctwFhK.cjs.map +0 -1
  64. package/pump-provider-CAKW652V.js.map +0 -1
  65. 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
- * # Board
4
+ * Registration bean for {@link BoardModel}.
5
5
  *
6
- * The registration bean includes convenience methods for creating and working with BoardModel instances.
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
- * ## type
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
- * @kosDependency({modelType: Board.type, id: "boardId"})
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8EK;AACL,eAAO,MAAM,KAAK,EAAE,QAAQ,CAC1B,wBAAwB,CAAC,UAAU,EAAE,YAAY,CAAC,CAWnD,CAAC"}
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
- * # DeviceAssembly
5
+ * Registration bean for {@link DeviceAssemblyModel}.
6
6
  *
7
- * The registration bean includes convenience methods for creating and working with DeviceAssemblyModel instances.
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
- * ## 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
+ * DeviceAssembly is a singleton. `KosModelRegistry.dispense.models()` registers it.
13
14
  *
14
15
  * @example
15
16
  * ```typescript
16
- *
17
- * @kosDependency({modelType: DeviceAssembly.type, id: "deviceAssemblyId"})
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkFK;AACL,eAAO,MAAM,cAAc,kFAMzB,CAAC"}
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
- * # GenericPour
5
+ * Registration bean for {@link GenericPourModel}.
6
6
  *
7
- * The registration bean includes convenience methods for creating and working with GenericPourModel instances.
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
- * ## 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
+ * 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
- * import { initKosProvider } from "@kosdev-code/kos-ui-sdk";
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgFK;AACL,eAAO,MAAM,WAAW,mEAMtB,CAAC"}
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
- * # Holder
12
+ * Registration bean for {@link HolderModel}.
13
13
  *
14
- * The registration bean includes convenience methods for creating and working with HolderModel instances.
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
- * ## type
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
- * @kosDependency({modelType: Holder.type, id: "holderId"})
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+EK;AACL,eAAO,MAAM,MAAM,EAAE,QAAQ,CAC3B,wBAAwB,CAAC,WAAW,EAAE,aAAa,CAAC,CAWrD,CAAC"}
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
- * # HolderContainer
4
+ * Registration bean for {@link HolderContainerModel}.
5
5
  *
6
- * The registration bean includes convenience methods for creating and working with HolderContainerModel instances.
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
- * ## type
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
- * @kosDependency({modelType: HolderContainer.type})
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0EO;AACP,eAAO,MAAM,eAAe,EAAE,iCAAiC,CAC7D,oBAAoB,EACpB,sBAAsB,CAavB,CAAC"}
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
- * # Ingredient
4
+ * Registration bean for {@link IngredientModel}.
5
5
  *
6
- * The registration bean includes convenience methods for creating and working with IngredientModel instances.
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
- * ## type
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
- * @kosDependency({modelType: Ingredient.type, id: "ingredientId"})
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgFK;AACL,eAAO,MAAM,UAAU,EAAE,QAAQ,CAC/B,wBAAwB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAW7D,CAAC"}
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 - Any additional data that is added to an ingredient at the application layer.
29
- *
30
- * @example The base Ingredient from the backend will have an id, type and name properties. However,
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
  */