@kosdev-code/kos-ui-sdk 3.0.25 → 3.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.kos.json +3 -2
- 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 +22 -131
- package/core/core/decorators/kos-multiple-future-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-reload-aware.d.ts +14 -14
- package/core/core/decorators/kos-reload-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-service-request-helpers.d.ts +3 -1
- package/core/core/decorators/kos-service-request-helpers.d.ts.map +1 -1
- package/core/core/decorators/kos-service-request.d.ts +85 -265
- package/core/core/decorators/kos-service-request.d.ts.map +1 -1
- package/core/core/decorators/kos-state-machine.d.ts +44 -273
- package/core/core/decorators/kos-state-machine.d.ts.map +1 -1
- package/core/core/decorators/kos-topic-handler-flow-control.d.ts +37 -29
- 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/kosDependency.d.ts +4 -2
- package/core/core/decorators/kosDependency.d.ts.map +1 -1
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/decorators/kosTopicHandler.d.ts +28 -98
- 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/extension/extension-manager.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 +22 -4
- package/core/core/kosCore.d.ts.map +1 -1
- package/core/core/kosModel.d.ts +21 -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-model-component-factory.d.ts +1 -1
- package/core/core/model/kos-model-component-factory.d.ts.map +1 -1
- package/core/core/model/kos-offline-queue.d.ts +1 -1
- package/core/core/model/kos-service-request-manager.d.ts +7 -2
- package/core/core/model/kos-service-request-manager.d.ts.map +1 -1
- package/core/core/model/kos-subscription-manager.d.ts +2 -2
- package/core/core/model/kos-subscription-manager.d.ts.map +1 -1
- package/core/core/model/service-response-store.d.ts +4 -16
- 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/kos-dependency.d.ts +13 -4
- package/core/types/kos-dependency.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 -15
- 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/model-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 +983 -11777
- package/index.cjs.map +1 -1
- package/index.js +1056 -11854
- 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 +5 -5
- package/models/utils/services/kos/daily/service.d.ts.map +1 -1
- package/models/utils/services/vfs/daily/service.d.ts +5 -5
- package/models/utils/services/vfs/daily/service.d.ts.map +1 -1
- package/models/utils/timer-manager.d.ts.map +1 -1
- package/package.json +2 -2
- package/{index-CRb8ucfF.cjs → software-info-registration-Le3V0a6v.cjs} +12187 -986
- package/software-info-registration-Le3V0a6v.cjs.map +1 -0
- package/software-info-registration-kSGacOka.js +24809 -0
- 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-CRb8ucfF.cjs.map +0 -1
- package/index-YzHb2lnB.js +0 -13607
- package/index-YzHb2lnB.js.map +0 -1
|
@@ -7,65 +7,31 @@ export interface KosTroubleAwareOptions {
|
|
|
7
7
|
pathProperty?: string;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Class decorator that
|
|
10
|
+
* Class decorator that makes a KOS model TroubleAware: it gets reactive `troubles`
|
|
11
|
+
* (the troubles whose path matches the model's path), `troublesByType` and
|
|
12
|
+
* `troubleStatus` (an empty string by default). The trouble container is added as a
|
|
13
|
+
* dependency automatically.
|
|
11
14
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* - Adding troubleStatus getter (returns empty string by default)
|
|
16
|
-
* - Adding troublesByType getter that groups troubles by type
|
|
17
|
-
*
|
|
18
|
-
* **Important**: Use TypeScript interface merging to get proper type information:
|
|
19
|
-
*
|
|
20
|
-
* ```typescript
|
|
21
|
-
* // Add ESLint disable comment at top of file, then:
|
|
22
|
-
* interface MyModelImpl extends TroubleAware {}
|
|
23
|
-
*
|
|
24
|
-
* @kosTroubleAware()
|
|
25
|
-
* class MyModelImpl implements IKosDataModel {
|
|
26
|
-
* path: string; // Required for trouble resolution
|
|
27
|
-
*
|
|
28
|
-
* constructor(modelId: string, options: MyOptions) {
|
|
29
|
-
* this.path = options.path;
|
|
30
|
-
* // All TroubleAware properties are now available with full type safety
|
|
31
|
-
* }
|
|
32
|
-
* }
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* The decorator requires the model to have a path property (default) or specify
|
|
36
|
-
* a custom path property via options.
|
|
15
|
+
* The model must expose its device path on `path`, or on the property named by
|
|
16
|
+
* `pathProperty`. Declare an interface with the same name as the class that extends
|
|
17
|
+
* `TroubleAware` (TypeScript interface merging) so the members are typed.
|
|
37
18
|
*
|
|
38
19
|
* @param options Configuration options for the decorator
|
|
39
20
|
* @returns A class decorator
|
|
40
21
|
*
|
|
41
22
|
* @example
|
|
42
23
|
* ```typescript
|
|
43
|
-
* // Default usage - uses this.path
|
|
44
24
|
* interface HolderModelImpl extends TroubleAware {}
|
|
45
25
|
*
|
|
26
|
+
* @kosModel("holder-model")
|
|
46
27
|
* @kosTroubleAware()
|
|
47
28
|
* class HolderModelImpl implements IKosDataModel {
|
|
48
|
-
* path: string;
|
|
29
|
+
* path: string;
|
|
49
30
|
*
|
|
50
31
|
* constructor(modelId: string, options: HolderOptions) {
|
|
51
32
|
* this.path = options.path;
|
|
52
33
|
* }
|
|
53
34
|
* }
|
|
54
|
-
*
|
|
55
|
-
* // Custom path property
|
|
56
|
-
* interface CustomModelImpl extends TroubleAware {}
|
|
57
|
-
*
|
|
58
|
-
* @kosTroubleAware({ pathProperty: 'devicePath' })
|
|
59
|
-
* class CustomModelImpl implements IKosDataModel {
|
|
60
|
-
* devicePath: string; // Custom path property
|
|
61
|
-
*
|
|
62
|
-
* constructor(modelId: string, options: CustomOptions) {
|
|
63
|
-
* this.devicePath = options.devicePath;
|
|
64
|
-
* }
|
|
65
|
-
* }
|
|
66
|
-
*
|
|
67
|
-
* // Type-safe external interface
|
|
68
|
-
* export type HolderModel = PublicModelInterface<HolderModelImpl> & TroubleAware;
|
|
69
35
|
* ```
|
|
70
36
|
*
|
|
71
37
|
* @category KOS Model Decorator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-trouble-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-trouble-aware.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED
|
|
1
|
+
{"version":3,"file":"kos-trouble-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-trouble-aware.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,eAAe,CAC7B,OAAO,CAAC,EAAE,sBAAsB,GAC/B,cAAc,CAsBhB"}
|
|
@@ -19,8 +19,8 @@ export interface KosViewModelOptions {
|
|
|
19
19
|
devToolsEnabled?: boolean;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Interface for ViewModels that support cleanup.
|
|
23
|
-
*
|
|
22
|
+
* Interface for ViewModels that support cleanup. `useViewModel` calls `dispose()` when
|
|
23
|
+
* the ViewModel is replaced or the component unmounts.
|
|
24
24
|
*
|
|
25
25
|
* @kosService core.view-model
|
|
26
26
|
* @kosApiLevel 20
|
|
@@ -29,32 +29,9 @@ export interface IKosViewModelDisposable {
|
|
|
29
29
|
dispose(): void | Promise<void>;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* Interface for ViewModels that require async initialization
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* When a ViewModel implements this interface, the useViewModel hook will:
|
|
36
|
-
* - Call ready() after construction
|
|
37
|
-
* - Track ready state and any errors
|
|
38
|
-
* - Return { viewModel, ready, error } instead of just the viewModel
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```typescript
|
|
42
|
-
* @kosViewModel({ typeId: 'order-summary' })
|
|
43
|
-
* class OrderSummaryViewModel implements IKosViewModelReady {
|
|
44
|
-
* constructor(
|
|
45
|
-
* private order: IOrderModel,
|
|
46
|
-
* private inventory: IInventoryModel
|
|
47
|
-
* ) {}
|
|
48
|
-
*
|
|
49
|
-
* async ready(): Promise<void> {
|
|
50
|
-
* // Await model readiness before ViewModel is considered ready
|
|
51
|
-
* await Promise.all([
|
|
52
|
-
* this.order.whenReady?.(),
|
|
53
|
-
* this.inventory.whenReady?.()
|
|
54
|
-
* ]);
|
|
55
|
-
* }
|
|
56
|
-
* }
|
|
57
|
-
* ```
|
|
32
|
+
* Interface for ViewModels that require async initialization, such as waiting for the
|
|
33
|
+
* models they wrap to be ready. `useViewModel` calls `ready()` after construction and
|
|
34
|
+
* reports its progress through the `ready` and `error` fields of its result.
|
|
58
35
|
*
|
|
59
36
|
* @kosService core.view-model
|
|
60
37
|
* @kosApiLevel 20
|
|
@@ -67,23 +44,8 @@ export interface IKosViewModelReady {
|
|
|
67
44
|
*/
|
|
68
45
|
export declare function hasReadyHook(obj: unknown): obj is IKosViewModelReady;
|
|
69
46
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```typescript
|
|
75
|
-
* interface MyViewModel extends KosLoggerAware {}
|
|
76
|
-
*
|
|
77
|
-
* @kosViewModel({ typeId: 'my-view-model' })
|
|
78
|
-
* @kosLoggerAware()
|
|
79
|
-
* export class MyViewModel {
|
|
80
|
-
* constructor(private readonly model: IMyModel) {}
|
|
81
|
-
*
|
|
82
|
-
* doSomething() {
|
|
83
|
-
* this.logger.info('Doing something');
|
|
84
|
-
* }
|
|
85
|
-
* }
|
|
86
|
-
* ```
|
|
47
|
+
* Members injected by @kosLoggerAware into a ViewModel. Declare an interface with the
|
|
48
|
+
* same name as the class that extends this type (TypeScript interface merging).
|
|
87
49
|
*
|
|
88
50
|
* @kosService core.view-model
|
|
89
51
|
* @kosApiLevel 20
|
|
@@ -96,75 +58,33 @@ export interface KosViewModelLoggerAware {
|
|
|
96
58
|
*/
|
|
97
59
|
export declare function isDisposable(obj: unknown): obj is IKosViewModelDisposable;
|
|
98
60
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
61
|
+
* Class decorator for a ViewModel: a plain class made into a reactive model without the
|
|
62
|
+
* KOS model lifecycle.
|
|
101
63
|
*
|
|
102
|
-
* Use
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
64
|
+
* Use it for state derived from one or more KOS models for a component. Dependencies
|
|
65
|
+
* are passed to the constructor, instances are created with `new` (usually inside
|
|
66
|
+
* `useViewModel`), and there are no lifecycle phases or dependency resolution. A
|
|
67
|
+
* ViewModel may also use @kosLoggerAware, @kosModelEffect and @kosStateMachine; its
|
|
68
|
+
* state machine initializes at construction.
|
|
107
69
|
*
|
|
108
70
|
* @param options Configuration options for the ViewModel
|
|
109
71
|
* @returns A class decorator
|
|
110
72
|
*
|
|
111
73
|
* @example
|
|
112
74
|
* ```typescript
|
|
113
|
-
* // Basic usage
|
|
114
|
-
* @kosViewModel({ typeId: 'counter' })
|
|
115
|
-
* export class CounterViewModel {
|
|
116
|
-
* count = 0;
|
|
117
|
-
*
|
|
118
|
-
* increment() {
|
|
119
|
-
* this.count++;
|
|
120
|
-
* }
|
|
121
|
-
* }
|
|
122
|
-
*
|
|
123
|
-
* // With logger support
|
|
124
|
-
* interface OrderSummaryViewModel extends KosViewModelLoggerAware {}
|
|
125
|
-
*
|
|
126
75
|
* @kosViewModel({ typeId: 'order-summary' })
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* constructor(
|
|
130
|
-
* private readonly order: IOrderModel,
|
|
131
|
-
* private readonly inventory: IInventoryModel
|
|
132
|
-
* ) {
|
|
133
|
-
* this.logger.info('ViewModel created');
|
|
134
|
-
* }
|
|
76
|
+
* export class OrderSummaryViewModel {
|
|
77
|
+
* constructor(private readonly order: IOrderModel) {}
|
|
135
78
|
*
|
|
136
79
|
* get total(): number {
|
|
137
80
|
* return this.order.items.reduce((sum, i) => sum + i.price, 0);
|
|
138
81
|
* }
|
|
139
|
-
*
|
|
140
|
-
* get hasStockIssues(): boolean {
|
|
141
|
-
* return this.order.items.some(item =>
|
|
142
|
-
* this.inventory.getStock(item.productId) < item.quantity
|
|
143
|
-
* );
|
|
144
|
-
* }
|
|
145
|
-
*
|
|
146
|
-
* dispose(): void {
|
|
147
|
-
* this.logger.info('ViewModel disposed');
|
|
148
|
-
* }
|
|
149
82
|
* }
|
|
150
83
|
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* const vm = useViewModel(
|
|
157
|
-
* () => new OrderSummaryViewModel(order!, inventory!),
|
|
158
|
-
* [order, inventory]
|
|
159
|
-
* );
|
|
160
|
-
*
|
|
161
|
-
* return (
|
|
162
|
-
* <div>
|
|
163
|
-
* <p>Total: ${vm.total}</p>
|
|
164
|
-
* {vm.hasStockIssues && <Warning>Some items may be unavailable</Warning>}
|
|
165
|
-
* </div>
|
|
166
|
-
* );
|
|
167
|
-
* }
|
|
84
|
+
* const OrderSummary = kosComponent(({ order }: Props) => {
|
|
85
|
+
* const { viewModel } = useViewModel(() => new OrderSummaryViewModel(order), [order]);
|
|
86
|
+
* return <p>Total: {viewModel.total}</p>;
|
|
87
|
+
* });
|
|
168
88
|
* ```
|
|
169
89
|
*
|
|
170
90
|
* @category KOS ViewModel Decorator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-view-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-view-model.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"kos-view-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-view-model.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAYpD;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,kBAAkB,CAOpE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,uBAAuB,CAOzE;AAuMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,cAAc,CAgB1E"}
|
|
@@ -7,8 +7,10 @@ export * as KosDependencyTypes from '../../types/kos-dependency';
|
|
|
7
7
|
* @param params.modelType The type of the model to be injected.
|
|
8
8
|
* @param params.id The id of the model to be injected.
|
|
9
9
|
* @param params.options The options to be passed to the model constructor.
|
|
10
|
-
* @param params.lifecycle The lifecycle
|
|
11
|
-
*
|
|
10
|
+
* @param params.lifecycle The lifecycle phase that resolves the dependency and waits for it
|
|
11
|
+
* to be ready (default INIT). ACTIVATE and ONLINE resolve again each time the phase repeats.
|
|
12
|
+
* @param params.resolutionPolicy What to do when no model with the id exists: CREATE (default)
|
|
13
|
+
* creates it, CONTINUE leaves the property undefined, FAIL fails the dependent at the phase.
|
|
12
14
|
*
|
|
13
15
|
* @category KOS Model Decorator
|
|
14
16
|
* @kosService core.dependency
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kosDependency.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kosDependency.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AAEjE
|
|
1
|
+
{"version":3,"file":"kosDependency.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kosDependency.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AAEjE;;;;;;;;;;;;;;;KAeK;AACL,eAAO,MAAM,aAAa,GACvB,OAAO,GAAG,OAAO,EAAE,0DAQjB,mBAAmB,CAAC,OAAO,CAAC,MAC9B,QAAQ,EAAE,GAAG,GAAG,EAAE,MAAM,WAAW,KAAG,GAUtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kosModel.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kosModel.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"kosModel.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kosModel.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA0pB5C,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACtC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,CA0DjD"}
|
|
@@ -89,9 +89,9 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
89
89
|
*/
|
|
90
90
|
explicitDestination?: boolean;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
92
|
+
* Delivers events only after a period of inactivity. By default the handler receives
|
|
93
|
+
* an array of every payload received during the delay; with `discardIntermediate`
|
|
94
|
+
* it receives only the last payload.
|
|
95
95
|
* @kosApiLevel 11
|
|
96
96
|
*/
|
|
97
97
|
debounce?: number | {
|
|
@@ -100,9 +100,9 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
100
100
|
discardIntermediate?: boolean;
|
|
101
101
|
};
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
103
|
+
* Limits delivery to once per interval. By default the handler receives an array of
|
|
104
|
+
* every payload received in the interval; with `discardIntermediate` it receives only
|
|
105
|
+
* the first payload in each window.
|
|
106
106
|
* @kosApiLevel 11
|
|
107
107
|
*/
|
|
108
108
|
throttle?: number | {
|
|
@@ -111,7 +111,8 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
111
111
|
discardIntermediate?: boolean;
|
|
112
112
|
};
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
114
|
+
* Holds events until the time window elapses or `maxSize` is reached, then calls the
|
|
115
|
+
* handler once per buffered event.
|
|
115
116
|
* @kosApiLevel 11
|
|
116
117
|
*/
|
|
117
118
|
buffer?: {
|
|
@@ -132,17 +133,8 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
132
133
|
*/
|
|
133
134
|
once?: boolean;
|
|
134
135
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*/
|
|
138
|
-
replay?: {
|
|
139
|
-
/** Number of events to remember and replay */
|
|
140
|
-
bufferSize: number;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* Named wildcard capture for trailing /* patterns.
|
|
144
|
-
* When enabled, the portion after the /* is parsed and passed to the handler.
|
|
145
|
-
* You can optionally specify a name for the captured segment.
|
|
136
|
+
* Name for the segment captured by a trailing `/*` in the topic (default `"path"`).
|
|
137
|
+
* The handler's second argument carries it as `wildcardCapture[wildcardName]`.
|
|
146
138
|
*
|
|
147
139
|
* @example
|
|
148
140
|
* ```typescript
|
|
@@ -152,59 +144,35 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
152
144
|
* wildcardName: "configPath"
|
|
153
145
|
* })
|
|
154
146
|
* handleConfigUpdate(payload: ConfigData, raw: ApiCallbackWithWildcard<any>) {
|
|
155
|
-
* // raw.wildcardCapture
|
|
147
|
+
* // raw.wildcardCapture?.configPath is everything after "/config/system/"
|
|
156
148
|
* }
|
|
157
149
|
* ```
|
|
158
150
|
* @kosApiLevel 12
|
|
159
151
|
*/
|
|
160
152
|
wildcardName?: string;
|
|
161
153
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* on-the-fly transforms, and rate limiting.
|
|
154
|
+
* Flow control applied to the event stream before the handler runs: batching,
|
|
155
|
+
* transforms, stateful filtering, rate limiting and retry.
|
|
165
156
|
*
|
|
166
|
-
* @example
|
|
167
|
-
* ```typescript
|
|
168
|
-
* @kosTopicHandler({
|
|
169
|
-
* topic: 'sensor.data',
|
|
170
|
-
* websocket: true,
|
|
171
|
-
* flow: {
|
|
172
|
-
* batch: { size: 50, window: 1000 },
|
|
173
|
-
* transform: (events) => aggregateEvents(events),
|
|
174
|
-
* backpressure: { maxConcurrent: 3 }
|
|
175
|
-
* }
|
|
176
|
-
* })
|
|
177
|
-
* handleProcessedEvents(aggregatedData) {
|
|
178
|
-
* // Receives transformed, batched data with backpressure control
|
|
179
|
-
* }
|
|
180
|
-
* ```
|
|
181
157
|
* @kosApiLevel 12
|
|
182
158
|
*/
|
|
183
159
|
flow?: FlowControlOptions<Response, TransformedResponse>;
|
|
184
160
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* temporal comparison with the baseline request/response timing.
|
|
161
|
+
* Makes the handler wait for a baseline service request to complete before it
|
|
162
|
+
* processes events. Events received earlier are queued and replayed according to
|
|
163
|
+
* `replayStrategy`, which compares them with the baseline request timing.
|
|
189
164
|
*
|
|
190
165
|
* @example
|
|
191
166
|
* ```typescript
|
|
192
167
|
* @kosTopicHandler({
|
|
193
168
|
* topic: TOPIC_INGREDIENT_UPDATE,
|
|
194
169
|
* websocket: true,
|
|
195
|
-
* lifecycle: DependencyLifecycle.READY,
|
|
196
170
|
* requiresBaseline: {
|
|
197
171
|
* path: PATH_INGREDIENTS,
|
|
198
|
-
*
|
|
199
|
-
* replayStrategy: 'after-request'
|
|
172
|
+
* replayStrategy: ReplayStrategy.AFTER_REQUEST
|
|
200
173
|
* }
|
|
201
174
|
* })
|
|
202
|
-
* handleIngredientUpdate(payload: IngredientUpdatePayload) {
|
|
203
|
-
* // Framework guarantees:
|
|
204
|
-
* // 1. Baseline loaded before this handler executes
|
|
205
|
-
* // 2. Queued events replayed with temporal filtering
|
|
206
|
-
* // 3. Only events newer than baseline are processed
|
|
207
|
-
* }
|
|
175
|
+
* handleIngredientUpdate(payload: IngredientUpdatePayload) {}
|
|
208
176
|
* ```
|
|
209
177
|
* @kosApiLevel 15
|
|
210
178
|
*/
|
|
@@ -213,61 +181,23 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
213
181
|
/**
|
|
214
182
|
* Decorator for defining a Kos topic handler function within a Kos Data Model class.
|
|
215
183
|
*
|
|
184
|
+
* The handler is called with the (transformed) payload and the raw message. Topics may
|
|
185
|
+
* include property keys from `createPropKey` to resolve per model instance, and a
|
|
186
|
+
* trailing `/*` to match a subtree (see `wildcardName`). When more than one of
|
|
187
|
+
* `debounce`, `throttle`, `buffer` and `once` is set, only the first in that order
|
|
188
|
+
* applies.
|
|
189
|
+
*
|
|
216
190
|
* @param params - An object containing configuration parameters for the topic handler.
|
|
217
191
|
* @returns A decorator function.
|
|
218
192
|
*
|
|
219
|
-
* @example
|
|
220
|
-
* ```typescript
|
|
221
|
-
* @kosTopicHandler({
|
|
222
|
-
* topic: 'temperature/update',
|
|
223
|
-
* websocket: true
|
|
224
|
-
* })
|
|
225
|
-
* handleTemperature(payload: TemperatureData) { }
|
|
226
|
-
* ```
|
|
227
|
-
*
|
|
228
|
-
* @example Debounced handling:
|
|
193
|
+
* @example
|
|
229
194
|
* ```typescript
|
|
230
195
|
* @kosTopicHandler({
|
|
231
|
-
* topic:
|
|
232
|
-
* websocket: true,
|
|
233
|
-
* debounce: 1000 // Wait 1 second after last event
|
|
234
|
-
* })
|
|
235
|
-
* handleRapidUpdates(payload: UpdateData) { }
|
|
236
|
-
* ```
|
|
237
|
-
*
|
|
238
|
-
* @example Buffered batch processing:
|
|
239
|
-
* ```typescript
|
|
240
|
-
* @kosTopicHandler({
|
|
241
|
-
* topic: 'log/entry',
|
|
242
|
-
* websocket: true,
|
|
243
|
-
* buffer: { time: 5000, maxSize: 100 }
|
|
244
|
-
* })
|
|
245
|
-
* handleLogBatch(entries: LogEntry[]) { }
|
|
246
|
-
* ```
|
|
247
|
-
*
|
|
248
|
-
* @example Trailing wildcard with custom name:
|
|
249
|
-
* ```typescript
|
|
250
|
-
* @kosTopicHandler({
|
|
251
|
-
* topic: '/config/system/*',
|
|
252
|
-
* websocket: true,
|
|
253
|
-
* wildcardName: 'configPath'
|
|
254
|
-
* })
|
|
255
|
-
* handleConfigUpdate(payload: ConfigData, raw: ApiCallbackWithWildcard<any>) {
|
|
256
|
-
* // raw.wildcardCapture.configPath = "network/timeout" (everything after "/config/system/")
|
|
257
|
-
* }
|
|
258
|
-
* ```
|
|
259
|
-
*
|
|
260
|
-
* @example Trailing wildcard with PropKeys:
|
|
261
|
-
* ```typescript
|
|
262
|
-
* const DEVICE_ID = createPropKey<DeviceModel>('deviceId');
|
|
263
|
-
*
|
|
264
|
-
* @kosTopicHandler({
|
|
265
|
-
* topic: `/devices/${DEVICE_ID}/sensors/*`,
|
|
196
|
+
* topic: `/devices/${createPropKey<DeviceModel>("deviceId")}/temperature`,
|
|
266
197
|
* websocket: true,
|
|
267
|
-
* wildcardName: 'sensorPath'
|
|
268
198
|
* })
|
|
269
|
-
*
|
|
270
|
-
*
|
|
199
|
+
* handleTemperature(payload: TemperatureData) {
|
|
200
|
+
* this.temperature = payload.value;
|
|
271
201
|
* }
|
|
272
202
|
* ```
|
|
273
203
|
* @category KOS Model Decorator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kosTopicHandler.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kosTopicHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"kosTopicHandler.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kosTopicHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG3E;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IACzE;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBxB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAsB,CACrC,QAAQ,GAAG,GAAG,EACd,KAAK,SAAS,aAAa,GAAG,GAAG,EACjC,mBAAmB,GAAG,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
|
export declare const KosViewModelSymbol: unique symbol;
|
|
26
26
|
export declare const ViewModelConfig: unique symbol;
|
|
27
27
|
export declare const ReloadAwareSetup: unique symbol;
|
|
28
|
+
export declare const MixinModels: unique symbol;
|
|
28
29
|
//# sourceMappingURL=propKeys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propKeys.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/propKeys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,SAAS,eAAsB,CAAC;AAC7C,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,cAAc,eAA2B,CAAC;AACvD,eAAO,MAAM,YAAY,eAAyB,CAAC;AACnD,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,4BAA4B,eAExC,CAAC;AACF,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AACjE,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AACjE,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,gBAAgB,eAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"propKeys.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/propKeys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,SAAS,eAAsB,CAAC;AAC7C,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,cAAc,eAA2B,CAAC;AACvD,eAAO,MAAM,YAAY,eAAyB,CAAC;AACnD,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,4BAA4B,eAExC,CAAC;AACF,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AACjE,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AACjE,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,WAAW,eAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-manager.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/extension/extension-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AAS,MAAM,GAAG,GAAG,IAAI,CACvE,KAAK,EAAE,CAAC,KACL,OAAO,CAAC,CAAC,CAAC,CAAC;AAOhB;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,aAAa,GAAG,GAAG,IAAI,MAAM,CAChE,MAAM,EACN,MAAM,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAC3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,oBAAoB,CAAC;AAC3D;;;GAGG;AACH,eAAO,MAAM,kCAAkC,2CACL,CAAC;AAM3C;;;GAGG;AACH,MAAM,WAAW,cAAc,CAC7B,IAAI,SAAS,MAAM,GAAG,GAAG,EACzB,MAAM,SAAS,MAAM,GAAG,GAAG,EAC3B,OAAO,SAAS,MAAM,GAAG,GAAG;IAE5B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,MAAM,CAAC;CAChE;AACD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,IAAI,MAAM,EACV,gBAAgB,cAAc,SAG/B,CAAC;AAEF,QAAA,MAAM,iBAAiB;;
|
|
1
|
+
{"version":3,"file":"extension-manager.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/extension/extension-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AACtD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UA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AAM,gBAAgB,EAAwB,oBAAoB,CAAC"}
|
|
@@ -6,10 +6,8 @@
|
|
|
6
6
|
* - Decorators: `kosIndexAware` (item-level), `kosContainerIndexAware`
|
|
7
7
|
* (container-level).
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* anything to get it — adding an `@kosIndexAware` item to any
|
|
12
|
-
* container is enough.
|
|
9
|
+
* `KosModelContainer` publishes ADDED and REMOVED for any `@kosIndexAware`
|
|
10
|
+
* item it holds.
|
|
13
11
|
*/
|
|
14
12
|
export { KosContainerIndexEvents } from './topics';
|
|
15
13
|
export { INDEX_COLLECTION_KEY, INDEX_RECORD_SYMBOL, isIndexableItem, type IndexableItem, type IndexAddedEvent, type IndexChangedEvent, type IndexPurgeEvent, type IndexRecord, type IndexRecordContribution, type IndexRemovedEvent, type IndexRequestSeedEvent, type IndexSeedEvent, } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,GACnC,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,35 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Container-level decorator
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `itemsProperty` pointing at the array of items the container
|
|
6
|
-
* exposes.
|
|
2
|
+
* Container-level decorator for the kos-ui-sdk container indexing system.
|
|
3
|
+
* Works with `@kosContainerAware` or `@kosChild`-based containers; it needs
|
|
4
|
+
* only an `itemsProperty` naming the array of items the container exposes.
|
|
7
5
|
*
|
|
8
|
-
*
|
|
6
|
+
* - On `init`, writes the declared collection onto the container's
|
|
7
|
+
* `KosContext`, where items resolve it by walking up the parent chain.
|
|
8
|
+
* - On `KosContainerIndexEvents.REQUEST_SEED`, publishes one SEED event with
|
|
9
|
+
* the records of the current items, so consumers can subscribe at any time.
|
|
10
|
+
* - On `unload`, publishes one PURGE per distinct collection in the current
|
|
11
|
+
* items so consumers can drop those records.
|
|
9
12
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* value via `KosContext.get(INDEX_COLLECTION_KEY)`, which
|
|
13
|
-
* auto-walks the parent chain.
|
|
14
|
-
*
|
|
15
|
-
* 2. Registers a `SubscriptionHandlers` entry for
|
|
16
|
-
* `KosContainerIndexEvents.REQUEST_SEED`. When a consumer
|
|
17
|
-
* publishes that topic, the container reads its current items,
|
|
18
|
-
* maps them via `INDEX_RECORD_SYMBOL`, and emits one SEED
|
|
19
|
-
* event. Lets subscribe order stop mattering.
|
|
20
|
-
*
|
|
21
|
-
* 3. Wraps `unload` to emit one PURGE per distinct collection in
|
|
22
|
-
* the current items, so consumers can drop the collection's
|
|
23
|
-
* records at container teardown.
|
|
24
|
-
*
|
|
25
|
-
* Membership detection (ADDED, REMOVED) is owned by
|
|
26
|
-
* `KosModelContainer` itself, not this decorator — the events fire
|
|
27
|
-
* at the moment of mutation, with no diffing or property-watching
|
|
28
|
-
* involved.
|
|
29
|
-
*
|
|
30
|
-
* Modeled on `kos-studio-state-aware`: class decorator, options
|
|
31
|
-
* object, `target.prototype[ModelEffects]` / `[SubscriptionHandlers]`
|
|
32
|
-
* registration pattern.
|
|
13
|
+
* ADDED and REMOVED events come from `KosModelContainer` itself at the moment
|
|
14
|
+
* of mutation.
|
|
33
15
|
*
|
|
34
16
|
* @kosService core.indexing
|
|
35
17
|
* @kosApiLevel 22
|
|
@@ -37,21 +19,15 @@
|
|
|
37
19
|
export interface KosContainerIndexAwareOptions {
|
|
38
20
|
/**
|
|
39
21
|
* Name of the property on the container that exposes its items
|
|
40
|
-
* as an array
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* collection).
|
|
44
|
-
*
|
|
45
|
-
* Used for SEED re-emission and PURGE. Membership add/remove
|
|
46
|
-
* events come from `KosModelContainer` directly and do not
|
|
47
|
-
* depend on this property.
|
|
22
|
+
* as an array, such as the `data` getter from `@kosContainerAware` or a
|
|
23
|
+
* custom getter on a `@kosChild`-managed collection. Used for SEED and
|
|
24
|
+
* PURGE; ADDED and REMOVED do not depend on it.
|
|
48
25
|
*/
|
|
49
26
|
itemsProperty: string;
|
|
50
27
|
/**
|
|
51
28
|
* Collection tag written onto the container's own `KosContext`
|
|
52
|
-
* so child items
|
|
53
|
-
*
|
|
54
|
-
* (heterogeneous containers).
|
|
29
|
+
* so child items inherit it. Optional when items declare their own
|
|
30
|
+
* `collection` through `@kosIndexAware`.
|
|
55
31
|
*/
|
|
56
32
|
collection?: string;
|
|
57
33
|
}
|
|
@@ -59,7 +35,7 @@ export interface KosContainerIndexAwareOptions {
|
|
|
59
35
|
* Class decorator that wires a container model into the kos-ui-sdk
|
|
60
36
|
* indexing system.
|
|
61
37
|
*
|
|
62
|
-
* @example
|
|
38
|
+
* @example
|
|
63
39
|
* ```ts
|
|
64
40
|
* @kosModel("image-container-model")
|
|
65
41
|
* @kosContainerAware<IImageModel>()
|
|
@@ -67,13 +43,6 @@ export interface KosContainerIndexAwareOptions {
|
|
|
67
43
|
* class ImageContainerModelImpl implements IKosDataModel { ... }
|
|
68
44
|
* ```
|
|
69
45
|
*
|
|
70
|
-
* @example Heterogeneous container — items declare their own collection
|
|
71
|
-
* ```ts
|
|
72
|
-
* @kosModel("virtual-machine-container-model")
|
|
73
|
-
* @kosContainerIndexAware({ itemsProperty: "virtualMachines" })
|
|
74
|
-
* class VirtualMachineContainerModelImpl implements IKosDataModel { ... }
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
46
|
* @category KOS Model Decorator
|
|
78
47
|
* @kosService core.indexing
|
|
79
48
|
* @kosApiLevel 22
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-container-index-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/kos-container-index-aware.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"kos-container-index-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/kos-container-index-aware.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;GAiBG;AAqBH,MAAM,WAAW,6BAA6B;IAC5C;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,6BAA6B,GACrC,cAAc,CAWhB"}
|