@kosdev-code/kos-ui-sdk 3.0.26 → 3.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.kos.json +2 -1
- package/common/events/async-event-bus.d.ts +8 -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/companion-instantiator.d.ts +5 -0
- package/core/core/companion-instantiator.d.ts.map +1 -1
- package/core/core/decorators/index.d.ts +1 -0
- package/core/core/decorators/index.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-mixin.d.ts +67 -0
- package/core/core/decorators/kos-mixin.d.ts.map +1 -0
- 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-topic-handler-flow-control.d.ts +11 -3
- package/core/core/decorators/kos-topic-handler-flow-control.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/decorators/propKeys.d.ts +1 -0
- package/core/core/decorators/propKeys.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-index.d.ts +11 -0
- package/core/core/kos-container-index.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/kos-subscription-manager.d.ts.map +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/registration/model-registration.d.ts.map +1 -1
- 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/model-type-guards.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 +692 -11760
- package/index.cjs.map +1 -1
- package/index.js +774 -11846
- 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/expression-parse-cache.d.ts +29 -0
- package/models/models/kos-expression-evaluator/expression-parse-cache.d.ts.map +1 -0
- package/models/models/kos-expression-evaluator/index.d.ts +1 -0
- package/models/models/kos-expression-evaluator/index.d.ts.map +1 -1
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts +73 -105
- 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 +2 -2
- package/{index-D52vEGXT.cjs → software-info-registration-Le3V0a6v.cjs} +11906 -416
- package/software-info-registration-Le3V0a6v.cjs.map +1 -0
- package/{index-Csq0zQtb.js → software-info-registration-kSGacOka.js} +12116 -625
- package/software-info-registration-kSGacOka.js.map +1 -0
- package/testing/index.d.ts +32 -34
- package/testing/index.d.ts.map +1 -1
- package/testing.cjs +2 -1
- package/testing.cjs.map +1 -1
- package/testing.js +2 -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/index-Csq0zQtb.js.map +0 -1
- package/index-D52vEGXT.cjs.map +0 -1
|
@@ -2,30 +2,11 @@ import { IKosDataModel } from '../../../core';
|
|
|
2
2
|
import { FutureResponse } from '../../../services/future';
|
|
3
3
|
import { FutureContainer, IFutureModel } from '../../future/future-types';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* This interface defines all the properties that can be set when initializing
|
|
8
|
-
* a trouble instance. Troubles represent issues, alerts, or conditions that
|
|
9
|
-
* require attention in the KOS system.
|
|
5
|
+
* Options for creating or updating a {@link TroubleModel}, usually mapped from
|
|
6
|
+
* the trouble data the backend sends.
|
|
10
7
|
*
|
|
11
8
|
* @template AdditionalData - Optional type parameter for domain-specific trouble data
|
|
12
9
|
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* const troubleOptions: TroubleOptions = {
|
|
16
|
-
* id: 'low-fluid-001',
|
|
17
|
-
* type: 'FLUID_LEVEL',
|
|
18
|
-
* reason: 'Fluid level below minimum threshold',
|
|
19
|
-
* rank: 7,
|
|
20
|
-
* role: 'operator',
|
|
21
|
-
* color: 'orange',
|
|
22
|
-
* resolvable: true,
|
|
23
|
-
* ifaces: ['fluid-monitor', 'alert-system'],
|
|
24
|
-
* tags: ['maintenance', 'fluid', 'warning'],
|
|
25
|
-
* createTime: new Date().toISOString()
|
|
26
|
-
* };
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
10
|
* @kosService core.trouble-aware
|
|
30
11
|
* @group KOS Model
|
|
31
12
|
* @category Types
|
|
@@ -66,34 +47,17 @@ export interface TroubleOptions<AdditionalData extends object = any> {
|
|
|
66
47
|
}
|
|
67
48
|
|
|
68
49
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* alerts throughout the KOS platform. It provides a unified way to track,
|
|
73
|
-
* display, resolve, and defer various types of operational issues.
|
|
74
|
-
*
|
|
75
|
-
* ## Key Features
|
|
76
|
-
* - **Priority ranking** - Troubles are ranked 1-10 for severity
|
|
77
|
-
* - **Role-based visibility** - Troubles can be filtered by user role
|
|
78
|
-
* - **Resolution support** - Resolvable troubles can be cleared through actions
|
|
79
|
-
* - **Deferral capability** - Troubles can be temporarily deferred
|
|
80
|
-
* - **Future integration** - Async resolution through futures
|
|
81
|
-
* - **Type categorization** - Troubles grouped by type for filtering
|
|
82
|
-
* - **Visual indicators** - Color coding for UI representation
|
|
50
|
+
* An issue, alert or condition reported by the device. A trouble has a rank,
|
|
51
|
+
* type, role and color for display, and may be resolvable (through a future) or
|
|
52
|
+
* deferrable.
|
|
83
53
|
*
|
|
84
54
|
* @template AdditionalData - Type parameter for domain-specific trouble data
|
|
85
55
|
*
|
|
86
56
|
* @interface
|
|
87
|
-
* @example
|
|
57
|
+
* @example
|
|
88
58
|
* ```typescript
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* console.error(`Critical trouble: ${trouble.reason}`);
|
|
92
|
-
* }
|
|
93
|
-
*
|
|
94
|
-
* if (trouble.resolvable) {
|
|
95
|
-
* const futureResponse = await trouble.resolve();
|
|
96
|
-
* }
|
|
59
|
+
* if (trouble.resolvable) {
|
|
60
|
+
* await trouble.resolve();
|
|
97
61
|
* }
|
|
98
62
|
* ```
|
|
99
63
|
*
|
|
@@ -189,22 +153,8 @@ export interface ContainerTroubleData {
|
|
|
189
153
|
}
|
|
190
154
|
|
|
191
155
|
/**
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* Provides a standard resolution mechanism for troubles and other
|
|
195
|
-
* resolvable conditions in the KOS system. Resolution typically
|
|
196
|
-
* involves sending a command to clear the condition.
|
|
197
|
-
*
|
|
198
|
-
* @example
|
|
199
|
-
* ```typescript
|
|
200
|
-
* class ResolvableTrouble implements ResolveAware {
|
|
201
|
-
* async resolve(tracker?: string) {
|
|
202
|
-
* console.log(`Resolving with tracker: ${tracker}`);
|
|
203
|
-
* const response = await sendResolveCommand(this.id, tracker);
|
|
204
|
-
* return response;
|
|
205
|
-
* }
|
|
206
|
-
* }
|
|
207
|
-
* ```
|
|
156
|
+
* Something that can be resolved asynchronously, usually by sending the
|
|
157
|
+
* backend a command that clears the condition.
|
|
208
158
|
*
|
|
209
159
|
* @kosService core.trouble-aware
|
|
210
160
|
* @group KOS Model
|
|
@@ -221,35 +171,8 @@ export interface ResolveAware {
|
|
|
221
171
|
}
|
|
222
172
|
|
|
223
173
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
* Deferral allows temporary postponement of trouble handling or
|
|
227
|
-
* other actions. Deferred items can be cleared to restore normal
|
|
228
|
-
* processing. This is useful for managing low-priority issues
|
|
229
|
-
* during critical operations.
|
|
230
|
-
*
|
|
231
|
-
* @example
|
|
232
|
-
* ```typescript
|
|
233
|
-
* class DeferrableTrouble implements DeferAware {
|
|
234
|
-
* shouldDefer = false;
|
|
235
|
-
* deferred = false;
|
|
236
|
-
*
|
|
237
|
-
* defer() {
|
|
238
|
-
* this.deferred = true;
|
|
239
|
-
* console.log('Trouble deferred');
|
|
240
|
-
* }
|
|
241
|
-
*
|
|
242
|
-
* clearDefer() {
|
|
243
|
-
* this.deferred = false;
|
|
244
|
-
* console.log('Deferral cleared');
|
|
245
|
-
* }
|
|
246
|
-
* }
|
|
247
|
-
*
|
|
248
|
-
* // Usage
|
|
249
|
-
* if (trouble.shouldDefer && !trouble.deferred) {
|
|
250
|
-
* trouble.defer();
|
|
251
|
-
* }
|
|
252
|
-
* ```
|
|
174
|
+
* Something whose handling can be postponed. A deferred item stays deferred
|
|
175
|
+
* until `clearDefer` is called.
|
|
253
176
|
*
|
|
254
177
|
* @kosService core.trouble-aware
|
|
255
178
|
* @group KOS Model
|
|
@@ -266,87 +189,8 @@ export interface DeferAware {
|
|
|
266
189
|
clearDefer: VoidFunction;
|
|
267
190
|
}
|
|
268
191
|
/**
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
* TroubleAware provides a standardized way for KOS models to expose
|
|
272
|
-
* their trouble states, making it easy to monitor, display, and react
|
|
273
|
-
* to issues throughout the system. Any model implementing this interface
|
|
274
|
-
* can be monitored for troubles and integrated with trouble management UI.
|
|
275
|
-
*
|
|
276
|
-
* ## Key Concepts
|
|
277
|
-
* - **Trouble aggregation** - Models can aggregate troubles from multiple sources
|
|
278
|
-
* - **Status summary** - Provides a single status string for quick checks
|
|
279
|
-
* - **Type grouping** - Troubles organized by type for filtering and display
|
|
280
|
-
* - **Read-only access** - Troubles are exposed as readonly for safety
|
|
281
|
-
*
|
|
282
|
-
* @example
|
|
283
|
-
* ```typescript
|
|
284
|
-
* // Check if a model has troubles
|
|
285
|
-
* function checkModelHealth(model: TroubleAware) {
|
|
286
|
-
* if (model.troubles.length > 0) {
|
|
287
|
-
* console.warn(`Model has ${model.troubles.length} troubles`);
|
|
288
|
-
* console.warn(`Status: ${model.troubleStatus}`);
|
|
289
|
-
*
|
|
290
|
-
* // Check specific trouble types
|
|
291
|
-
* const errors = model.troublesByType['ERROR'] || [];
|
|
292
|
-
* const warnings = model.troublesByType['WARNING'] || [];
|
|
293
|
-
*
|
|
294
|
-
* if (errors.length > 0) {
|
|
295
|
-
* handleCriticalErrors(errors);
|
|
296
|
-
* }
|
|
297
|
-
* }
|
|
298
|
-
* }
|
|
299
|
-
* ```
|
|
300
|
-
*
|
|
301
|
-
* @example
|
|
302
|
-
* ```typescript
|
|
303
|
-
* // React component using TroubleAware
|
|
304
|
-
* const TroubleIndicator: React.FC<{ model: TroubleAware }> = ({ model }) => {
|
|
305
|
-
* const troubles = model.troubles;
|
|
306
|
-
* const highPriority = troubles.filter(t => t.rank >= 7);
|
|
307
|
-
*
|
|
308
|
-
* if (troubles.length === 0) {
|
|
309
|
-
* return <StatusIcon color="green" />;
|
|
310
|
-
* }
|
|
311
|
-
*
|
|
312
|
-
* return (
|
|
313
|
-
* <div className="trouble-indicator">
|
|
314
|
-
* <StatusIcon color={highPriority.length > 0 ? 'red' : 'yellow'} />
|
|
315
|
-
* <span>{model.troubleStatus}</span>
|
|
316
|
-
* <Badge count={troubles.length} />
|
|
317
|
-
* </div>
|
|
318
|
-
* );
|
|
319
|
-
* };
|
|
320
|
-
* ```
|
|
321
|
-
*
|
|
322
|
-
* @example
|
|
323
|
-
* ```typescript
|
|
324
|
-
* // Implementing TroubleAware
|
|
325
|
-
* class MyModel implements TroubleAware {
|
|
326
|
-
* private _troubles: TroubleModel[] = [];
|
|
327
|
-
*
|
|
328
|
-
* get troubles(): readonly TroubleModel[] {
|
|
329
|
-
* return this._troubles;
|
|
330
|
-
* }
|
|
331
|
-
*
|
|
332
|
-
* get troubleStatus(): string {
|
|
333
|
-
* if (this._troubles.length === 0) return 'OK';
|
|
334
|
-
* const highest = this._troubles.reduce((max, t) =>
|
|
335
|
-
* t.rank > max.rank ? t : max
|
|
336
|
-
* );
|
|
337
|
-
* return highest.reason || 'Unknown issue';
|
|
338
|
-
* }
|
|
339
|
-
*
|
|
340
|
-
* get troublesByType(): Record<string, TroubleModel[]> {
|
|
341
|
-
* return this._troubles.reduce((groups, trouble) => {
|
|
342
|
-
* const type = trouble.type;
|
|
343
|
-
* groups[type] = groups[type] || [];
|
|
344
|
-
* groups[type].push(trouble);
|
|
345
|
-
* return groups;
|
|
346
|
-
* }, {} as Record<string, TroubleModel[]>);
|
|
347
|
-
* }
|
|
348
|
-
* }
|
|
349
|
-
* ```
|
|
192
|
+
* A model that exposes the troubles affecting it, so trouble UI and hooks such
|
|
193
|
+
* as `useTroubleDecoration` can monitor it.
|
|
350
194
|
*
|
|
351
195
|
* @kosService core.trouble-aware
|
|
352
196
|
* @group KOS Model
|
|
@@ -357,27 +201,12 @@ export interface DeferAware {
|
|
|
357
201
|
* @see {@link useTroubleDecoration} - Hook for trouble-based styling
|
|
358
202
|
*/
|
|
359
203
|
export interface TroubleAware {
|
|
360
|
-
/**
|
|
361
|
-
* Array of troubles directly related to this model.
|
|
362
|
-
* Troubles are typically sorted by rank (highest priority first).
|
|
363
|
-
*/
|
|
204
|
+
/** Troubles directly related to this model. */
|
|
364
205
|
readonly troubles: TroubleModel[];
|
|
365
206
|
|
|
366
|
-
/**
|
|
367
|
-
* Summary status string representing the highest priority trouble.
|
|
368
|
-
* Returns a human-readable status or 'OK' if no troubles exist.
|
|
369
|
-
*/
|
|
207
|
+
/** Summary status derived from the model's troubles. */
|
|
370
208
|
readonly troubleStatus: string;
|
|
371
209
|
|
|
372
|
-
/**
|
|
373
|
-
* Troubles organized by their type property.
|
|
374
|
-
* Useful for filtering and categorized display of issues.
|
|
375
|
-
*
|
|
376
|
-
* @example
|
|
377
|
-
* ```typescript
|
|
378
|
-
* const errorTroubles = model.troublesByType['ERROR'] || [];
|
|
379
|
-
* const warningTroubles = model.troublesByType['WARNING'] || [];
|
|
380
|
-
* ```
|
|
381
|
-
*/
|
|
210
|
+
/** Troubles grouped by their `type`. */
|
|
382
211
|
readonly troublesByType: Record<string, TroubleModel[]>;
|
|
383
212
|
}
|
|
@@ -1,94 +1,13 @@
|
|
|
1
1
|
import { TroubleAware } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* Type guard
|
|
4
|
-
*
|
|
5
|
-
* This function performs runtime validation to determine whether a given object
|
|
6
|
-
* has the necessary properties and structure to be considered trouble-aware.
|
|
7
|
-
* It checks for the presence of both the `troubles` array and `troublesByType`
|
|
8
|
-
* object, which are required by the TroubleAware interface.
|
|
3
|
+
* Type guard for {@link TroubleAware}: true when `obj` has a `troubles` array
|
|
4
|
+
* and a `troublesByType` object. It checks structure only, not the contents.
|
|
9
5
|
*
|
|
10
6
|
* @category Utilities
|
|
11
7
|
* @category Trouble Management
|
|
12
8
|
*
|
|
13
|
-
* @param obj - The object to check
|
|
14
|
-
*
|
|
15
|
-
* @returns `true` if the object implements TroubleAware interface, `false` otherwise.
|
|
16
|
-
* When this function returns true, TypeScript will narrow the type of `obj`
|
|
17
|
-
* to `TroubleAware` in the current scope.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* // Basic type guard usage
|
|
22
|
-
* function processModel(model: IKosDataModel) {
|
|
23
|
-
* if (isTroubleAware(model)) {
|
|
24
|
-
* // TypeScript now knows model has troubles property
|
|
25
|
-
* console.log(`Found ${model.troubles.length} troubles`);
|
|
26
|
-
* console.log(`Trouble status: ${model.troubleStatus}`);
|
|
27
|
-
* } else {
|
|
28
|
-
* console.log('Model is not trouble-aware');
|
|
29
|
-
* }
|
|
30
|
-
* }
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```typescript
|
|
35
|
-
* // Using with React hooks for conditional trouble handling
|
|
36
|
-
* const TroubleDisplay: React.FC<{ model: IKosDataModel }> = ({ model }) => {
|
|
37
|
-
* if (!isTroubleAware(model)) {
|
|
38
|
-
* return <div>No trouble tracking available</div>;
|
|
39
|
-
* }
|
|
40
|
-
*
|
|
41
|
-
* // Safe to access trouble properties here
|
|
42
|
-
* const criticalTroubles = model.troubles.filter(t => t.rank > 8);
|
|
43
|
-
* const troubleTypes = Object.keys(model.troublesByType);
|
|
44
|
-
*
|
|
45
|
-
* return (
|
|
46
|
-
* <div>
|
|
47
|
-
* <h3>Trouble Status: {model.troubleStatus}</h3>
|
|
48
|
-
* <p>Critical issues: {criticalTroubles.length}</p>
|
|
49
|
-
* <p>Types: {troubleTypes.join(', ')}</p>
|
|
50
|
-
* </div>
|
|
51
|
-
* );
|
|
52
|
-
* };
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
* // Filtering trouble-aware models from a collection
|
|
58
|
-
* const models: IKosDataModel[] = getAllModels();
|
|
59
|
-
* const troubleAwareModels = models.filter(isTroubleAware);
|
|
60
|
-
*
|
|
61
|
-
* // TypeScript knows troubleAwareModels is TroubleAware[]
|
|
62
|
-
* troubleAwareModels.forEach(model => {
|
|
63
|
-
* const troublesByType = model.troublesByType;
|
|
64
|
-
* Object.entries(troublesByType).forEach(([type, troubles]) => {
|
|
65
|
-
* console.log(`Type ${type}: ${troubles.length} troubles`);
|
|
66
|
-
* });
|
|
67
|
-
* });
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* // Early return pattern for non-trouble-aware models
|
|
73
|
-
* function calculateTroubleSeverity(model: any): number {
|
|
74
|
-
* if (!isTroubleAware(model)) {
|
|
75
|
-
* return 0; // No troubles means no severity
|
|
76
|
-
* }
|
|
77
|
-
*
|
|
78
|
-
* // Calculate weighted severity based on trouble ranks
|
|
79
|
-
* return model.troubles.reduce((total, trouble) => {
|
|
80
|
-
* return total + (trouble.rank * (trouble.deferred ? 0.5 : 1));
|
|
81
|
-
* }, 0);
|
|
82
|
-
* }
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
|
-
* @remarks
|
|
86
|
-
* - This is a runtime check, not a compile-time check
|
|
87
|
-
* - The function checks for structural compatibility, not nominal typing
|
|
88
|
-
* - It validates that `troubles` is specifically an Array instance, not just array-like
|
|
89
|
-
* - The `troublesByType` property must be an object (not null or undefined)
|
|
90
|
-
* - Does not validate the contents of the arrays or object, only their presence and type
|
|
91
|
-
* - This function is commonly used as a guard before accessing trouble-related properties
|
|
9
|
+
* @param obj - The object to check
|
|
10
|
+
* @returns `true` if the object implements TroubleAware
|
|
92
11
|
*
|
|
93
12
|
* @see {@link TroubleAware} - The interface this function checks for
|
|
94
13
|
* @see {@link useTroubleDecoration} - Hook that uses this guard internally
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-trouble-aware.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-ui-sdk/src/models/models/trouble/utils/is-trouble-aware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"is-trouble-aware.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-ui-sdk/src/models/models/trouble/utils/is-trouble-aware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,IAAI,YAAY,CAO7D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TroubleResponse } from '../trouble/services';
|
|
2
|
+
import { TroubleModel, TroubleOptions } from '../trouble/types';
|
|
3
|
+
export interface TroubleDto {
|
|
4
|
+
id: string;
|
|
5
|
+
servicePath: string;
|
|
6
|
+
trouble: TroubleResponse;
|
|
7
|
+
}
|
|
8
|
+
export declare function mapTroubleToOptions(dto: TroubleDto): TroubleOptions;
|
|
9
|
+
export declare function createTroubleModel(dto: TroubleDto): TroubleModel;
|
|
10
|
+
export declare function mapTroubleToDto(trouble: TroubleResponse, servicePath: string): TroubleDto;
|
|
11
|
+
//# sourceMappingURL=trouble-builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trouble-builders.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/trouble-container/trouble-builders.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE1E,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,UAAU,GAAG,cAAc,CAWnE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,GAAG,YAAY,CAEhE;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,MAAM,GAClB,UAAU,CAEZ"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IKosDataModel, IKosIdentifiable, KosContainerAwareWithProp, KosFutureAwareFull, KosLoggerAware, KosModelRegistrationType, PublicModelInterface } from '../../../core';
|
|
2
2
|
import { TroubleResponse } from '../trouble/services';
|
|
3
3
|
import { TroubleModel } from '../trouble/types';
|
|
4
|
+
import { TroubleDto } from './trouble-builders';
|
|
4
5
|
import { TroubleContainerOptions } from './types';
|
|
5
6
|
export declare const MODEL_TYPE = "trouble-container-model";
|
|
6
7
|
export type TroubleContainerModel = PublicModelInterface<TroubleContainerModelImpl>;
|
|
7
|
-
export interface TroubleContainerModelImpl extends KosContainerAwareWithProp<TroubleModel, "troubles">, KosFutureAwareFull, KosLoggerAware {
|
|
8
|
+
export interface TroubleContainerModelImpl extends KosContainerAwareWithProp<TroubleModel, "troubles", TroubleDto>, KosFutureAwareFull, KosLoggerAware {
|
|
8
9
|
}
|
|
9
10
|
export declare class Troubles {
|
|
10
11
|
static readonly INDEX_TROUBLES_BY_IFACE = "byIface";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trouble-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/trouble-container/trouble-container-model.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"trouble-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/trouble-container/trouble-container-model.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAGvB,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAE5B,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;AAClD,MAAM,WAAW,yBACf,SAAQ,yBAAyB,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC,EACrE,kBAAkB,EAClB,cAAc;CAAG;AACrB,qBAAa,QAAQ;IACnB,MAAM,CAAC,QAAQ,CAAC,uBAAuB,aAAa;IACpD,MAAM,CAAC,QAAQ,CAAC,sBAAsB,YAAY;IAClD,MAAM,CAAC,QAAQ,CAAC,uBAAuB,aAAa;IACpD,MAAM,CAAC,QAAQ,CAAC,0BAA0B,gBAAgB;IAC1D,MAAM,CAAC,QAAQ,CAAC,aAAa,UAAU;IACvC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,UAAU;CAC5C;AACD,qBAgBa,yBACX,YAAW,gBAAgB,EAAE,aAAa;IAE1C,MAAM,CAAC,YAAY,EAAE,wBAAwB,CAC3C,yBAAyB,EACzB,uBAAuB,CACxB,CAAC;IACF,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,SAAuB;gBACtB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB;IAMvD,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IASvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBrB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM;IAYjC,oBAAoB,CAAC,EAAE,EAAE,MAAM;IAW/B,kBAAkB,CAAC,OAAO,EAAE,eAAe;CAQ5C"}
|
|
@@ -2,85 +2,15 @@ import { SingletonKosModelRegistrationFactory } from '../../../core';
|
|
|
2
2
|
import { UsbUpdateContainerOptions } from './types';
|
|
3
3
|
import { UsbUpdateContainerModel } from './usb-update-container-model';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Registration for {@link UsbUpdateContainerModel}, a singleton model.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* ## type
|
|
10
|
-
* The type property is a string that identifies the model type.
|
|
11
|
-
* The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently
|
|
12
|
-
* used when declaring dependencies on models.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
*
|
|
17
|
-
* @kosDependency({modelType: UsbUpdateContainer.type, id: "usbUpdateContainerId"})
|
|
18
|
-
* private usbUpdateContainerModel: UsbUpdateContainerModel;
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## factory
|
|
23
|
-
*
|
|
24
|
-
* The factory method creates a factory function that can be used to create new UsbUpdateContainerModel instances.
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
* As this is a singleton model, the factory function accepts the model options as its argument.
|
|
28
|
-
*
|
|
29
|
-
* If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored
|
|
30
|
-
* in this case and the existing model will be returned in its current state.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const model = UsbUpdateContainer.factory({
|
|
35
|
-
* // Add option data
|
|
36
|
-
* });
|
|
37
|
-
* ```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*
|
|
41
|
-
* ## predicate
|
|
42
|
-
*
|
|
43
|
-
* [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a UsbUpdateContainerModel.
|
|
7
|
+
* `type` identifies the model in the registry and in `@kosDependency` declarations.
|
|
8
|
+
* `register()` adds the model to the registry. `instance()` builds or returns the single instance; later calls ignore the options.
|
|
44
9
|
*
|
|
45
10
|
* @example
|
|
46
11
|
* ```typescript
|
|
47
|
-
*
|
|
48
|
-
* const model: IKosDataModel = ...; // some model
|
|
49
|
-
*
|
|
50
|
-
* if (UsbUpdateContainer.predicate(model)) {
|
|
51
|
-
* // if the function evaluates to true, the model is narrowed down to UsbUpdateContainerModel
|
|
52
|
-
* // and the compiler will know that the model has the UsbUpdateContainerModel interface
|
|
53
|
-
* model.updateAvailability(false);
|
|
54
|
-
* }
|
|
12
|
+
* const model = UsbUpdateContainer.instance().options(options).build();
|
|
55
13
|
* ```
|
|
56
|
-
|
|
57
|
-
* ## registration
|
|
58
|
-
*
|
|
59
|
-
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
60
|
-
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
*
|
|
65
|
-
* In an application registration file you can declare the model registration as follows:
|
|
66
|
-
*
|
|
67
|
-
* **registration.ts**
|
|
68
|
-
* ```typescript
|
|
69
|
-
* import { UsbUpdateContainer } from "@kosdev-code/kos-dispense-sdk";
|
|
70
|
-
* ...
|
|
71
|
-
* import { ExtensionManager, IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
72
|
-
* export const kosModels: IKosRegistry["models"] = {
|
|
73
|
-
* ...UsbUpdateContainer.registration,
|
|
74
|
-
* };
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* ## registration.singleton
|
|
78
|
-
|
|
79
|
-
* The usbUpdateContainer model is a singleton model. This means that each time the factory function is called , the same instance will be returned.
|
|
80
|
-
* If the model does not yet exist, it will be created passing in the provided options to initialize it.
|
|
81
|
-
*
|
|
82
|
-
* Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.
|
|
83
|
-
|
|
84
|
-
* */
|
|
14
|
+
*/
|
|
85
15
|
export declare const UsbUpdateContainer: SingletonKosModelRegistrationFactory<UsbUpdateContainerModel, UsbUpdateContainerOptions>;
|
|
86
16
|
//# sourceMappingURL=usb-update-container-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usb-update-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/usb-update/usb-update-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAO5E
|
|
1
|
+
{"version":3,"file":"usb-update-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/usb-update/usb-update-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAO5E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,0FAM7B,CAAC"}
|
|
@@ -2,85 +2,15 @@ import { KosModelRegistrationFactory } from '../../../core';
|
|
|
2
2
|
import { UsbUpdateOptions } from './types';
|
|
3
3
|
import { UsbUpdateModel } from './usb-update-model';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Registration for {@link UsbUpdateModel}.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* ## type
|
|
10
|
-
* The type property is a string that identifies the model type.
|
|
11
|
-
* The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently
|
|
12
|
-
* used when declaring dependencies on models.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
*
|
|
17
|
-
* @kosDependency({modelType: UsbUpdate.type, id: "usbUpdateId"})
|
|
18
|
-
* private usbUpdateModel: UsbUpdateModel;
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## factory
|
|
23
|
-
*
|
|
24
|
-
* The factory method creates a factory function that can be used to create new UsbUpdateModel instances.
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
* The factory function is a curried function that takes the model id as the first argument and the options as the second argument.
|
|
28
|
-
*
|
|
29
|
-
* If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored
|
|
30
|
-
* in this case and the existing model will be returned in its current state.
|
|
7
|
+
* `type` identifies the model in the registry and in `@kosDependency` declarations.
|
|
8
|
+
* `register()` adds the model to the registry. `instance(id)` builds the model, or returns the existing one when the id is already in use.
|
|
31
9
|
*
|
|
32
10
|
* @example
|
|
33
11
|
* ```typescript
|
|
34
|
-
* const model = UsbUpdate.
|
|
35
|
-
* // Add option data
|
|
36
|
-
* });
|
|
12
|
+
* const model = UsbUpdate.instance("usbUpdateId").options(options).build();
|
|
37
13
|
* ```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*
|
|
41
|
-
* ## predicate
|
|
42
|
-
*
|
|
43
|
-
* [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a UsbUpdateModel.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
*
|
|
48
|
-
* const model: IKosDataModel = ...; // some model
|
|
49
|
-
*
|
|
50
|
-
* if (UsbUpdate.predicate(model)) {
|
|
51
|
-
* // if the function evaluates to true, the model is narrowed down to UsbUpdateModel
|
|
52
|
-
* // and the compiler will know that the model has the UsbUpdateModel interface
|
|
53
|
-
* model.updateAvailability(false);
|
|
54
|
-
* }
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
* ## registration
|
|
58
|
-
*
|
|
59
|
-
* The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
|
|
60
|
-
* can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
*
|
|
65
|
-
* In an application registration file you can declare the model registration as follows:
|
|
66
|
-
*
|
|
67
|
-
* **registration.ts**
|
|
68
|
-
* ```typescript
|
|
69
|
-
* import { UsbUpdate } from "@kos-ui/project-models";
|
|
70
|
-
* import { KosModelRegistry } from "@kosdev-code/kos-dispense-sdk";
|
|
71
|
-
*
|
|
72
|
-
* import { initKosProvider } from "@kosdev-code/kos-ui-sdk";
|
|
73
|
-
*
|
|
74
|
-
* KosModelRegistry.dispense
|
|
75
|
-
* .models()
|
|
76
|
-
* .model(UsbUpdate);
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* ## registration.singleton
|
|
80
|
-
|
|
81
|
-
* The usbUpdate model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.
|
|
82
|
-
* If the factory function is called with an ID that already exists, the existing model will be returned.
|
|
83
|
-
|
|
84
|
-
* */
|
|
14
|
+
*/
|
|
85
15
|
export declare const UsbUpdate: KosModelRegistrationFactory<UsbUpdateModel, UsbUpdateOptions>;
|
|
86
16
|
//# sourceMappingURL=usb-update-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usb-update-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/usb-update/usb-update-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD
|
|
1
|
+
{"version":3,"file":"usb-update-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/usb-update/usb-update-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,+DAMpB,CAAC"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A long-running operation whose progress can be observed imperatively.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `awaitFutureCall` adapts a KOS Future, but an XHR upload or an aggregate
|
|
8
|
-
* over several operations can implement it just as well.
|
|
4
|
+
* Progress surfaces (notifications, status indicators, modals) depend on this
|
|
5
|
+
* interface rather than on any producer. `awaitFutureCall` adapts a KOS Future
|
|
6
|
+
* to it; an upload or an aggregate of several operations can implement it too.
|
|
9
7
|
*/
|
|
10
8
|
export interface ProgressOperation<T = unknown> extends Promise<T> {
|
|
11
9
|
/**
|
|
12
|
-
* Percent complete, 0-100.
|
|
13
|
-
*
|
|
10
|
+
* Percent complete, 0-100. A value of 0 or less means the operation has not
|
|
11
|
+
* reported progress yet, so consumers should show an indeterminate state.
|
|
14
12
|
*/
|
|
15
13
|
readonly progress: number;
|
|
16
14
|
/**
|
|
@@ -33,8 +31,7 @@ export interface ProgressOperation<T = unknown> extends Promise<T> {
|
|
|
33
31
|
*/
|
|
34
32
|
cancel(): Promise<void>;
|
|
35
33
|
/**
|
|
36
|
-
*
|
|
37
|
-
* a missing implementation as "unknown".
|
|
34
|
+
* Whether the operation was cancelled. Treat a missing implementation as unknown.
|
|
38
35
|
*/
|
|
39
36
|
isCancelled?(): boolean;
|
|
40
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancellable-promise.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/types/cancellable-promise.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"cancellable-promise.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/types/cancellable-promise.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,OAAO,CAAC,CAAC,CAAC;IAChE;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,IAAI,OAAO,CAAC;IAExB;;;OAGG;IACH,gBAAgB,CACd,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,GACnD,MAAM,IAAI,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,CAAE,SAAQ,iBAAiB,CAAC,CAAC,CAAC;IACjE;;OAEG;IACH,aAAa,IAAI,eAAe,GAAG,SAAS,CAAC;IAE7C;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,eAAe,CAAC,EAAE,eAAe,EACjC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAClC,MAAM,CAAC,EAAE,GAAG,GACX,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACzB,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACpC,kBAAkB,CAAC,CAAC,CAAC,CAAC"}
|