@kosdev-code/kos-ui-sdk 0.1.0-next.944 → 0.1.0-next.958
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.kos.json +2 -1
- package/common/events/async-event-bus.d.ts +2 -11
- package/common/events/async-event-bus.d.ts.map +1 -1
- package/common/events/eventBus.d.ts +1 -18
- package/common/events/eventBus.d.ts.map +1 -1
- package/core/core/decorators/kos-child.d.ts +2 -3
- package/core/core/decorators/kos-child.d.ts.map +1 -1
- package/core/core/decorators/kos-companion.d.ts +25 -87
- package/core/core/decorators/kos-companion.d.ts.map +1 -1
- package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts +2 -0
- package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts.map +1 -0
- package/core/core/decorators/kos-container-aware.d.ts +191 -420
- package/core/core/decorators/kos-container-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-execute-service-request.d.ts +7 -11
- package/core/core/decorators/kos-execute-service-request.d.ts.map +1 -1
- package/core/core/decorators/kos-execution-context.d.ts +14 -31
- package/core/core/decorators/kos-execution-context.d.ts.map +1 -1
- package/core/core/decorators/kos-future-aware.d.ts +21 -74
- package/core/core/decorators/kos-future-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-http-decorators.d.ts +18 -62
- package/core/core/decorators/kos-http-decorators.d.ts.map +1 -1
- package/core/core/decorators/kos-logger-aware.d.ts +10 -60
- package/core/core/decorators/kos-logger-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-model-effect.d.ts +10 -9
- package/core/core/decorators/kos-model-effect.d.ts.map +1 -1
- package/core/core/decorators/kos-multiple-future-aware.d.ts +21 -94
- package/core/core/decorators/kos-multiple-future-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-reload-aware.d.ts +14 -16
- package/core/core/decorators/kos-reload-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-service-request.d.ts +80 -238
- package/core/core/decorators/kos-service-request.d.ts.map +1 -1
- package/core/core/decorators/kos-state-machine.d.ts +35 -275
- package/core/core/decorators/kos-state-machine.d.ts.map +1 -1
- package/core/core/decorators/kos-trouble-aware.d.ts +9 -43
- package/core/core/decorators/kos-trouble-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-view-model.d.ts +20 -100
- package/core/core/decorators/kos-view-model.d.ts.map +1 -1
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/decorators/kosTopicHandler.d.ts +28 -89
- package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
- package/core/core/indexing/index.d.ts +2 -4
- package/core/core/indexing/index.d.ts.map +1 -1
- package/core/core/indexing/kos-container-index-aware.d.ts +17 -48
- package/core/core/indexing/kos-container-index-aware.d.ts.map +1 -1
- package/core/core/indexing/kos-index-aware.d.ts +11 -37
- package/core/core/indexing/kos-index-aware.d.ts.map +1 -1
- package/core/core/kos-container-model.d.ts +11 -32
- package/core/core/kos-container-model.d.ts.map +1 -1
- package/core/core/kos-data-container.d.ts +6 -6
- package/core/core/kos-data-container.d.ts.map +1 -1
- package/core/core/kosCore.d.ts +7 -4
- package/core/core/kosCore.d.ts.map +1 -1
- package/core/core/kosModel.d.ts +16 -8
- package/core/core/kosModel.d.ts.map +1 -1
- package/core/core/kosModelManager.d.ts +2 -3
- package/core/core/kosModelManager.d.ts.map +1 -1
- package/core/core/lifecycle/constants.d.ts +6 -2
- package/core/core/lifecycle/constants.d.ts.map +1 -1
- package/core/core/lifecycle/kosCoreLifecycle.d.ts +11 -1
- package/core/core/lifecycle/kosCoreLifecycle.d.ts.map +1 -1
- package/core/core/lifecycle/kosModelLifecycle.d.ts +6 -0
- package/core/core/lifecycle/kosModelLifecycle.d.ts.map +1 -1
- package/core/core/lifecycle/model-machine.d.ts +6 -0
- package/core/core/lifecycle/model-machine.d.ts.map +1 -1
- package/core/core/model/kos-fsm-manager.d.ts +6 -0
- package/core/core/model/kos-fsm-manager.d.ts.map +1 -1
- package/core/core/model/kos-offline-queue.d.ts +1 -1
- package/core/core/model/service-response-store.d.ts +2 -15
- package/core/core/model/service-response-store.d.ts.map +1 -1
- package/core/core/reconnect/reconnect-fixture.d.ts +17 -0
- package/core/core/reconnect/reconnect-fixture.d.ts.map +1 -0
- package/core/core/services/app-startup-service.d.ts +5 -13
- package/core/core/services/app-startup-service.d.ts.map +1 -1
- package/core/core/services/intent-service.d.ts +3 -12
- package/core/core/services/intent-service.d.ts.map +1 -1
- package/core/core/transport/mock/mock-frames.d.ts +3 -3
- package/core/core/transport/transport.d.ts +1 -1
- package/core/core/transport/transport.d.ts.map +1 -1
- package/core/core/transport/webSocketTransport.d.ts +10 -0
- package/core/core/transport/webSocketTransport.d.ts.map +1 -1
- package/core/types/model.d.ts +4 -8
- package/core/types/model.d.ts.map +1 -1
- package/core/types/service-response-store.d.ts +3 -11
- package/core/types/service-response-store.d.ts.map +1 -1
- package/core/types/utils/kos-fetch.d.ts +25 -37
- package/core/types/utils/kos-fetch.d.ts.map +1 -1
- package/core/util/abortable-when.d.ts +5 -6
- package/core/util/abortable-when.d.ts.map +1 -1
- package/core/util/ancestor-path-visitor.d.ts +14 -20
- package/core/util/ancestor-path-visitor.d.ts.map +1 -1
- package/core/util/container-utils.d.ts +26 -159
- package/core/util/container-utils.d.ts.map +1 -1
- package/core/util/date-utils.d.ts +9 -58
- package/core/util/date-utils.d.ts.map +1 -1
- package/core/util/debounce.d.ts +1 -8
- package/core/util/debounce.d.ts.map +1 -1
- package/core/util/kos-fetch.d.ts +1 -1
- package/core/util/kos-fetch.d.ts.map +1 -1
- package/core/util/kos-model-utils.d.ts +10 -11
- package/core/util/kos-model-utils.d.ts.map +1 -1
- package/core/util/model-attribute-utils.d.ts +5 -22
- package/core/util/model-attribute-utils.d.ts.map +1 -1
- package/core/util/promise-utils.d.ts +1 -26
- package/core/util/promise-utils.d.ts.map +1 -1
- package/core/util/service-factory.d.ts +5 -23
- package/core/util/service-factory.d.ts.map +1 -1
- package/core/util/service-request-error.d.ts +3 -5
- package/core/util/service-request-error.d.ts.map +1 -1
- package/core/util/service-response.d.ts +12 -67
- package/core/util/service-response.d.ts.map +1 -1
- package/core/util/transport-not-ready-error.d.ts +11 -13
- package/core/util/transport-not-ready-error.d.ts.map +1 -1
- package/core/util/when-ready.d.ts +1 -8
- package/core/util/when-ready.d.ts.map +1 -1
- package/index.cjs +144 -109
- package/index.cjs.map +1 -1
- package/index.js +173 -138
- package/index.js.map +1 -1
- package/models/decorators/future-service.d.ts +7 -7
- package/models/models/browser-router/browser-router-model.d.ts +10 -39
- package/models/models/browser-router/browser-router-model.d.ts.map +1 -1
- package/models/models/browser-router/browser-router-registration.d.ts +5 -77
- package/models/models/browser-router/browser-router-registration.d.ts.map +1 -1
- package/models/models/browser-router/types/index.d.ts +2 -16
- package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts +5 -77
- package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts.map +1 -1
- package/models/models/canvas-renderer/canvas-renderer-registration.d.ts +5 -75
- package/models/models/canvas-renderer/canvas-renderer-registration.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-model-builder.d.ts +4 -11
- package/models/models/config-bean/config-bean-model-builder.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-model.d.ts +23 -66
- package/models/models/config-bean/config-bean-model.d.ts.map +1 -1
- package/models/models/config-bean-prop/config-bean-prop-model.d.ts +15 -62
- package/models/models/config-bean-prop/config-bean-prop-model.d.ts.map +1 -1
- package/models/models/config-bean-prop/types/index.d.ts +34 -215
- package/models/models/device/device-model.d.ts +20 -199
- package/models/models/device/device-model.d.ts.map +1 -1
- package/models/models/device/device-registration.d.ts +7 -87
- package/models/models/device/device-registration.d.ts.map +1 -1
- package/models/models/device/types/index.d.ts +5 -34
- package/models/models/future/future-aware.d.ts +7 -71
- package/models/models/future/future-aware.d.ts.map +1 -1
- package/models/models/future/future-model-builder.d.ts +2 -2
- package/models/models/future/future-model.d.ts +3 -23
- package/models/models/future/future-model.d.ts.map +1 -1
- package/models/models/future/future-types.d.ts +28 -145
- package/models/models/future/future-types.d.ts.map +1 -1
- package/models/models/gpio-chip/gpio-chip-builders.d.ts +14 -0
- package/models/models/gpio-chip/gpio-chip-builders.d.ts.map +1 -0
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts +2 -1
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts.map +1 -1
- package/models/models/key-value/key-value-model.d.ts +12 -72
- package/models/models/key-value/key-value-model.d.ts.map +1 -1
- package/models/models/key-value/key-value-registration.d.ts +5 -77
- package/models/models/key-value/key-value-registration.d.ts.map +1 -1
- package/models/models/key-value/services/key-value-services.d.ts +13 -72
- package/models/models/key-value/services/key-value-services.d.ts.map +1 -1
- package/models/models/key-value/types/index.d.ts +3 -46
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts +32 -99
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts.map +1 -1
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts +2 -12
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts.map +1 -1
- package/models/models/kos-log-manager/kos-log-manager-model.d.ts +7 -46
- package/models/models/kos-log-manager/kos-log-manager-model.d.ts.map +1 -1
- package/models/models/kos-log-manager/kos-log-manager-registration.d.ts +5 -80
- package/models/models/kos-log-manager/kos-log-manager-registration.d.ts.map +1 -1
- package/models/models/kos-log-manager/types/index.d.ts +13 -156
- package/models/models/kos-time/kos-time-model.d.ts +8 -39
- package/models/models/kos-time/kos-time-model.d.ts.map +1 -1
- package/models/models/kos-time/kos-time-registration.d.ts +6 -73
- package/models/models/kos-time/kos-time-registration.d.ts.map +1 -1
- package/models/models/kos-time/types/index.d.ts +3 -58
- package/models/models/log-block/log-block-container-model.d.ts +2 -118
- package/models/models/log-block/log-block-container-model.d.ts.map +1 -1
- package/models/models/log-block/log-block-container-registration.d.ts +5 -75
- package/models/models/log-block/log-block-container-registration.d.ts.map +1 -1
- package/models/models/log-block/log-block-model.d.ts +5 -168
- package/models/models/log-block/log-block-model.d.ts.map +1 -1
- package/models/models/log-block/log-block-registration.d.ts +5 -75
- package/models/models/log-block/log-block-registration.d.ts.map +1 -1
- package/models/models/log-block/types/index.d.ts +14 -81
- package/models/models/log-stream/log-stream-container-model.d.ts +8 -35
- package/models/models/log-stream/log-stream-container-model.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-container-registration.d.ts +5 -75
- package/models/models/log-stream/log-stream-container-registration.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-model.d.ts +8 -29
- package/models/models/log-stream/log-stream-model.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-registration.d.ts +5 -75
- package/models/models/log-stream/log-stream-registration.d.ts.map +1 -1
- package/models/models/log-stream/types/index.d.ts +5 -60
- package/models/models/network-interface/network-interface-container-model.d.ts +6 -35
- package/models/models/network-interface/network-interface-container-model.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-container-registration.d.ts +5 -73
- package/models/models/network-interface/network-interface-container-registration.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-model.d.ts +5 -43
- package/models/models/network-interface/network-interface-model.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-registration.d.ts +5 -73
- package/models/models/network-interface/network-interface-registration.d.ts.map +1 -1
- package/models/models/network-interface/types/index.d.ts +2 -16
- package/models/models/ota/ota-model.d.ts +11 -39
- package/models/models/ota/ota-model.d.ts.map +1 -1
- package/models/models/ota/ota-registration.d.ts +5 -77
- package/models/models/ota/ota-registration.d.ts.map +1 -1
- package/models/models/ota/types/index.d.ts +2 -141
- package/models/models/region-info/types/index.d.ts +19 -99
- package/models/models/region-info/types/index.d.ts.map +1 -1
- package/models/models/software-info/services/software-info-services.d.ts +2 -14
- package/models/models/software-info/services/software-info-services.d.ts.map +1 -1
- package/models/models/software-info/software-info-model.d.ts +3 -39
- package/models/models/software-info/software-info-model.d.ts.map +1 -1
- package/models/models/software-info/software-info-registration.d.ts +6 -73
- package/models/models/software-info/software-info-registration.d.ts.map +1 -1
- package/models/models/software-info/types/index.d.ts +6 -20
- package/models/models/state-bean/state-bean-model.d.ts +10 -41
- package/models/models/state-bean/state-bean-model.d.ts.map +1 -1
- package/models/models/state-bean/state-bean-registration.d.ts +6 -73
- package/models/models/state-bean/state-bean-registration.d.ts.map +1 -1
- package/models/models/state-bean/types/index.d.ts +4 -84
- package/models/models/state-prop/state-prop-model.d.ts +6 -40
- package/models/models/state-prop/state-prop-model.d.ts.map +1 -1
- package/models/models/state-prop/state-prop-registration.d.ts +6 -73
- package/models/models/state-prop/state-prop-registration.d.ts.map +1 -1
- package/models/models/state-prop/types/index.d.ts +5 -37
- package/models/models/storage-device/storage-device-container-model.d.ts +7 -273
- package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-container-registration.d.ts +5 -75
- package/models/models/storage-device/storage-device-container-registration.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-model.d.ts +3 -49
- package/models/models/storage-device/storage-device-model.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-registration.d.ts +5 -75
- package/models/models/storage-device/storage-device-registration.d.ts.map +1 -1
- package/models/models/storage-device/types/index.d.ts +13 -82
- package/models/models/studio-properties/studio-properties-model.d.ts +13 -36
- package/models/models/studio-properties/studio-properties-model.d.ts.map +1 -1
- package/models/models/studio-properties/studio-properties-registration.d.ts +5 -75
- package/models/models/studio-properties/studio-properties-registration.d.ts.map +1 -1
- package/models/models/studio-properties/types/index.d.ts +2 -24
- package/models/models/translation/descriptor-merge.d.ts +13 -17
- package/models/models/translation/descriptor-merge.d.ts.map +1 -1
- package/models/models/translation/services/translation-services.d.ts +19 -77
- package/models/models/translation/services/translation-services.d.ts.map +1 -1
- package/models/models/translation/test-harness.d.ts +6 -8
- package/models/models/translation/test-harness.d.ts.map +1 -1
- package/models/models/translation/translation-container-model.d.ts +7 -59
- package/models/models/translation/translation-container-model.d.ts.map +1 -1
- package/models/models/translation/translation-container-registration.d.ts +6 -73
- package/models/models/translation/translation-container-registration.d.ts.map +1 -1
- package/models/models/translation/translation-model.d.ts +17 -50
- package/models/models/translation/translation-model.d.ts.map +1 -1
- package/models/models/translation/translation-registration.d.ts +6 -73
- package/models/models/translation/translation-registration.d.ts.map +1 -1
- package/models/models/translation/types/index.d.ts +51 -276
- package/models/models/trouble/trouble-registration.d.ts +6 -73
- package/models/models/trouble/trouble-registration.d.ts.map +1 -1
- package/models/models/trouble/types/index.d.ts +17 -188
- package/models/models/trouble/utils/is-trouble-aware.d.ts +4 -85
- package/models/models/trouble/utils/is-trouble-aware.d.ts.map +1 -1
- package/models/models/trouble-container/trouble-builders.d.ts +11 -0
- package/models/models/trouble-container/trouble-builders.d.ts.map +1 -0
- package/models/models/trouble-container/trouble-container-model.d.ts +2 -1
- package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
- package/models/models/usb-update/usb-update-container-registration.d.ts +5 -75
- package/models/models/usb-update/usb-update-container-registration.d.ts.map +1 -1
- package/models/models/usb-update/usb-update-registration.d.ts +5 -75
- package/models/models/usb-update/usb-update-registration.d.ts.map +1 -1
- package/models/types/cancellable-promise.d.ts +6 -9
- package/models/types/cancellable-promise.d.ts.map +1 -1
- package/models/utils/await-future-call.d.ts +9 -21
- package/models/utils/await-future-call.d.ts.map +1 -1
- package/models/utils/cancellable-future-call.d.ts +8 -19
- package/models/utils/cancellable-future-call.d.ts.map +1 -1
- package/models/utils/cancellable-service.d.ts +14 -23
- package/models/utils/cancellable-service.d.ts.map +1 -1
- package/models/utils/conversion-utils.d.ts +8 -48
- package/models/utils/conversion-utils.d.ts.map +1 -1
- package/models/utils/persistence-store.d.ts +1 -1
- package/models/utils/service.d.ts +14 -48
- package/models/utils/service.d.ts.map +1 -1
- package/models/utils/services/kos/daily/service.d.ts +4 -4
- package/models/utils/services/vfs/daily/service.d.ts +4 -4
- package/models/utils/timer-manager.d.ts.map +1 -1
- package/package.json +3 -3
- package/{software-info-registration-CKlTQPet.js → software-info-registration-C8kf-pBB.js} +551 -530
- package/software-info-registration-C8kf-pBB.js.map +1 -0
- package/{software-info-registration-GUbTY4KD.cjs → software-info-registration-Y1iADHWT.cjs} +522 -501
- package/software-info-registration-Y1iADHWT.cjs.map +1 -0
- package/testing/index.d.ts +28 -33
- package/testing/index.d.ts.map +1 -1
- package/testing.cjs +1 -1
- package/testing.cjs.map +1 -1
- package/testing.js +1 -1
- package/testing.js.map +1 -1
- package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts +9 -0
- package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts.map +1 -0
- package/ui/components/connection-dev-button/index.d.ts +36 -0
- package/ui/components/connection-dev-button/index.d.ts.map +1 -0
- package/ui/components/connection-dev-button/use-connection-dev-state.d.ts +29 -0
- package/ui/components/connection-dev-button/use-connection-dev-state.d.ts.map +1 -0
- package/ui/components/index.d.ts +1 -0
- package/ui/components/index.d.ts.map +1 -1
- package/ui/features/canvas/hooks/use-image-renderer.d.ts +5 -4
- package/ui/features/canvas/hooks/use-image-renderer.d.ts.map +1 -1
- package/ui/hooks/use-function-warmup.d.ts +4 -14
- package/ui/hooks/use-function-warmup.d.ts.map +1 -1
- package/ui/hooks/use-kos-date-formats.d.ts +15 -29
- package/ui/hooks/use-kos-date-formats.d.ts.map +1 -1
- package/ui/hooks/use-kos-region-timezones.d.ts +4 -55
- package/ui/hooks/use-kos-region-timezones.d.ts.map +1 -1
- package/ui/hooks/use-kos-regions.d.ts +11 -23
- package/ui/hooks/use-kos-regions.d.ts.map +1 -1
- package/ui/hooks/use-kos-time-formats.d.ts +16 -31
- package/ui/hooks/use-kos-time-formats.d.ts.map +1 -1
- package/ui/hooks/use-kos-unit-systems.d.ts +13 -27
- package/ui/hooks/use-kos-unit-systems.d.ts.map +1 -1
- package/ui/hooks/view-model/use-view-model.d.ts +6 -31
- package/ui/hooks/view-model/use-view-model.d.ts.map +1 -1
- package/ui/policies/reload-on-disconnect-policy.d.ts +5 -6
- package/ui/policies/reload-on-disconnect-policy.d.ts.map +1 -1
- package/software-info-registration-CKlTQPet.js.map +0 -1
- package/software-info-registration-GUbTY4KD.cjs.map +0 -1
|
@@ -2,85 +2,15 @@ import { KosModelRegistrationFactory } from '../../../core';
|
|
|
2
2
|
import { LogBlockContainerModel } from './log-block-container-model';
|
|
3
3
|
import { LogBlockContainerOptions } from './types';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Registration for {@link LogBlockContainerModel}.
|
|
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: LogBlockContainer.type, id: "logBlockContainerId"})
|
|
18
|
-
* private logBlockContainerModel: LogBlockContainerModel;
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## factory
|
|
23
|
-
*
|
|
24
|
-
* The factory method creates a factory function that can be used to create new LogBlockContainerModel 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 = LogBlockContainer.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 LogBlockContainerModel.
|
|
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.
|
|
44
9
|
*
|
|
45
10
|
* @example
|
|
46
11
|
* ```typescript
|
|
47
|
-
*
|
|
48
|
-
* const model: IKosDataModel = ...; // some model
|
|
49
|
-
*
|
|
50
|
-
* if (LogBlockContainer.predicate(model)) {
|
|
51
|
-
* // if the function evaluates to true, the model is narrowed down to LogBlockContainerModel
|
|
52
|
-
* // and the compiler will know that the model has the LogBlockContainerModel interface
|
|
53
|
-
* model.updateAvailability(false);
|
|
54
|
-
* }
|
|
12
|
+
* const model = LogBlockContainer.instance("logBlockContainerId").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 { LogBlockContainer } from "@kosdev-code/kos-ui-sdk";
|
|
70
|
-
* ...
|
|
71
|
-
* import { ExtensionManager, IKosRegistry } from "@kosdev-code/kos-ui-sdk";
|
|
72
|
-
* export const kosModels: IKosRegistry["models"] = {
|
|
73
|
-
* ...LogBlockContainer.registration,
|
|
74
|
-
* };
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* ## registration.singleton
|
|
78
|
-
|
|
79
|
-
* The logBlockContainer 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 LogBlockContainer: KosModelRegistrationFactory<LogBlockContainerModel, LogBlockContainerOptions>;
|
|
86
16
|
//# sourceMappingURL=log-block-container-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-block-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/log-block/log-block-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAM1E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"log-block-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/log-block/log-block-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAM1E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,+EAM5B,CAAC"}
|
|
@@ -4,176 +4,13 @@ import { PublicModelInterface } from '../../../core/types';
|
|
|
4
4
|
import { LogBlockOptions } from './types';
|
|
5
5
|
export declare const MODEL_TYPE = "log-block-model";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* manageable, sequential segments with precise line numbering and timing information.
|
|
13
|
-
*
|
|
14
|
-
* ## Key Features
|
|
15
|
-
* - **Block-based Storage** - Efficient memory usage through segmented log storage
|
|
16
|
-
* - **Line Management** - Precise line numbering with start/end tracking
|
|
17
|
-
* - **Time-based Organization** - Temporal ordering with start and end timestamps
|
|
18
|
-
* - **Dynamic Loading** - On-demand synchronization of log lines from source
|
|
19
|
-
* - **Incremental Updates** - Add new lines without full reload
|
|
20
|
-
* - **Stream Integration** - Seamless integration with LogStreamModel containers
|
|
21
|
-
*
|
|
22
|
-
* ## Architecture Relationship
|
|
23
|
-
* LogBlock works as a component within the broader log streaming architecture:
|
|
24
|
-
* - **LogStreamModel** contains multiple LogBlockModels via LogBlockContainerModel
|
|
25
|
-
* - **LogBlockContainerModel** manages and sorts blocks by block number
|
|
26
|
-
* - **LogBlockModel** stores the actual log lines and metadata for a specific segment
|
|
27
|
-
* - This design enables efficient memory usage and fast access to recent log data
|
|
28
|
-
*
|
|
29
|
-
* ## Common Use Cases
|
|
30
|
-
* - **Memory-efficient Log Storage** - Break large log streams into manageable blocks
|
|
31
|
-
* - **Sequential Log Access** - Navigate through log history by block
|
|
32
|
-
* - **Selective Loading** - Load only needed blocks for performance
|
|
33
|
-
* - **Log Line Management** - Add, retrieve, and manage individual log entries
|
|
34
|
-
* - **Time-based Log Analysis** - Filter and analyze logs by time ranges
|
|
35
|
-
* - **Stream Synchronization** - Keep log blocks synchronized with source streams
|
|
7
|
+
* One block of a log stream: its block number, line range, time range and the
|
|
8
|
+
* lines loaded so far. A {@link LogStreamModel} holds its blocks in a
|
|
9
|
+
* {@link LogBlockContainerModel} sorted by block number, and creates and updates
|
|
10
|
+
* them from stream topics. `syncLines` fetches the block's lines from the
|
|
11
|
+
* backend.
|
|
36
12
|
*
|
|
37
13
|
* @interface
|
|
38
|
-
* @example Basic Usage
|
|
39
|
-
* ```typescript
|
|
40
|
-
* // Typically accessed through LogStreamModel, not created directly
|
|
41
|
-
* const logStream = LogStream.instance('app-logs')
|
|
42
|
-
* .options({ name: 'application-logs', nodeId: 'primary' })
|
|
43
|
-
* .build();
|
|
44
|
-
*
|
|
45
|
-
* await logStream.load();
|
|
46
|
-
*
|
|
47
|
-
* // Access blocks within the stream
|
|
48
|
-
* const blocks = logStream.blocks;
|
|
49
|
-
* const currentBlock = logStream.currentBlock;
|
|
50
|
-
*
|
|
51
|
-
* if (currentBlock) {
|
|
52
|
-
* console.log(`Block ${currentBlock.blockNum}`);
|
|
53
|
-
* console.log(`Lines: ${currentBlock.startLineNum}-${currentBlock.endLineNum}`);
|
|
54
|
-
* console.log(`Time range: ${currentBlock.startTime} to ${currentBlock.endTime}`);
|
|
55
|
-
* console.log(`Line count: ${currentBlock.lineCount}`);
|
|
56
|
-
* }
|
|
57
|
-
* ```
|
|
58
|
-
*
|
|
59
|
-
* @example Block Line Management
|
|
60
|
-
* ```typescript
|
|
61
|
-
* // Access through log stream
|
|
62
|
-
* const logStream = LogStream.instance('system-logs').build();
|
|
63
|
-
* const block = logStream.currentBlock;
|
|
64
|
-
*
|
|
65
|
-
* if (block) {
|
|
66
|
-
* // Get current lines
|
|
67
|
-
* console.log(`Block has ${block.lines.length} loaded lines`);
|
|
68
|
-
*
|
|
69
|
-
* // Add new lines (typically done automatically by stream)
|
|
70
|
-
* block.addLines(['New log entry 1', 'New log entry 2']);
|
|
71
|
-
*
|
|
72
|
-
* // Sync with remote source
|
|
73
|
-
* await block.syncLines();
|
|
74
|
-
*
|
|
75
|
-
* // Process lines
|
|
76
|
-
* block.lines.forEach((line, index) => {
|
|
77
|
-
* const globalLineNum = block.startLineNum + index;
|
|
78
|
-
* console.log(`Line ${globalLineNum}: ${line}`);
|
|
79
|
-
* });
|
|
80
|
-
* }
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* @example Block Analysis and Filtering
|
|
84
|
-
* ```typescript
|
|
85
|
-
* // Analyze blocks within a stream
|
|
86
|
-
* const logStream = LogStream.instance('error-logs').build();
|
|
87
|
-
* await logStream.load();
|
|
88
|
-
*
|
|
89
|
-
* // Find blocks within a time range
|
|
90
|
-
* const startTime = new Date('2024-01-01T00:00:00Z');
|
|
91
|
-
* const endTime = new Date('2024-01-01T23:59:59Z');
|
|
92
|
-
*
|
|
93
|
-
* const blocksInRange = logStream.blocks.filter(block =>
|
|
94
|
-
* block.startTime >= startTime && block.endTime <= endTime
|
|
95
|
-
* );
|
|
96
|
-
*
|
|
97
|
-
* console.log(`Found ${blocksInRange.length} blocks in date range`);
|
|
98
|
-
*
|
|
99
|
-
* // Process error logs from specific blocks
|
|
100
|
-
* for (const block of blocksInRange) {
|
|
101
|
-
* await block.syncLines(); // Ensure lines are loaded
|
|
102
|
-
*
|
|
103
|
-
* const errorLines = block.lines
|
|
104
|
-
* .map((line, index) => ({ line, lineNum: block.startLineNum + index }))
|
|
105
|
-
* .filter(({ line }) => line.includes('ERROR'));
|
|
106
|
-
*
|
|
107
|
-
* if (errorLines.length > 0) {
|
|
108
|
-
* console.log(`Block ${block.blockNum} has ${errorLines.length} errors`);
|
|
109
|
-
* errorLines.forEach(({ line, lineNum }) => {
|
|
110
|
-
* console.log(`Line ${lineNum}: ${line}`);
|
|
111
|
-
* });
|
|
112
|
-
* }
|
|
113
|
-
* }
|
|
114
|
-
* ```
|
|
115
|
-
*
|
|
116
|
-
* @example Block Container Integration
|
|
117
|
-
* ```typescript
|
|
118
|
-
* // Access blocks through their container
|
|
119
|
-
* const logStream = LogStream.instance('debug-logs').build();
|
|
120
|
-
* const blockContainer = logStream.blocks; // This is a LogBlockContainerModel
|
|
121
|
-
*
|
|
122
|
-
* // Blocks are automatically sorted by block number
|
|
123
|
-
* const sortedBlocks = blockContainer.data;
|
|
124
|
-
* console.log(`Stream has ${sortedBlocks.length} blocks`);
|
|
125
|
-
*
|
|
126
|
-
* // Get specific block by ID
|
|
127
|
-
* const blockId = 'debug-logs-block-5';
|
|
128
|
-
* const specificBlock = blockContainer.getModel(blockId);
|
|
129
|
-
*
|
|
130
|
-
* if (specificBlock) {
|
|
131
|
-
* console.log(`Block ${specificBlock.blockNum} loaded`);
|
|
132
|
-
* await specificBlock.syncLines();
|
|
133
|
-
* }
|
|
134
|
-
*
|
|
135
|
-
* // Add new block to container (typically done automatically)
|
|
136
|
-
* const newBlockOptions: LogBlockOptions = {
|
|
137
|
-
* nodeId: 'primary',
|
|
138
|
-
* stream: 'debug-logs',
|
|
139
|
-
* blockNum: 10,
|
|
140
|
-
* startLineNum: 1000,
|
|
141
|
-
* endLineNum: 1099,
|
|
142
|
-
* startTime: new Date(),
|
|
143
|
-
* endTime: new Date(Date.now() + 60000),
|
|
144
|
-
* lineCount: 100
|
|
145
|
-
* };
|
|
146
|
-
*
|
|
147
|
-
* const newBlock = LogBlock.instance('debug-logs-block-10')
|
|
148
|
-
* .options(newBlockOptions)
|
|
149
|
-
* .build();
|
|
150
|
-
*
|
|
151
|
-
* blockContainer.addModel(newBlock);
|
|
152
|
-
* ```
|
|
153
|
-
*
|
|
154
|
-
* @example Block Update and Synchronization
|
|
155
|
-
* ```typescript
|
|
156
|
-
* const block = logStream.currentBlock;
|
|
157
|
-
*
|
|
158
|
-
* if (block) {
|
|
159
|
-
* // Update block metadata (typically done by stream management)
|
|
160
|
-
* const updatedOptions: LogBlockOptions = {
|
|
161
|
-
* ...block,
|
|
162
|
-
* endLineNum: block.endLineNum + 50,
|
|
163
|
-
* endTime: new Date(),
|
|
164
|
-
* lineCount: block.lineCount + 50
|
|
165
|
-
* };
|
|
166
|
-
*
|
|
167
|
-
* block.updateModel(updatedOptions);
|
|
168
|
-
*
|
|
169
|
-
* // Sync to get new lines
|
|
170
|
-
* await block.syncLines();
|
|
171
|
-
*
|
|
172
|
-
* console.log(`Block now has ${block.lines.length} lines loaded`);
|
|
173
|
-
* console.log(`Updated end time: ${block.endTime}`);
|
|
174
|
-
* }
|
|
175
|
-
* ```
|
|
176
|
-
*
|
|
177
14
|
* @group KOS Model
|
|
178
15
|
* @category Device Logging
|
|
179
16
|
* @useDeclaredType
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-block-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/log-block/log-block-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EAEb,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"log-block-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/log-block/log-block-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EAEb,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAEpE;;;GAGG;AACH,qBACa,iBAAkB,YAAW,aAAa,EAAE,gBAAgB;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,MAAM,CAAmB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAEhB,GAAG,EAAE,MAAM,CAAC;gBAEV,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,kBAAkB;IAiBvB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAehC,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAQ3C,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAS5C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B"}
|
|
@@ -2,85 +2,15 @@ import { KosModelRegistrationFactory } from '../../../core/core/registration';
|
|
|
2
2
|
import { LogBlockModel } from './log-block-model';
|
|
3
3
|
import { LogBlockOptions } from './types';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Registration for {@link LogBlockModel}.
|
|
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: LogBlock.type, id: "logBlockId"})
|
|
18
|
-
* private logBlockModel: LogBlockModel;
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## factory
|
|
23
|
-
*
|
|
24
|
-
* The factory method creates a factory function that can be used to create new LogBlockModel 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 = LogBlock.
|
|
35
|
-
* // Add option data
|
|
36
|
-
* });
|
|
12
|
+
* const model = LogBlock.instance("logBlockId").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 LogBlockModel.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
*
|
|
48
|
-
* const model: IKosDataModel = ...; // some model
|
|
49
|
-
*
|
|
50
|
-
* if (LogBlock.predicate(model)) {
|
|
51
|
-
* // if the function evaluates to true, the model is narrowed down to LogBlockModel
|
|
52
|
-
* // and the compiler will know that the model has the LogBlockModel 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 { LogBlock } 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(LogBlock);
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* ## registration.singleton
|
|
80
|
-
|
|
81
|
-
* The logBlock 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 LogBlock: KosModelRegistrationFactory<LogBlockModel, LogBlockOptions>;
|
|
86
16
|
//# sourceMappingURL=log-block-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-block-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/log-block/log-block-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"log-block-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/log-block/log-block-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,6DAMnB,CAAC"}
|
|
@@ -1,106 +1,45 @@
|
|
|
1
1
|
// --------------- LogBlock ---------------
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* These options define the metadata and boundaries for a log block, including
|
|
7
|
-
* line numbering, timing information, and stream identification. Used when
|
|
8
|
-
* creating new log blocks or updating existing block metadata.
|
|
9
|
-
*
|
|
10
|
-
* @example Basic Configuration
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const blockOptions: LogBlockOptions = {
|
|
13
|
-
* nodeId: 'primary',
|
|
14
|
-
* stream: 'application-logs',
|
|
15
|
-
* blockNum: 5,
|
|
16
|
-
* startLineNum: 401,
|
|
17
|
-
* endLineNum: 500,
|
|
18
|
-
* startTime: new Date('2024-01-01T10:00:00Z'),
|
|
19
|
-
* endTime: new Date('2024-01-01T10:05:00Z'),
|
|
20
|
-
* lineCount: 100
|
|
21
|
-
* };
|
|
22
|
-
*
|
|
23
|
-
* const logBlock = LogBlock.instance('app-block-5')
|
|
24
|
-
* .options(blockOptions)
|
|
25
|
-
* .build();
|
|
26
|
-
* ```
|
|
4
|
+
* Options for a {@link LogBlockModel}: which stream the block belongs to and
|
|
5
|
+
* its line and time ranges.
|
|
27
6
|
*
|
|
28
7
|
* @kosService core.logging
|
|
29
8
|
* @group KOS Model
|
|
30
9
|
* @category Device Logging
|
|
31
10
|
*/
|
|
32
11
|
export interface LogBlockOptions {
|
|
33
|
-
/**
|
|
34
|
-
* Node identifier where the log block originates.
|
|
35
|
-
*
|
|
36
|
-
* Specifies which KOS device node contains this log block.
|
|
37
|
-
* Used for routing and organization in multi-node environments.
|
|
38
|
-
*/
|
|
12
|
+
/** Id of the node the block's stream comes from. */
|
|
39
13
|
nodeId: string;
|
|
40
14
|
|
|
41
|
-
/**
|
|
42
|
-
* Name of the log stream this block belongs to.
|
|
43
|
-
*
|
|
44
|
-
* Identifies the parent stream that contains this block.
|
|
45
|
-
* Used for organization and cross-referencing with LogStreamModel.
|
|
46
|
-
*/
|
|
15
|
+
/** Name of the log stream the block belongs to. */
|
|
47
16
|
stream: string;
|
|
48
17
|
|
|
49
18
|
/**
|
|
50
|
-
* Sequential block number within the stream.
|
|
51
|
-
*
|
|
52
|
-
* Used for ordering blocks chronologically within a stream.
|
|
53
|
-
* Blocks are automatically sorted by this number in containers.
|
|
19
|
+
* Sequential block number within the stream; containers sort blocks by it.
|
|
54
20
|
*/
|
|
55
21
|
blockNum: number;
|
|
56
22
|
|
|
57
|
-
/**
|
|
58
|
-
* Global line number where this block starts.
|
|
59
|
-
*
|
|
60
|
-
* The first line number in this block relative to the entire stream.
|
|
61
|
-
* Used for accurate line numbering across the complete log stream.
|
|
62
|
-
*/
|
|
23
|
+
/** Stream-wide number of the block's first line. */
|
|
63
24
|
startLineNum: number;
|
|
64
25
|
|
|
65
|
-
/**
|
|
66
|
-
* Global line number where this block ends.
|
|
67
|
-
*
|
|
68
|
-
* The last line number in this block relative to the entire stream.
|
|
69
|
-
* Used with startLineNum to define the block's line range.
|
|
70
|
-
*/
|
|
26
|
+
/** Stream-wide number of the block's last line. */
|
|
71
27
|
endLineNum: number;
|
|
72
28
|
|
|
73
|
-
/**
|
|
74
|
-
* Timestamp when this log block period began.
|
|
75
|
-
*
|
|
76
|
-
* Used for time-based filtering and analysis of log blocks.
|
|
77
|
-
*/
|
|
29
|
+
/** Start of the period the block covers. */
|
|
78
30
|
startTime: Date;
|
|
79
31
|
|
|
80
|
-
/**
|
|
81
|
-
* Timestamp when this log block period ended.
|
|
82
|
-
*
|
|
83
|
-
* Used with startTime to define the temporal range of the block.
|
|
84
|
-
*/
|
|
32
|
+
/** End of the period the block covers. */
|
|
85
33
|
endTime: Date;
|
|
86
34
|
|
|
87
|
-
/**
|
|
88
|
-
* Total number of log lines in this block.
|
|
89
|
-
*
|
|
90
|
-
* Should equal (endLineNum - startLineNum + 1). Used for
|
|
91
|
-
* validation and progress tracking during block loading.
|
|
92
|
-
*/
|
|
35
|
+
/** Number of lines in the block. */
|
|
93
36
|
lineCount: number;
|
|
94
37
|
}
|
|
95
38
|
|
|
96
39
|
// --------------- LogBlockContainer ---------------
|
|
97
40
|
|
|
98
41
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* Currently an empty interface but reserved for future container-level
|
|
102
|
-
* configuration options such as block sorting preferences, memory limits,
|
|
103
|
-
* or automatic cleanup policies.
|
|
42
|
+
* Options for a {@link LogBlockContainerModel}. The container takes none.
|
|
104
43
|
*
|
|
105
44
|
* @kosService core.logging
|
|
106
45
|
* @group KOS Model
|
|
@@ -110,11 +49,8 @@ export interface LogBlockOptions {
|
|
|
110
49
|
export interface LogBlockContainerOptions {}
|
|
111
50
|
|
|
112
51
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* Used in topic handlers for log block events, representing block metadata
|
|
116
|
-
* as received from the KOS system. Similar to LogBlockOptions but uses
|
|
117
|
-
* timestamp numbers instead of Date objects for serialization efficiency.
|
|
52
|
+
* Block metadata as received on log stream topics. Times are milliseconds since
|
|
53
|
+
* the epoch.
|
|
118
54
|
*
|
|
119
55
|
* @kosService core.logging
|
|
120
56
|
* @group KOS Model
|
|
@@ -140,10 +76,7 @@ export interface LogBlockType {
|
|
|
140
76
|
}
|
|
141
77
|
|
|
142
78
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* Used in topic handlers for log line events, containing both the actual
|
|
146
|
-
* log lines and the block metadata. Extends LogBlockType with the lines array.
|
|
79
|
+
* Log lines and their block metadata as received on log stream topics.
|
|
147
80
|
*
|
|
148
81
|
* @kosService core.logging
|
|
149
82
|
* @group KOS Model
|
|
@@ -7,43 +7,16 @@ import { LogStreamModel } from './log-stream-model';
|
|
|
7
7
|
import { LogStreamContainerOptions } from './types';
|
|
8
8
|
export declare const MODEL_TYPE = "log-stream-container-model";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* The device's log streams, one {@link LogStreamModel} per stream, keyed by
|
|
11
|
+
* stream name. On load the container creates a model for each stream the device
|
|
12
|
+
* lists. It adds streams announced on `/kos/logs/streams/add/*` and routes the
|
|
13
|
+
* `/kos/logs/subscription/*` block and line topics to the matching stream.
|
|
14
|
+
* `selectedStream` records the stream the UI is showing.
|
|
11
15
|
*
|
|
12
|
-
*
|
|
13
|
-
* from the KOS system. It provides centralized management of log streams, automatic stream discovery,
|
|
14
|
-
* and coordinated event handling for efficient log processing across multiple sources.
|
|
15
|
-
*
|
|
16
|
-
* ## Topic-Based Reactivity
|
|
17
|
-
* The container listens to these KOS topics for real-time log management:
|
|
18
|
-
* - **`/kos/logs/subscription/addBlock/*`** - Fired when new log blocks are created
|
|
19
|
-
* - **`/kos/logs/subscription/updateBlock/*`** - Fired when existing log blocks are updated
|
|
20
|
-
* - **`/kos/logs/subscription/removeBlock/*`** - Fired when log blocks are removed
|
|
21
|
-
* - **`/kos/logs/subscription/lines/*`** - Fired when new log lines are added to blocks
|
|
22
|
-
* - **`/kos/logs/streams/add/*`** - Fired when new log streams are discovered
|
|
23
|
-
*
|
|
24
|
-
* ## Key Features
|
|
25
|
-
* - **Multi-stream Management** - Handle multiple log streams simultaneously
|
|
26
|
-
* - **Automatic Stream Discovery** - Automatically add new streams as they become available
|
|
27
|
-
* - **Topic-based Synchronization** - Real-time updates via KOS event system
|
|
28
|
-
* - **Stream Selection** - Track currently selected stream for UI purposes
|
|
29
|
-
* - **Block Management** - Coordinate block updates across all managed streams
|
|
30
|
-
*
|
|
31
|
-
* ## Common Use Cases
|
|
32
|
-
* - **Log Dashboard** - Central management of multiple log sources
|
|
33
|
-
* - **System Monitoring** - Monitor logs from all system components
|
|
34
|
-
* - **Debugging Interface** - Switch between different log streams during troubleshooting
|
|
35
|
-
* - **Log Aggregation** - Collect and manage logs from distributed sources
|
|
36
|
-
*
|
|
37
|
-
* @example Basic Usage
|
|
16
|
+
* @example
|
|
38
17
|
* ```typescript
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* .build();
|
|
42
|
-
*
|
|
43
|
-
* // Subscribe to and manage multiple streams
|
|
44
|
-
* await logContainer.subscribeToLogStream('application-logs');
|
|
45
|
-
* const appStream = logContainer.getModel('application-logs');
|
|
46
|
-
* logContainer.updateSelectedStream(appStream);
|
|
18
|
+
* await logStreams.subscribeToLogStream("application-logs");
|
|
19
|
+
* logStreams.updateSelectedStream(logStreams.getModel("application-logs"));
|
|
47
20
|
* ```
|
|
48
21
|
*
|
|
49
22
|
* @group KOS Model
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-stream-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/log-stream/log-stream-container-model.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACV,aAAa,EAEb,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,UAAU,+BAA+B,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"log-stream-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/log-stream/log-stream-container-model.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACV,aAAa,EAEb,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,UAAU,+BAA+B,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,uBAAuB,GACjC,oBAAoB,CAAC,2BAA2B,CAAC,CAAC;AAQpD;;;GAGG;AACH,qBACa,2BACX,YAAW,gBAAgB,EAAE,eAAe,CAAC,cAAc,CAAC,EAAE,aAAa;IAE3E,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,OAAO,CAAC,MAAM,CAAmB;IACjC,4DAA4D;IAC5D,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,uDAAuD;IAC7C,OAAO,CAAC,OAAO,CAAqC;gBAE5D,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,kBAAkB;IAW7B,QAAQ,CAAC,EAAE,EAAE,MAAM;IAGnB,IAAI,MAAM,uCAET;IACD,IAAI,IAAI,qBAEP;IAED,WAAW,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAItD,QAAQ,CAAC,KAAK,EAAE,cAAc;IAI9B,WAAW,CAAC,EAAE,EAAE,MAAM;IAKtB,oBAAoB,CAAC,MAAM,CAAC,EAAE,cAAc;IAQ5C,iBAAiB,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;IAgB1C,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,KAAA;IAa1C,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,KAAA;IAa7C,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,KAAA;IAa7C,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,KAAA;IAQzC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWzD;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAqB5B"}
|