@kosdev-code/kos-ui-sdk 0.1.0-next.944 → 0.1.0-next.958
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.kos.json +2 -1
- package/common/events/async-event-bus.d.ts +2 -11
- package/common/events/async-event-bus.d.ts.map +1 -1
- package/common/events/eventBus.d.ts +1 -18
- package/common/events/eventBus.d.ts.map +1 -1
- package/core/core/decorators/kos-child.d.ts +2 -3
- package/core/core/decorators/kos-child.d.ts.map +1 -1
- package/core/core/decorators/kos-companion.d.ts +25 -87
- package/core/core/decorators/kos-companion.d.ts.map +1 -1
- package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts +2 -0
- package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts.map +1 -0
- package/core/core/decorators/kos-container-aware.d.ts +191 -420
- package/core/core/decorators/kos-container-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-execute-service-request.d.ts +7 -11
- package/core/core/decorators/kos-execute-service-request.d.ts.map +1 -1
- package/core/core/decorators/kos-execution-context.d.ts +14 -31
- package/core/core/decorators/kos-execution-context.d.ts.map +1 -1
- package/core/core/decorators/kos-future-aware.d.ts +21 -74
- package/core/core/decorators/kos-future-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-http-decorators.d.ts +18 -62
- package/core/core/decorators/kos-http-decorators.d.ts.map +1 -1
- package/core/core/decorators/kos-logger-aware.d.ts +10 -60
- package/core/core/decorators/kos-logger-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-model-effect.d.ts +10 -9
- package/core/core/decorators/kos-model-effect.d.ts.map +1 -1
- package/core/core/decorators/kos-multiple-future-aware.d.ts +21 -94
- package/core/core/decorators/kos-multiple-future-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-reload-aware.d.ts +14 -16
- package/core/core/decorators/kos-reload-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-service-request.d.ts +80 -238
- package/core/core/decorators/kos-service-request.d.ts.map +1 -1
- package/core/core/decorators/kos-state-machine.d.ts +35 -275
- package/core/core/decorators/kos-state-machine.d.ts.map +1 -1
- package/core/core/decorators/kos-trouble-aware.d.ts +9 -43
- package/core/core/decorators/kos-trouble-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-view-model.d.ts +20 -100
- package/core/core/decorators/kos-view-model.d.ts.map +1 -1
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/decorators/kosTopicHandler.d.ts +28 -89
- package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
- package/core/core/indexing/index.d.ts +2 -4
- package/core/core/indexing/index.d.ts.map +1 -1
- package/core/core/indexing/kos-container-index-aware.d.ts +17 -48
- package/core/core/indexing/kos-container-index-aware.d.ts.map +1 -1
- package/core/core/indexing/kos-index-aware.d.ts +11 -37
- package/core/core/indexing/kos-index-aware.d.ts.map +1 -1
- package/core/core/kos-container-model.d.ts +11 -32
- package/core/core/kos-container-model.d.ts.map +1 -1
- package/core/core/kos-data-container.d.ts +6 -6
- package/core/core/kos-data-container.d.ts.map +1 -1
- package/core/core/kosCore.d.ts +7 -4
- package/core/core/kosCore.d.ts.map +1 -1
- package/core/core/kosModel.d.ts +16 -8
- package/core/core/kosModel.d.ts.map +1 -1
- package/core/core/kosModelManager.d.ts +2 -3
- package/core/core/kosModelManager.d.ts.map +1 -1
- package/core/core/lifecycle/constants.d.ts +6 -2
- package/core/core/lifecycle/constants.d.ts.map +1 -1
- package/core/core/lifecycle/kosCoreLifecycle.d.ts +11 -1
- package/core/core/lifecycle/kosCoreLifecycle.d.ts.map +1 -1
- package/core/core/lifecycle/kosModelLifecycle.d.ts +6 -0
- package/core/core/lifecycle/kosModelLifecycle.d.ts.map +1 -1
- package/core/core/lifecycle/model-machine.d.ts +6 -0
- package/core/core/lifecycle/model-machine.d.ts.map +1 -1
- package/core/core/model/kos-fsm-manager.d.ts +6 -0
- package/core/core/model/kos-fsm-manager.d.ts.map +1 -1
- package/core/core/model/kos-offline-queue.d.ts +1 -1
- package/core/core/model/service-response-store.d.ts +2 -15
- package/core/core/model/service-response-store.d.ts.map +1 -1
- package/core/core/reconnect/reconnect-fixture.d.ts +17 -0
- package/core/core/reconnect/reconnect-fixture.d.ts.map +1 -0
- package/core/core/services/app-startup-service.d.ts +5 -13
- package/core/core/services/app-startup-service.d.ts.map +1 -1
- package/core/core/services/intent-service.d.ts +3 -12
- package/core/core/services/intent-service.d.ts.map +1 -1
- package/core/core/transport/mock/mock-frames.d.ts +3 -3
- package/core/core/transport/transport.d.ts +1 -1
- package/core/core/transport/transport.d.ts.map +1 -1
- package/core/core/transport/webSocketTransport.d.ts +10 -0
- package/core/core/transport/webSocketTransport.d.ts.map +1 -1
- package/core/types/model.d.ts +4 -8
- package/core/types/model.d.ts.map +1 -1
- package/core/types/service-response-store.d.ts +3 -11
- package/core/types/service-response-store.d.ts.map +1 -1
- package/core/types/utils/kos-fetch.d.ts +25 -37
- package/core/types/utils/kos-fetch.d.ts.map +1 -1
- package/core/util/abortable-when.d.ts +5 -6
- package/core/util/abortable-when.d.ts.map +1 -1
- package/core/util/ancestor-path-visitor.d.ts +14 -20
- package/core/util/ancestor-path-visitor.d.ts.map +1 -1
- package/core/util/container-utils.d.ts +26 -159
- package/core/util/container-utils.d.ts.map +1 -1
- package/core/util/date-utils.d.ts +9 -58
- package/core/util/date-utils.d.ts.map +1 -1
- package/core/util/debounce.d.ts +1 -8
- package/core/util/debounce.d.ts.map +1 -1
- package/core/util/kos-fetch.d.ts +1 -1
- package/core/util/kos-fetch.d.ts.map +1 -1
- package/core/util/kos-model-utils.d.ts +10 -11
- package/core/util/kos-model-utils.d.ts.map +1 -1
- package/core/util/model-attribute-utils.d.ts +5 -22
- package/core/util/model-attribute-utils.d.ts.map +1 -1
- package/core/util/promise-utils.d.ts +1 -26
- package/core/util/promise-utils.d.ts.map +1 -1
- package/core/util/service-factory.d.ts +5 -23
- package/core/util/service-factory.d.ts.map +1 -1
- package/core/util/service-request-error.d.ts +3 -5
- package/core/util/service-request-error.d.ts.map +1 -1
- package/core/util/service-response.d.ts +12 -67
- package/core/util/service-response.d.ts.map +1 -1
- package/core/util/transport-not-ready-error.d.ts +11 -13
- package/core/util/transport-not-ready-error.d.ts.map +1 -1
- package/core/util/when-ready.d.ts +1 -8
- package/core/util/when-ready.d.ts.map +1 -1
- package/index.cjs +144 -109
- package/index.cjs.map +1 -1
- package/index.js +173 -138
- package/index.js.map +1 -1
- package/models/decorators/future-service.d.ts +7 -7
- package/models/models/browser-router/browser-router-model.d.ts +10 -39
- package/models/models/browser-router/browser-router-model.d.ts.map +1 -1
- package/models/models/browser-router/browser-router-registration.d.ts +5 -77
- package/models/models/browser-router/browser-router-registration.d.ts.map +1 -1
- package/models/models/browser-router/types/index.d.ts +2 -16
- package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts +5 -77
- package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts.map +1 -1
- package/models/models/canvas-renderer/canvas-renderer-registration.d.ts +5 -75
- package/models/models/canvas-renderer/canvas-renderer-registration.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-model-builder.d.ts +4 -11
- package/models/models/config-bean/config-bean-model-builder.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-model.d.ts +23 -66
- package/models/models/config-bean/config-bean-model.d.ts.map +1 -1
- package/models/models/config-bean-prop/config-bean-prop-model.d.ts +15 -62
- 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 +34 -215
- package/models/models/device/device-model.d.ts +20 -199
- package/models/models/device/device-model.d.ts.map +1 -1
- package/models/models/device/device-registration.d.ts +7 -87
- package/models/models/device/device-registration.d.ts.map +1 -1
- package/models/models/device/types/index.d.ts +5 -34
- package/models/models/future/future-aware.d.ts +7 -71
- package/models/models/future/future-aware.d.ts.map +1 -1
- package/models/models/future/future-model-builder.d.ts +2 -2
- package/models/models/future/future-model.d.ts +3 -23
- package/models/models/future/future-model.d.ts.map +1 -1
- package/models/models/future/future-types.d.ts +28 -145
- package/models/models/future/future-types.d.ts.map +1 -1
- package/models/models/gpio-chip/gpio-chip-builders.d.ts +14 -0
- package/models/models/gpio-chip/gpio-chip-builders.d.ts.map +1 -0
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts +2 -1
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts.map +1 -1
- package/models/models/key-value/key-value-model.d.ts +12 -72
- package/models/models/key-value/key-value-model.d.ts.map +1 -1
- package/models/models/key-value/key-value-registration.d.ts +5 -77
- package/models/models/key-value/key-value-registration.d.ts.map +1 -1
- package/models/models/key-value/services/key-value-services.d.ts +13 -72
- package/models/models/key-value/services/key-value-services.d.ts.map +1 -1
- package/models/models/key-value/types/index.d.ts +3 -46
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts +32 -99
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts.map +1 -1
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts +2 -12
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts.map +1 -1
- package/models/models/kos-log-manager/kos-log-manager-model.d.ts +7 -46
- package/models/models/kos-log-manager/kos-log-manager-model.d.ts.map +1 -1
- package/models/models/kos-log-manager/kos-log-manager-registration.d.ts +5 -80
- package/models/models/kos-log-manager/kos-log-manager-registration.d.ts.map +1 -1
- package/models/models/kos-log-manager/types/index.d.ts +13 -156
- package/models/models/kos-time/kos-time-model.d.ts +8 -39
- package/models/models/kos-time/kos-time-model.d.ts.map +1 -1
- package/models/models/kos-time/kos-time-registration.d.ts +6 -73
- package/models/models/kos-time/kos-time-registration.d.ts.map +1 -1
- package/models/models/kos-time/types/index.d.ts +3 -58
- package/models/models/log-block/log-block-container-model.d.ts +2 -118
- package/models/models/log-block/log-block-container-model.d.ts.map +1 -1
- package/models/models/log-block/log-block-container-registration.d.ts +5 -75
- package/models/models/log-block/log-block-container-registration.d.ts.map +1 -1
- package/models/models/log-block/log-block-model.d.ts +5 -168
- package/models/models/log-block/log-block-model.d.ts.map +1 -1
- package/models/models/log-block/log-block-registration.d.ts +5 -75
- package/models/models/log-block/log-block-registration.d.ts.map +1 -1
- package/models/models/log-block/types/index.d.ts +14 -81
- package/models/models/log-stream/log-stream-container-model.d.ts +8 -35
- package/models/models/log-stream/log-stream-container-model.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-container-registration.d.ts +5 -75
- package/models/models/log-stream/log-stream-container-registration.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-model.d.ts +8 -29
- package/models/models/log-stream/log-stream-model.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-registration.d.ts +5 -75
- package/models/models/log-stream/log-stream-registration.d.ts.map +1 -1
- package/models/models/log-stream/types/index.d.ts +5 -60
- package/models/models/network-interface/network-interface-container-model.d.ts +6 -35
- 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 +5 -73
- package/models/models/network-interface/network-interface-container-registration.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-model.d.ts +5 -43
- package/models/models/network-interface/network-interface-model.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-registration.d.ts +5 -73
- package/models/models/network-interface/network-interface-registration.d.ts.map +1 -1
- package/models/models/network-interface/types/index.d.ts +2 -16
- package/models/models/ota/ota-model.d.ts +11 -39
- package/models/models/ota/ota-model.d.ts.map +1 -1
- package/models/models/ota/ota-registration.d.ts +5 -77
- package/models/models/ota/ota-registration.d.ts.map +1 -1
- package/models/models/ota/types/index.d.ts +2 -141
- package/models/models/region-info/types/index.d.ts +19 -99
- package/models/models/region-info/types/index.d.ts.map +1 -1
- package/models/models/software-info/services/software-info-services.d.ts +2 -14
- package/models/models/software-info/services/software-info-services.d.ts.map +1 -1
- package/models/models/software-info/software-info-model.d.ts +3 -39
- package/models/models/software-info/software-info-model.d.ts.map +1 -1
- package/models/models/software-info/software-info-registration.d.ts +6 -73
- package/models/models/software-info/software-info-registration.d.ts.map +1 -1
- package/models/models/software-info/types/index.d.ts +6 -20
- package/models/models/state-bean/state-bean-model.d.ts +10 -41
- package/models/models/state-bean/state-bean-model.d.ts.map +1 -1
- package/models/models/state-bean/state-bean-registration.d.ts +6 -73
- package/models/models/state-bean/state-bean-registration.d.ts.map +1 -1
- package/models/models/state-bean/types/index.d.ts +4 -84
- package/models/models/state-prop/state-prop-model.d.ts +6 -40
- package/models/models/state-prop/state-prop-model.d.ts.map +1 -1
- package/models/models/state-prop/state-prop-registration.d.ts +6 -73
- package/models/models/state-prop/state-prop-registration.d.ts.map +1 -1
- package/models/models/state-prop/types/index.d.ts +5 -37
- package/models/models/storage-device/storage-device-container-model.d.ts +7 -273
- package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-container-registration.d.ts +5 -75
- package/models/models/storage-device/storage-device-container-registration.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-model.d.ts +3 -49
- package/models/models/storage-device/storage-device-model.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-registration.d.ts +5 -75
- package/models/models/storage-device/storage-device-registration.d.ts.map +1 -1
- package/models/models/storage-device/types/index.d.ts +13 -82
- package/models/models/studio-properties/studio-properties-model.d.ts +13 -36
- package/models/models/studio-properties/studio-properties-model.d.ts.map +1 -1
- package/models/models/studio-properties/studio-properties-registration.d.ts +5 -75
- package/models/models/studio-properties/studio-properties-registration.d.ts.map +1 -1
- package/models/models/studio-properties/types/index.d.ts +2 -24
- package/models/models/translation/descriptor-merge.d.ts +13 -17
- package/models/models/translation/descriptor-merge.d.ts.map +1 -1
- package/models/models/translation/services/translation-services.d.ts +19 -77
- package/models/models/translation/services/translation-services.d.ts.map +1 -1
- package/models/models/translation/test-harness.d.ts +6 -8
- package/models/models/translation/test-harness.d.ts.map +1 -1
- package/models/models/translation/translation-container-model.d.ts +7 -59
- package/models/models/translation/translation-container-model.d.ts.map +1 -1
- package/models/models/translation/translation-container-registration.d.ts +6 -73
- package/models/models/translation/translation-container-registration.d.ts.map +1 -1
- package/models/models/translation/translation-model.d.ts +17 -50
- package/models/models/translation/translation-model.d.ts.map +1 -1
- package/models/models/translation/translation-registration.d.ts +6 -73
- package/models/models/translation/translation-registration.d.ts.map +1 -1
- package/models/models/translation/types/index.d.ts +51 -276
- package/models/models/trouble/trouble-registration.d.ts +6 -73
- package/models/models/trouble/trouble-registration.d.ts.map +1 -1
- package/models/models/trouble/types/index.d.ts +17 -188
- package/models/models/trouble/utils/is-trouble-aware.d.ts +4 -85
- package/models/models/trouble/utils/is-trouble-aware.d.ts.map +1 -1
- package/models/models/trouble-container/trouble-builders.d.ts +11 -0
- package/models/models/trouble-container/trouble-builders.d.ts.map +1 -0
- package/models/models/trouble-container/trouble-container-model.d.ts +2 -1
- package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
- package/models/models/usb-update/usb-update-container-registration.d.ts +5 -75
- package/models/models/usb-update/usb-update-container-registration.d.ts.map +1 -1
- package/models/models/usb-update/usb-update-registration.d.ts +5 -75
- package/models/models/usb-update/usb-update-registration.d.ts.map +1 -1
- package/models/types/cancellable-promise.d.ts +6 -9
- package/models/types/cancellable-promise.d.ts.map +1 -1
- package/models/utils/await-future-call.d.ts +9 -21
- package/models/utils/await-future-call.d.ts.map +1 -1
- package/models/utils/cancellable-future-call.d.ts +8 -19
- package/models/utils/cancellable-future-call.d.ts.map +1 -1
- package/models/utils/cancellable-service.d.ts +14 -23
- package/models/utils/cancellable-service.d.ts.map +1 -1
- package/models/utils/conversion-utils.d.ts +8 -48
- package/models/utils/conversion-utils.d.ts.map +1 -1
- package/models/utils/persistence-store.d.ts +1 -1
- package/models/utils/service.d.ts +14 -48
- package/models/utils/service.d.ts.map +1 -1
- package/models/utils/services/kos/daily/service.d.ts +4 -4
- package/models/utils/services/vfs/daily/service.d.ts +4 -4
- package/models/utils/timer-manager.d.ts.map +1 -1
- package/package.json +3 -3
- package/{software-info-registration-CKlTQPet.js → software-info-registration-C8kf-pBB.js} +551 -530
- package/software-info-registration-C8kf-pBB.js.map +1 -0
- package/{software-info-registration-GUbTY4KD.cjs → software-info-registration-Y1iADHWT.cjs} +522 -501
- package/software-info-registration-Y1iADHWT.cjs.map +1 -0
- package/testing/index.d.ts +28 -33
- package/testing/index.d.ts.map +1 -1
- package/testing.cjs +1 -1
- package/testing.cjs.map +1 -1
- package/testing.js +1 -1
- package/testing.js.map +1 -1
- package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts +9 -0
- package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts.map +1 -0
- package/ui/components/connection-dev-button/index.d.ts +36 -0
- package/ui/components/connection-dev-button/index.d.ts.map +1 -0
- package/ui/components/connection-dev-button/use-connection-dev-state.d.ts +29 -0
- package/ui/components/connection-dev-button/use-connection-dev-state.d.ts.map +1 -0
- package/ui/components/index.d.ts +1 -0
- package/ui/components/index.d.ts.map +1 -1
- package/ui/features/canvas/hooks/use-image-renderer.d.ts +5 -4
- package/ui/features/canvas/hooks/use-image-renderer.d.ts.map +1 -1
- package/ui/hooks/use-function-warmup.d.ts +4 -14
- package/ui/hooks/use-function-warmup.d.ts.map +1 -1
- package/ui/hooks/use-kos-date-formats.d.ts +15 -29
- package/ui/hooks/use-kos-date-formats.d.ts.map +1 -1
- package/ui/hooks/use-kos-region-timezones.d.ts +4 -55
- package/ui/hooks/use-kos-region-timezones.d.ts.map +1 -1
- package/ui/hooks/use-kos-regions.d.ts +11 -23
- package/ui/hooks/use-kos-regions.d.ts.map +1 -1
- package/ui/hooks/use-kos-time-formats.d.ts +16 -31
- package/ui/hooks/use-kos-time-formats.d.ts.map +1 -1
- package/ui/hooks/use-kos-unit-systems.d.ts +13 -27
- package/ui/hooks/use-kos-unit-systems.d.ts.map +1 -1
- package/ui/hooks/view-model/use-view-model.d.ts +6 -31
- package/ui/hooks/view-model/use-view-model.d.ts.map +1 -1
- package/ui/policies/reload-on-disconnect-policy.d.ts +5 -6
- package/ui/policies/reload-on-disconnect-policy.d.ts.map +1 -1
- package/software-info-registration-CKlTQPet.js.map +0 -1
- package/software-info-registration-GUbTY4KD.cjs.map +0 -1
|
@@ -5,89 +5,21 @@ export declare const TOPIC_CRITICAL_DATA_CHANGED = "/kos/criticalData/changed";
|
|
|
5
5
|
export declare const TOPIC_CRITICAL_DATA_AVAILABLE = "/kos/criticalData/available";
|
|
6
6
|
export declare const TOPIC_CRITICAL_DATA_UNAVAILABLE = "/kos/criticalData/unavailable";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Device identity: serial number, name and node id.
|
|
9
9
|
*
|
|
10
|
-
* The
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* The model loads the device details and serial number on load, and reloads the
|
|
11
|
+
* serial number when the `/kos/criticalData/changed` or
|
|
12
|
+
* `/kos/criticalData/available` topics fire. Values read `"unassigned"` until
|
|
13
|
+
* they have been loaded.
|
|
13
14
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* ### Device Identity Management
|
|
17
|
-
* - **Serial Number Tracking**: Hardware-based device identification
|
|
18
|
-
* - **Name Management**: Human-readable device naming for administration
|
|
19
|
-
* - **Node Configuration**: Multi-node deployment topology handling
|
|
20
|
-
*
|
|
21
|
-
* ### Real-time Synchronization
|
|
22
|
-
* - **Critical Data Events**: Automatic updates on system data changes
|
|
23
|
-
* - **WebSocket Integration**: Live device state synchronization
|
|
24
|
-
* - **Lazy Loading**: Efficient data retrieval when needed
|
|
25
|
-
*
|
|
26
|
-
* ### Node Topology Support
|
|
27
|
-
* - **Node Type/Name Parsing**: Automatic node identifier decomposition
|
|
28
|
-
* - **Multi-node Deployments**: Support for complex system architectures
|
|
29
|
-
* - **Role-based Configuration**: Node-specific parameter management
|
|
30
|
-
*
|
|
31
|
-
* ## Common Integration Patterns
|
|
32
|
-
*
|
|
33
|
-
* ### System Administration Dashboards
|
|
34
|
-
* ```typescript
|
|
35
|
-
* const device = Device.factory({
|
|
36
|
-
* serialNumber: 'KOS-DEV-001',
|
|
37
|
-
* name: 'Production Dispenser Alpha',
|
|
38
|
-
* nodeId: 'primary-main'
|
|
39
|
-
* });
|
|
40
|
-
*
|
|
41
|
-
* // Access device identity
|
|
42
|
-
* console.log(`Device: ${device.name}`);
|
|
43
|
-
* console.log(`Serial: ${device.serialNumber}`);
|
|
44
|
-
* console.log(`Node: ${device.nodeType}-${device.nodeName}`);
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* ### Multi-node System Coordination
|
|
48
|
-
* ```typescript
|
|
49
|
-
* const primaryDevice = Device.factory({
|
|
50
|
-
* nodeId: 'primary-controller'
|
|
51
|
-
* });
|
|
52
|
-
*
|
|
53
|
-
* const secondaryDevice = Device.factory({
|
|
54
|
-
* nodeId: 'secondary-backup'
|
|
55
|
-
* });
|
|
56
|
-
*
|
|
57
|
-
* // Coordinate based on node roles
|
|
58
|
-
* if (primaryDevice.nodeType === 'primary') {
|
|
59
|
-
* // Handle primary node logic
|
|
60
|
-
* }
|
|
61
|
-
* ```
|
|
15
|
+
* This is an alias for the implementation {@link DeviceModelImpl}.
|
|
62
16
|
*
|
|
63
|
-
*
|
|
17
|
+
* @example
|
|
64
18
|
* ```typescript
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* name: userProvidedName,
|
|
68
|
-
* nodeId: deploymentConfiguration.nodeId
|
|
69
|
-
* });
|
|
70
|
-
*
|
|
71
|
-
* // Device automatically loads additional data
|
|
72
|
-
* // from critical data events
|
|
19
|
+
* @kosDependency({ modelType: Device.type, id: Device.type })
|
|
20
|
+
* private device!: DeviceModel;
|
|
73
21
|
* ```
|
|
74
22
|
*
|
|
75
|
-
* ## Real-time Updates
|
|
76
|
-
*
|
|
77
|
-
* The Device model automatically responds to critical data changes:
|
|
78
|
-
* - Monitors `/kos/criticalData/changed` and `/kos/criticalData/available` topics
|
|
79
|
-
* - Updates serial number and configuration when system data becomes available
|
|
80
|
-
* - Maintains consistency across device restarts and configuration changes
|
|
81
|
-
*
|
|
82
|
-
* ## Singleton Behavior
|
|
83
|
-
*
|
|
84
|
-
* Device models use singleton pattern - each device type has one instance:
|
|
85
|
-
* - Subsequent factory calls return the existing instance
|
|
86
|
-
* - Options are ignored after first creation
|
|
87
|
-
* - Ensures system-wide device identity consistency
|
|
88
|
-
*
|
|
89
|
-
* This is an alias for the implementation {@link DeviceModelImpl}.
|
|
90
|
-
*
|
|
91
23
|
* @interface
|
|
92
24
|
* @group KOS Model
|
|
93
25
|
* @category Device Data
|
|
@@ -98,145 +30,34 @@ export declare class DeviceModelImpl implements IKosDataModel, IKosIdentifiable
|
|
|
98
30
|
id: string;
|
|
99
31
|
private logger;
|
|
100
32
|
private _serialNumber;
|
|
101
|
-
/**
|
|
102
|
-
* Hardware-based device serial number for unique identification.
|
|
103
|
-
*
|
|
104
|
-
* Returns the device's hardware serial number or "unassigned" if not yet loaded.
|
|
105
|
-
* Serial numbers are typically retrieved from the device's hardware identification
|
|
106
|
-
* system during critical data events.
|
|
107
|
-
*
|
|
108
|
-
* @example
|
|
109
|
-
* ```typescript
|
|
110
|
-
* const device = Device.factory({});
|
|
111
|
-
*
|
|
112
|
-
* // Check if serial number is available
|
|
113
|
-
* if (device.serialNumber !== "unassigned") {
|
|
114
|
-
* console.log(`Device Serial: ${device.serialNumber}`);
|
|
115
|
-
* }
|
|
116
|
-
* ```
|
|
117
|
-
*/
|
|
33
|
+
/** Hardware serial number, or `"unassigned"` until it has been loaded. */
|
|
118
34
|
get serialNumber(): string | "unassigned";
|
|
119
35
|
private _name;
|
|
120
|
-
/**
|
|
121
|
-
* Human-readable device name for administrative identification.
|
|
122
|
-
*
|
|
123
|
-
* Returns the configured device name or "unassigned" if not yet set.
|
|
124
|
-
* Device names are typically configured during device setup and used
|
|
125
|
-
* in administrative interfaces for device identification and management.
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* ```typescript
|
|
129
|
-
* const device = Device.factory({
|
|
130
|
-
* name: 'Main Production Dispenser'
|
|
131
|
-
* });
|
|
132
|
-
*
|
|
133
|
-
* console.log(`Device Name: ${device.name}`);
|
|
134
|
-
* // Output: "Device Name: Main Production Dispenser"
|
|
135
|
-
* ```
|
|
136
|
-
*/
|
|
36
|
+
/** Human-readable device name, or `"unassigned"` until it has been loaded. */
|
|
137
37
|
get name(): string | "unassigned";
|
|
138
38
|
private _nodeId;
|
|
139
39
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* Returns the complete node ID or "unassigned" if not yet configured.
|
|
143
|
-
* Node IDs follow the pattern "type-instance" (e.g., "primary-main", "secondary-backup")
|
|
144
|
-
* and identify the specific node role and instance within multi-node deployments.
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```typescript
|
|
148
|
-
* const device = Device.factory({
|
|
149
|
-
* nodeId: 'primary-controller'
|
|
150
|
-
* });
|
|
40
|
+
* Node identifier within the deployment, in `type-name` form (for example
|
|
41
|
+
* `primary-main`), or `"unassigned"` until it has been loaded.
|
|
151
42
|
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* ```
|
|
155
|
-
*
|
|
156
|
-
* @see {@link nodeType} for extracting the node type portion
|
|
157
|
-
* @see {@link nodeName} for extracting the node name portion
|
|
43
|
+
* @see {@link nodeType} for the type portion
|
|
44
|
+
* @see {@link nodeName} for the name portion
|
|
158
45
|
*/
|
|
159
46
|
get nodeId(): string | "unassigned";
|
|
160
47
|
/**
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* Returns the first part of the node ID (before the hyphen).
|
|
164
|
-
* For node ID "primary-controller", this returns "primary".
|
|
165
|
-
* Used for role-based logic and node coordination.
|
|
166
|
-
*
|
|
167
|
-
* @example
|
|
168
|
-
* ```typescript
|
|
169
|
-
* const device = Device.factory({
|
|
170
|
-
* nodeId: 'primary-controller'
|
|
171
|
-
* });
|
|
172
|
-
*
|
|
173
|
-
* console.log(`Node Type: ${device.nodeType}`);
|
|
174
|
-
* // Output: "Node Type: primary"
|
|
175
|
-
*
|
|
176
|
-
* // Role-based coordination
|
|
177
|
-
* if (device.nodeType === 'primary') {
|
|
178
|
-
* // Handle primary node responsibilities
|
|
179
|
-
* }
|
|
180
|
-
* ```
|
|
48
|
+
* The part of {@link nodeId} before the hyphen (`"primary"` for `primary-main`).
|
|
181
49
|
*/
|
|
182
50
|
get nodeType(): string;
|
|
183
51
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* Returns the second part of the node ID (after the hyphen).
|
|
187
|
-
* For node ID "primary-controller", this returns "controller".
|
|
188
|
-
* Used for instance-specific identification within node types.
|
|
189
|
-
*
|
|
190
|
-
* @example
|
|
191
|
-
* ```typescript
|
|
192
|
-
* const device = Device.factory({
|
|
193
|
-
* nodeId: 'secondary-backup'
|
|
194
|
-
* });
|
|
195
|
-
*
|
|
196
|
-
* console.log(`Node Name: ${device.nodeName}`);
|
|
197
|
-
* // Output: "Node Name: backup"
|
|
198
|
-
*
|
|
199
|
-
* // Instance-specific logic
|
|
200
|
-
* if (device.nodeName === 'backup') {
|
|
201
|
-
* // Handle backup node configuration
|
|
202
|
-
* }
|
|
203
|
-
* ```
|
|
52
|
+
* The part of {@link nodeId} after the hyphen (`"main"` for `primary-main`).
|
|
204
53
|
*/
|
|
205
54
|
get nodeName(): string;
|
|
206
55
|
constructor(modelId: string, _options: DeviceOptions, context: KosCreationContext);
|
|
207
56
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* Allows dynamic updating of device identity and node configuration.
|
|
211
|
-
* Any undefined values will be set to "unassigned". This method is typically
|
|
212
|
-
* called internally during device data loading or external configuration changes.
|
|
213
|
-
*
|
|
214
|
-
* @param options - Device configuration options to apply
|
|
215
|
-
*
|
|
216
|
-
* @example
|
|
217
|
-
* ```typescript
|
|
218
|
-
* const device = Device.factory({});
|
|
219
|
-
*
|
|
220
|
-
* // Update with new device information
|
|
221
|
-
* device.updateModel({
|
|
222
|
-
* serialNumber: 'KOS-DEVICE-12345',
|
|
223
|
-
* name: 'Updated Dispenser Name',
|
|
224
|
-
* nodeId: 'primary-main'
|
|
225
|
-
* });
|
|
226
|
-
*
|
|
227
|
-
* console.log(device.serialNumber); // "KOS-DEVICE-12345"
|
|
228
|
-
* console.log(device.name); // "Updated Dispenser Name"
|
|
229
|
-
* console.log(device.nodeId); // "primary-main"
|
|
230
|
-
* ```
|
|
57
|
+
* Replace the device identity. Fields left undefined become `"unassigned"`, so
|
|
58
|
+
* pass every field you want to keep.
|
|
231
59
|
*
|
|
232
|
-
* @
|
|
233
|
-
* ```typescript
|
|
234
|
-
* // Only update specific fields
|
|
235
|
-
* device.updateModel({
|
|
236
|
-
* name: 'New Device Name'
|
|
237
|
-
* // serialNumber and nodeId remain unchanged
|
|
238
|
-
* });
|
|
239
|
-
* ```
|
|
60
|
+
* @param options - Device identity to apply
|
|
240
61
|
*/
|
|
241
62
|
updateModel(options: DeviceOptions): void;
|
|
242
63
|
private loadDeviceData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/device/device-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAEhB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,UAAU,iBAAiB,CAAC;AACzC,eAAO,MAAM,2BAA2B,8BAA8B,CAAC;AACvE,eAAO,MAAM,6BAA6B,gCAAgC,CAAC;AAC3E,eAAO,MAAM,+BAA+B,kCAAkC,CAAC;AAE/E
|
|
1
|
+
{"version":3,"file":"device-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/device/device-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAEhB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,UAAU,iBAAiB,CAAC;AACzC,eAAO,MAAM,2BAA2B,8BAA8B,CAAC;AACvE,eAAO,MAAM,6BAA6B,gCAAgC,CAAC;AAC3E,eAAO,MAAM,+BAA+B,kCAAkC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAC,eAAe,CAAC,CAAC;AAEhE,qBACa,eAAgB,YAAW,aAAa,EAAE,gBAAgB;IACrE,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,aAAa,CAAwB;IAE7C,0EAA0E;IAC1E,IAAI,YAAY,IAAI,MAAM,GAAG,YAAY,CAExC;IAED,OAAO,CAAC,KAAK,CAAwB;IAErC,8EAA8E;IAC9E,IAAI,IAAI,IAAI,MAAM,GAAG,YAAY,CAEhC;IAED,OAAO,CAAC,OAAO,CAAwB;IAEvC;;;;;;OAMG;IACH,IAAI,MAAM,IAAI,MAAM,GAAG,YAAY,CAElC;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAGrB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAGrB;gBAGC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,kBAAkB;IAS7B;;;;;OAKG;IACH,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;YAM3B,cAAc;YAYd,gBAAgB;IAU9B;;OAEG;IAKG,yBAAyB;IAO/B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5B"}
|
|
@@ -2,98 +2,18 @@ import { SingletonKosModelRegistrationFactory } from '../../../core';
|
|
|
2
2
|
import { DeviceModel } from './device-model';
|
|
3
3
|
import { DeviceOptions } from './types';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Registration for {@link DeviceModel}, a singleton model holding the device's
|
|
6
|
+
* identity, serial number and node configuration.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
+
* `type` identifies the model in the registry and in `@kosDependency` declarations.
|
|
9
|
+
* `register()` adds the model to the registry. `instance()` builds or returns the single instance; later calls ignore the options.
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
* Device models handle device identity, hardware serial numbers, and node configuration within KOS deployments.
|
|
11
|
-
*
|
|
12
|
-
* ## Core Registration Properties
|
|
13
|
-
*
|
|
14
|
-
* ### type
|
|
15
|
-
*
|
|
16
|
-
* Model type identifier used for dependency injection and type narrowing.
|
|
17
|
-
* Essential for declaring model dependencies in other components.
|
|
18
|
-
*
|
|
19
|
-
* @example Model Dependency Declaration
|
|
11
|
+
* @example
|
|
20
12
|
* ```typescript
|
|
21
|
-
* @kosDependency({modelType: Device.type, id:
|
|
22
|
-
* private
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* ### factory
|
|
26
|
-
*
|
|
27
|
-
* Creates DeviceModel instances with singleton behavior. Multiple calls return the same instance,
|
|
28
|
-
* ensuring system-wide device identity consistency.
|
|
29
|
-
*
|
|
30
|
-
* **Singleton Behavior**: Subsequent factory calls return existing instance; options ignored after first creation.
|
|
31
|
-
*
|
|
32
|
-
* @example Device Creation and Identity Access
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const device = Device.factory({
|
|
35
|
-
* serialNumber: 'KOS-DEVICE-001',
|
|
36
|
-
* name: 'Production Dispenser Alpha',
|
|
37
|
-
* nodeId: 'primary-controller'
|
|
38
|
-
* });
|
|
39
|
-
*
|
|
40
|
-
* // Access device identity
|
|
41
|
-
* console.log(`Device: ${device.name} (${device.serialNumber})`);
|
|
42
|
-
* console.log(`Node: ${device.nodeType}-${device.nodeName}`);
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* @example Multi-node System Coordination
|
|
46
|
-
* ```typescript
|
|
47
|
-
* const primaryDevice = Device.factory({ nodeId: 'primary-main' });
|
|
48
|
-
* const backupDevice = Device.factory({ nodeId: 'secondary-backup' });
|
|
49
|
-
*
|
|
50
|
-
* // Coordinate based on node roles
|
|
51
|
-
* if (primaryDevice.nodeType === 'primary') {
|
|
52
|
-
* // Handle primary node responsibilities
|
|
53
|
-
* }
|
|
13
|
+
* @kosDependency({ modelType: Device.type, id: Device.type })
|
|
14
|
+
* private device!: DeviceModel;
|
|
54
15
|
* ```
|
|
55
16
|
*
|
|
56
|
-
* ### predicate
|
|
57
|
-
*
|
|
58
|
-
* [TypeScript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates)
|
|
59
|
-
* for identifying and narrowing models to DeviceModel instances.
|
|
60
|
-
*
|
|
61
|
-
* @example Type Narrowing for Device Operations
|
|
62
|
-
* ```typescript
|
|
63
|
-
* const model: IKosDataModel = getModel(); // some model
|
|
64
|
-
*
|
|
65
|
-
* if (Device.predicate(model)) {
|
|
66
|
-
* // Compiler now knows model is DeviceModel
|
|
67
|
-
* console.log(`Device Serial: ${model.serialNumber}`);
|
|
68
|
-
* model.updateModel({ name: 'Updated Name' });
|
|
69
|
-
* }
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* ### registration
|
|
73
|
-
*
|
|
74
|
-
* Registration object for model registry integration. Provides all required information
|
|
75
|
-
* for registering the DeviceModelImpl implementation with the model registry.
|
|
76
|
-
*
|
|
77
|
-
* @example Model Registry Configuration
|
|
78
|
-
* ```typescript
|
|
79
|
-
* // registration.ts
|
|
80
|
-
* import { Device } from "@kos-ui/project-models";
|
|
81
|
-
* import { KosModelRegistry } from "@kosdev-code/kos-dispense-sdk";
|
|
82
|
-
*
|
|
83
|
-
* KosModelRegistry.dispense
|
|
84
|
-
* .models()
|
|
85
|
-
* .model(Device);
|
|
86
|
-
* ```
|
|
87
|
-
*
|
|
88
|
-
* ## Singleton Architecture
|
|
89
|
-
*
|
|
90
|
-
* **Device models use singleton pattern** ensuring system-wide consistency:
|
|
91
|
-
* - Each device type has exactly one instance
|
|
92
|
-
* - Subsequent factory calls return existing instance
|
|
93
|
-
* - Options are ignored after initial creation
|
|
94
|
-
* - Uses model type as unique identifier
|
|
95
|
-
* - Guarantees device identity consistency across system
|
|
96
|
-
*
|
|
97
17
|
* @group KOS Model
|
|
98
18
|
* @category Device Data
|
|
99
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/device/device-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"device-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/device/device-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,kEAMjB,CAAC"}
|
|
@@ -1,47 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Defines device identity and node-specific parameters for KOS device modeling.
|
|
5
|
-
* Device models represent the physical device identity and node configuration
|
|
6
|
-
* within a KOS system deployment.
|
|
7
|
-
*
|
|
8
|
-
* @example Basic Device Configuration
|
|
9
|
-
* ```typescript
|
|
10
|
-
* const deviceOptions: DeviceOptions = {
|
|
11
|
-
* serialNumber: 'KOS-DEVICE-12345',
|
|
12
|
-
* name: 'Main Beverage Dispenser',
|
|
13
|
-
* nodeId: 'primary-node-01'
|
|
14
|
-
* };
|
|
15
|
-
*
|
|
16
|
-
* const device = Device.factory(deviceOptions);
|
|
17
|
-
* ```
|
|
2
|
+
* Identity fields of a {@link DeviceModel}. The model loads these from the
|
|
3
|
+
* device and applies them with `updateModel`.
|
|
18
4
|
*
|
|
19
5
|
* @kosService core.device
|
|
20
6
|
* @group KOS Model
|
|
21
7
|
* @category Service Integration
|
|
22
8
|
*/
|
|
23
9
|
export interface DeviceOptions {
|
|
24
|
-
/**
|
|
25
|
-
* Unique device serial number from hardware.
|
|
26
|
-
*
|
|
27
|
-
* Retrieved from the device's hardware identification system.
|
|
28
|
-
* Used for warranty tracking, support, and device-specific configuration.
|
|
29
|
-
*/
|
|
10
|
+
/** Hardware serial number. */
|
|
30
11
|
serialNumber?: string;
|
|
31
12
|
|
|
32
|
-
/**
|
|
33
|
-
* Human-readable device name for identification.
|
|
34
|
-
*
|
|
35
|
-
* Typically configured during device setup and used in administrative
|
|
36
|
-
* interfaces for device identification and management.
|
|
37
|
-
*/
|
|
13
|
+
/** Human-readable device name. */
|
|
38
14
|
name?: string;
|
|
39
15
|
|
|
40
|
-
/**
|
|
41
|
-
* Node identifier within the KOS deployment.
|
|
42
|
-
*
|
|
43
|
-
* Identifies the specific node role and instance within a multi-node
|
|
44
|
-
* KOS deployment. Format typically follows 'type-instance' pattern.
|
|
45
|
-
*/
|
|
16
|
+
/** Node identifier within the deployment, in `type-name` form. */
|
|
46
17
|
nodeId?: string;
|
|
47
18
|
}
|
|
@@ -1,40 +1,10 @@
|
|
|
1
1
|
import { FutureAwareContainer, FutureContainer, IFutureModel, MultiFutureAware } from './future-types';
|
|
2
2
|
/**
|
|
3
|
-
* Future handler
|
|
3
|
+
* Future handler that tracks several concurrent Futures by alias.
|
|
4
|
+
* `@kosMultipleFutureAware` installs it as the model's `futureHandler`.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* and receives automatic progress updates and cleanup when operations complete.
|
|
8
|
-
*
|
|
9
|
-
* @example Managing Multiple Operations
|
|
10
|
-
* ```typescript
|
|
11
|
-
* @kosModel("device-maintenance-model")
|
|
12
|
-
* export class DeviceMaintenanceModel implements FutureContainer {
|
|
13
|
-
* futureHandler: MultipleFutureHandler;
|
|
14
|
-
*
|
|
15
|
-
* constructor(modelId: string, options: any, context: KosCreationContext) {
|
|
16
|
-
* this.id = modelId;
|
|
17
|
-
* this.futureHandler = new MultipleFutureHandler(this);
|
|
18
|
-
* }
|
|
19
|
-
*
|
|
20
|
-
* async startCalibration(deviceId: string): Promise<CalibrationResult> {
|
|
21
|
-
* const future = await this.createFuture('/device/calibrate', { deviceId });
|
|
22
|
-
* this.futureHandler.addFuture(future, `calibration-${deviceId}`);
|
|
23
|
-
* return future;
|
|
24
|
-
* }
|
|
25
|
-
*
|
|
26
|
-
* async startCleaning(deviceId: string): Promise<CleaningResult> {
|
|
27
|
-
* const future = await this.createFuture('/device/clean', { deviceId });
|
|
28
|
-
* this.futureHandler.addFuture(future, `cleaning-${deviceId}`);
|
|
29
|
-
* return future;
|
|
30
|
-
* }
|
|
31
|
-
*
|
|
32
|
-
* onFutureUpdate(future: IFutureModel): void {
|
|
33
|
-
* // Handle progress updates from any managed Future
|
|
34
|
-
* console.log(`${future.id}: ${future.progress}% complete`);
|
|
35
|
-
* }
|
|
36
|
-
* }
|
|
37
|
-
* ```
|
|
6
|
+
* Calls without an alias act on the most recently added Future; `future`
|
|
7
|
+
* returns the one stored under the default context.
|
|
38
8
|
*
|
|
39
9
|
* @group KOS Model
|
|
40
10
|
* @category Asynchronous Operations
|
|
@@ -54,43 +24,9 @@ export declare class MultipleFutureHandler<T extends {} = Record<string, unknown
|
|
|
54
24
|
get futureMap(): Map<string, IFutureModel<T>>;
|
|
55
25
|
}
|
|
56
26
|
/**
|
|
57
|
-
* Future handler
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* one operation at a time. Automatically tracks progress and provides reactive
|
|
61
|
-
* status information for UI integration.
|
|
62
|
-
*
|
|
63
|
-
* @example Single Operation Management
|
|
64
|
-
* ```typescript
|
|
65
|
-
* @kosModel("brewing-system-model")
|
|
66
|
-
* export class BrewingSystemModel implements FutureContainer {
|
|
67
|
-
* futureHandler: FutureHandler;
|
|
68
|
-
*
|
|
69
|
-
* constructor(modelId: string, options: any, context: KosCreationContext) {
|
|
70
|
-
* this.id = modelId;
|
|
71
|
-
* this.futureHandler = new FutureHandler(this);
|
|
72
|
-
* }
|
|
73
|
-
*
|
|
74
|
-
* async startBrewingCycle(recipe: Recipe): Promise<BrewingResult> {
|
|
75
|
-
* const future = await this.createFuture('/brewing/start', { recipe });
|
|
76
|
-
* this.futureHandler.addFuture(future);
|
|
77
|
-
* return future;
|
|
78
|
-
* }
|
|
79
|
-
*
|
|
80
|
-
* get isOperationActive(): boolean {
|
|
81
|
-
* return this.futureHandler.status !== 'NOT_RESOLVED';
|
|
82
|
-
* }
|
|
83
|
-
*
|
|
84
|
-
* get operationProgress(): number {
|
|
85
|
-
* return this.futureHandler.progress;
|
|
86
|
-
* }
|
|
87
|
-
*
|
|
88
|
-
* onFutureUpdate(future: IFutureModel): void {
|
|
89
|
-
* // Handle progress updates from the active Future
|
|
90
|
-
* console.log(`Brewing: ${future.progress}% complete`);
|
|
91
|
-
* }
|
|
92
|
-
* }
|
|
93
|
-
* ```
|
|
27
|
+
* Future handler that tracks one Future at a time; adding a Future replaces
|
|
28
|
+
* the previous one. `@kosFutureAware` installs it as the model's
|
|
29
|
+
* `futureHandler`. `status` reads `NOT_RESOLVED` while no Future is held.
|
|
94
30
|
*
|
|
95
31
|
* @group KOS Model
|
|
96
32
|
* @category Asynchronous Operations
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"future-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/future/future-aware.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAExB
|
|
1
|
+
{"version":3,"file":"future-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/future/future-aware.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;GASG;AACH,qBAAa,qBAAqB,CAAC,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CACvE,YAAW,oBAAoB,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEvD,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAiC;IAClD,OAAO,CAAC,SAAS,CAAC,CAAqB;gBAC3B,SAAS,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,EAAE,MAAM;IAQnE,IAAI,UAAU,sBAEb;IAED,IAAI,MAAM,gCAET;IACD,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM;IAajD,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM;IAM3B,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM;IAKxB,IAAI,SAAS,iCAEZ;CACF;AAED;;;;;;;GAOG;AACH,qBAAa,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CACnE,YAAW,oBAAoB,CAAC,CAAC,CAAC;IAElC,OAAO,CAAC,QAAQ,CAAC,CAAa;IAE9B,OAAO,CAAC,OAAO,CAAC,CAAkB;IAClC,OAAO,CAAC,SAAS,CAAC,CAAqB;gBAC3B,SAAS,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;IAK1C,YAAY;IAMZ,IAAI,MAAM,gCAET;IACD,SAAS,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,SAAS;IAIxC,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IAWjC,cAAc,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAEjE,IAAI,UAAU,sBAEb;IACD,IAAI,aAAa,WAEhB;IAED,IAAI,MAAM,WAET;IAED,IAAI,QAAQ,WAEX;IAEK,MAAM;CAUb"}
|
|
@@ -21,8 +21,8 @@ export declare const mapDtoToFutureOptions: (dto: FutureResponse) => IFutureMode
|
|
|
21
21
|
* Maps a `FutureResponse` DTO to an `IFutureModel` object.
|
|
22
22
|
*
|
|
23
23
|
* @remarks
|
|
24
|
-
*
|
|
25
|
-
*
|
|
24
|
+
* Runs as a single action, so readers of the model see one consistent update.
|
|
25
|
+
* A model that has already ended is left unchanged.
|
|
26
26
|
*
|
|
27
27
|
* @params dto - the Data Transfer Object received from the backend
|
|
28
28
|
* @params model - the IModel to be update
|
|
@@ -51,32 +51,12 @@ declare class FutureModel implements IFutureModel {
|
|
|
51
51
|
*/
|
|
52
52
|
cancelFuture(): Promise<void>;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* @returns Status string: "NOT_ACTIVE", "IN_PROGRESS", "Success", or "Fail"
|
|
57
|
-
*
|
|
58
|
-
* @example Monitor Status
|
|
59
|
-
* ```typescript
|
|
60
|
-
* if (future.status === "IN_PROGRESS") {
|
|
61
|
-
* console.log(`Operation running: ${future.progress}% complete`);
|
|
62
|
-
* } else if (future.status === "Success") {
|
|
63
|
-
* console.log("Operation completed successfully!");
|
|
64
|
-
* }
|
|
65
|
-
* ```
|
|
54
|
+
* Status of the operation: the `endState` once it has ended, otherwise
|
|
55
|
+
* `IN_PROGRESS` while progress is reported, or `NOT_ACTIVE`.
|
|
66
56
|
*/
|
|
67
57
|
get status(): FutureEndState | "IN_PROGRESS" | "NOT_ACTIVE";
|
|
68
58
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* @returns Formatted time string (e.g., "5 minutes", "30 seconds") or empty string if unknown
|
|
72
|
-
*
|
|
73
|
-
* @example Display Time Remaining
|
|
74
|
-
* ```typescript
|
|
75
|
-
* const timeLeft = future.timeRemaining;
|
|
76
|
-
* if (timeLeft) {
|
|
77
|
-
* console.log(`${timeLeft} remaining`);
|
|
78
|
-
* }
|
|
79
|
-
* ```
|
|
59
|
+
* Remaining time as text, such as `"5 minutes"`, or an empty string when unknown.
|
|
80
60
|
*/
|
|
81
61
|
get timeRemaining(): string;
|
|
82
62
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"future-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/future/future-model.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,cAAc,EAGd,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAOxE,UAAU,WAAY,SAAQ,YAAY;CAAG;AAI7C;;;;;;;GAOG;AACH,cACM,WAAY,YAAW,YAAY;IACvC,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,aAAa,CAGuB;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;gBAED,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,kBAAkB;IAwB7B;;;;;;;OAOG;IACG,IAAI;IAIV;;OAEG;IACH,MAAM;IAMN;;;;;;;;;;OAUG;IACG,YAAY;IAgBlB
|
|
1
|
+
{"version":3,"file":"future-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/future/future-model.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,cAAc,EAGd,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAOxE,UAAU,WAAY,SAAQ,YAAY;CAAG;AAI7C;;;;;;;GAOG;AACH,cACM,WAAY,YAAW,YAAY;IACvC,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,aAAa,CAGuB;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;gBAED,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,kBAAkB;IAwB7B;;;;;;;OAOG;IACG,IAAI;IAIV;;OAEG;IACH,MAAM;IAMN;;;;;;;;;;OAUG;IACG,YAAY;IAgBlB;;;OAGG;IACH,IAAI,MAAM,kDAMT;IAED;;OAEG;IACH,IAAI,aAAa,WAoChB;IAID;;;;;;;;OAQG;IAIH,mBAAmB,CAAC,MAAM,EAAE,cAAc;CAM3C;AAED,eAAe,WAAW,CAAC"}
|