@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-container-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-container-aware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"kos-container-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-container-aware.ts"],"names":[],"mappings":"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"}
|
|
@@ -3,9 +3,9 @@ import { KosExecutionContext } from './kos-execution-context';
|
|
|
3
3
|
import { KosLoggerAware } from './kos-logger-aware';
|
|
4
4
|
import { HttpMethod, ServiceRequestExecutor } from './kos-service-request';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Runs a method-driven service request: checks the injected context, awaits the
|
|
7
|
+
* error-first tuple, logs a failure and treats an empty body as a failure, so the
|
|
8
|
+
* caller handles only the success path.
|
|
9
9
|
*
|
|
10
10
|
* ```typescript
|
|
11
11
|
* const data = await executeServiceRequest(this, $ctx, {
|
|
@@ -14,15 +14,11 @@ import { HttpMethod, ServiceRequestExecutor } from './kos-service-request';
|
|
|
14
14
|
* if (!data) return;
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
-
* Failures are
|
|
18
|
-
* decorator injects — nothing to pass, and nothing to leave stale at the next
|
|
19
|
-
* rename.
|
|
17
|
+
* Failures are logged against the method name the decorator puts on `$ctx.$name`.
|
|
20
18
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* performed, error-first as `(error, data)`, and never receives a context. See
|
|
25
|
-
* `KosExecutionContext`.
|
|
19
|
+
* Use it only with a @kosServiceRequest that has no `lifecycle`. A lifecycle-driven
|
|
20
|
+
* handler receives `(error, data)` with the request already performed and never gets
|
|
21
|
+
* a context.
|
|
26
22
|
*
|
|
27
23
|
* @param host Model the request belongs to; supplies the logger.
|
|
28
24
|
* @param $ctx Context the decorator injected as the method's last parameter.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-execute-service-request.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-execute-service-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEhF
|
|
1
|
+
{"version":3,"file":"kos-execute-service-request.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-execute-service-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjC,IAAI,SAAS,MAAM,KAAK,EACxB,MAAM,SAAS,UAAU,GAAG,KAAK,EACjC,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,EAEjD,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,SAAS,EACvE,MAAM,CAAC,EAAE,UAAU,CAAC,sBAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAClE,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC,CAuB/C"}
|
|
@@ -7,31 +7,20 @@ import { ClientResponse } from '../../util/kos-service-request';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const KOS_EXECUTION_CONTEXT: unique symbol;
|
|
9
9
|
/**
|
|
10
|
-
* Execution context passed
|
|
10
|
+
* Execution context passed as the last parameter of a decorated method, carrying the
|
|
11
|
+
* runtime functionality its decorators inject: `$request` and `$name` from a
|
|
12
|
+
* method-driven @kosServiceRequest, `$tracker` from @kosFuture.
|
|
11
13
|
*
|
|
12
|
-
*
|
|
13
|
-
* into methods without polluting the class interface or relying on magic parameters.
|
|
14
|
-
*
|
|
15
|
-
* Currently used by @kosServiceRequest to inject the $request executor.
|
|
16
|
-
* Designed to be extensible for future decorators that need to inject runtime functionality.
|
|
17
|
-
*
|
|
18
|
-
* @example Using with @kosServiceRequest
|
|
14
|
+
* @example
|
|
19
15
|
* ```typescript
|
|
20
|
-
* @kosServiceRequest({
|
|
21
|
-
*
|
|
22
|
-
* method: 'post'
|
|
23
|
-
* })
|
|
24
|
-
* async createRelease(
|
|
16
|
+
* @kosServiceRequest({ path: PATH_VM_INSTALL, method: 'post' })
|
|
17
|
+
* async install(
|
|
25
18
|
* path: string,
|
|
26
|
-
*
|
|
27
|
-
* ctx: KosExecutionContext<paths, typeof PATH_VM_INSTALL, 'post'>
|
|
19
|
+
* ctx?: KosExecutionContext<paths, typeof PATH_VM_INSTALL, 'post'>
|
|
28
20
|
* ): Promise<void> {
|
|
29
|
-
* const [error, response] = await ctx
|
|
30
|
-
* queryParams: { keySetId: keysetId },
|
|
31
|
-
* body: { path }
|
|
32
|
-
* });
|
|
21
|
+
* const [error, response] = await ctx!.$request!({ body: { path } });
|
|
33
22
|
* if (error) throw new Error(error);
|
|
34
|
-
*
|
|
23
|
+
* this.lastInstall = response;
|
|
35
24
|
* }
|
|
36
25
|
* ```
|
|
37
26
|
*
|
|
@@ -50,12 +39,9 @@ export interface KosExecutionContext<Paths extends Record<string, any> = Record<
|
|
|
50
39
|
*/
|
|
51
40
|
$request?: ServiceRequestExecutor<Paths, Path, Method>;
|
|
52
41
|
/**
|
|
53
|
-
*
|
|
54
|
-
* response when
|
|
55
|
-
*
|
|
56
|
-
* Type-only: never populated at runtime. It exists so `executeServiceRequest`
|
|
57
|
-
* can read the shape off the context, while `$request` keeps returning `any`
|
|
58
|
-
* on its data half, as it always has.
|
|
42
|
+
* Type of what the request yields after the decorator's `transform` (the raw
|
|
43
|
+
* response when there is none). Type-only and never set at runtime;
|
|
44
|
+
* `executeServiceRequest` reads its return type from it.
|
|
59
45
|
*/
|
|
60
46
|
readonly $transformed?: Transformed;
|
|
61
47
|
/**
|
|
@@ -64,11 +50,8 @@ export interface KosExecutionContext<Paths extends Record<string, any> = Record<
|
|
|
64
50
|
*/
|
|
65
51
|
$tracker?: string;
|
|
66
52
|
/**
|
|
67
|
-
* Name of the decorated method (injected by @kosServiceRequest)
|
|
68
|
-
*
|
|
69
|
-
* Lets helpers attribute a failure to its method without the caller passing
|
|
70
|
-
* the name in — a hand-written label silently outlives the rename that
|
|
71
|
-
* invalidates it, and a stale one points at code that no longer exists.
|
|
53
|
+
* Name of the decorated method (injected by @kosServiceRequest), used to attribute
|
|
54
|
+
* failures to the method.
|
|
72
55
|
*/
|
|
73
56
|
$name?: string;
|
|
74
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-execution-context.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-execution-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,eAAgC,CAAC;AAEnE
|
|
1
|
+
{"version":3,"file":"kos-execution-context.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-execution-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,eAAgC,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,mBAAmB,CAClC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACvD,IAAI,SAAS,MAAM,KAAK,GAAG,MAAM,EACjC,MAAM,SAAS,UAAU,GAAG,KAAK,EACjC,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC;IAEjD;;;OAGG;IACH,CAAC,qBAAqB,CAAC,EAAE,IAAI,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAEvD;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC;IAEpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,mBAAmB,CAE1E"}
|
|
@@ -10,49 +10,22 @@ export interface KosFutureAwareOptions {
|
|
|
10
10
|
handlerProperty?: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* Add ESLint disable comment at top of file, then:
|
|
18
|
-
* ```typescript
|
|
19
|
-
* interface BackgroundServiceModelImpl extends KosFutureAwareMinimal {}
|
|
20
|
-
*
|
|
21
|
-
* kosFutureAware({ mode: 'minimal' })
|
|
22
|
-
* class BackgroundServiceModelImpl implements IKosDataModel {
|
|
23
|
-
* // futureHandler is now available via interface merging
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
13
|
+
* Members injected by @kosFutureAware in minimal mode. Declare an interface with the
|
|
14
|
+
* same name as the class that extends this type (TypeScript interface merging).
|
|
26
15
|
*
|
|
27
16
|
* @kosService core.future-aware
|
|
28
17
|
* @kosApiLevel 13
|
|
29
18
|
*/
|
|
30
19
|
export interface KosFutureAwareMinimal<T extends object = Record<string, unknown>> {
|
|
31
20
|
/**
|
|
32
|
-
*
|
|
33
|
-
* Provides methods to add, remove, and query Future instances.
|
|
34
|
-
* Automatically injected by @kosFutureAware decorator.
|
|
21
|
+
* Container that tracks the model's Future operations.
|
|
35
22
|
*/
|
|
36
23
|
futureHandler: FutureAwareContainer<T>;
|
|
37
24
|
}
|
|
38
25
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* Add ESLint disable comment at top of file, then:
|
|
44
|
-
* ```typescript
|
|
45
|
-
* interface CopyLogsModelImpl extends KosFutureAwareFull<CopyProgress> {}
|
|
46
|
-
*
|
|
47
|
-
* kosFutureAware() // defaults to full mode
|
|
48
|
-
* class CopyLogsModelImpl implements IKosDataModel {
|
|
49
|
-
* // All Future Container properties are now available automatically
|
|
50
|
-
*
|
|
51
|
-
* onFutureUpdate?(future: IFutureModel<CopyProgress>): void {
|
|
52
|
-
* // Access typed clientData
|
|
53
|
-
* }
|
|
54
|
-
* }
|
|
55
|
-
* ```
|
|
26
|
+
* Members injected by @kosFutureAware in full mode (the default). Declare an interface
|
|
27
|
+
* with the same name as the class that extends this type (TypeScript interface
|
|
28
|
+
* merging).
|
|
56
29
|
*
|
|
57
30
|
* @kosService core.future-aware
|
|
58
31
|
* @kosApiLevel 13
|
|
@@ -98,56 +71,30 @@ export interface KosFutureAwareFull<T extends object = Record<string, unknown>>
|
|
|
98
71
|
cancelFuture(): Promise<void>;
|
|
99
72
|
}
|
|
100
73
|
/**
|
|
101
|
-
* Class decorator that
|
|
102
|
-
*
|
|
103
|
-
* This decorator eliminates the need for manual Future Container setup by:
|
|
104
|
-
* - Adding a futureHandler property for managing Future operations
|
|
105
|
-
* - Adding reactive getters for future, progress, status, isRunning, isCancelled (in full mode)
|
|
106
|
-
* - Adding cancelFuture method for canceling operations (in full mode)
|
|
107
|
-
*
|
|
108
|
-
* **Important**: Use TypeScript interface merging to get proper type information:
|
|
109
|
-
*
|
|
110
|
-
* ```typescript
|
|
111
|
-
* // Add ESLint disable comment at top of file, then:
|
|
112
|
-
* interface MyModelImpl extends KosFutureAwareFull<MyDataType> {}
|
|
74
|
+
* Class decorator that lets a KOS model track a long-running backend operation (a
|
|
75
|
+
* Future) started by one of its @kosFuture methods.
|
|
113
76
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* ```
|
|
77
|
+
* The model gets a `futureHandler` container and, in full mode, reactive `future`,
|
|
78
|
+
* `progress`, `status`, `isRunning` and `isCancelled` getters plus `cancelFuture()`.
|
|
79
|
+
* An optional `onFutureUpdate(future)` method on the model is called as the Future
|
|
80
|
+
* progresses. For several concurrent Futures, use @kosMultipleFutureAware.
|
|
119
81
|
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
82
|
+
* Pair the decorator with an interface that extends {@link KosFutureAwareFull} (or
|
|
83
|
+
* {@link KosFutureAwareMinimal}) so the injected members are typed.
|
|
122
84
|
*
|
|
123
85
|
* @param options Configuration options for the decorator
|
|
124
86
|
* @returns A class decorator
|
|
125
87
|
*
|
|
126
88
|
* @example
|
|
127
89
|
* ```typescript
|
|
128
|
-
*
|
|
129
|
-
* interface DeviceOperationsModelImpl extends KosFutureAwareFull<OperationData> {}
|
|
130
|
-
*
|
|
131
|
-
* kosFutureAware()
|
|
132
|
-
* class DeviceOperationsModelImpl implements IKosDataModel {
|
|
133
|
-
* onFutureUpdate?(future: IFutureModel<OperationData>): void {
|
|
134
|
-
* // Handle Future updates
|
|
135
|
-
* }
|
|
136
|
-
*
|
|
137
|
-
* kosFuture()
|
|
138
|
-
* async performOperation(): Promise<OperationData> {
|
|
139
|
-
* return { result: "done" };
|
|
140
|
-
* }
|
|
141
|
-
* }
|
|
142
|
-
*
|
|
143
|
-
* // Minimal mode example
|
|
144
|
-
* interface BackgroundServiceModelImpl extends KosFutureAwareMinimal {}
|
|
90
|
+
* interface CopyLogsModelImpl extends KosFutureAwareFull<CopyProgress> {}
|
|
145
91
|
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
92
|
+
* @kosModel("copy-logs-model")
|
|
93
|
+
* @kosFutureAware()
|
|
94
|
+
* class CopyLogsModelImpl implements IKosDataModel {
|
|
95
|
+
* @kosFuture()
|
|
96
|
+
* async startCopy(): Promise<FutureResponse | undefined> {
|
|
97
|
+
* return startCopyService();
|
|
151
98
|
* }
|
|
152
99
|
* }
|
|
153
100
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-future-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-future-aware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACb,MAAM,4CAA4C,CAAC;AAGpD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,mGAAmG;IACnG,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED
|
|
1
|
+
{"version":3,"file":"kos-future-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-future-aware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACb,MAAM,4CAA4C,CAAC;AAGpD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,mGAAmG;IACnG,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CACpC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAE1C;;OAEG;IACH,aAAa,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;CACxC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAC5E,SAAQ,qBAAqB,CAAC,CAAC,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAEzB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;;;;;OAMG;IACH,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,cAAc,CAC5B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,cAAc,CAchB"}
|
|
@@ -16,37 +16,18 @@ export interface IHttpRouteConfig {
|
|
|
16
16
|
middleware?: Array<(req: KosRequest, res: KosResponse, next: () => void) => void>;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* - {MODEL_ID} - replaced with the model's ID
|
|
24
|
-
* - {PROP_propertyName} - replaced with model.propertyName value
|
|
19
|
+
* Registers the decorated method as the handler for GET requests to `path` on the
|
|
20
|
+
* browser router. `:name` segments are parsed into `req.params`. The path may also use
|
|
21
|
+
* `{MODEL_ID}` (the model's ID) and `{PROP_propertyName}` (a model property value),
|
|
22
|
+
* resolved when the route is registered.
|
|
25
23
|
*
|
|
26
|
-
* @
|
|
27
|
-
* ```typescript
|
|
28
|
-
* @get("/api/users/:id")
|
|
29
|
-
* async getUser(req: KosRequest<"/api/users/:id">, res: KosResponse) {
|
|
30
|
-
* const userId = req.params.id;
|
|
31
|
-
* const user = await this.userService.getUser(userId);
|
|
32
|
-
* res.status(200).send(user);
|
|
33
|
-
* }
|
|
34
|
-
* ```
|
|
24
|
+
* @param path - The route path (e.g., "/api/users/:id")
|
|
35
25
|
*
|
|
36
|
-
* @example
|
|
26
|
+
* @example
|
|
37
27
|
* ```typescript
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* @get("/api/tenants/{PROP_tenantId}/users")
|
|
42
|
-
* async getTenantUsers(req: KosRequest, res: KosResponse) {
|
|
43
|
-
* // Route registered as: /api/tenants/acme-corp/users
|
|
44
|
-
* }
|
|
45
|
-
*
|
|
46
|
-
* @get("/api/models/{MODEL_ID}/config")
|
|
47
|
-
* async getModelConfig(req: KosRequest, res: KosResponse) {
|
|
48
|
-
* // Route registered as: /api/models/<actual-model-id>/config
|
|
49
|
-
* }
|
|
28
|
+
* @get("/api/models/{MODEL_ID}/users/:id")
|
|
29
|
+
* async getUser(req: KosRequest<"/api/models/{MODEL_ID}/users/:id">, res: KosResponse) {
|
|
30
|
+
* res.send(this.users.getModel(req.params.id));
|
|
50
31
|
* }
|
|
51
32
|
* ```
|
|
52
33
|
*
|
|
@@ -55,55 +36,30 @@ export interface IHttpRouteConfig {
|
|
|
55
36
|
*/
|
|
56
37
|
export declare const get: (path: string) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
57
38
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @
|
|
39
|
+
* Registers the decorated method as the handler for POST requests to `path`.
|
|
40
|
+
* See {@link get} for path syntax.
|
|
60
41
|
*
|
|
61
|
-
* @
|
|
62
|
-
* ```typescript
|
|
63
|
-
* @post("/api/users")
|
|
64
|
-
* async createUser(req: KosRequest<"/api/users">, res: KosResponse) {
|
|
65
|
-
* const userData = req.body;
|
|
66
|
-
* const newUser = await this.userService.createUser(userData);
|
|
67
|
-
* res.status(201).send(newUser);
|
|
68
|
-
* }
|
|
69
|
-
* ```
|
|
42
|
+
* @param path - The route path
|
|
70
43
|
*
|
|
71
44
|
* @kosService core.http-route
|
|
72
45
|
* @kosApiLevel 12
|
|
73
46
|
*/
|
|
74
47
|
export declare const post: (path: string) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
75
48
|
/**
|
|
76
|
-
*
|
|
77
|
-
* @
|
|
49
|
+
* Registers the decorated method as the handler for PUT requests to `path`.
|
|
50
|
+
* See {@link get} for path syntax.
|
|
78
51
|
*
|
|
79
|
-
* @
|
|
80
|
-
* ```typescript
|
|
81
|
-
* @put("/api/users/:id")
|
|
82
|
-
* async updateUser(req: KosRequest<"/api/users/:id">, res: KosResponse) {
|
|
83
|
-
* const userId = req.params.id;
|
|
84
|
-
* const updates = req.body;
|
|
85
|
-
* const updatedUser = await this.userService.updateUser(userId, updates);
|
|
86
|
-
* res.status(200).send(updatedUser);
|
|
87
|
-
* }
|
|
88
|
-
* ```
|
|
52
|
+
* @param path - The route path
|
|
89
53
|
*
|
|
90
54
|
* @kosService core.http-route
|
|
91
55
|
* @kosApiLevel 12
|
|
92
56
|
*/
|
|
93
57
|
export declare const put: (path: string) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
94
58
|
/**
|
|
95
|
-
*
|
|
96
|
-
* @
|
|
59
|
+
* Registers the decorated method as the handler for DELETE requests to `path`.
|
|
60
|
+
* See {@link get} for path syntax.
|
|
97
61
|
*
|
|
98
|
-
* @
|
|
99
|
-
* ```typescript
|
|
100
|
-
* @del("/api/users/:id")
|
|
101
|
-
* async deleteUser(req: KosRequest<"/api/users/:id">, res: KosResponse) {
|
|
102
|
-
* const userId = req.params.id;
|
|
103
|
-
* await this.userService.deleteUser(userId);
|
|
104
|
-
* res.status(204).send();
|
|
105
|
-
* }
|
|
106
|
-
* ```
|
|
62
|
+
* @param path - The route path
|
|
107
63
|
*
|
|
108
64
|
* @kosService core.http-route
|
|
109
65
|
* @kosApiLevel 12
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-http-decorators.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-http-decorators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAGpC;;GAEG;AACH,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAO7D;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,KAAK,CAChB,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAC9D,CAAC;CACH;AA2CD
|
|
1
|
+
{"version":3,"file":"kos-http-decorators.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-http-decorators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAGpC;;GAEG;AACH,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAO7D;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,KAAK,CAChB,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAC9D,CAAC;CACH;AA2CD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,GAAG,SAxD4B,MAAM,MAE5C,QAAQ,GAAG,EACX,aAAa,MAAM,EACnB,YAAY,kBAAkB,uBAoDe,CAAC;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,SAnE2B,MAAM,MAE5C,QAAQ,GAAG,EACX,aAAa,MAAM,EACnB,YAAY,kBAAkB,uBA+DiB,CAAC;AAEtD;;;;;;;;GAQG;AACH,eAAO,MAAM,GAAG,SA9E4B,MAAM,MAE5C,QAAQ,GAAG,EACX,aAAa,MAAM,EACnB,YAAY,kBAAkB,uBA0Ee,CAAC;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,GAAG,SAzF4B,MAAM,MAE5C,QAAQ,GAAG,EACX,aAAa,MAAM,EACnB,YAAY,kBAAkB,uBAqFkB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,UAAU,SA9FqB,MAAM,MAE5C,QAAQ,GAAG,EACX,aAAa,MAAM,EACnB,YAAY,kBAAkB,uBA0FP,CAAC;AAE9B;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,gBAAgB,EAAE,CAEnE"}
|
|
@@ -10,91 +10,41 @@ export interface KosLoggerAwareOptions {
|
|
|
10
10
|
loggerContext?: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* interface MyModelImpl extends KosLoggerAware {}
|
|
19
|
-
*
|
|
20
|
-
* @kosModel("my-model")
|
|
21
|
-
* @kosLoggerAware()
|
|
22
|
-
* export class MyModelImpl implements IKosDataModel {
|
|
23
|
-
* id: string;
|
|
24
|
-
*
|
|
25
|
-
* constructor(modelId: string, options: any, context: KosCreationContext) {
|
|
26
|
-
* this.id = modelId;
|
|
27
|
-
* // No logger setup needed - automatically injected!
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* async performOperation() {
|
|
31
|
-
* this.logger.info("Starting operation"); // Direct access to logger
|
|
32
|
-
* }
|
|
33
|
-
* }
|
|
34
|
-
* ```
|
|
13
|
+
* Members injected by @kosLoggerAware. Declare an interface with the same name as the
|
|
14
|
+
* class that extends this type (TypeScript interface merging).
|
|
35
15
|
*
|
|
36
16
|
* @kosService core.logger-aware
|
|
37
17
|
* @kosApiLevel 13
|
|
38
18
|
*/
|
|
39
19
|
export interface KosLoggerAware {
|
|
40
20
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* Shared across all instances of the same model type for optimal performance.
|
|
44
|
-
* Provides structured logging with debug(), info(), warn(), and error() methods.
|
|
45
|
-
* Logger context is automatically set to the model type name unless overridden.
|
|
21
|
+
* Logger for this model type, shared by all its instances. Its context is the model
|
|
22
|
+
* type unless `loggerContext` is set.
|
|
46
23
|
*/
|
|
47
24
|
logger: KosContextLogger;
|
|
48
25
|
}
|
|
49
26
|
/**
|
|
50
|
-
* Class decorator that
|
|
51
|
-
*
|
|
52
|
-
* This decorator eliminates the need for manual logger setup in constructors by:
|
|
53
|
-
* - Creating a single shared logger per model type (not per instance)
|
|
54
|
-
* - Using the KosLoggerFactory for consistent logger creation
|
|
55
|
-
* - Following KOS naming conventions for logger context
|
|
56
|
-
* - Providing optimal performance through logger reuse
|
|
27
|
+
* Class decorator that gives a KOS model or ViewModel a `logger` (or `loggerProperty`).
|
|
57
28
|
*
|
|
58
|
-
*
|
|
59
|
-
* of that type.
|
|
29
|
+
* The logger is created lazily on first access, once per model type, and shared by
|
|
30
|
+
* every instance of that type.
|
|
60
31
|
*
|
|
61
|
-
*
|
|
32
|
+
* @param options Configuration options for the logger injection
|
|
33
|
+
* @returns A class decorator
|
|
62
34
|
*
|
|
35
|
+
* @example
|
|
63
36
|
* ```typescript
|
|
64
37
|
* interface MyModelImpl extends KosLoggerAware {}
|
|
65
38
|
*
|
|
66
39
|
* @kosModel("my-model")
|
|
67
40
|
* @kosLoggerAware()
|
|
68
41
|
* export class MyModelImpl implements IKosDataModel {
|
|
69
|
-
* // logger property is now available with full type safety
|
|
70
42
|
* async doSomething() {
|
|
71
43
|
* this.logger.debug("Doing something...");
|
|
72
44
|
* }
|
|
73
45
|
* }
|
|
74
46
|
* ```
|
|
75
47
|
*
|
|
76
|
-
* @param options Configuration options for the logger injection
|
|
77
|
-
* @returns A class decorator
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
* ```typescript
|
|
81
|
-
* // Basic usage with default logger property
|
|
82
|
-
* @kosLoggerAware()
|
|
83
|
-
* class MyModel { }
|
|
84
|
-
*
|
|
85
|
-
* // Custom logger property name
|
|
86
|
-
* @kosLoggerAware({ loggerProperty: 'log' })
|
|
87
|
-
* class MyModel {
|
|
88
|
-
* // this.log is available instead of this.logger
|
|
89
|
-
* }
|
|
90
|
-
*
|
|
91
|
-
* // Custom logger context for specialized logging
|
|
92
|
-
* @kosLoggerAware({ loggerContext: 'analytics' })
|
|
93
|
-
* class AnalyticsModel {
|
|
94
|
-
* // Logger uses "analytics" context instead of model type
|
|
95
|
-
* }
|
|
96
|
-
* ```
|
|
97
|
-
*
|
|
98
48
|
* @category KOS Model Decorator
|
|
99
49
|
* @since 2.1.0
|
|
100
50
|
* @kosService core.logger-aware
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-logger-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-logger-aware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,8CAA8C;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED
|
|
1
|
+
{"version":3,"file":"kos-logger-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-logger-aware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,8CAA8C;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAC5B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,cAAc,CAqChB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { IKosDataModel } from '../kosModel';
|
|
2
|
+
import { KosModelRegistrationFactory } from '../registration/base-kos-model-registration';
|
|
3
|
+
import { KosCompanionAware } from './kos-companion';
|
|
4
|
+
/**
|
|
5
|
+
* A mixin declared on a host, keyed by the property that holds it.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export interface KosMixinDefinition {
|
|
10
|
+
registration: KosModelRegistrationFactory<any, any>;
|
|
11
|
+
options?: unknown;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The host interface a mixin requires.
|
|
15
|
+
*
|
|
16
|
+
* @kosService core.mixin
|
|
17
|
+
* @kosApiLevel 25
|
|
18
|
+
*/
|
|
19
|
+
export type KosMixinHost<TMixin> = TMixin extends KosCompanionAware<infer THost> ? THost : IKosDataModel;
|
|
20
|
+
/**
|
|
21
|
+
* The options a host passes to its mixin. Any option can be a prop key, resolved from the
|
|
22
|
+
* host's data when the mixin is created.
|
|
23
|
+
*
|
|
24
|
+
* @kosService core.mixin
|
|
25
|
+
* @kosApiLevel 25
|
|
26
|
+
*/
|
|
27
|
+
export type KosMixinOptions<O> = O extends {
|
|
28
|
+
data?: infer D;
|
|
29
|
+
} ? {
|
|
30
|
+
[K in keyof D]: D[K] | string;
|
|
31
|
+
} : never;
|
|
32
|
+
/**
|
|
33
|
+
* Mixes a reusable behaviour into a model. The host gets its own instance of the mixin
|
|
34
|
+
* in the decorated property, there from the moment the host is created and observable,
|
|
35
|
+
* so the host's effects can react to it.
|
|
36
|
+
*
|
|
37
|
+
* The mixin calls back into the host through `getCompanionParent()`, typed by the host
|
|
38
|
+
* interface it declares; a host that does not implement that interface does not
|
|
39
|
+
* compile.
|
|
40
|
+
*
|
|
41
|
+
* @param mixin The mixin model's registration.
|
|
42
|
+
* @param options The mixin's model options, received as `options.data`. Any option can
|
|
43
|
+
* be a prop key (`createPropKey`), resolved from the host's data when the mixin is
|
|
44
|
+
* created.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* interface DirtyHost extends IKosDataModel { onDirtyChanged?(dirty: boolean): void }
|
|
49
|
+
* interface DirtyTrackingImpl extends KosCompanionComposition<DirtyHost> {}
|
|
50
|
+
*
|
|
51
|
+
* @kosModel("dirty-tracking")
|
|
52
|
+
* @kosCompanion({ mode: "composition" })
|
|
53
|
+
* class DirtyTrackingImpl implements IKosDataModel { ... }
|
|
54
|
+
*
|
|
55
|
+
* @kosModel("recipe")
|
|
56
|
+
* class RecipeImpl implements IKosDataModel, DirtyHost {
|
|
57
|
+
* @kosMixin(DirtyTracking, { fields: ["name"] })
|
|
58
|
+
* dirty!: DirtyTrackingModel;
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @category KOS Model Decorator
|
|
63
|
+
* @kosService core.mixin
|
|
64
|
+
* @kosApiLevel 25
|
|
65
|
+
*/
|
|
66
|
+
export declare function kosMixin<TMixin extends IKosDataModel, O extends object>(mixin: KosModelRegistrationFactory<TMixin, O>, options?: KosMixinOptions<O>): (target: KosMixinHost<TMixin>, propertyKey: string) => void;
|
|
67
|
+
//# sourceMappingURL=kos-mixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kos-mixin.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-mixin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,2BAA2B,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,MAAM,IAAI,MAAM,SAAS,iBAAiB,CAAC,MAAM,KAAK,CAAC,GAC5E,KAAK,GACL,aAAa,CAAC;AAElB;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAA;CAAE,GACzD;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM;CAAE,GACjC,KAAK,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,QAAQ,CAAC,MAAM,SAAS,aAAa,EAAE,CAAC,SAAS,MAAM,EACrE,KAAK,EAAE,2BAA2B,CAAC,MAAM,EAAE,CAAC,CAAC,EAC7C,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,IAEpB,QAAQ,YAAY,CAAC,MAAM,CAAC,EAAE,aAAa,MAAM,KAAG,IAAI,CAuBjE"}
|
|
@@ -12,20 +12,21 @@ interface KosModelEffectProps<T = any> {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Method decorator that runs the method as a reactive effect of the model.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
17
|
+
* With `dependencies`, the method runs each time the returned values change (and once
|
|
18
|
+
* immediately with `fireImmediately`). Without them, it runs immediately and again
|
|
19
|
+
* whenever any reactive model state it reads changes. Effects start when the model
|
|
20
|
+
* loads and stop when it unloads. The method cannot be called directly.
|
|
21
|
+
*
|
|
22
|
+
* @param props - The effect's dependencies and options.
|
|
18
23
|
* @returns A decorator function.
|
|
19
24
|
*
|
|
20
25
|
* @example
|
|
21
26
|
* ```typescript
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @kosModelEffect()
|
|
26
|
-
* handleModelEffect() {
|
|
27
|
-
* // Handle the received topic payload here.
|
|
28
|
-
* }
|
|
27
|
+
* @kosModelEffect({ dependencies: (model: MyModelImpl) => [model.selectedId] })
|
|
28
|
+
* onSelectionChanged() {
|
|
29
|
+
* this.details = this.lookup(this.selectedId);
|
|
29
30
|
* }
|
|
30
31
|
* ```
|
|
31
32
|
* @category KOS Model Decorator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-model-effect.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-model-effect.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,UAAU,mBAAmB,CAAC,CAAC,GAAG,GAAG;IACnC,YAAY,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE;QACR,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH;AACD
|
|
1
|
+
{"version":3,"file":"kos-model-effect.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-model-effect.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,UAAU,mBAAmB,CAAC,CAAC,GAAG,GAAG;IACnC,YAAY,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE;QACR,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH;AACD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,IAC5D,QAAQ,CAAC,EAAE,cAAc,MAAM,EAAE,YAAY,kBAAkB,UAYxE"}
|