@kosdev-code/kos-ui-sdk 0.1.0-next.948 → 0.1.0-next.962
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/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 +150 -88
- package/core/core/decorators/kos-container-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-reload-aware.d.ts +10 -8
- package/core/core/decorators/kos-reload-aware.d.ts.map +1 -1
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/kosCore.d.ts +4 -1
- 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/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/reconnect/reconnect-fixture.d.ts +17 -0
- package/core/core/reconnect/reconnect-fixture.d.ts.map +1 -0
- 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/util/model-type-guards.d.ts.map +1 -1
- package/index.cjs +134 -90
- package/index.cjs.map +1 -1
- package/index.js +163 -119
- package/index.js.map +1 -1
- package/models/models/config-bean/config-bean-model.d.ts +9 -0
- package/models/models/config-bean/config-bean-model.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/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 +54 -19
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.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/package.json +3 -3
- package/{software-info-registration-CY_E6Rw7.cjs → software-info-registration-BAk6JWkz.cjs} +595 -214
- package/software-info-registration-BAk6JWkz.cjs.map +1 -0
- package/{software-info-registration-CuuEsH8v.js → software-info-registration-CefJgWke.js} +624 -243
- package/software-info-registration-CefJgWke.js.map +1 -0
- package/testing.cjs +1 -1
- package/testing.js +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/software-info-registration-CY_E6Rw7.cjs.map +0 -1
- package/software-info-registration-CuuEsH8v.js.map +0 -1
|
@@ -85,6 +85,15 @@ declare class ConfigBeanModelImpl<T extends {} = any> implements IKosDataModel {
|
|
|
85
85
|
* Fetches the bean's values and schema.
|
|
86
86
|
*/
|
|
87
87
|
load(): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* @internal
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* Fetches the bean again and updates its values and schema in place, so a
|
|
93
|
+
* KOS Core reload after a reconnect leaves the same instance current.
|
|
94
|
+
*/
|
|
95
|
+
reload(): Promise<void>;
|
|
96
|
+
private fetchBean;
|
|
88
97
|
/**
|
|
89
98
|
* Gets all available schema property keys.
|
|
90
99
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-bean-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/config-bean/config-bean-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,OAAO,EACP,oBAAoB,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAKL,2BAA2B,EAG5B,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAGL,KAAK,wBAAwB,EAE9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAO/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,oBAAoB,CACrE,mBAAmB,CAAC,CAAC,CAAC,CACvB,CAAC;AAYF,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAM1D;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,CAIR;AAiBD;;;GAGG;AACH,cACM,mBAAmB,CAAC,CAAC,SAAS,EAAE,GAAG,GAAG,CAAE,YAAW,aAAa;IACpE,yDAAyD;IACzD,OAAO,CAAC,iBAAiB,CAAiC;IAE1D,0DAA0D;IAC1D,OAAO,CAAC,cAAc,CAA8B;IAEpD,oEAAoE;IACpE,OAAO,CAAC,OAAO,CAAC,CAAiB;IACjC,8DAA8D;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAE/D,oFAAoF;IACpF,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAEnE,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;OAQG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB;IAsB7D;;;;OAIG;IACH,IAAI,MAAM,wCAET;IAED;;OAEG;IACG,KAAK;IAIX;;;;;OAKG;IACG,IAAI;
|
|
1
|
+
{"version":3,"file":"config-bean-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/config-bean/config-bean-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,OAAO,EACP,oBAAoB,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAKL,2BAA2B,EAG5B,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAGL,KAAK,wBAAwB,EAE9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAO/C;;;;;;;;;;;;;;;;;;;;;;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,EAAE,MAAM;IAahC;;;;;;;OAOG;IACG,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,mBAAmB;IAIvE;;;;;;;;;;OAUG;IACG,gBAAgB;IAYtB;;;;;;;OAOG;IAOH,uBAAuB,CAAC,UAAU,EAAE,wBAAwB;CAG7D;AAED,eAAO,MAAM,UAAU,6EAMrB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GpioChipModel } from './gpio-chip-model';
|
|
2
|
+
import { GpioChipContainerResponse } from './services';
|
|
3
|
+
import { GpioChipOptions } from './types';
|
|
4
|
+
export type GpioChipResponse = GpioChipContainerResponse[number];
|
|
5
|
+
export interface GpioChipDto extends GpioChipOptions {
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function mapGpioChipToOptions(dto: GpioChipDto): GpioChipOptions;
|
|
9
|
+
export declare function createGpioChipModel(dto: GpioChipDto): GpioChipModel;
|
|
10
|
+
export declare function updateGpioChipModel(dto: GpioChipDto, model: GpioChipModel): void;
|
|
11
|
+
export declare function filterGpioChipDto(chip: GpioChipResponse): boolean;
|
|
12
|
+
export declare function mapGpioChipId(chip: GpioChipResponse): GpioChipDto;
|
|
13
|
+
export declare function afterGpioChipCreated(model: GpioChipModel, dto: GpioChipDto): void;
|
|
14
|
+
//# sourceMappingURL=gpio-chip-builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpio-chip-builders.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/gpio-chip/gpio-chip-builders.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAEjE,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,eAAe,CAEtE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,WAAW,GAAG,aAAa,CAEnE;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,aAAa,GACnB,IAAI,CAEN;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAEjE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW,CASjE;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,EACpB,GAAG,EAAE,WAAW,GACf,IAAI,CAWN"}
|
|
@@ -6,9 +6,10 @@ import { PublicModelInterface } from '../../../core/types';
|
|
|
6
6
|
import { GpioChipModel } from './gpio-chip-model';
|
|
7
7
|
import { GpioChipContainerResponse } from './services';
|
|
8
8
|
import { GpioChipContainerOptions } from './types';
|
|
9
|
+
import { GpioChipResponse } from './gpio-chip-builders';
|
|
9
10
|
export declare const MODEL_TYPE = "gpio-chip-container-model";
|
|
10
11
|
export type GpioChipContainerModel = PublicModelInterface<GpioChipContainerModelImpl>;
|
|
11
|
-
export interface GpioChipContainerModelImpl extends KosLoggerAware, KosContainerAware<GpioChipModel> {
|
|
12
|
+
export interface GpioChipContainerModelImpl extends KosLoggerAware, KosContainerAware<GpioChipModel, GpioChipResponse> {
|
|
12
13
|
}
|
|
13
14
|
export declare class GpioChipContainerModelImpl implements IKosIdentifiable, IKosDataModel {
|
|
14
15
|
static Registration: SingletonKosModelRegistrationFactory<GpioChipContainerModel, GpioChipContainerOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpio-chip-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/gpio-chip/gpio-chip-container-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"gpio-chip-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/gpio-chip/gpio-chip-container-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,UAAU,8BAA8B,CAAC;AAEtD,MAAM,MAAM,sBAAsB,GAChC,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;AAGnD,MAAM,WAAW,0BACf,SAAQ,cAAc,EACpB,iBAAiB,CAAC,aAAa,EAAE,gBAAgB,CAAC;CAAG;AAEzD,qBAca,0BACX,YAAW,gBAAgB,EAAE,aAAa;IAG1C,MAAM,CAAC,YAAY,EAAE,oCAAoC,CACvD,sBAAsB,EACtB,wBAAwB,CACzB,CAAC;IAEF,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,MAAM,CAAC;gBAEf,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB;IAK9D,WAAW,CAAC,QAAQ,EAAE,wBAAwB,GAAG,IAAI;IAoB/C,kBAAkB,CACtB,MAAM,EAAE,KAAK,EACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,GAClD,OAAO,CAAC,IAAI,CAAC;IAsDV,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B;AACD,eAAO,MAAM,iBAAiB,wFAA0C,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Parser } from 'expr-eval';
|
|
2
|
+
import { KosData } from '../../../core';
|
|
3
|
+
import { ExpressionResult } from './kos-expression-evaluator-model';
|
|
4
|
+
/**
|
|
5
|
+
* An expression parsed once and evaluated against any context object.
|
|
6
|
+
*/
|
|
7
|
+
export interface ParsedExpression {
|
|
8
|
+
/** The expression string it was parsed from */
|
|
9
|
+
readonly expression: string;
|
|
10
|
+
/** Evaluate against the given context data; a failure is returned as `error`, not thrown */
|
|
11
|
+
evaluate(contextData: Record<string, unknown>): ExpressionResult;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parsed expressions keyed by expression string, least recently used evicted
|
|
15
|
+
* first once `limit` is reached.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ExpressionParseCache {
|
|
18
|
+
private readonly parser;
|
|
19
|
+
private readonly limit;
|
|
20
|
+
private readonly entries;
|
|
21
|
+
constructor(parser: Parser, limit?: number);
|
|
22
|
+
parse(expression: string): ParsedExpression;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Layers `local` over `base` without copying either: a key `local` owns wins,
|
|
26
|
+
* every other key reads through to `base`.
|
|
27
|
+
*/
|
|
28
|
+
export declare const layerContext: (base: KosData<Record<string, unknown>>, local: Record<string, unknown>) => Record<string, unknown>;
|
|
29
|
+
//# sourceMappingURL=expression-parse-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expression-parse-cache.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/kos-expression-evaluator/expression-parse-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+CAA+C;IAC/C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,4FAA4F;IAC5F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAAC;CAClE;AA6BD;;;GAGG;AACH,qBAAa,oBAAoB;IAI7B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuC;gBAG5C,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,MAA0B;IAGpD,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB;CAkB5C;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACtC,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAUrB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { KosExpressionEvaluatorModel, KosExpressionEvaluatorModelImpl, ExpressionResult, NamedExpression, } from './kos-expression-evaluator-model';
|
|
2
|
+
export type { ParsedExpression } from './expression-parse-cache';
|
|
2
3
|
export type * from './types';
|
|
3
4
|
export declare const KosExpressionEvaluator: import('../../..').KosModelRegistrationType<import('./kos-expression-evaluator-model').KosExpressionEvaluatorModel<string>, import('./types').KosExpressionEvaluatorOptions>;
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/kos-expression-evaluator/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,2BAA2B,EAC3B,+BAA+B,EAC/B,gBAAgB,EAChB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,mBAAmB,SAAS,CAAC;AAE7B,eAAO,MAAM,sBAAsB,8KACW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/kos-expression-evaluator/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,2BAA2B,EAC3B,+BAA+B,EAC/B,gBAAgB,EAChB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,mBAAmB,SAAS,CAAC;AAE7B,eAAO,MAAM,sBAAsB,8KACW,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { KosModelRegistrationType } from '../../../core';
|
|
|
2
2
|
import { IKosDataModel, KosCreationContext } from '../../../core/core/kosModel';
|
|
3
3
|
import { IKosIdentifiable } from '../../../core/core/types';
|
|
4
4
|
import { PublicModelInterface } from '../../../core/types';
|
|
5
|
+
import { ParsedExpression } from './expression-parse-cache';
|
|
5
6
|
import { KosExpressionEvaluatorOptions } from './types';
|
|
6
7
|
export declare const MODEL_TYPE = "kos-expression-evaluator-model";
|
|
7
8
|
/**
|
|
@@ -18,18 +19,25 @@ export interface NamedExpression {
|
|
|
18
19
|
name: string;
|
|
19
20
|
/** The expression string (JavaScript-like syntax) */
|
|
20
21
|
expression: string;
|
|
21
|
-
/**
|
|
22
|
+
/** The current result, re-evaluated only after a context value it read changes */
|
|
22
23
|
get result(): ExpressionResult;
|
|
23
|
-
/**
|
|
24
|
+
/** Evaluate the expression against the given context data */
|
|
24
25
|
evaluate(contextData: Record<string, unknown>): ExpressionResult;
|
|
25
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated The result is derived from the context data; this has no effect.
|
|
28
|
+
*/
|
|
26
29
|
updateResult(result: ExpressionResult): void;
|
|
27
30
|
}
|
|
28
31
|
/**
|
|
29
32
|
* Evaluates named expressions against context data and keeps their results
|
|
30
|
-
* current.
|
|
31
|
-
*
|
|
32
|
-
* or
|
|
33
|
+
* current. Each expression's result is a computed over the context values it
|
|
34
|
+
* reads: it re-evaluates only after one of those values changes, and only when
|
|
35
|
+
* read. A `kosComponent` or model effect that reads `results[name]` re-renders
|
|
36
|
+
* when that expression's result changes, and not for any other expression.
|
|
37
|
+
*
|
|
38
|
+
* `evaluateWithLocalContext` evaluates an expression against the context with
|
|
39
|
+
* a local object layered over it, such as a list row's item, and
|
|
40
|
+
* `parseExpression` returns a cached parse to evaluate against any object.
|
|
33
41
|
*
|
|
34
42
|
* Expressions use `expr-eval` syntax, plus the built-in functions `exists(value)`
|
|
35
43
|
* and `isEmpty(value)` and any `customFunctions` passed in the options. The type
|
|
@@ -60,7 +68,8 @@ export declare class KosExpressionEvaluatorModelImpl<T extends string = string>
|
|
|
60
68
|
private parser;
|
|
61
69
|
private _data;
|
|
62
70
|
private _expressions;
|
|
63
|
-
private
|
|
71
|
+
private _parseCache;
|
|
72
|
+
private _resultsView;
|
|
64
73
|
private _contextRevision;
|
|
65
74
|
constructor(modelId: string, options: KosExpressionEvaluatorOptions, context: KosCreationContext);
|
|
66
75
|
/**
|
|
@@ -71,7 +80,8 @@ export declare class KosExpressionEvaluatorModelImpl<T extends string = string>
|
|
|
71
80
|
get data(): Record<string, unknown>;
|
|
72
81
|
get contextRevision(): number;
|
|
73
82
|
/**
|
|
74
|
-
* Replace the context data.
|
|
83
|
+
* Replace the context data. An expression re-evaluates only if a value it
|
|
84
|
+
* read changed.
|
|
75
85
|
*
|
|
76
86
|
* @param newData - Complete new context data to replace existing data
|
|
77
87
|
*/
|
|
@@ -100,35 +110,60 @@ export declare class KosExpressionEvaluatorModelImpl<T extends string = string>
|
|
|
100
110
|
*/
|
|
101
111
|
addModelToContext(key: string, model: unknown): void;
|
|
102
112
|
/**
|
|
103
|
-
* Add a named expression
|
|
113
|
+
* Add a named expression. It evaluates on first read. Adding a name that
|
|
114
|
+
* exists replaces that expression.
|
|
104
115
|
*
|
|
105
116
|
* @param name - Unique identifier for this expression
|
|
106
117
|
* @param expressionString - Expression in `expr-eval` syntax
|
|
107
118
|
* @throws {Error} If the expression has invalid syntax
|
|
108
119
|
*/
|
|
109
120
|
addExpression(name: T, expressionString: string): void;
|
|
121
|
+
/**
|
|
122
|
+
* Remove a named expression and release the context values it tracks.
|
|
123
|
+
*
|
|
124
|
+
* @param name - The expression name
|
|
125
|
+
* @returns Whether an expression was removed
|
|
126
|
+
*/
|
|
110
127
|
removeExpression(name: T): boolean;
|
|
111
128
|
getExpression(name: T): NamedExpression | undefined;
|
|
112
129
|
getExpressionValue(name: T): ExpressionResult | undefined;
|
|
113
130
|
/**
|
|
114
|
-
* The
|
|
115
|
-
*
|
|
131
|
+
* The result of an expression without a warning when it does not exist. It
|
|
132
|
+
* re-evaluates only if a context value it read changed since the last
|
|
133
|
+
* evaluation, and a reader tracks the result, not the expression's inputs.
|
|
116
134
|
*
|
|
117
|
-
* @param name - The expression name to get the
|
|
118
|
-
* @returns The
|
|
135
|
+
* @param name - The expression name to get the result for
|
|
136
|
+
* @returns The result, or undefined if expression doesn't exist
|
|
119
137
|
*/
|
|
120
138
|
getCachedExpressionValue(name: T): ExpressionResult | undefined;
|
|
121
139
|
get expressions(): NamedExpression[];
|
|
122
140
|
get expressionNames(): T[];
|
|
141
|
+
/**
|
|
142
|
+
* Every expression's result by name. Reading `results[name]` evaluates only
|
|
143
|
+
* that expression, and only if a context value it read changed.
|
|
144
|
+
*/
|
|
123
145
|
get results(): Record<T, ExpressionResult>;
|
|
124
|
-
/** Re-evaluate every expression and update the cached results. */
|
|
125
|
-
private evaluateAllExpressions;
|
|
126
146
|
/**
|
|
127
|
-
*
|
|
147
|
+
* Parse an expression, or return the cached parse of the same string, to
|
|
148
|
+
* evaluate against any context object.
|
|
149
|
+
*
|
|
150
|
+
* @param expressionString - Expression in `expr-eval` syntax
|
|
151
|
+
* @returns The parsed expression
|
|
152
|
+
* @throws {Error} If the expression has invalid syntax
|
|
153
|
+
*/
|
|
154
|
+
parseExpression(expressionString: string): ParsedExpression;
|
|
155
|
+
/**
|
|
156
|
+
* Evaluate an expression against the context data with `localContext`
|
|
157
|
+
* layered over it, without copying either. A key in `localContext` wins over
|
|
158
|
+
* the same context key. Called from a reactive render, the reader tracks only
|
|
159
|
+
* the values the expression read.
|
|
160
|
+
*
|
|
161
|
+
* @param expressionString - Expression in `expr-eval` syntax
|
|
162
|
+
* @param localContext - Values that apply to this evaluation only, such as a row's item
|
|
163
|
+
* @returns The result; a syntax or evaluation failure is returned as `error`
|
|
128
164
|
*/
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
private updateResult;
|
|
165
|
+
evaluateWithLocalContext(expressionString: string, localContext?: Record<string, unknown>): ExpressionResult;
|
|
166
|
+
private createResultsView;
|
|
132
167
|
/**
|
|
133
168
|
* Add an expression under a generated id and return the id, for use with
|
|
134
169
|
* `getExpressionValue(id)` or `results[id]`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-expression-evaluator-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/kos-expression-evaluator/kos-expression-evaluator-model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kos-expression-evaluator-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/kos-expression-evaluator/kos-expression-evaluator-model.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,wBAAwB,EAC9B,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACV,aAAa,EAEb,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGhE,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,UAAU,mCAAmC,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,KAAK,EAAE,OAAO,CAAC;IACf,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiED,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,IAAI,MAAM,IAAI,gBAAgB,CAAC;IAC/B,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAAC;IACjE;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,2BAA2B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAC/D,oBAAoB,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3D;;;GAGG;AACH,qBAC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I,EAAE,CAAC,GAAG,gBAAgB,GAAG,SAAS;IAazD;;;;;;;OAOG;IACH,wBAAwB,CAAC,IAAI,EAAE,CAAC,GAAG,gBAAgB,GAAG,SAAS;IAQ/D,IAAI,WAAW,IAAI,eAAe,EAAE,CAEnC;IAED,IAAI,eAAe,IAAI,CAAC,EAAE,CAEzB;IAED;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAEzC;IAED;;;;;;;OAOG;IACH,eAAe,CAAC,gBAAgB,EAAE,MAAM,GAAG,gBAAgB;IAI3D;;;;;;;;;OASG;IACH,wBAAwB,CACtB,gBAAgB,EAAE,MAAM,EACxB,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACzC,gBAAgB;IAanB,OAAO,CAAC,iBAAiB;IA2BzB;;;;;;OAMG;IACH,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM;CAUnD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TroubleResponse } from '../trouble/services';
|
|
2
|
+
import { TroubleModel, TroubleOptions } from '../trouble/types';
|
|
3
|
+
export interface TroubleDto {
|
|
4
|
+
id: string;
|
|
5
|
+
servicePath: string;
|
|
6
|
+
trouble: TroubleResponse;
|
|
7
|
+
}
|
|
8
|
+
export declare function mapTroubleToOptions(dto: TroubleDto): TroubleOptions;
|
|
9
|
+
export declare function createTroubleModel(dto: TroubleDto): TroubleModel;
|
|
10
|
+
export declare function mapTroubleToDto(trouble: TroubleResponse, servicePath: string): TroubleDto;
|
|
11
|
+
//# sourceMappingURL=trouble-builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trouble-builders.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/trouble-container/trouble-builders.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE1E,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,UAAU,GAAG,cAAc,CAWnE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,GAAG,YAAY,CAEhE;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,MAAM,GAClB,UAAU,CAEZ"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IKosDataModel, IKosIdentifiable, KosContainerAwareWithProp, KosFutureAwareFull, KosLoggerAware, KosModelRegistrationType, PublicModelInterface } from '../../../core';
|
|
2
2
|
import { TroubleResponse } from '../trouble/services';
|
|
3
3
|
import { TroubleModel } from '../trouble/types';
|
|
4
|
+
import { TroubleDto } from './trouble-builders';
|
|
4
5
|
import { TroubleContainerOptions } from './types';
|
|
5
6
|
export declare const MODEL_TYPE = "trouble-container-model";
|
|
6
7
|
export type TroubleContainerModel = PublicModelInterface<TroubleContainerModelImpl>;
|
|
7
|
-
export interface TroubleContainerModelImpl extends KosContainerAwareWithProp<TroubleModel, "troubles">, KosFutureAwareFull, KosLoggerAware {
|
|
8
|
+
export interface TroubleContainerModelImpl extends KosContainerAwareWithProp<TroubleModel, "troubles", TroubleDto>, KosFutureAwareFull, KosLoggerAware {
|
|
8
9
|
}
|
|
9
10
|
export declare class Troubles {
|
|
10
11
|
static readonly INDEX_TROUBLES_BY_IFACE = "byIface";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trouble-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/trouble-container/trouble-container-model.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"trouble-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/trouble-container/trouble-container-model.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAGvB,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,UAAU,4BAA4B,CAAC;AAEpD,MAAM,MAAM,qBAAqB,GAC/B,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;AAClD,MAAM,WAAW,yBACf,SAAQ,yBAAyB,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC,EACrE,kBAAkB,EAClB,cAAc;CAAG;AACrB,qBAAa,QAAQ;IACnB,MAAM,CAAC,QAAQ,CAAC,uBAAuB,aAAa;IACpD,MAAM,CAAC,QAAQ,CAAC,sBAAsB,YAAY;IAClD,MAAM,CAAC,QAAQ,CAAC,uBAAuB,aAAa;IACpD,MAAM,CAAC,QAAQ,CAAC,0BAA0B,gBAAgB;IAC1D,MAAM,CAAC,QAAQ,CAAC,aAAa,UAAU;IACvC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,UAAU;CAC5C;AACD,qBAgBa,yBACX,YAAW,gBAAgB,EAAE,aAAa;IAE1C,MAAM,CAAC,YAAY,EAAE,wBAAwB,CAC3C,yBAAyB,EACzB,uBAAuB,CACxB,CAAC;IACF,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,SAAuB;gBACtB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB;IAMvD,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IASvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBrB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM;IAYjC,oBAAoB,CAAC,EAAE,EAAE,MAAM;IAW/B,kBAAkB,CAAC,OAAO,EAAE,eAAe;CAQ5C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-ui-sdk",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.962",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-router-dom": "^6.11.2"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@kosdev-code/kos-api-levels": "0.1.0-next.
|
|
53
|
+
"@kosdev-code/kos-api-levels": "0.1.0-next.962",
|
|
54
54
|
"mobx": "^6.9.0",
|
|
55
55
|
"mobx-react-lite": "^3.4.3",
|
|
56
56
|
"date-fns": "^2.30.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"kos": {
|
|
61
61
|
"build": {
|
|
62
|
-
"gitHash": "
|
|
62
|
+
"gitHash": "74f83a9fea3ca5ee9f5bbead8f50cf7e81dd90c0"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|