@kosdev-code/kos-ui-sdk 3.0.26 → 3.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.kos.json +2 -1
- package/common/events/async-event-bus.d.ts +8 -11
- package/common/events/async-event-bus.d.ts.map +1 -1
- package/common/events/eventBus.d.ts +1 -18
- package/common/events/eventBus.d.ts.map +1 -1
- package/core/core/companion-instantiator.d.ts +5 -0
- package/core/core/companion-instantiator.d.ts.map +1 -1
- package/core/core/decorators/index.d.ts +1 -0
- package/core/core/decorators/index.d.ts.map +1 -1
- package/core/core/decorators/kos-child.d.ts +2 -3
- package/core/core/decorators/kos-child.d.ts.map +1 -1
- package/core/core/decorators/kos-companion.d.ts +26 -88
- 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 +69 -0
- package/core/core/decorators/kos-mixin.d.ts.map +1 -0
- package/core/core/decorators/kos-model-effect.d.ts +10 -9
- package/core/core/decorators/kos-model-effect.d.ts.map +1 -1
- package/core/core/decorators/kos-multiple-future-aware.d.ts +21 -94
- package/core/core/decorators/kos-multiple-future-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-reload-aware.d.ts +14 -16
- package/core/core/decorators/kos-reload-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-service-request.d.ts +80 -238
- package/core/core/decorators/kos-service-request.d.ts.map +1 -1
- package/core/core/decorators/kos-state-machine.d.ts +35 -275
- package/core/core/decorators/kos-state-machine.d.ts.map +1 -1
- package/core/core/decorators/kos-topic-handler-flow-control.d.ts +11 -3
- package/core/core/decorators/kos-topic-handler-flow-control.d.ts.map +1 -1
- package/core/core/decorators/kos-trouble-aware.d.ts +9 -43
- package/core/core/decorators/kos-trouble-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-view-model.d.ts +20 -100
- package/core/core/decorators/kos-view-model.d.ts.map +1 -1
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/decorators/kosTopicHandler.d.ts +28 -89
- package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
- package/core/core/decorators/propKeys.d.ts +1 -0
- package/core/core/decorators/propKeys.d.ts.map +1 -1
- package/core/core/indexing/index.d.ts +2 -4
- package/core/core/indexing/index.d.ts.map +1 -1
- package/core/core/indexing/kos-container-index-aware.d.ts +17 -48
- package/core/core/indexing/kos-container-index-aware.d.ts.map +1 -1
- package/core/core/indexing/kos-index-aware.d.ts +11 -37
- package/core/core/indexing/kos-index-aware.d.ts.map +1 -1
- package/core/core/kos-container-index.d.ts +11 -0
- package/core/core/kos-container-index.d.ts.map +1 -1
- package/core/core/kos-container-model.d.ts +11 -32
- package/core/core/kos-container-model.d.ts.map +1 -1
- package/core/core/kos-data-container.d.ts +6 -6
- package/core/core/kos-data-container.d.ts.map +1 -1
- package/core/core/kosCore.d.ts +7 -4
- package/core/core/kosCore.d.ts.map +1 -1
- package/core/core/kosModel.d.ts +16 -8
- package/core/core/kosModel.d.ts.map +1 -1
- package/core/core/kosModelManager.d.ts +2 -3
- package/core/core/kosModelManager.d.ts.map +1 -1
- package/core/core/lifecycle/constants.d.ts +6 -2
- package/core/core/lifecycle/constants.d.ts.map +1 -1
- package/core/core/lifecycle/kosCoreLifecycle.d.ts +11 -1
- package/core/core/lifecycle/kosCoreLifecycle.d.ts.map +1 -1
- package/core/core/lifecycle/kosModelLifecycle.d.ts +6 -0
- package/core/core/lifecycle/kosModelLifecycle.d.ts.map +1 -1
- package/core/core/lifecycle/model-machine.d.ts +6 -0
- package/core/core/lifecycle/model-machine.d.ts.map +1 -1
- package/core/core/model/kos-fsm-manager.d.ts +6 -0
- package/core/core/model/kos-fsm-manager.d.ts.map +1 -1
- package/core/core/model/kos-offline-queue.d.ts +1 -1
- package/core/core/model/kos-subscription-manager.d.ts.map +1 -1
- package/core/core/model/service-response-store.d.ts +2 -15
- package/core/core/model/service-response-store.d.ts.map +1 -1
- package/core/core/reconnect/reconnect-fixture.d.ts +17 -0
- package/core/core/reconnect/reconnect-fixture.d.ts.map +1 -0
- package/core/core/registration/model-registration.d.ts.map +1 -1
- package/core/core/services/app-startup-service.d.ts +5 -13
- package/core/core/services/app-startup-service.d.ts.map +1 -1
- package/core/core/services/intent-service.d.ts +3 -12
- package/core/core/services/intent-service.d.ts.map +1 -1
- package/core/core/transport/mock/mock-frames.d.ts +3 -3
- package/core/core/transport/transport.d.ts +1 -1
- package/core/core/transport/transport.d.ts.map +1 -1
- package/core/core/transport/webSocketTransport.d.ts +10 -0
- package/core/core/transport/webSocketTransport.d.ts.map +1 -1
- package/core/types/model.d.ts +4 -8
- package/core/types/model.d.ts.map +1 -1
- package/core/types/service-response-store.d.ts +3 -11
- package/core/types/service-response-store.d.ts.map +1 -1
- package/core/types/utils/kos-fetch.d.ts +25 -37
- package/core/types/utils/kos-fetch.d.ts.map +1 -1
- package/core/util/abortable-when.d.ts +5 -6
- package/core/util/abortable-when.d.ts.map +1 -1
- package/core/util/ancestor-path-visitor.d.ts +14 -20
- package/core/util/ancestor-path-visitor.d.ts.map +1 -1
- package/core/util/container-utils.d.ts +26 -159
- package/core/util/container-utils.d.ts.map +1 -1
- package/core/util/date-utils.d.ts +9 -58
- package/core/util/date-utils.d.ts.map +1 -1
- package/core/util/debounce.d.ts +1 -8
- package/core/util/debounce.d.ts.map +1 -1
- package/core/util/kos-fetch.d.ts +1 -1
- package/core/util/kos-fetch.d.ts.map +1 -1
- package/core/util/kos-model-utils.d.ts +10 -11
- package/core/util/kos-model-utils.d.ts.map +1 -1
- package/core/util/model-attribute-utils.d.ts +5 -22
- package/core/util/model-attribute-utils.d.ts.map +1 -1
- package/core/util/model-type-guards.d.ts.map +1 -1
- package/core/util/promise-utils.d.ts +1 -26
- package/core/util/promise-utils.d.ts.map +1 -1
- package/core/util/service-factory.d.ts +5 -23
- package/core/util/service-factory.d.ts.map +1 -1
- package/core/util/service-request-error.d.ts +3 -5
- package/core/util/service-request-error.d.ts.map +1 -1
- package/core/util/service-response.d.ts +12 -67
- package/core/util/service-response.d.ts.map +1 -1
- package/core/util/transport-not-ready-error.d.ts +11 -13
- package/core/util/transport-not-ready-error.d.ts.map +1 -1
- package/core/util/when-ready.d.ts +1 -8
- package/core/util/when-ready.d.ts.map +1 -1
- package/index.cjs +692 -11760
- package/index.cjs.map +1 -1
- package/index.js +774 -11846
- package/index.js.map +1 -1
- package/models/decorators/future-service.d.ts +7 -7
- package/models/models/browser-router/browser-router-model.d.ts +10 -39
- package/models/models/browser-router/browser-router-model.d.ts.map +1 -1
- package/models/models/browser-router/browser-router-registration.d.ts +5 -77
- package/models/models/browser-router/browser-router-registration.d.ts.map +1 -1
- package/models/models/browser-router/types/index.d.ts +2 -16
- package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts +5 -77
- package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts.map +1 -1
- package/models/models/canvas-renderer/canvas-renderer-registration.d.ts +5 -75
- package/models/models/canvas-renderer/canvas-renderer-registration.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-model-builder.d.ts +4 -11
- package/models/models/config-bean/config-bean-model-builder.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-model.d.ts +23 -66
- package/models/models/config-bean/config-bean-model.d.ts.map +1 -1
- package/models/models/config-bean-prop/config-bean-prop-model.d.ts +15 -62
- package/models/models/config-bean-prop/config-bean-prop-model.d.ts.map +1 -1
- package/models/models/config-bean-prop/types/index.d.ts +34 -215
- package/models/models/device/device-model.d.ts +20 -199
- package/models/models/device/device-model.d.ts.map +1 -1
- package/models/models/device/device-registration.d.ts +7 -87
- package/models/models/device/device-registration.d.ts.map +1 -1
- package/models/models/device/types/index.d.ts +5 -34
- package/models/models/future/future-aware.d.ts +7 -71
- package/models/models/future/future-aware.d.ts.map +1 -1
- package/models/models/future/future-model-builder.d.ts +2 -2
- package/models/models/future/future-model.d.ts +3 -23
- package/models/models/future/future-model.d.ts.map +1 -1
- package/models/models/future/future-types.d.ts +28 -145
- package/models/models/future/future-types.d.ts.map +1 -1
- package/models/models/gpio-chip/gpio-chip-builders.d.ts +14 -0
- package/models/models/gpio-chip/gpio-chip-builders.d.ts.map +1 -0
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts +2 -1
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts.map +1 -1
- package/models/models/key-value/key-value-model.d.ts +12 -72
- package/models/models/key-value/key-value-model.d.ts.map +1 -1
- package/models/models/key-value/key-value-registration.d.ts +5 -77
- package/models/models/key-value/key-value-registration.d.ts.map +1 -1
- package/models/models/key-value/services/key-value-services.d.ts +13 -72
- package/models/models/key-value/services/key-value-services.d.ts.map +1 -1
- package/models/models/key-value/types/index.d.ts +3 -46
- package/models/models/kos-expression-evaluator/expression-parse-cache.d.ts +29 -0
- package/models/models/kos-expression-evaluator/expression-parse-cache.d.ts.map +1 -0
- package/models/models/kos-expression-evaluator/index.d.ts +1 -0
- package/models/models/kos-expression-evaluator/index.d.ts.map +1 -1
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts +73 -105
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts.map +1 -1
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts +2 -12
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts.map +1 -1
- package/models/models/kos-log-manager/kos-log-manager-model.d.ts +7 -46
- package/models/models/kos-log-manager/kos-log-manager-model.d.ts.map +1 -1
- package/models/models/kos-log-manager/kos-log-manager-registration.d.ts +5 -80
- package/models/models/kos-log-manager/kos-log-manager-registration.d.ts.map +1 -1
- package/models/models/kos-log-manager/types/index.d.ts +13 -156
- package/models/models/kos-time/kos-time-model.d.ts +8 -39
- package/models/models/kos-time/kos-time-model.d.ts.map +1 -1
- package/models/models/kos-time/kos-time-registration.d.ts +6 -73
- package/models/models/kos-time/kos-time-registration.d.ts.map +1 -1
- package/models/models/kos-time/types/index.d.ts +3 -58
- package/models/models/log-block/log-block-container-model.d.ts +2 -118
- package/models/models/log-block/log-block-container-model.d.ts.map +1 -1
- package/models/models/log-block/log-block-container-registration.d.ts +5 -75
- package/models/models/log-block/log-block-container-registration.d.ts.map +1 -1
- package/models/models/log-block/log-block-model.d.ts +5 -168
- package/models/models/log-block/log-block-model.d.ts.map +1 -1
- package/models/models/log-block/log-block-registration.d.ts +5 -75
- package/models/models/log-block/log-block-registration.d.ts.map +1 -1
- package/models/models/log-block/types/index.d.ts +14 -81
- package/models/models/log-stream/log-stream-container-model.d.ts +8 -35
- package/models/models/log-stream/log-stream-container-model.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-container-registration.d.ts +5 -75
- package/models/models/log-stream/log-stream-container-registration.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-model.d.ts +8 -29
- package/models/models/log-stream/log-stream-model.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-registration.d.ts +5 -75
- package/models/models/log-stream/log-stream-registration.d.ts.map +1 -1
- package/models/models/log-stream/types/index.d.ts +5 -60
- package/models/models/network-interface/network-interface-container-model.d.ts +6 -35
- package/models/models/network-interface/network-interface-container-model.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-container-registration.d.ts +5 -73
- package/models/models/network-interface/network-interface-container-registration.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-model.d.ts +5 -43
- package/models/models/network-interface/network-interface-model.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-registration.d.ts +5 -73
- package/models/models/network-interface/network-interface-registration.d.ts.map +1 -1
- package/models/models/network-interface/types/index.d.ts +2 -16
- package/models/models/ota/ota-model.d.ts +11 -39
- package/models/models/ota/ota-model.d.ts.map +1 -1
- package/models/models/ota/ota-registration.d.ts +5 -77
- package/models/models/ota/ota-registration.d.ts.map +1 -1
- package/models/models/ota/types/index.d.ts +2 -141
- package/models/models/region-info/types/index.d.ts +19 -99
- package/models/models/region-info/types/index.d.ts.map +1 -1
- package/models/models/software-info/services/software-info-services.d.ts +2 -14
- package/models/models/software-info/services/software-info-services.d.ts.map +1 -1
- package/models/models/software-info/software-info-model.d.ts +3 -39
- package/models/models/software-info/software-info-model.d.ts.map +1 -1
- package/models/models/software-info/software-info-registration.d.ts +6 -73
- package/models/models/software-info/software-info-registration.d.ts.map +1 -1
- package/models/models/software-info/types/index.d.ts +6 -20
- package/models/models/state-bean/state-bean-model.d.ts +10 -41
- package/models/models/state-bean/state-bean-model.d.ts.map +1 -1
- package/models/models/state-bean/state-bean-registration.d.ts +6 -73
- package/models/models/state-bean/state-bean-registration.d.ts.map +1 -1
- package/models/models/state-bean/types/index.d.ts +4 -84
- package/models/models/state-prop/state-prop-model.d.ts +6 -40
- package/models/models/state-prop/state-prop-model.d.ts.map +1 -1
- package/models/models/state-prop/state-prop-registration.d.ts +6 -73
- package/models/models/state-prop/state-prop-registration.d.ts.map +1 -1
- package/models/models/state-prop/types/index.d.ts +5 -37
- package/models/models/storage-device/storage-device-container-model.d.ts +7 -273
- package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-container-registration.d.ts +5 -75
- package/models/models/storage-device/storage-device-container-registration.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-model.d.ts +3 -49
- package/models/models/storage-device/storage-device-model.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-registration.d.ts +5 -75
- package/models/models/storage-device/storage-device-registration.d.ts.map +1 -1
- package/models/models/storage-device/types/index.d.ts +13 -82
- package/models/models/studio-properties/studio-properties-model.d.ts +13 -36
- package/models/models/studio-properties/studio-properties-model.d.ts.map +1 -1
- package/models/models/studio-properties/studio-properties-registration.d.ts +5 -75
- package/models/models/studio-properties/studio-properties-registration.d.ts.map +1 -1
- package/models/models/studio-properties/types/index.d.ts +2 -24
- package/models/models/translation/descriptor-merge.d.ts +13 -17
- package/models/models/translation/descriptor-merge.d.ts.map +1 -1
- package/models/models/translation/services/translation-services.d.ts +19 -77
- package/models/models/translation/services/translation-services.d.ts.map +1 -1
- package/models/models/translation/test-harness.d.ts +6 -8
- package/models/models/translation/test-harness.d.ts.map +1 -1
- package/models/models/translation/translation-container-model.d.ts +7 -59
- package/models/models/translation/translation-container-model.d.ts.map +1 -1
- package/models/models/translation/translation-container-registration.d.ts +6 -73
- package/models/models/translation/translation-container-registration.d.ts.map +1 -1
- package/models/models/translation/translation-model.d.ts +17 -50
- package/models/models/translation/translation-model.d.ts.map +1 -1
- package/models/models/translation/translation-registration.d.ts +6 -73
- package/models/models/translation/translation-registration.d.ts.map +1 -1
- package/models/models/translation/types/index.d.ts +51 -276
- package/models/models/trouble/trouble-registration.d.ts +6 -73
- package/models/models/trouble/trouble-registration.d.ts.map +1 -1
- package/models/models/trouble/types/index.d.ts +17 -188
- package/models/models/trouble/utils/is-trouble-aware.d.ts +4 -85
- package/models/models/trouble/utils/is-trouble-aware.d.ts.map +1 -1
- package/models/models/trouble-container/trouble-builders.d.ts +11 -0
- package/models/models/trouble-container/trouble-builders.d.ts.map +1 -0
- package/models/models/trouble-container/trouble-container-model.d.ts +2 -1
- package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
- package/models/models/usb-update/usb-update-container-registration.d.ts +5 -75
- package/models/models/usb-update/usb-update-container-registration.d.ts.map +1 -1
- package/models/models/usb-update/usb-update-registration.d.ts +5 -75
- package/models/models/usb-update/usb-update-registration.d.ts.map +1 -1
- package/models/types/cancellable-promise.d.ts +6 -9
- package/models/types/cancellable-promise.d.ts.map +1 -1
- package/models/utils/await-future-call.d.ts +9 -21
- package/models/utils/await-future-call.d.ts.map +1 -1
- package/models/utils/cancellable-future-call.d.ts +8 -19
- package/models/utils/cancellable-future-call.d.ts.map +1 -1
- package/models/utils/cancellable-service.d.ts +14 -23
- package/models/utils/cancellable-service.d.ts.map +1 -1
- package/models/utils/conversion-utils.d.ts +8 -48
- package/models/utils/conversion-utils.d.ts.map +1 -1
- package/models/utils/persistence-store.d.ts +1 -1
- package/models/utils/service.d.ts +14 -48
- package/models/utils/service.d.ts.map +1 -1
- package/models/utils/services/kos/daily/service.d.ts +4 -4
- package/models/utils/services/vfs/daily/service.d.ts +4 -4
- package/models/utils/timer-manager.d.ts.map +1 -1
- package/package.json +2 -2
- package/{index-D52vEGXT.cjs → software-info-registration-Le3V0a6v.cjs} +11906 -416
- package/software-info-registration-Le3V0a6v.cjs.map +1 -0
- package/{index-Csq0zQtb.js → software-info-registration-kSGacOka.js} +12116 -625
- package/software-info-registration-kSGacOka.js.map +1 -0
- package/testing/index.d.ts +32 -34
- package/testing/index.d.ts.map +1 -1
- package/testing.cjs +2 -1
- package/testing.cjs.map +1 -1
- package/testing.js +2 -1
- package/testing.js.map +1 -1
- package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts +9 -0
- package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts.map +1 -0
- package/ui/components/connection-dev-button/index.d.ts +36 -0
- package/ui/components/connection-dev-button/index.d.ts.map +1 -0
- package/ui/components/connection-dev-button/use-connection-dev-state.d.ts +29 -0
- package/ui/components/connection-dev-button/use-connection-dev-state.d.ts.map +1 -0
- package/ui/components/index.d.ts +1 -0
- package/ui/components/index.d.ts.map +1 -1
- package/ui/features/canvas/hooks/use-image-renderer.d.ts +5 -4
- package/ui/features/canvas/hooks/use-image-renderer.d.ts.map +1 -1
- package/ui/hooks/use-function-warmup.d.ts +4 -14
- package/ui/hooks/use-function-warmup.d.ts.map +1 -1
- package/ui/hooks/use-kos-date-formats.d.ts +15 -29
- package/ui/hooks/use-kos-date-formats.d.ts.map +1 -1
- package/ui/hooks/use-kos-region-timezones.d.ts +4 -55
- package/ui/hooks/use-kos-region-timezones.d.ts.map +1 -1
- package/ui/hooks/use-kos-regions.d.ts +11 -23
- package/ui/hooks/use-kos-regions.d.ts.map +1 -1
- package/ui/hooks/use-kos-time-formats.d.ts +16 -31
- package/ui/hooks/use-kos-time-formats.d.ts.map +1 -1
- package/ui/hooks/use-kos-unit-systems.d.ts +13 -27
- package/ui/hooks/use-kos-unit-systems.d.ts.map +1 -1
- package/ui/hooks/view-model/use-view-model.d.ts +6 -31
- package/ui/hooks/view-model/use-view-model.d.ts.map +1 -1
- package/ui/policies/reload-on-disconnect-policy.d.ts +5 -6
- package/ui/policies/reload-on-disconnect-policy.d.ts.map +1 -1
- package/index-Csq0zQtb.js.map +0 -1
- package/index-D52vEGXT.cjs.map +0 -1
|
@@ -23,40 +23,28 @@ export interface AwaitFutureCallOptions {
|
|
|
23
23
|
timeoutMs?: number;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Calls a @kosFuture method on a future-aware model and returns a
|
|
27
27
|
* CancellablePromise that settles from the future's end state:
|
|
28
28
|
*
|
|
29
29
|
* - resolves with the method's response once the future ends in SUCCESS
|
|
30
|
-
* - rejects with {@link FutureCallError} on FAIL
|
|
30
|
+
* - rejects with {@link FutureCallError} on FAIL, ABORT or CANCEL
|
|
31
31
|
* - rejects with the service error if the call itself throws
|
|
32
|
-
* - resolves with the response when the call
|
|
33
|
-
* future-tracked (no future was produced)
|
|
32
|
+
* - resolves with the response when the call produces no future
|
|
34
33
|
*
|
|
35
|
-
* The
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* aliases are unaffected.
|
|
34
|
+
* The @kosFuture wrapper registers the future on the model's `futureHandler`
|
|
35
|
+
* before the request is sent, so the future is captured reliably, and
|
|
36
|
+
* concurrent operations under other aliases are unaffected.
|
|
39
37
|
*
|
|
40
|
-
* @example
|
|
38
|
+
* @example
|
|
41
39
|
* ```typescript
|
|
42
40
|
* try {
|
|
43
|
-
* await awaitFutureCall(
|
|
44
|
-
* a.publishImportedKab(path, version, qualifier)
|
|
45
|
-
* );
|
|
46
|
-
* studio.notifications.success("Published");
|
|
41
|
+
* await awaitFutureCall(pump, (p) => p.calibrate());
|
|
47
42
|
* } catch (e) {
|
|
48
43
|
* if (e instanceof FutureCallError && !e.isCancelled) {
|
|
49
|
-
*
|
|
44
|
+
* showError(e.reason);
|
|
50
45
|
* }
|
|
51
46
|
* }
|
|
52
47
|
* ```
|
|
53
|
-
*
|
|
54
|
-
* @example Cancellation and progress
|
|
55
|
-
* ```typescript
|
|
56
|
-
* const call = awaitFutureCall(model, (m) => m.performOperation());
|
|
57
|
-
* const stop = call.onProgressUpdate((p, status) => render(p, status));
|
|
58
|
-
* // later: await call.cancel();
|
|
59
|
-
* ```
|
|
60
48
|
*/
|
|
61
49
|
export declare function awaitFutureCall<T extends FutureContainer, R>(model: T, methodCall: (model: T) => Promise<R>, options?: AwaitFutureCallOptions): CancellablePromise<R>;
|
|
62
50
|
//# sourceMappingURL=await-future-call.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"await-future-call.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/await-future-call.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"await-future-call.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/await-future-call.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAIvE;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAEf,QAAQ,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAQxE,IAAI,WAAW,YAKd;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,eAAe,EAAE,CAAC,EAC1D,KAAK,EAAE,CAAC,EACR,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EACpC,OAAO,GAAE,sBAA2B,GACnC,kBAAkB,CAAC,CAAC,CAAC,CAuKvB"}
|
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
import { FutureContainer } from '../models/future/future-types';
|
|
2
2
|
import { CancellablePromise } from '../types/cancellable-promise';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Calls a @kosFuture method and returns a CancellablePromise whose `cancel()`
|
|
5
|
+
* cancels the future the call started.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```typescript
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* // Later: await model.future?.cancelFuture();
|
|
12
|
-
*
|
|
13
|
-
* // Use:
|
|
14
|
-
* const cancellable = makeCancellable(model, m => m.performOperation('data'));
|
|
15
|
-
* // Later: await cancellable.cancel();
|
|
9
|
+
* const call = makeCancellable(model, (m) => m.performOperation("data"));
|
|
10
|
+
* await call.cancel();
|
|
16
11
|
* ```
|
|
17
12
|
*/
|
|
18
13
|
export declare function makeCancellable<T extends FutureContainer, R>(model: T, methodCall: (model: T) => Promise<R>): CancellablePromise<R>;
|
|
19
14
|
/**
|
|
20
|
-
*
|
|
21
|
-
* This is more explicit but requires wrapping individual calls
|
|
15
|
+
* {@link makeCancellable} for a method given by name and arguments.
|
|
22
16
|
*
|
|
23
17
|
* @example
|
|
24
18
|
* ```typescript
|
|
25
|
-
* const
|
|
26
|
-
* await cancellable.cancel();
|
|
19
|
+
* const call = withCancellation(model, "performOperation", "data");
|
|
27
20
|
* ```
|
|
28
21
|
*/
|
|
29
22
|
export declare function withCancellation<T extends FutureContainer, K extends keyof T>(model: T, methodName: K, ...args: T[K] extends (...args: infer A) => any ? A : never): CancellablePromise<T[K] extends (...args: any[]) => Promise<infer R> ? R : never>;
|
|
30
23
|
/**
|
|
31
|
-
*
|
|
24
|
+
* Collects cancellable calls so they can be cancelled together.
|
|
32
25
|
*
|
|
33
26
|
* @example
|
|
34
27
|
* ```typescript
|
|
35
28
|
* const batch = createCancellationBatch();
|
|
36
|
-
*
|
|
37
|
-
* const op1 = batch.add(model, m => m.performOperation1());
|
|
38
|
-
* const op2 = batch.add(model, m => m.performOperation2());
|
|
39
|
-
*
|
|
40
|
-
* // Cancel all operations at once
|
|
29
|
+
* batch.add(model, (m) => m.performOperation());
|
|
41
30
|
* await batch.cancelAll();
|
|
42
31
|
* ```
|
|
43
32
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancellable-future-call.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/cancellable-future-call.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cancellable-future-call.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/cancellable-future-call.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGvE;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,eAAe,EAAE,CAAC,EAC1D,KAAK,EAAE,CAAC,EACR,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GACnC,kBAAkB,CAAC,CAAC,CAAC,CAkCvB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,eAAe,EAAE,CAAC,SAAS,MAAM,CAAC,EAC3E,KAAK,EAAE,CAAC,EACR,UAAU,EAAE,CAAC,EACb,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,GAC1D,kBAAkB,CACnB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAC9D,CAoCA;AAED;;;;;;;;;GASG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAAsC;IAExD,GAAG,CAAC,CAAC,SAAS,eAAe,EAAE,CAAC,EAC9B,KAAK,EAAE,CAAC,EACR,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GACnC,kBAAkB,CAAC,CAAC,CAAC;IAMlB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAWhC,iBAAiB,IAAI,KAAK,CAAC,eAAe,GAAG,SAAS,CAAC;IAIvD,cAAc,IAAI,MAAM;IAIxB,KAAK,IAAI,IAAI;CAGd;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAE3D"}
|
|
@@ -16,40 +16,31 @@ export type CancellableFunction<T extends (...args: any[]) => any> = T & {
|
|
|
16
16
|
isActive: () => boolean;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* Wraps a service function so each call can be aborted. The wrapper passes an
|
|
20
|
+
* `AbortSignal` as the function's last argument, aborts the previous call when
|
|
21
|
+
* called again, and exposes `cancel()`, `getController()` and `isActive()`.
|
|
21
22
|
*
|
|
22
23
|
* @example
|
|
23
24
|
* ```typescript
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* };
|
|
28
|
-
*
|
|
29
|
-
* // Make it cancellable
|
|
30
|
-
* const cancellableGetUsers = createCancellableService(getUsers);
|
|
31
|
-
*
|
|
32
|
-
* // Use it
|
|
33
|
-
* const users = await cancellableGetUsers({ page: 1 });
|
|
34
|
-
*
|
|
35
|
-
* // Cancel if needed
|
|
36
|
-
* cancellableGetUsers.cancel();
|
|
25
|
+
* const getUsers = createCancellableService(
|
|
26
|
+
* async (params?: UserParams, signal?: AbortSignal) => api.get("/users", params, { signal })
|
|
27
|
+
* );
|
|
28
|
+
* const users = await getUsers({ page: 1 });
|
|
29
|
+
* getUsers.cancel();
|
|
37
30
|
* ```
|
|
38
31
|
*/
|
|
39
32
|
export declare function createCancellableService<TArgs extends any[], TReturn>(serviceFunction: (...args: [...TArgs, AbortSignal?]) => Promise<TReturn>): CancellableFunction<(...args: TArgs) => Promise<TReturn>>;
|
|
40
33
|
/**
|
|
41
|
-
*
|
|
34
|
+
* Base class for services with several cancellable methods. Each method made
|
|
35
|
+
* with `createMethod` aborts its own previous call, and `cancelAll` aborts every
|
|
36
|
+
* active call.
|
|
42
37
|
*
|
|
43
38
|
* @example
|
|
44
39
|
* ```typescript
|
|
45
40
|
* class UserService extends CancellableServiceManager {
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* getUser = this.createMethod(async (id: string, signal?: AbortSignal) => {
|
|
51
|
-
* return api.get(`/users/${id}`, undefined, { signal });
|
|
52
|
-
* });
|
|
41
|
+
* getUser = this.createMethod("getUser", async (id: string, signal?: AbortSignal) =>
|
|
42
|
+
* api.get(`/users/${id}`, undefined, { signal })
|
|
43
|
+
* );
|
|
53
44
|
* }
|
|
54
45
|
* ```
|
|
55
46
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancellable-service.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/cancellable-service.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG;IACvE;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;OAEG;IACH,aAAa,EAAE,MAAM,eAAe,GAAG,SAAS,CAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"cancellable-service.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/cancellable-service.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG;IACvE;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;OAEG;IACH,aAAa,EAAE,MAAM,eAAe,GAAG,SAAS,CAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,SAAS,GAAG,EAAE,EAAE,OAAO,EACnE,eAAe,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,KAAK,EAAE,WAAW,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,GACvE,mBAAmB,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAuC3D;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,WAAW,CAAsC;IAEzD;;OAEG;IACH,SAAS,CAAC,YAAY,CAAC,KAAK,SAAS,GAAG,EAAE,EAAE,OAAO,EACjD,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,KAAK,EAAE,WAAW,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,GACvE,mBAAmB,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IA4B5D;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQhC;;OAEG;IACH,SAAS,IAAI,IAAI;IAOjB;;OAEG;IACH,gBAAgB,IAAI,MAAM,EAAE;IAI5B;;OAEG;IACH,iBAAiB,IAAI,OAAO;CAG7B"}
|
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
import { UnitSource } from '../models/region-info/types';
|
|
2
2
|
export type UnitConversionSource = string | UnitSource;
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Converts a value between units using the region info model.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { convert } from "@kosdev-code/kos-ui-sdk";
|
|
12
|
-
*
|
|
13
|
-
* const value = convert(1000, "milliliter", "fluid-ounce");
|
|
14
|
-
* ```
|
|
6
|
+
* Units can be given as unit names or as {@link UnitSource} objects. A unit name
|
|
7
|
+
* for `from` is treated as an SI unit. When `to` is omitted, the value is
|
|
8
|
+
* converted to the region's default unit for the same measure.
|
|
15
9
|
*
|
|
16
|
-
* The to unit can be omitted in which case the value will be converted to the default unit for the selected region measure:
|
|
17
10
|
* @example
|
|
18
11
|
* ```typescript
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* // convert 1000 milliliters to the default unit for the region. If the region is set to US, the value will be converted to fluid ounces.
|
|
22
|
-
* const value = convert(1000, "milliliter");
|
|
12
|
+
* const ounces = convert(1000, "milliliter", "fluid-ounce");
|
|
23
13
|
* ```
|
|
24
14
|
*
|
|
25
|
-
* The source and target units can also be specified as {@see UnitSource} objects:
|
|
26
|
-
* @example
|
|
27
|
-
* ```typescript
|
|
28
|
-
* import { convert } from "@kosdev-code/kos-ui-sdk";
|
|
29
|
-
*
|
|
30
|
-
* const value = convert(1000, {name: "milliliter", measure: "volume", system: "si"}, {name: "fluid-ounce", measure: "volume", system: "us"});
|
|
31
|
-
* ```
|
|
32
|
-
* In this case properties on the source and target are all optional so long as either the name or measure is specified.
|
|
33
|
-
*
|
|
34
15
|
* @param value - the value to convert
|
|
35
16
|
* @param from - the source unit
|
|
36
17
|
* @param to - the target unit. If omitted, the value will be converted to the default unit for the region measure.
|
|
@@ -38,33 +19,12 @@ export type UnitConversionSource = string | UnitSource;
|
|
|
38
19
|
*/
|
|
39
20
|
export declare const convert: (value: number, from: UnitConversionSource, to?: UnitConversionSource) => string;
|
|
40
21
|
/**
|
|
41
|
-
* Converts a
|
|
42
|
-
* an object containing the converted value, display strings, and the unit.
|
|
22
|
+
* Converts a value like {@link convert} and formats it with its unit.
|
|
43
23
|
*
|
|
44
24
|
* @example
|
|
45
|
-
* convert and format a value, letting the region determine the target unit:
|
|
46
|
-
*
|
|
47
25
|
* ```typescript
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* // If the region is set to US, the value is converted to fluid ounces.
|
|
51
|
-
* const result = convertWithUnits(1000, "milliliter");
|
|
52
|
-
* // result.value -> the converted numeric value as a string
|
|
53
|
-
* // result.display -> "33.81 fluid ounces" (long form)
|
|
54
|
-
* // result.shortDisplay -> "33.81 fl oz" (short form)
|
|
55
|
-
* // result.unit -> "fluid-ounce"
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* specify the target unit and control the number of decimal places:
|
|
60
|
-
*
|
|
61
|
-
* ```typescript
|
|
62
|
-
* import { convertWithUnits } from "@kosdev-code/kos-ui-sdk";
|
|
63
|
-
*
|
|
64
|
-
* const result = convertWithUnits(1000, "milliliter", "fluid-ounce", {
|
|
65
|
-
* minDecimals: 1,
|
|
66
|
-
* maxDecimals: 1,
|
|
67
|
-
* });
|
|
26
|
+
* const { display, shortDisplay } = convertWithUnits(1000, "milliliter");
|
|
27
|
+
* // with a US region: "33.81 fluid ounces", "33.81 fl oz"
|
|
68
28
|
* ```
|
|
69
29
|
*
|
|
70
30
|
* @param value - The numeric value to convert.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversion-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/conversion-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,UAAU,CAAC;AAsBvD
|
|
1
|
+
{"version":3,"file":"conversion-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/conversion-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,UAAU,CAAC;AAsBvD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,OAAO,GAClB,OAAO,MAAM,EACb,MAAM,oBAAoB,EAC1B,KAAK,oBAAoB,WAqB1B,CAAC;AA6BF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,MAAM,EACb,MAAM,oBAAoB,EAC1B,KAAK,oBAAoB,EACzB,SAAS;IACP,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,KACA;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CA4CtE,CAAC"}
|
|
@@ -45,7 +45,7 @@ export interface KosPersistenceStore {
|
|
|
45
45
|
/**
|
|
46
46
|
* Subscribe to a KOS Persistence Store or create a new one
|
|
47
47
|
* The store will be namespaced by the stateKey and the sessionId allows
|
|
48
|
-
* for multiple instances of data to be created with the same store using
|
|
48
|
+
* for multiple instances of data to be created with the same store using the session id
|
|
49
49
|
* as the discriminator.
|
|
50
50
|
*
|
|
51
51
|
* If the sessionId is not provided, the store will be global
|
|
@@ -88,74 +88,40 @@ export type PutPaths = ValidPaths["put"];
|
|
|
88
88
|
export type DeletePaths = ValidPaths["delete"];
|
|
89
89
|
export type ApiResponse<Path extends ApiPath, Method extends "get" | "post" | "put" | "delete" = "get"> = ClientResponse<KosApi, Path, Method>;
|
|
90
90
|
/**
|
|
91
|
-
* Request options for
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```typescript
|
|
96
|
-
* const options: KosRequestOptions = {
|
|
97
|
-
* destinationAddress: 'device-123',
|
|
98
|
-
* headers: { 'X-Custom-Header': 'value' },
|
|
99
|
-
* timeout: 5000
|
|
100
|
-
* };
|
|
101
|
-
* ```
|
|
91
|
+
* Request options for a service call: destination address, headers, timeout and
|
|
92
|
+
* other transport options.
|
|
102
93
|
*/
|
|
103
94
|
export type { RequestOptions as KosRequestOptions };
|
|
104
95
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
96
|
+
* Execution context typed against the KOS SDK OpenAPI paths. It is injected as
|
|
97
|
+
* the last parameter of methods decorated with `@kosServiceRequest` (without a
|
|
98
|
+
* lifecycle), which add `$request`, or `@kosFuture` with
|
|
99
|
+
* `trackerPolicy: "context"`, which adds the `$tracker` id.
|
|
108
100
|
*
|
|
109
|
-
* @example
|
|
101
|
+
* @example
|
|
110
102
|
* ```typescript
|
|
111
|
-
* @kosServiceRequest({
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* })
|
|
115
|
-
* async refreshStatus(
|
|
116
|
-
* ctx: ExecutionContext<typeof PATH_DEVICE_STATUS, 'get'>
|
|
117
|
-
* ): Promise<void> {
|
|
118
|
-
* const [error, response] = await ctx.$request({
|
|
119
|
-
* queryParams: { includeMetadata: true }, // ← Fully typed!
|
|
120
|
-
* requestOptions: {
|
|
121
|
-
* destinationAddress: 'device-123',
|
|
122
|
-
* timeout: 5000
|
|
123
|
-
* }
|
|
124
|
-
* });
|
|
103
|
+
* @kosServiceRequest({ path: PATH_DEVICE_STATUS, method: "get" })
|
|
104
|
+
* async refreshStatus(ctx: ExecutionContext<typeof PATH_DEVICE_STATUS, "get">): Promise<void> {
|
|
105
|
+
* const [error, response] = await ctx.$request!({ requestOptions: { timeout: 5000 } });
|
|
125
106
|
* if (error) throw new Error(error);
|
|
126
107
|
* this.status = response?.status;
|
|
127
108
|
* }
|
|
128
109
|
* ```
|
|
129
|
-
*
|
|
130
|
-
* @example With @kosFuture (context-based tracker)
|
|
131
|
-
* ```typescript
|
|
132
|
-
* @kosFuture({ trackerPolicy: 'context' })
|
|
133
|
-
* async loadData(filter: string, ctx: ExecutionContext): Promise<Data> {
|
|
134
|
-
* const data = await fetchData(filter);
|
|
135
|
-
* ctx.$tracker?.complete();
|
|
136
|
-
* return data;
|
|
137
|
-
* }
|
|
138
|
-
* ```
|
|
139
110
|
*/
|
|
140
111
|
export type ExecutionContext<Path extends ApiPath = ApiPath, Method extends HttpMethod = "get"> = KosExecutionContext<paths, Path, Method>;
|
|
141
112
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* Provides full IntelliSense and type safety for path, query params, and body
|
|
145
|
-
* based on the KOS SDK OpenAPI schema.
|
|
113
|
+
* `@kosServiceRequest` typed against the KOS SDK OpenAPI paths, so the path,
|
|
114
|
+
* query parameters and body are checked against the schema.
|
|
146
115
|
*
|
|
147
116
|
* @example
|
|
148
117
|
* ```typescript
|
|
149
|
-
* import { kosServiceRequest, PATH_DEVICE_STATUS } from '../../utils/service';
|
|
150
|
-
*
|
|
151
118
|
* @kosServiceRequest({
|
|
152
119
|
* path: PATH_DEVICE_STATUS,
|
|
153
|
-
* method:
|
|
120
|
+
* method: "get",
|
|
154
121
|
* lifecycle: DependencyLifecycle.LOAD,
|
|
155
|
-
* queryParams: { includeMetadata: true } // ← Fully typed!
|
|
156
122
|
* })
|
|
157
123
|
* private onStatusLoaded(): void {
|
|
158
|
-
*
|
|
124
|
+
* this.status = getServiceResponse(this, PATH_DEVICE_STATUS);
|
|
159
125
|
* }
|
|
160
126
|
* ```
|
|
161
127
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAwB,CAAC;AAElC,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC;AAC3B,MAAM,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC;AAClC,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;AAE9C,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AACzC,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AAE/C,MAAM,MAAM,WAAW,CACrB,IAAI,SAAS,OAAO,EACpB,MAAM,SAAS,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,IACtD,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAwB,CAAC;AAElC,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC;AAC3B,MAAM,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC;AAClC,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;AAE9C,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AACzC,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AAE/C,MAAM,MAAM,WAAW,CACrB,IAAI,SAAS,OAAO,EACpB,MAAM,SAAS,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,IACtD,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEzC;;;GAGG;AACH,YAAY,EAAE,cAAc,IAAI,iBAAiB,EAAE,CAAC;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,gBAAgB,CAC1B,IAAI,SAAS,OAAO,GAAG,OAAO,EAC9B,MAAM,SAAS,UAAU,GAAG,KAAK,IAC/B,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,SAAS,OAAO,EACpB,MAAM,SAAS,UAAU,GAAG,KAAK,EACjC,QAAQ,GAAG,GAAG,EACd,mBAAmB,GAAG,QAAQ,EAE9B,MAAM,EAAE,wBAAwB,CAC9B,KAAK,EACL,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,mBAAmB,CACpB,4FASF;AAED,eAAe,GAAG,CAAC"}
|
|
@@ -9,7 +9,7 @@ export type Api = paths;
|
|
|
9
9
|
export type ApiPath = keyof paths;
|
|
10
10
|
export type ValidPaths = PathsByMethod<paths>;
|
|
11
11
|
/**
|
|
12
|
-
* Methods a response type can be derived for
|
|
12
|
+
* Methods a response type can be derived for: the lowercase subset of
|
|
13
13
|
* HttpMethod. The uppercase spellings HttpMethod also permits do not match the
|
|
14
14
|
* keys of an OpenAPI `paths` object, so they would silently yield `unknown`.
|
|
15
15
|
*/
|
|
@@ -53,8 +53,8 @@ export interface Endpoint {
|
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Declare an endpoint once. The decorator config, the execution context type
|
|
56
|
-
* and the response type are all derived from the result, so
|
|
57
|
-
*
|
|
56
|
+
* and the response type are all derived from the result, so the path string
|
|
57
|
+
* is written once and cannot drift between them.
|
|
58
58
|
*
|
|
59
59
|
* @example
|
|
60
60
|
* ```typescript
|
|
@@ -69,7 +69,7 @@ export declare function endpoint<Path extends ApiPath, Method extends SupportedM
|
|
|
69
69
|
readonly method: Method;
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
|
-
* Execution context for an endpoint
|
|
72
|
+
* Execution context for an endpoint: the method-driven `$ctx` parameter type.
|
|
73
73
|
* Pass `Transformed` when the decorator declares a `transform`, so what the
|
|
74
74
|
* method receives is typed as the mapper's output rather than the raw response.
|
|
75
75
|
*/
|
|
@@ -9,7 +9,7 @@ export type Api = paths;
|
|
|
9
9
|
export type ApiPath = keyof paths;
|
|
10
10
|
export type ValidPaths = PathsByMethod<paths>;
|
|
11
11
|
/**
|
|
12
|
-
* Methods a response type can be derived for
|
|
12
|
+
* Methods a response type can be derived for: the lowercase subset of
|
|
13
13
|
* HttpMethod. The uppercase spellings HttpMethod also permits do not match the
|
|
14
14
|
* keys of an OpenAPI `paths` object, so they would silently yield `unknown`.
|
|
15
15
|
*/
|
|
@@ -53,8 +53,8 @@ export interface Endpoint {
|
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Declare an endpoint once. The decorator config, the execution context type
|
|
56
|
-
* and the response type are all derived from the result, so
|
|
57
|
-
*
|
|
56
|
+
* and the response type are all derived from the result, so the path string
|
|
57
|
+
* is written once and cannot drift between them.
|
|
58
58
|
*
|
|
59
59
|
* @example
|
|
60
60
|
* ```typescript
|
|
@@ -69,7 +69,7 @@ export declare function endpoint<Path extends ApiPath, Method extends SupportedM
|
|
|
69
69
|
readonly method: Method;
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
|
-
* Execution context for an endpoint
|
|
72
|
+
* Execution context for an endpoint: the method-driven `$ctx` parameter type.
|
|
73
73
|
* Pass `Transformed` when the decorator declares a `transform`, so what the
|
|
74
74
|
* method receives is typed as the mapper's output rather than the raw response.
|
|
75
75
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer-manager.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/timer-manager.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"timer-manager.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/timer-manager.ts"],"names":[],"mappings":"AACA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAQD;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAAC,CAAiB;IAC/B,OAAO,CAAC,KAAK,CAA6D;IAC1E,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,cAAc,CAAyC;IAE/D,IAAI,EAAE,WAEL;IACD;;;;;OAKG;gBAED,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,EAC3C,cAAc,CAAC,EAAE,WAAW,EAAE;IAiChC;;OAEG;IACI,KAAK;IAYZ;;OAEG;IACI,KAAK;IAQZ;;OAEG;IACI,OAAO;IAKd;;;OAGG;IACI,KAAK;IAML,aAAa,CAAC,OAAO,EAAE,MAAM;IAKpC;;;OAGG;IACI,gBAAgB,CAAC,WAAW,EAAE,WAAW;IAiBhD;;;OAGG;IACI,mBAAmB,CAAC,UAAU,EAAE,MAAM;IAc7C;;OAEG;IACH,OAAO,CAAC,WAAW;IAkBnB;;;OAGG;IACH,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,UAAU;IAMlB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAO5B;AAmBD;;GAEG;AACH,eAAO,MAAM,YAAY;IACvB;;;;;;OAMG;8BAEK,MAAM,QACN,IAAI,mBACO,WAAW,EAAE;IAMhC;;;;;;OAMG;sBACe,MAAM,qCAAiC,WAAW,EAAE;IAStE;;;;OAIG;mBACY,MAAM;IAIrB;;;OAGG;qBACc,MAAM;IAIvB;;;OAGG;uBACgB,MAAM;IAIzB;;;OAGG;qBACc,MAAM;IAIvB;;;;OAIG;2BACoB,MAAM,UAAU,WAAW;IAIlD;;;;OAIG;8BACuB,MAAM,cAAc,MAAM;IAIpD;;;OAGG;qBACc,MAAM;CAGxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-ui-sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"kos": {
|
|
61
61
|
"build": {
|
|
62
|
-
"gitHash": "
|
|
62
|
+
"gitHash": "b9e5f8aef087e5b4dfb73cd8b92598cbca8c0e49"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|