@kosdev-code/kos-ui-sdk 2.0.41 → 2.1.1
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/core/core/decorators/index.d.ts +4 -0
- package/core/core/decorators/index.d.ts.map +1 -1
- package/core/core/decorators/kos-companion.d.ts +125 -8
- package/core/core/decorators/kos-companion.d.ts.map +1 -1
- package/core/core/decorators/kos-container-aware.d.ts +465 -0
- package/core/core/decorators/kos-container-aware.d.ts.map +1 -0
- package/core/core/decorators/kos-future-aware.d.ts +150 -0
- package/core/core/decorators/kos-future-aware.d.ts.map +1 -0
- package/core/core/decorators/kos-logger-aware.d.ts +96 -0
- package/core/core/decorators/kos-logger-aware.d.ts.map +1 -0
- package/core/core/decorators/kos-trouble-aware.d.ts +71 -0
- package/core/core/decorators/kos-trouble-aware.d.ts.map +1 -0
- package/core/core/decorators/kosModel.d.ts +8 -2
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
- package/core/core/decorators/propKeys.d.ts +4 -0
- package/core/core/decorators/propKeys.d.ts.map +1 -1
- package/core/core/extension/extension-manager.d.ts +1 -1
- package/core/core/extension/extension-manager.d.ts.map +1 -1
- package/core/core/kosCore.d.ts.map +1 -1
- package/core/core/registration/index.d.ts +1 -0
- package/core/core/registration/index.d.ts.map +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.d.ts.map +1 -1
- package/core/util/container-utils.d.ts +3 -2
- package/core/util/container-utils.d.ts.map +1 -1
- package/core/util/observable-proxy-map.d.ts.map +1 -1
- package/index.cjs +79 -76
- package/index.cjs.map +1 -1
- package/index.d.cts +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +9672 -7760
- package/index.js.map +1 -1
- package/models/models/browser-router/browser-router-model.d.ts +80 -1
- package/models/models/browser-router/browser-router-model.d.ts.map +1 -1
- package/models/models/browser-router/types/index.d.ts +25 -1
- package/models/models/config-bean/config-bean-model-builder.d.ts +4 -2
- package/models/models/config-bean/config-bean-model-builder.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-model.d.ts +117 -13
- package/models/models/config-bean/config-bean-model.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-types.d.ts +6 -3
- package/models/models/config-bean/config-bean-types.d.ts.map +1 -1
- package/models/models/config-bean/types/index.d.ts +33 -0
- package/models/models/config-bean-prop/config-bean-prop-model.d.ts +112 -1
- package/models/models/config-bean-prop/config-bean-prop-model.d.ts.map +1 -1
- package/models/models/config-bean-prop/types/index.d.ts +293 -17
- package/models/models/device/device-model.d.ts +219 -9
- package/models/models/device/device-model.d.ts.map +1 -1
- package/models/models/device/device-registration.d.ts +61 -48
- package/models/models/device/device-registration.d.ts.map +1 -1
- package/models/models/device/types/index.d.ts +41 -0
- package/models/models/future/future-aware.d.ts +82 -0
- package/models/models/future/future-aware.d.ts.map +1 -1
- package/models/models/future/future-model.d.ts +34 -5
- package/models/models/future/future-model.d.ts.map +1 -1
- package/models/models/future/future-types.d.ts +186 -7
- package/models/models/future/future-types.d.ts.map +1 -1
- package/models/models/future-container/future-container-model.d.ts +2 -2
- package/models/models/index.d.ts +1 -0
- package/models/models/index.d.ts.map +1 -1
- package/models/models/key-value/index.d.ts +4 -0
- package/models/models/key-value/index.d.ts.map +1 -1
- package/models/models/key-value/key-value-model.d.ts +111 -0
- package/models/models/key-value/key-value-model.d.ts.map +1 -1
- package/models/models/key-value/services/key-value-services.d.ts +124 -2
- package/models/models/key-value/services/key-value-services.d.ts.map +1 -1
- package/models/models/key-value/types/index.d.ts +56 -0
- package/models/models/kos-expression-evaluator/index.d.ts +4 -0
- package/models/models/kos-expression-evaluator/index.d.ts.map +1 -0
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts +209 -0
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts.map +1 -0
- package/models/models/kos-expression-evaluator/services/index.d.ts +6 -0
- package/models/models/kos-expression-evaluator/services/index.d.ts.map +1 -0
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts +15 -0
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts.map +1 -0
- package/models/models/kos-expression-evaluator/types/index.d.ts +1 -0
- package/models/models/kos-log-manager/kos-log-manager-model.d.ts +61 -14
- package/models/models/kos-log-manager/kos-log-manager-model.d.ts.map +1 -1
- package/models/models/kos-log-manager/types/index.d.ts +187 -0
- package/models/models/kos-time/kos-time-model.d.ts +64 -0
- package/models/models/kos-time/kos-time-model.d.ts.map +1 -1
- package/models/models/kos-time/types/index.d.ts +80 -0
- package/models/models/log-block/log-block-container-model.d.ts +132 -0
- package/models/models/log-block/log-block-container-model.d.ts.map +1 -1
- package/models/models/log-block/log-block-model.d.ts +185 -0
- package/models/models/log-block/log-block-model.d.ts.map +1 -1
- package/models/models/log-block/types/index.d.ts +129 -0
- package/models/models/log-stream/index.d.ts +6 -2
- package/models/models/log-stream/index.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-container-model.d.ts +62 -0
- package/models/models/log-stream/log-stream-container-model.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-model.d.ts +55 -0
- package/models/models/log-stream/log-stream-model.d.ts.map +1 -1
- package/models/models/log-stream/services/log-stream-services.d.ts +2 -1
- package/models/models/log-stream/services/log-stream-services.d.ts.map +1 -1
- package/models/models/log-stream/types/index.d.ts +77 -0
- package/models/models/network-interface/index.d.ts +6 -2
- package/models/models/network-interface/index.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-container-model.d.ts +62 -0
- package/models/models/network-interface/network-interface-container-model.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-container-registration.d.ts +2 -1
- package/models/models/network-interface/network-interface-container-registration.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-model.d.ts +77 -0
- package/models/models/network-interface/network-interface-model.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-registration.d.ts +2 -1
- package/models/models/network-interface/network-interface-registration.d.ts.map +1 -1
- package/models/models/network-interface/services/network-interface-services.d.ts +54 -0
- package/models/models/network-interface/services/network-interface-services.d.ts.map +1 -1
- package/models/models/network-interface/types/index.d.ts +21 -0
- package/models/models/ota/ota-model.d.ts +82 -3
- package/models/models/ota/ota-model.d.ts.map +1 -1
- package/models/models/ota/types/index.d.ts +146 -0
- package/models/models/region-info/region-info-model.d.ts +7 -3
- package/models/models/region-info/region-info-model.d.ts.map +1 -1
- package/models/models/region-info/services/region-info-services.d.ts.map +1 -1
- package/models/models/region-info/types/index.d.ts +141 -13
- package/models/models/region-info/types/index.d.ts.map +1 -1
- package/models/models/software-info/software-info-model.d.ts +74 -2
- package/models/models/software-info/software-info-model.d.ts.map +1 -1
- package/models/models/software-info/types/index.d.ts +48 -16
- package/models/models/state-bean/state-bean-model.d.ts +86 -9
- package/models/models/state-bean/state-bean-model.d.ts.map +1 -1
- package/models/models/state-bean/types/index.d.ts +114 -6
- package/models/models/state-prop/state-prop-model.d.ts +78 -1
- package/models/models/state-prop/state-prop-model.d.ts.map +1 -1
- package/models/models/state-prop/types/index.d.ts +55 -7
- package/models/models/storage-device/storage-device-container-model.d.ts +289 -2
- package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-model.d.ts +84 -2
- package/models/models/storage-device/storage-device-model.d.ts.map +1 -1
- package/models/models/storage-device/types/index.d.ts +112 -0
- package/models/models/studio-properties/studio-properties-model.d.ts +75 -0
- package/models/models/studio-properties/studio-properties-model.d.ts.map +1 -1
- package/models/models/studio-properties/types/index.d.ts +29 -0
- package/models/models/translation/services/translation-services.d.ts +128 -2
- package/models/models/translation/services/translation-services.d.ts.map +1 -1
- package/models/models/translation/translation-container-model.d.ts +100 -10
- package/models/models/translation/translation-container-model.d.ts.map +1 -1
- package/models/models/translation/translation-container-registration.d.ts +2 -1
- package/models/models/translation/translation-container-registration.d.ts.map +1 -1
- package/models/models/translation/translation-context.d.ts +1 -16
- package/models/models/translation/translation-context.d.ts.map +1 -1
- package/models/models/translation/translation-model.d.ts +113 -1
- package/models/models/translation/translation-model.d.ts.map +1 -1
- package/models/models/translation/types/index.d.ts +340 -0
- package/models/models/trouble/services/trouble-services.d.ts +3 -3
- package/models/models/trouble/services/trouble-services.d.ts.map +1 -1
- package/models/models/trouble/trouble-model.d.ts +2 -1
- package/models/models/trouble/trouble-model.d.ts.map +1 -1
- package/models/models/trouble/types/index.d.ts +22 -93
- package/models/models/trouble/utils/is-trouble-aware.d.ts +2 -2
- package/models/models/trouble/utils/is-trouble-aware.d.ts.map +1 -1
- package/models/models/trouble-container/index.d.ts +4 -3
- package/models/models/trouble-container/index.d.ts.map +1 -1
- package/models/models/trouble-container/trouble-container-model.d.ts +9 -5
- package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
- package/models/models/trouble-container/types/index.d.ts +2 -15
- package/models/utils/client.d.ts +8 -8
- package/models/utils/core-registration-manager.d.ts +1 -1
- package/models/utils/core-registration-manager.d.ts.map +1 -1
- package/models/utils/index.d.ts +0 -2
- package/models/utils/index.d.ts.map +1 -1
- package/models/utils/service.d.ts +9 -9
- package/package.json +2 -2
- package/ui/contexts/state-bean/state-bean-provider.d.ts.map +1 -1
- package/ui/hooks/state-bean/use-state-bean.d.ts +2 -2
- package/ui/hooks/state-bean/use-state-bean.d.ts.map +1 -1
- package/ui/hooks/state-bean/with-state-bean.d.ts.map +1 -1
- package/ui/hooks/translation-container/use-translation-container.d.ts +4 -33
- package/ui/hooks/translation-container/use-translation-container.d.ts.map +1 -1
- package/models/models/trouble-container/trouble-container-registration.d.ts +0 -5
- package/models/models/trouble-container/trouble-container-registration.d.ts.map +0 -1
- package/models/utils/kosmodel-compatible-future-mixin.d.ts +0 -142
- package/models/utils/kosmodel-compatible-future-mixin.d.ts.map +0 -1
- package/models/utils/kosmodel-interface-companion-mixin.d.ts +0 -83
- package/models/utils/kosmodel-interface-companion-mixin.d.ts.map +0 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
export type { NetworkInterfaceContainerModel } from './network-interface-container-model';
|
|
1
2
|
export { NetworkInterfaceContainer } from './network-interface-container-registration';
|
|
3
|
+
export type { NetworkInterfaceModel } from './network-interface-model';
|
|
2
4
|
export { NetworkInterface } from './network-interface-registration';
|
|
3
5
|
export type * from './types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @group KOS Model
|
|
8
|
+
* @category Network Interfaces
|
|
9
|
+
*/
|
|
6
10
|
export * as NetworkInterfaceServices from './services';
|
|
7
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,mBAAmB,SAAS,CAAC;AAC7B;;;GAGG;AACH,OAAO,KAAK,wBAAwB,MAAM,YAAY,CAAC"}
|
|
@@ -3,10 +3,66 @@ import { NetworkInterfaceModel } from './network-interface-model';
|
|
|
3
3
|
import { IKosDataModel, IKosIdentifiable, IKosModelContainer, IKosModelHolder, KosCreationContext, PublicModelInterface } from '../../../core';
|
|
4
4
|
|
|
5
5
|
export declare const MODEL_TYPE = "network-interface-container-model";
|
|
6
|
+
/**
|
|
7
|
+
* NetworkInterfaceContainer - Centralized management of multiple network interfaces on KOS devices.
|
|
8
|
+
*
|
|
9
|
+
* The NetworkInterfaceContainer model provides comprehensive management of all network interfaces
|
|
10
|
+
* available on a KOS device, including automatic discovery, categorization, and real-time updates.
|
|
11
|
+
* This container model is essential for applications that need to manage multiple network interfaces,
|
|
12
|
+
* build network configuration screens, or monitor overall network connectivity status.
|
|
13
|
+
*
|
|
14
|
+
* ## Key Features
|
|
15
|
+
* - **Automatic Interface Discovery** - Loads and manages all available network interfaces from the device
|
|
16
|
+
* - **Category-Based Indexing** - Organizes interfaces by category (INTERNAL, INTEGRATION, EXTERNAL, NONE)
|
|
17
|
+
* - **Real-Time Refresh** - Updates interface data with current network state
|
|
18
|
+
* - **Unified Interface Management** - Single point of access for all network interface operations
|
|
19
|
+
* - **Dynamic Interface Tracking** - Handles interface addition/removal as network state changes
|
|
20
|
+
* - **Service Integration** - Automatically fetches interface data from KOS network services
|
|
21
|
+
*
|
|
22
|
+
* ## Interface Categories
|
|
23
|
+
* The container automatically organizes interfaces into categories:
|
|
24
|
+
* - **EXTERNAL** - User-facing interfaces (WiFi adapters, Ethernet ports)
|
|
25
|
+
* - **INTERNAL** - System interfaces (loopback, virtual interfaces)
|
|
26
|
+
* - **INTEGRATION** - Integration-specific network interfaces
|
|
27
|
+
* - **NONE** - Uncategorized interfaces
|
|
28
|
+
*
|
|
29
|
+
* ## Common Use Cases
|
|
30
|
+
* - **Network Configuration UI** - Build comprehensive network settings interfaces
|
|
31
|
+
* - **System Monitoring** - Track overall network connectivity and interface health
|
|
32
|
+
* - **Interface Selection** - Allow users to choose from available network interfaces
|
|
33
|
+
* - **Network Diagnostics** - Provide detailed system-wide network interface information
|
|
34
|
+
* - **Automated Network Management** - Programmatically manage multiple interfaces
|
|
35
|
+
*
|
|
36
|
+
* @example Basic Usage
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const networkContainer = NetworkInterfaceContainer.instance('system-interfaces')
|
|
39
|
+
* .build();
|
|
40
|
+
*
|
|
41
|
+
* // Access all network interfaces and get specific interface
|
|
42
|
+
* const allInterfaces = networkContainer.models;
|
|
43
|
+
* const ethInterface = networkContainer.getModel('eth0');
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @group KOS Model
|
|
47
|
+
* @category Network Interfaces
|
|
48
|
+
* @interface
|
|
49
|
+
* @useDeclaredType
|
|
50
|
+
*
|
|
51
|
+
* @see {@link NetworkInterface} - Individual network interface model
|
|
52
|
+
* @see {@link NetworkInterfaceOptions} - Network interface configuration options
|
|
53
|
+
* @see {@link getNetworkInterfaces} - Service function for loading interface data
|
|
54
|
+
*/
|
|
6
55
|
export type NetworkInterfaceContainerModel = PublicModelInterface<NetworkInterfaceContainerModelImpl>;
|
|
56
|
+
/**
|
|
57
|
+
* @ignore
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
7
60
|
export declare class NetworkInterfaceContainerModelImpl implements IKosIdentifiable, IKosModelHolder<NetworkInterfaceModel>, IKosDataModel {
|
|
61
|
+
/** Unique identifier for the container model instance */
|
|
8
62
|
id: string;
|
|
63
|
+
/** Context logger for debugging and network interface operations */
|
|
9
64
|
private logger;
|
|
65
|
+
/** Container for managing NetworkInterface model instances with category indexing */
|
|
10
66
|
private _models;
|
|
11
67
|
constructor(modelId: string, options: NetworkInterfaceContainerOptions, context: KosCreationContext);
|
|
12
68
|
getModel(id: string): NetworkInterfaceModel | undefined;
|
|
@@ -14,8 +70,14 @@ export declare class NetworkInterfaceContainerModelImpl implements IKosIdentifia
|
|
|
14
70
|
get data(): NetworkInterfaceModel[];
|
|
15
71
|
addModel(model: NetworkInterfaceModel): void;
|
|
16
72
|
removeModel(id: string): void;
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
17
76
|
init(): Promise<void>;
|
|
18
77
|
refreshInterfaces(): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
19
81
|
load(): Promise<void>;
|
|
20
82
|
}
|
|
21
83
|
//# sourceMappingURL=network-interface-container-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-interface-container-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/network-interface-container-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAEf,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAEhE,eAAO,MAAM,UAAU,sCAAsC,CAAC;AAE9D,MAAM,MAAM,8BAA8B,GACxC,oBAAoB,CAAC,kCAAkC,CAAC,CAAC;AAE3D,qBACa,kCACX,YACE,gBAAgB,EAChB,eAAe,CAAC,qBAAqB,CAAC,EACtC,aAAa;IAEf,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,MAAM,CAAmB;
|
|
1
|
+
{"version":3,"file":"network-interface-container-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/network-interface-container-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAEf,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAEhE,eAAO,MAAM,UAAU,sCAAsC,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,MAAM,8BAA8B,GACxC,oBAAoB,CAAC,kCAAkC,CAAC,CAAC;AAE3D;;;GAGG;AACH,qBACa,kCACX,YACE,gBAAgB,EAChB,eAAe,CAAC,qBAAqB,CAAC,EACtC,aAAa;IAEf,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,oEAAoE;IACpE,OAAO,CAAC,MAAM,CAAmB;IACjC,qFAAqF;IAC3E,OAAO,CAAC,OAAO,CAA4C;gBAEnE,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,gCAAgC,EACzC,OAAO,EAAE,kBAAkB;IAe7B,QAAQ,CAAC,EAAE,EAAE,MAAM;IAGnB,IAAI,MAAM,8CAET;IACD,IAAI,IAAI,4BAEP;IAED,QAAQ,CAAC,KAAK,EAAE,qBAAqB;IAIrC,WAAW,CAAC,EAAE,EAAE,MAAM;IAKtB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAMrB,iBAAiB;IAoBvB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAO5B"}
|
|
@@ -80,7 +80,8 @@ import { SingletonKosModelRegistrationFactory } from '../../../core';
|
|
|
80
80
|
* If the model does not yet exist, it will be created passing in the provided options to initialize it.
|
|
81
81
|
*
|
|
82
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
|
-
|
|
83
|
+
* @group KOS Model
|
|
84
|
+
* @category Network Interfaces
|
|
84
85
|
* */
|
|
85
86
|
export declare const NetworkInterfaceContainer: SingletonKosModelRegistrationFactory<NetworkInterfaceContainerModel, object>;
|
|
86
87
|
//# sourceMappingURL=network-interface-container-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-interface-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/network-interface-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAQ1F
|
|
1
|
+
{"version":3,"file":"network-interface-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/network-interface-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAQ1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiFK;AACL,eAAO,MAAM,yBAAyB,8EAOlC,CAAC"}
|
|
@@ -3,23 +3,100 @@ import { EthernetData, Ip44Settings, NetworkInterfaceCategory, NetworkInterfaceD
|
|
|
3
3
|
import { IKosDataModel, IKosIdentifiable, KosCreationContext, PublicModelInterface } from '../../../core';
|
|
4
4
|
|
|
5
5
|
export declare const MODEL_TYPE = "network-interface-model";
|
|
6
|
+
/**
|
|
7
|
+
* NetworkInterface - Network interface management and monitoring for KOS devices.
|
|
8
|
+
*
|
|
9
|
+
* The NetworkInterface model provides comprehensive network interface management capabilities, including
|
|
10
|
+
* WiFi and Ethernet configuration, IP settings, and real-time network state monitoring. This model is
|
|
11
|
+
* essential for applications that need to display network status, configure network connections, or
|
|
12
|
+
* manage network interfaces on KOS devices.
|
|
13
|
+
*
|
|
14
|
+
* ## Key Features
|
|
15
|
+
* - **Network Interface Discovery** - Automatically discovers and tracks available network interfaces
|
|
16
|
+
* - **WiFi Management** - Access WiFi connection details, signal strength, and access point information
|
|
17
|
+
* - **Ethernet Monitoring** - Track Ethernet connection status, speed, and duplex settings
|
|
18
|
+
* - **IP Configuration** - Monitor and manage IPv4 settings including addresses, gateways, and DNS
|
|
19
|
+
* - **Connection State Tracking** - Real-time monitoring of network device states and connectivity
|
|
20
|
+
* - **Hardware Information** - Access to MAC addresses, MTU settings, and device capabilities
|
|
21
|
+
*
|
|
22
|
+
* ## Network Interface Categories
|
|
23
|
+
* The model categorizes interfaces for easier management:
|
|
24
|
+
* - **INTERNAL** - Internal system interfaces (loopback, etc.)
|
|
25
|
+
* - **INTEGRATION** - Integration-specific interfaces
|
|
26
|
+
* - **EXTERNAL** - User-facing network interfaces (WiFi, Ethernet)
|
|
27
|
+
* - **NONE** - Uncategorized interfaces
|
|
28
|
+
*
|
|
29
|
+
* ## Common Use Cases
|
|
30
|
+
* - **Network Status Display** - Show current connection status and network details in UI
|
|
31
|
+
* - **Connection Management** - Allow users to view and configure network settings
|
|
32
|
+
* - **Network Diagnostics** - Provide detailed network interface information for troubleshooting
|
|
33
|
+
* - **System Integration** - Monitor network connectivity for automated systems
|
|
34
|
+
* - **Configuration Interfaces** - Build network configuration screens with current state
|
|
35
|
+
*
|
|
36
|
+
* @interface
|
|
37
|
+
* @example Basic Usage
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const networkInterface = NetworkInterface.instance('eth0')
|
|
40
|
+
* .options({
|
|
41
|
+
* name: 'eth0',
|
|
42
|
+
* type: 'ethernet',
|
|
43
|
+
* configured: true,
|
|
44
|
+
* category: 'EXTERNAL'
|
|
45
|
+
* })
|
|
46
|
+
* .build();
|
|
47
|
+
*
|
|
48
|
+
* console.log(networkInterface.name); // 'eth0'
|
|
49
|
+
* console.log(networkInterface.configured); // true
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @group KOS Model
|
|
53
|
+
* @category Network Interfaces
|
|
54
|
+
* @useDeclaredType
|
|
55
|
+
*
|
|
56
|
+
* @see {@link NetworkInterfaceContainer} - Container model for managing multiple network interfaces
|
|
57
|
+
* @see {@link NetworkInterfaceOptions} - Configuration options interface
|
|
58
|
+
* @see {@link EthernetData} - Ethernet-specific interface data
|
|
59
|
+
* @see {@link WifiData} - WiFi-specific interface data
|
|
60
|
+
* @see {@link Ip44Settings} - IPv4 configuration settings
|
|
61
|
+
*/
|
|
6
62
|
export type NetworkInterfaceModel = PublicModelInterface<NetworkInterfaceModelImpl>;
|
|
63
|
+
/**
|
|
64
|
+
* @ignore
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
7
67
|
export declare class NetworkInterfaceModelImpl implements IKosDataModel, IKosIdentifiable, NetworkInterfaceData {
|
|
68
|
+
/** Unique identifier for the model instance */
|
|
8
69
|
id: string;
|
|
70
|
+
/** Network interface name (e.g., 'eth0', 'wlan0', 'lo') */
|
|
9
71
|
name: string;
|
|
72
|
+
/** Interface type identifier (e.g., 'ethernet', 'wifi', 'loopback') */
|
|
10
73
|
type: string;
|
|
74
|
+
/** NetworkManager device state code indicating connection status */
|
|
11
75
|
nmdevicestate: number;
|
|
76
|
+
/** Hardware MAC address of the network interface */
|
|
12
77
|
hwaddress: string;
|
|
78
|
+
/** Maximum Transmission Unit size for the interface */
|
|
13
79
|
mtu: number;
|
|
80
|
+
/** Whether the interface is currently configured and active */
|
|
14
81
|
configured: boolean;
|
|
82
|
+
/** WiFi-specific connection data including SSID, signal strength, and security */
|
|
15
83
|
wifi?: WifiData;
|
|
84
|
+
/** Ethernet-specific connection data including carrier status, speed, and duplex */
|
|
16
85
|
ethernet?: EthernetData;
|
|
86
|
+
/** IPv4 network settings including address, gateway, and DNS configuration */
|
|
17
87
|
ip4settings?: Ip44Settings;
|
|
88
|
+
/** Interface categorization for organizational purposes */
|
|
18
89
|
category: NetworkInterfaceCategory;
|
|
19
90
|
private logger;
|
|
20
91
|
constructor(modelId: string, options: NetworkInterfaceOptions, context: KosCreationContext);
|
|
21
92
|
updateModel(options: NetworkInterfaceOptions): void;
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
22
96
|
init(): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
23
100
|
load(): Promise<void>;
|
|
24
101
|
}
|
|
25
102
|
//# sourceMappingURL=network-interface-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-interface-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/network-interface-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAEhB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,EACT,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,UAAU,4BAA4B,CAAC;AAEpD,MAAM,MAAM,qBAAqB,GAC/B,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;AAElD,qBACa,yBACX,YAAW,aAAa,EAAE,gBAAgB,EAAE,oBAAoB;IAEhE,EAAE,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"network-interface-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/network-interface-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAEhB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,EACT,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,UAAU,4BAA4B,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,MAAM,qBAAqB,GAC/B,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;AAElD;;;GAGG;AACH,qBACa,yBACX,YAAW,aAAa,EAAE,gBAAgB,EAAE,oBAAoB;IAEhE,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;IAEX,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IAEb,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IAEb,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;IAEtB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAElB,uDAAuD;IACvD,GAAG,EAAE,MAAM,CAAC;IAEZ,+DAA+D;IAC/D,UAAU,EAAE,OAAO,CAAC;IAEpB,kFAAkF;IAClF,IAAI,CAAC,EAAE,QAAQ,CAAC;IAEhB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,YAAY,CAAC;IAE3B,2DAA2D;IAC3D,QAAQ,EAAE,wBAAwB,CAAC;IAEnC,OAAO,CAAC,MAAM,CAAmB;gBAG/B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,kBAAkB;IAiB7B,WAAW,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI;IAenD;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B"}
|
|
@@ -80,7 +80,8 @@ import { KosModelRegistrationFactory } from '../../../core';
|
|
|
80
80
|
|
|
81
81
|
* The networkInterface 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
82
|
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
83
|
-
|
|
83
|
+
* @group KOS Model
|
|
84
|
+
* @category Network Interfaces
|
|
84
85
|
* */
|
|
85
86
|
export declare const NetworkInterface: KosModelRegistrationFactory<NetworkInterfaceModel, import('./services').NetworkInterfaceData>;
|
|
86
87
|
//# sourceMappingURL=network-interface-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-interface-registration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/network-interface-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAOvE
|
|
1
|
+
{"version":3,"file":"network-interface-registration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/network-interface-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAOvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiFK;AACL,eAAO,MAAM,gBAAgB,+FAM3B,CAAC"}
|
|
@@ -1,38 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network interface categories for organizational purposes.
|
|
3
|
+
* @group KOS Model
|
|
4
|
+
* @category Network Interfaces
|
|
5
|
+
*/
|
|
1
6
|
export type NetworkInterfaceCategory = "INTERNAL" | "INTEGRATION" | "EXTERNAL" | "NONE";
|
|
7
|
+
/**
|
|
8
|
+
* Ethernet-specific interface data including connection status and performance metrics.
|
|
9
|
+
* @group KOS Model
|
|
10
|
+
* @category Network Interfaces
|
|
11
|
+
*/
|
|
2
12
|
export interface EthernetData {
|
|
13
|
+
/** Whether the Ethernet cable is connected (link up/down status) */
|
|
3
14
|
carrier: boolean;
|
|
15
|
+
/** Connection speed in Mbps (e.g., 10, 100, 1000) */
|
|
4
16
|
speed: number;
|
|
17
|
+
/** Duplex mode - 'full' for full-duplex, 'half' for half-duplex */
|
|
5
18
|
duplex: string;
|
|
6
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* WiFi-specific interface data including access point details and signal metrics.
|
|
22
|
+
* @group KOS Model
|
|
23
|
+
* @category Network Interfaces
|
|
24
|
+
*/
|
|
7
25
|
export interface WifiData {
|
|
26
|
+
/** Access Point flags indicating capabilities and features */
|
|
8
27
|
apFlags: number;
|
|
28
|
+
/** BSSID (MAC address) of the connected access point */
|
|
9
29
|
bssid: string;
|
|
30
|
+
/** WPA security flags for the connection */
|
|
10
31
|
wpaFlags: number;
|
|
32
|
+
/** Connection bitrate in bits per second */
|
|
11
33
|
bitrate: number;
|
|
34
|
+
/** Network name (Service Set Identifier) */
|
|
12
35
|
ssid: string;
|
|
36
|
+
/** Signal strength percentage (0-100) */
|
|
13
37
|
signal: number;
|
|
38
|
+
/** RSN (Robust Security Network) flags for WPA2/WPA3 */
|
|
14
39
|
rsnFlags: number;
|
|
40
|
+
/** Time in seconds since the access point was last seen */
|
|
15
41
|
lastSeenAgo: number;
|
|
42
|
+
/** WiFi frequency in MHz (e.g., 2437 for 2.4GHz, 5220 for 5GHz) */
|
|
16
43
|
frequency: number;
|
|
17
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* IPv4 network configuration settings including addressing and DNS.
|
|
47
|
+
* @group KOS Model
|
|
48
|
+
* @category Network Interfaces
|
|
49
|
+
*/
|
|
18
50
|
export interface Ip44Settings {
|
|
51
|
+
/** Subnet prefix length (e.g., 24 for /24 subnet mask) */
|
|
19
52
|
prefix: number;
|
|
53
|
+
/** List of address/prefix combinations in CIDR notation */
|
|
20
54
|
addressprefixlist: string[];
|
|
55
|
+
/** Primary IP address assigned to the interface */
|
|
21
56
|
address: string;
|
|
57
|
+
/** IP configuration method ('auto' for DHCP, 'manual' for static) */
|
|
22
58
|
method: string;
|
|
59
|
+
/** Default gateway IP address for routing */
|
|
23
60
|
gateway: string;
|
|
61
|
+
/** List of DNS server IP addresses */
|
|
24
62
|
dnslist: string[];
|
|
25
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Complete network interface data structure containing all interface properties.
|
|
66
|
+
* This is the main interface that NetworkInterfaceModel implements.
|
|
67
|
+
* @group KOS Model
|
|
68
|
+
* @category Network Interfaces
|
|
69
|
+
*/
|
|
26
70
|
export interface NetworkInterfaceData {
|
|
71
|
+
/** Network interface name (e.g., 'eth0', 'wlan0', 'lo') */
|
|
27
72
|
name: string;
|
|
73
|
+
/** Interface type identifier (e.g., 'ethernet', 'wifi', 'loopback') */
|
|
28
74
|
type: string;
|
|
75
|
+
/** NetworkManager device state code indicating connection status */
|
|
29
76
|
nmdevicestate: number;
|
|
77
|
+
/** Hardware MAC address of the network interface */
|
|
30
78
|
hwaddress: string;
|
|
79
|
+
/** Maximum Transmission Unit size for the interface */
|
|
31
80
|
mtu: number;
|
|
81
|
+
/** Whether the interface is currently configured and active */
|
|
32
82
|
configured: boolean;
|
|
83
|
+
/** WiFi-specific connection data (only present for WiFi interfaces) */
|
|
33
84
|
wifi?: WifiData;
|
|
85
|
+
/** Ethernet-specific connection data (only present for Ethernet interfaces) */
|
|
34
86
|
ethernet?: EthernetData;
|
|
87
|
+
/** IPv4 network settings (present when interface has IP configuration) */
|
|
35
88
|
ip4settings?: Ip44Settings;
|
|
89
|
+
/** Interface categorization for organizational purposes */
|
|
36
90
|
category: NetworkInterfaceCategory;
|
|
37
91
|
}
|
|
38
92
|
type NetworkInterfaceResponse = [error: string, data: undefined] | [error: undefined, data: NetworkInterfaceData[] | undefined];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-interface-services.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/services/network-interface-services.ts"],"names":[],"mappings":"AAmBA,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,aAAa,GACb,UAAU,GACV,MAAM,CAAC;AAEX,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"network-interface-services.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/network-interface/services/network-interface-services.ts"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,aAAa,GACb,UAAU,GACV,MAAM,CAAC;AAEX;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,OAAO,EAAE,OAAO,CAAC;IACjB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ,+DAA+D;IAC/D,UAAU,EAAE,OAAO,CAAC;IACpB,uEAAuE;IACvE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,2DAA2D;IAC3D,QAAQ,EAAE,wBAAwB,CAAC;CACpC;AAED,KAAK,wBAAwB,GACzB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,GAChC,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAC,CAAC;AACjE;;;;GAIG;AAEH,eAAO,MAAM,oBAAoB,QACrB,QAAQ,wBAAwB,CAezC,CAAC"}
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { NetworkInterfaceData } from '../services';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for NetworkInterface model instances.
|
|
6
|
+
*
|
|
7
|
+
* This interface defines the complete network interface configuration including hardware details,
|
|
8
|
+
* connection state, and protocol-specific information for WiFi and Ethernet interfaces.
|
|
9
|
+
* Use these options when creating NetworkInterface models to represent physical or virtual
|
|
10
|
+
* network interfaces on KOS devices.
|
|
11
|
+
*
|
|
12
|
+
* @example Basic Usage
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const options: NetworkInterfaceOptions = {
|
|
15
|
+
* name: 'eth0',
|
|
16
|
+
* type: 'ethernet',
|
|
17
|
+
* configured: true,
|
|
18
|
+
* category: 'EXTERNAL'
|
|
19
|
+
* };
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @group KOS Model
|
|
23
|
+
* @category Network Interfaces
|
|
24
|
+
*/
|
|
4
25
|
export type NetworkInterfaceOptions = NetworkInterfaceData;
|
|
5
26
|
|
|
6
27
|
// --------------- NetworkInterfaceContainer ---------------
|
|
@@ -5,20 +5,99 @@ import { IKosDataModel, KosCreationContext } from '../../../core/core/kosModel';
|
|
|
5
5
|
import { IKosDataContainer } from '../../../core/core/kos-data-container';
|
|
6
6
|
|
|
7
7
|
export declare const MODEL_TYPE = "ota-model";
|
|
8
|
+
/**
|
|
9
|
+
* OTA - Over-the-Air update management system for KOS devices.
|
|
10
|
+
*
|
|
11
|
+
* The OTA model provides comprehensive management of software updates and artifacts on KOS devices,
|
|
12
|
+
* including real-time download progress tracking, installation management, and error handling.
|
|
13
|
+
* This model is essential for applications that need to manage software updates, display update
|
|
14
|
+
* status, and handle system maintenance operations.
|
|
15
|
+
*
|
|
16
|
+
* ## Key Features
|
|
17
|
+
* - **Real-Time Update Tracking** - Live monitoring of download progress and installation status
|
|
18
|
+
* - **Artifact Management** - Complete visibility into available and installed software artifacts
|
|
19
|
+
* - **Trouble Integration** - Integration with KOS trouble system for error tracking and resolution
|
|
20
|
+
* - **Status Monitoring** - Comprehensive status tracking (downloading, pending, ready, error, idle)
|
|
21
|
+
* - **Installation Control** - Safe installation and reboot management for pending updates
|
|
22
|
+
* - **Progress Reporting** - Detailed download progress with size and percentage completion
|
|
23
|
+
*
|
|
24
|
+
* ## Topic-Based Reactivity
|
|
25
|
+
* The model listens to these KOS topics for real-time synchronization:
|
|
26
|
+
* - **`/kos/ota/artifacts/all`** - Complete artifact list updates from OTA service
|
|
27
|
+
* - **`/kos/ota/artifacts/changed`** - Incremental artifact status changes during downloads
|
|
28
|
+
*
|
|
29
|
+
* ## Update States
|
|
30
|
+
* - **idle** - No updates in progress, system ready
|
|
31
|
+
* - **downloading** - Updates actively downloading from remote sources
|
|
32
|
+
* - **pending** - Updates downloaded and staged, ready for installation
|
|
33
|
+
* - **ready** - Updates installed and ready for use
|
|
34
|
+
* - **error** - Update process encountered errors, intervention needed
|
|
35
|
+
*
|
|
36
|
+
* ## Common Use Cases
|
|
37
|
+
* - **Update Status Dashboard** - Display current update status and progress to users
|
|
38
|
+
* - **System Maintenance** - Manage scheduled updates and installations
|
|
39
|
+
* - **Error Handling** - Monitor and resolve update-related issues
|
|
40
|
+
* - **Progress Monitoring** - Track download progress for large artifacts
|
|
41
|
+
* - **Installation Management** - Control when updates are applied to minimize downtime
|
|
42
|
+
*
|
|
43
|
+
* @interface
|
|
44
|
+
* @example Basic Usage
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const otaModel = Ota.instance('system-updater').build();
|
|
47
|
+
*
|
|
48
|
+
* // Access current update status and manage installations
|
|
49
|
+
* console.log(otaModel.status); // 'idle' | 'downloading' | 'pending' | 'ready' | 'error'
|
|
50
|
+
* if (otaModel.status === 'pending') {
|
|
51
|
+
* otaModel.installAndReboot();
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @group KOS Model
|
|
56
|
+
* @category System Integration
|
|
57
|
+
* @useDeclaredType
|
|
58
|
+
*
|
|
59
|
+
* @see {@link UpdaterOptions} - Configuration options for OTA model
|
|
60
|
+
* @see {@link UpdaterItem} - Individual update artifact interface
|
|
61
|
+
* @see {@link UpdaterStatus} - Available update status types
|
|
62
|
+
* @see {@link OTAArtifactResponse} - Raw artifact data from OTA service
|
|
63
|
+
* @see {@link TroubleContainer} - Integrated trouble management system
|
|
64
|
+
*/
|
|
8
65
|
export type OtaModel = PublicModelInterface<OtaModelImpl>;
|
|
66
|
+
/**
|
|
67
|
+
* @ignore
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
9
70
|
export declare class OtaModelImpl implements IKosDataModel, IKosIdentifiable {
|
|
71
|
+
/** Unique identifier for the model instance */
|
|
10
72
|
id: string;
|
|
11
73
|
private logger;
|
|
74
|
+
/** Internal data container holding all available update artifacts */
|
|
12
75
|
private data;
|
|
76
|
+
/** Trouble container dependency for tracking OTA-related troubles */
|
|
13
77
|
private troubleContainer;
|
|
14
|
-
|
|
15
|
-
get
|
|
16
|
-
|
|
78
|
+
/** Trouble condition indicating downloads are currently in progress */
|
|
79
|
+
get downloadInProgressTrouble(): import('..').TroubleModel<any>;
|
|
80
|
+
/** Trouble condition indicating updates are downloaded and pending installation */
|
|
81
|
+
get updatePendingTrouble(): import('..').TroubleModel<any>;
|
|
82
|
+
/** Trouble condition indicating OTA process is paused due to errors */
|
|
83
|
+
get pausedDueToErrorsTrouble(): import('..').TroubleModel<any>;
|
|
84
|
+
/** Collection of all available update artifacts with their current status */
|
|
17
85
|
get updates(): IKosDataContainer<UpdaterItem>;
|
|
86
|
+
/** Current overall update status based on active trouble conditions */
|
|
18
87
|
get status(): UpdaterStatus;
|
|
19
88
|
constructor(modelId: string, options: UpdaterOptions, context: KosCreationContext);
|
|
89
|
+
/**
|
|
90
|
+
* Installs pending updates and initiates system reboot.
|
|
91
|
+
* This method resolves the OTAUpdatePendingTrouble to trigger installation.
|
|
92
|
+
*/
|
|
20
93
|
installAndReboot(): void;
|
|
94
|
+
/**
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
21
97
|
init(): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
22
101
|
load(): Promise<void>;
|
|
23
102
|
handleAllArtifacts(artifacts: OTAArtifactResponse[]): Promise<void>;
|
|
24
103
|
handleChangedArtifacts(artifacts: OTAArtifactResponse[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ota-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/ota/ota-model.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EACV,aAAa,EAEb,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAIhE,OAAO,KAAK,EACV,mBAAmB,EAEnB,WAAW,EACX,cAAc,EACd,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,UAAU,cAAc,CAAC;AAEtC,MAAM,MAAM,QAAQ,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAC;AA8D1D,qBACa,YAAa,YAAW,aAAa,EAAE,gBAAgB;IAClE,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,MAAM,CAAmB;IAEjC,OAAO,CAAC,IAAI,CAA0D;
|
|
1
|
+
{"version":3,"file":"ota-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/ota/ota-model.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EACV,aAAa,EAEb,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAIhE,OAAO,KAAK,EACV,mBAAmB,EAEnB,WAAW,EACX,cAAc,EACd,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,UAAU,cAAc,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,MAAM,QAAQ,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAC;AA8D1D;;;GAGG;AACH,qBACa,YAAa,YAAW,aAAa,EAAE,gBAAgB;IAClE,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,MAAM,CAAmB;IAEjC,qEAAqE;IACrE,OAAO,CAAC,IAAI,CAA0D;IAEtE,qEAAqE;IAErE,OAAO,CAAC,gBAAgB,CAAyB;IAEjD,uEAAuE;IACvE,IAAI,yBAAyB,mCAQ5B;IAED,mFAAmF;IACnF,IAAI,oBAAoB,mCAOvB;IAED,uEAAuE;IACvE,IAAI,wBAAwB,mCAO3B;IAED,6EAA6E;IAC7E,IAAI,OAAO,mCAEV;IAED,uEAAuE;IACvE,IAAI,MAAM,IAAI,aAAa,CAU1B;gBAGC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,kBAAkB;IAU7B;;;OAGG;IACH,gBAAgB;IAchB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAwBrB,kBAAkB,CAAC,SAAS,EAAE,mBAAmB,EAAE;IAoBzD,sBAAsB,CAAC,SAAS,EAAE,mBAAmB,EAAE;CAaxD"}
|
|
@@ -51,6 +51,152 @@ export interface UpdaterItem {
|
|
|
51
51
|
status: UpdaterStatus;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Configuration options for OTA model instances.
|
|
56
|
+
*
|
|
57
|
+
* This interface defines the initial configuration for the OTA model, including
|
|
58
|
+
* any pre-existing artifact data that should be loaded during model initialization.
|
|
59
|
+
* In most cases, the OTA model will automatically load artifacts from the OTA service,
|
|
60
|
+
* but this option allows for pre-loading or testing scenarios.
|
|
61
|
+
*
|
|
62
|
+
* @example Basic OTA Model Creation
|
|
63
|
+
* ```typescript
|
|
64
|
+
* // Most common usage - let model load artifacts automatically
|
|
65
|
+
* const otaModel = Ota.instance('system-updates').build();
|
|
66
|
+
*
|
|
67
|
+
* // The model will automatically:
|
|
68
|
+
* // - Connect to OTA service
|
|
69
|
+
* // - Load current artifacts
|
|
70
|
+
* // - Subscribe to real-time updates
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @example Pre-loaded Artifacts (Advanced)
|
|
74
|
+
* ```typescript
|
|
75
|
+
* // Advanced usage with pre-loaded artifact data
|
|
76
|
+
* const mockArtifacts: OTAArtifactResponse[] = [
|
|
77
|
+
* {
|
|
78
|
+
* artifactInfo: {
|
|
79
|
+
* identifier: 'system-update-v1.2.0',
|
|
80
|
+
* name: 'System Update',
|
|
81
|
+
* version: '1.2.0',
|
|
82
|
+
* size: 52428800, // 50MB
|
|
83
|
+
* hash: 'sha256:abc123...',
|
|
84
|
+
* miniHash: 'abc123'
|
|
85
|
+
* },
|
|
86
|
+
* status: 'STAGED',
|
|
87
|
+
* done: true,
|
|
88
|
+
* requests: {
|
|
89
|
+
* 'primary': {
|
|
90
|
+
* currentSize: 52428800,
|
|
91
|
+
* downloaderActive: false,
|
|
92
|
+
* downloaderName: 'system-updater',
|
|
93
|
+
* errorCount: 0,
|
|
94
|
+
* fileNotFoundCount: 0,
|
|
95
|
+
* kabId: 'system-update-v1.2.0',
|
|
96
|
+
* lastUpdateTime: Date.now()
|
|
97
|
+
* }
|
|
98
|
+
* }
|
|
99
|
+
* }
|
|
100
|
+
* ];
|
|
101
|
+
*
|
|
102
|
+
* const options: UpdaterOptions = {
|
|
103
|
+
* otaArtifactResponse: mockArtifacts
|
|
104
|
+
* };
|
|
105
|
+
*
|
|
106
|
+
* const otaModel = Ota.instance('preloaded-updater')
|
|
107
|
+
* .options(options)
|
|
108
|
+
* .build();
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @example Testing Scenarios
|
|
112
|
+
* ```typescript
|
|
113
|
+
* // Create OTA model with test data for different scenarios
|
|
114
|
+
* const createTestOtaModel = (scenario: 'downloading' | 'pending' | 'error') => {
|
|
115
|
+
* const testArtifacts: OTAArtifactResponse[] = [];
|
|
116
|
+
*
|
|
117
|
+
* switch (scenario) {
|
|
118
|
+
* case 'downloading':
|
|
119
|
+
* testArtifacts.push({
|
|
120
|
+
* artifactInfo: {
|
|
121
|
+
* identifier: 'app-update-v2.1.0',
|
|
122
|
+
* name: 'Application Update',
|
|
123
|
+
* version: '2.1.0',
|
|
124
|
+
* size: 104857600, // 100MB
|
|
125
|
+
* hash: 'sha256:def456...',
|
|
126
|
+
* miniHash: 'def456'
|
|
127
|
+
* },
|
|
128
|
+
* status: 'MISSING',
|
|
129
|
+
* done: false,
|
|
130
|
+
* requests: {
|
|
131
|
+
* 'primary': {
|
|
132
|
+
* currentSize: 31457280, // 30MB downloaded
|
|
133
|
+
* downloaderActive: true,
|
|
134
|
+
* downloaderName: 'app-updater',
|
|
135
|
+
* errorCount: 0,
|
|
136
|
+
* fileNotFoundCount: 0,
|
|
137
|
+
* kabId: 'app-update-v2.1.0',
|
|
138
|
+
* lastUpdateTime: Date.now()
|
|
139
|
+
* }
|
|
140
|
+
* }
|
|
141
|
+
* });
|
|
142
|
+
* break;
|
|
143
|
+
*
|
|
144
|
+
* case 'pending':
|
|
145
|
+
* testArtifacts.push({
|
|
146
|
+
* artifactInfo: {
|
|
147
|
+
* identifier: 'security-patch-v1.0.1',
|
|
148
|
+
* name: 'Security Patch',
|
|
149
|
+
* version: '1.0.1',
|
|
150
|
+
* size: 10485760, // 10MB
|
|
151
|
+
* hash: 'sha256:ghi789...',
|
|
152
|
+
* miniHash: 'ghi789'
|
|
153
|
+
* },
|
|
154
|
+
* status: 'STAGED',
|
|
155
|
+
* done: true,
|
|
156
|
+
* requests: {
|
|
157
|
+
* 'primary': {
|
|
158
|
+
* currentSize: 10485760,
|
|
159
|
+
* downloaderActive: false,
|
|
160
|
+
* downloaderName: 'security-updater',
|
|
161
|
+
* errorCount: 0,
|
|
162
|
+
* fileNotFoundCount: 0,
|
|
163
|
+
* kabId: 'security-patch-v1.0.1',
|
|
164
|
+
* lastUpdateTime: Date.now()
|
|
165
|
+
* }
|
|
166
|
+
* }
|
|
167
|
+
* });
|
|
168
|
+
* break;
|
|
169
|
+
*
|
|
170
|
+
* case 'error':
|
|
171
|
+
* testArtifacts.push({
|
|
172
|
+
* status: 'INVALID',
|
|
173
|
+
* done: false,
|
|
174
|
+
* error: 'Checksum verification failed',
|
|
175
|
+
* requests: {
|
|
176
|
+
* 'primary': {
|
|
177
|
+
* currentSize: 0,
|
|
178
|
+
* downloaderActive: false,
|
|
179
|
+
* downloaderName: 'failed-updater',
|
|
180
|
+
* errorCount: 3,
|
|
181
|
+
* fileNotFoundCount: 0,
|
|
182
|
+
* kabId: 'failed-update-v1.0.0',
|
|
183
|
+
* lastUpdateTime: Date.now(),
|
|
184
|
+
* lastErrorReason: 'Checksum verification failed'
|
|
185
|
+
* }
|
|
186
|
+
* }
|
|
187
|
+
* });
|
|
188
|
+
* break;
|
|
189
|
+
* }
|
|
190
|
+
*
|
|
191
|
+
* return Ota.instance(`test-${scenario}`)
|
|
192
|
+
* .options({ otaArtifactResponse: testArtifacts })
|
|
193
|
+
* .build();
|
|
194
|
+
* };
|
|
195
|
+
* ```
|
|
196
|
+
*
|
|
197
|
+
* @category Model Configuration
|
|
198
|
+
* @category System Integration
|
|
199
|
+
*/
|
|
54
200
|
export interface UpdaterOptions {
|
|
55
201
|
otaArtifactResponse: OTAArtifactResponse[];
|
|
56
202
|
}
|