@kosdev-code/kos-ui-sdk 3.0.2 → 3.0.3
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/core/core/indexing/index.d.ts +18 -0
- package/core/core/indexing/index.d.ts.map +1 -0
- package/core/core/indexing/kos-container-index-aware.d.ts +82 -0
- package/core/core/indexing/kos-container-index-aware.d.ts.map +1 -0
- package/core/core/indexing/kos-index-aware.d.ts +78 -0
- package/core/core/indexing/kos-index-aware.d.ts.map +1 -0
- package/core/core/indexing/topics.d.ts +43 -0
- package/core/core/indexing/topics.d.ts.map +1 -0
- package/core/core/indexing/types.d.ts +114 -0
- package/core/core/indexing/types.d.ts.map +1 -0
- package/core/core/kos-container-model.d.ts +17 -0
- package/core/core/kos-container-model.d.ts.map +1 -1
- package/core/index.d.ts +1 -0
- package/core/index.d.ts.map +1 -1
- package/index.cjs +189 -0
- package/index.cjs.map +1 -1
- package/index.js +189 -0
- package/index.js.map +1 -1
- package/models/utils/service-accessor.d.ts +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public surface of the kos-ui-sdk container indexing system.
|
|
3
|
+
*
|
|
4
|
+
* - Topics: `KosContainerIndexEvents` enum.
|
|
5
|
+
* - Types: `IndexRecord`, payload shapes, symbol/key constants.
|
|
6
|
+
* - Decorators: `kosIndexAware` (item-level), `kosContainerIndexAware`
|
|
7
|
+
* (container-level).
|
|
8
|
+
*
|
|
9
|
+
* Container-side membership publishing (ADDED, REMOVED) lives in
|
|
10
|
+
* `KosModelContainer` itself; consumers don't need to import
|
|
11
|
+
* anything to get it — adding an `@kosIndexAware` item to any
|
|
12
|
+
* container is enough.
|
|
13
|
+
*/
|
|
14
|
+
export { KosContainerIndexEvents } from './topics';
|
|
15
|
+
export { INDEX_COLLECTION_KEY, INDEX_RECORD_SYMBOL, isIndexableItem, type IndexableItem, type IndexAddedEvent, type IndexChangedEvent, type IndexPurgeEvent, type IndexRecord, type IndexRecordContribution, type IndexRemovedEvent, type IndexRequestSeedEvent, type IndexSeedEvent, } from './types';
|
|
16
|
+
export { kosIndexAware, type KosIndexAware, type KosIndexAwareOptions, } from './kos-index-aware';
|
|
17
|
+
export { kosContainerIndexAware, type KosContainerIndexAwareOptions, } from './kos-container-index-aware';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,GACnC,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container-level decorator that wires up the kos-ui-sdk container
|
|
3
|
+
* indexing system. Composes with the upstream `@kosContainerAware`
|
|
4
|
+
* (or with legacy `@kosChild`-based containers) — it only needs an
|
|
5
|
+
* `itemsProperty` pointing at the array of items the container
|
|
6
|
+
* exposes.
|
|
7
|
+
*
|
|
8
|
+
* Three responsibilities:
|
|
9
|
+
*
|
|
10
|
+
* 1. Wraps `init` so the decorator-declared collection is written
|
|
11
|
+
* onto the container's own `KosContext`. Items resolve the
|
|
12
|
+
* value via `KosContext.get(INDEX_COLLECTION_KEY)`, which
|
|
13
|
+
* auto-walks the parent chain.
|
|
14
|
+
*
|
|
15
|
+
* 2. Registers a `SubscriptionHandlers` entry for
|
|
16
|
+
* `KosContainerIndexEvents.REQUEST_SEED`. When a consumer
|
|
17
|
+
* publishes that topic, the container reads its current items,
|
|
18
|
+
* maps them via `INDEX_RECORD_SYMBOL`, and emits one SEED
|
|
19
|
+
* event. Lets subscribe order stop mattering.
|
|
20
|
+
*
|
|
21
|
+
* 3. Wraps `unload` to emit one PURGE per distinct collection in
|
|
22
|
+
* the current items, so consumers can drop the collection's
|
|
23
|
+
* records at container teardown.
|
|
24
|
+
*
|
|
25
|
+
* Membership detection (ADDED, REMOVED) is owned by
|
|
26
|
+
* `KosModelContainer` itself, not this decorator — the events fire
|
|
27
|
+
* at the moment of mutation, with no diffing or property-watching
|
|
28
|
+
* involved.
|
|
29
|
+
*
|
|
30
|
+
* Modeled on `kos-studio-state-aware`: class decorator, options
|
|
31
|
+
* object, `target.prototype[ModelEffects]` / `[SubscriptionHandlers]`
|
|
32
|
+
* registration pattern.
|
|
33
|
+
*
|
|
34
|
+
* @kosService core.indexing
|
|
35
|
+
* @kosApiLevel 22
|
|
36
|
+
*/
|
|
37
|
+
export interface KosContainerIndexAwareOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Name of the property on the container that exposes its items
|
|
40
|
+
* as an array. May be a `@kosContainerAware`-injected `data` /
|
|
41
|
+
* `models` getter, or a legacy custom getter (e.g.
|
|
42
|
+
* `virtualMachines` on a container with a `@kosChild`-managed
|
|
43
|
+
* collection).
|
|
44
|
+
*
|
|
45
|
+
* Used for SEED re-emission and PURGE. Membership add/remove
|
|
46
|
+
* events come from `KosModelContainer` directly and do not
|
|
47
|
+
* depend on this property.
|
|
48
|
+
*/
|
|
49
|
+
itemsProperty: string;
|
|
50
|
+
/**
|
|
51
|
+
* Collection tag written onto the container's own `KosContext`
|
|
52
|
+
* so child items can resolve it via auto-walk. Optional when
|
|
53
|
+
* items declare their own `collection` via `@kosIndexAware`
|
|
54
|
+
* (heterogeneous containers).
|
|
55
|
+
*/
|
|
56
|
+
collection?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Class decorator that wires a container model into the kos-ui-sdk
|
|
60
|
+
* indexing system.
|
|
61
|
+
*
|
|
62
|
+
* @example Homogeneous container — single collection
|
|
63
|
+
* ```ts
|
|
64
|
+
* @kosModel("image-container-model")
|
|
65
|
+
* @kosContainerAware<IImageModel>()
|
|
66
|
+
* @kosContainerIndexAware({ itemsProperty: "data", collection: "images" })
|
|
67
|
+
* class ImageContainerModelImpl implements IKosDataModel { ... }
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example Heterogeneous container — items declare their own collection
|
|
71
|
+
* ```ts
|
|
72
|
+
* @kosModel("virtual-machine-container-model")
|
|
73
|
+
* @kosContainerIndexAware({ itemsProperty: "virtualMachines" })
|
|
74
|
+
* class VirtualMachineContainerModelImpl implements IKosDataModel { ... }
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @category KOS Model Decorator
|
|
78
|
+
* @kosService core.indexing
|
|
79
|
+
* @kosApiLevel 22
|
|
80
|
+
*/
|
|
81
|
+
export declare function kosContainerIndexAware(options: KosContainerIndexAwareOptions): ClassDecorator;
|
|
82
|
+
//# sourceMappingURL=kos-container-index-aware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kos-container-index-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/kos-container-index-aware.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAqBH,MAAM,WAAW,6BAA6B;IAC5C;;;;;;;;;;OAUG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,6BAA6B,GACrC,cAAc,CAWhB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { INDEX_RECORD_SYMBOL, IndexRecordContribution } from './types';
|
|
2
|
+
export interface KosIndexAwareOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Per-item collection tag. May be:
|
|
5
|
+
*
|
|
6
|
+
* - A static string.
|
|
7
|
+
* - A function called with the instance, returning the tag
|
|
8
|
+
* (heterogeneous case where one container holds items belonging
|
|
9
|
+
* to multiple collections, distinguished by some item property).
|
|
10
|
+
* - Undefined — the item resolves its collection from its
|
|
11
|
+
* `KosContext` (auto-walks the parent chain). When the item
|
|
12
|
+
* lives under a `@kosContainerIndexAware`-decorated container,
|
|
13
|
+
* that container has already written its declared collection
|
|
14
|
+
* onto its own context, so this resolves transparently with no
|
|
15
|
+
* per-item declaration needed.
|
|
16
|
+
*/
|
|
17
|
+
collection?: string | ((self: any) => string | undefined);
|
|
18
|
+
/**
|
|
19
|
+
* Field names projected into the index record and watched for
|
|
20
|
+
* change. Empty/absent means no CHANGED events are emitted; the
|
|
21
|
+
* record still exposes `id`, `modelType`, and `collection`.
|
|
22
|
+
*/
|
|
23
|
+
fields?: string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Use TypeScript interface merging to attach the indexable contract
|
|
27
|
+
* to your model class:
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* interface MyItemModelImpl extends KosIndexAware {}
|
|
31
|
+
*
|
|
32
|
+
* @kosModel("my-item-model")
|
|
33
|
+
* @kosIndexAware({ collection: "items", fields: ["name"] })
|
|
34
|
+
* class MyItemModelImpl implements IKosDataModel { ... }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Mirrors the `KosLoggerAware` / `KosContainerAware` pattern.
|
|
38
|
+
*/
|
|
39
|
+
export interface KosIndexAware {
|
|
40
|
+
readonly [INDEX_RECORD_SYMBOL]: IndexRecordContribution;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Class decorator that registers a model as a publisher of index
|
|
44
|
+
* records.
|
|
45
|
+
*
|
|
46
|
+
* Reads `id` and `modelTypeId` off the instance at record-construction
|
|
47
|
+
* time. Both are part of the standard kos-model surface — `id` from
|
|
48
|
+
* `IKosIdentifiable`, `modelTypeId` from `@kosModel`. No author
|
|
49
|
+
* duplication needed.
|
|
50
|
+
*
|
|
51
|
+
* @example Heterogeneous container — collection resolved per item
|
|
52
|
+
* ```ts
|
|
53
|
+
* interface VirtualMachineModelImpl extends KosIndexAware {}
|
|
54
|
+
*
|
|
55
|
+
* @kosModel("virtual-machine-model")
|
|
56
|
+
* @kosIndexAware({
|
|
57
|
+
* collection: (self) => self.type,
|
|
58
|
+
* fields: ["name", "desc"],
|
|
59
|
+
* })
|
|
60
|
+
* class VirtualMachineModelImpl implements IKosDataModel { ... }
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Homogeneous — collection declared on the container instead
|
|
64
|
+
* ```ts
|
|
65
|
+
* @kosModel("image-model")
|
|
66
|
+
* @kosIndexAware({ fields: ["name"] })
|
|
67
|
+
* class ImageModelImpl implements IKosDataModel { ... }
|
|
68
|
+
*
|
|
69
|
+
* @kosContainerIndexAware({ itemsProperty: "images", collection: "images" })
|
|
70
|
+
* class ImageContainerModelImpl ...
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @category KOS Model Decorator
|
|
74
|
+
* @kosService core.indexing
|
|
75
|
+
* @kosApiLevel 22
|
|
76
|
+
*/
|
|
77
|
+
export declare function kosIndexAware(options?: KosIndexAwareOptions): ClassDecorator;
|
|
78
|
+
//# sourceMappingURL=kos-index-aware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kos-index-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/kos-index-aware.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAOH,OAAO,EAEL,mBAAmB,EAEnB,KAAK,uBAAuB,EAC7B,MAAM,SAAS,CAAC;AAMjB,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;IAE1D;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAMD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,CAAC,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;CACzD;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,cAAc,CAY5E"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventBus topic constants for the kos-ui-sdk container indexing
|
|
3
|
+
* system.
|
|
4
|
+
*
|
|
5
|
+
* `KosModelContainer` publishes ADDED and REMOVED directly when its
|
|
6
|
+
* items are mutated. The `@kosIndexAware` decorator publishes CHANGED
|
|
7
|
+
* via a model-effect over its declared fields. The
|
|
8
|
+
* `@kosContainerIndexAware` decorator publishes SEED on demand and
|
|
9
|
+
* PURGE on unload, and subscribes to REQUEST_SEED for late-attach
|
|
10
|
+
* consumer handshakes.
|
|
11
|
+
*
|
|
12
|
+
* Topic naming is intentionally flat (`kos/model/container/index/<verb>`)
|
|
13
|
+
* — the collection is carried in the payload, not the topic, so a
|
|
14
|
+
* single subscribe gives a consumer visibility into the entire index.
|
|
15
|
+
*
|
|
16
|
+
* @kosService core.indexing
|
|
17
|
+
* @kosApiLevel 22
|
|
18
|
+
*/
|
|
19
|
+
export declare enum KosContainerIndexEvents {
|
|
20
|
+
/** A new item was added to an indexable collection. */
|
|
21
|
+
ADDED = "kos/model/container/index/added",
|
|
22
|
+
/** An item was removed from an indexable collection. */
|
|
23
|
+
REMOVED = "kos/model/container/index/removed",
|
|
24
|
+
/** An item's declared index fields changed. */
|
|
25
|
+
CHANGED = "kos/model/container/index/changed",
|
|
26
|
+
/**
|
|
27
|
+
* A container's current contents as a single snapshot. Emitted in
|
|
28
|
+
* response to REQUEST_SEED so late-attaching consumers can
|
|
29
|
+
* re-establish their index without per-item events.
|
|
30
|
+
*/
|
|
31
|
+
SEED = "kos/model/container/index/seed",
|
|
32
|
+
/**
|
|
33
|
+
* A container is being unloaded; the index should drop all records
|
|
34
|
+
* matching the carried collection.
|
|
35
|
+
*/
|
|
36
|
+
PURGE = "kos/model/container/index/purge",
|
|
37
|
+
/**
|
|
38
|
+
* Consumer-initiated request that all already-`ready()`
|
|
39
|
+
* containers re-emit a SEED. Lets subscribe order stop mattering.
|
|
40
|
+
*/
|
|
41
|
+
REQUEST_SEED = "kos/model/container/index/request-seed"
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=topics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topics.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/topics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,uBAAuB;IACjC,uDAAuD;IACvD,KAAK,oCAAoC;IAEzC,wDAAwD;IACxD,OAAO,sCAAsC;IAE7C,+CAA+C;IAC/C,OAAO,sCAAsC;IAE7C;;;;OAIG;IACH,IAAI,mCAAmC;IAEvC;;;OAGG;IACH,KAAK,oCAAoC;IAEzC;;;OAGG;IACH,YAAY,2CAA2C;CACxD"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type contracts for the kos-ui-sdk container indexing system.
|
|
3
|
+
*
|
|
4
|
+
* The contracts live here rather than alongside any particular
|
|
5
|
+
* decorator so the decorators, the EventBus payloads, and downstream
|
|
6
|
+
* consumers can all import the same shapes without circular
|
|
7
|
+
* dependencies.
|
|
8
|
+
*
|
|
9
|
+
* @kosService core.indexing
|
|
10
|
+
* @kosApiLevel 22
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Property key used by `@kosIndexAware` to expose an item model's
|
|
14
|
+
* current index record. Keyed by `Symbol.for` so cross-bundle
|
|
15
|
+
* equality holds — the SDK is built separately from consumer code.
|
|
16
|
+
*
|
|
17
|
+
* Container-side publishers read this off each item they're about to
|
|
18
|
+
* broadcast.
|
|
19
|
+
*/
|
|
20
|
+
export declare const INDEX_RECORD_SYMBOL: unique symbol;
|
|
21
|
+
/**
|
|
22
|
+
* String key used by `@kosContainerIndexAware` to publish its
|
|
23
|
+
* declared collection onto its own `KosContext`. Items inherit it
|
|
24
|
+
* via `KosContext.get(INDEX_COLLECTION_KEY)`, which auto-walks the
|
|
25
|
+
* parent chain.
|
|
26
|
+
*
|
|
27
|
+
* String-keyed because `KosContext.get/set` only accept strings.
|
|
28
|
+
* Namespaced to avoid collision with any feature-level context value
|
|
29
|
+
* an author might define.
|
|
30
|
+
*/
|
|
31
|
+
export declare const INDEX_COLLECTION_KEY = "@kosdev-code/kos-ui-sdk.collection";
|
|
32
|
+
/**
|
|
33
|
+
* Structural contract for any item model that participates in
|
|
34
|
+
* indexing. The container-side publisher uses this shape to read
|
|
35
|
+
* records off items at publish time.
|
|
36
|
+
*/
|
|
37
|
+
export interface IndexableItem {
|
|
38
|
+
readonly [INDEX_RECORD_SYMBOL]: IndexRecordContribution;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Runtime check used by `KosModelContainer` to decide whether to
|
|
42
|
+
* publish for a given item.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isIndexableItem(value: unknown): value is IndexableItem;
|
|
45
|
+
/**
|
|
46
|
+
* What an item contributes via `INDEX_RECORD_SYMBOL`. `collection`
|
|
47
|
+
* is optional — when absent, the item resolves it from its
|
|
48
|
+
* `KosContext` (auto-walking the parent chain).
|
|
49
|
+
*
|
|
50
|
+
* Additional fields beyond identity + collection are arbitrary and
|
|
51
|
+
* driven by the item-level decorator's `fields` declaration.
|
|
52
|
+
*/
|
|
53
|
+
export interface IndexRecordContribution {
|
|
54
|
+
/** Stable id of the indexed item. */
|
|
55
|
+
id: string;
|
|
56
|
+
/** Model type id (e.g. `"virtual-machine-model"`). */
|
|
57
|
+
modelType: string;
|
|
58
|
+
/** Per-item collection tag. Falls back to container declaration if absent. */
|
|
59
|
+
collection?: string;
|
|
60
|
+
/** Declared index-relevant fields. Shape is per-modelType. */
|
|
61
|
+
[field: string]: unknown;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* What the container actually publishes on the EventBus. Identical
|
|
65
|
+
* shape to `IndexRecordContribution`, but `collection` is required
|
|
66
|
+
* — by publish time the fallback rule has already been applied.
|
|
67
|
+
*/
|
|
68
|
+
export interface IndexRecord extends IndexRecordContribution {
|
|
69
|
+
collection: string;
|
|
70
|
+
}
|
|
71
|
+
/** Payload for `KosContainerIndexEvents.ADDED`. */
|
|
72
|
+
export interface IndexAddedEvent {
|
|
73
|
+
record: IndexRecord;
|
|
74
|
+
}
|
|
75
|
+
/** Payload for `KosContainerIndexEvents.REMOVED`. */
|
|
76
|
+
export interface IndexRemovedEvent {
|
|
77
|
+
id: string;
|
|
78
|
+
modelType: string;
|
|
79
|
+
collection: string;
|
|
80
|
+
}
|
|
81
|
+
/** Payload for `KosContainerIndexEvents.CHANGED`. Full record, not deltas. */
|
|
82
|
+
export interface IndexChangedEvent {
|
|
83
|
+
record: IndexRecord;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Payload for `KosContainerIndexEvents.SEED`. Emitted in response to
|
|
87
|
+
* REQUEST_SEED. The items array may carry mixed collections
|
|
88
|
+
* (heterogeneous containers where items are tagged by their own
|
|
89
|
+
* properties). Subscribers route per record, not per top-level field.
|
|
90
|
+
*/
|
|
91
|
+
export interface IndexSeedEvent {
|
|
92
|
+
modelType: string;
|
|
93
|
+
items: IndexRecord[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Payload for `KosContainerIndexEvents.PURGE`. Collection-scoped;
|
|
97
|
+
* the consumer drops all matching records.
|
|
98
|
+
*/
|
|
99
|
+
export interface IndexPurgeEvent {
|
|
100
|
+
modelType: string;
|
|
101
|
+
collection: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Payload for `KosContainerIndexEvents.REQUEST_SEED`. Optional
|
|
105
|
+
* `collections` filter lets a targeted consumer ask only for what it
|
|
106
|
+
* cares about; an empty/absent filter means "all".
|
|
107
|
+
*/
|
|
108
|
+
export interface IndexRequestSeedEvent {
|
|
109
|
+
/** Free-form id used for diagnostics (e.g. `"index-service"`). */
|
|
110
|
+
requestedBy: string;
|
|
111
|
+
/** Optional filter; undefined or empty means "all collections". */
|
|
112
|
+
collections?: string[];
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,eAE/B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,uCAAuC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,CAAC,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;CACzD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAItE;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,uBAAuB;IAC1D,UAAU,EAAE,MAAM,CAAC;CACpB;AAMD,mDAAmD;AACnD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,qDAAqD;AACrD,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB"}
|
|
@@ -201,6 +201,23 @@ export declare class KosModelContainer<T extends IKosDataModel> implements IKosM
|
|
|
201
201
|
* @private
|
|
202
202
|
*/
|
|
203
203
|
private _configureModelMonitoring;
|
|
204
|
+
/**
|
|
205
|
+
* Publish KosContainerIndexEvents.ADDED for an indexable item.
|
|
206
|
+
* No-op when the model carries no INDEX_RECORD_SYMBOL (not opted
|
|
207
|
+
* into indexing) or when the record has no resolvable collection
|
|
208
|
+
* (item has no own tag and no inheritable container context).
|
|
209
|
+
*
|
|
210
|
+
* @private
|
|
211
|
+
*/
|
|
212
|
+
private _publishIndexAdded;
|
|
213
|
+
/**
|
|
214
|
+
* Publish KosContainerIndexEvents.REMOVED for an indexable item.
|
|
215
|
+
* Called with the model BEFORE it's deleted from the container so
|
|
216
|
+
* the payload can carry modelType + collection.
|
|
217
|
+
*
|
|
218
|
+
* @private
|
|
219
|
+
*/
|
|
220
|
+
private _publishIndexRemoved;
|
|
204
221
|
removeModel(id: string, defer?: boolean): void;
|
|
205
222
|
updateModel(model: T): void;
|
|
206
223
|
getModel(id: string): T | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-container-model.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/core/kos-container-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;
|
|
1
|
+
{"version":3,"file":"kos-container-model.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/core/kos-container-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AAaH,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAW5E,OAAO,EACL,kBAAkB,EAClB,WAAW,EAEZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,gBAAgB;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC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E,KAAK,IAAI,EAC7D,OAAO,CAAC,EAAE,GAAG;IAKf,MAAM;;;;;;;CAYP"}
|
package/core/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './core/api';
|
|
|
3
3
|
export * from './core/context';
|
|
4
4
|
export * from './core/decorators';
|
|
5
5
|
export * from './core/extension';
|
|
6
|
+
export * from './core/indexing';
|
|
6
7
|
export * from './core/kos-container-index';
|
|
7
8
|
export * from './core/kos-container-model';
|
|
8
9
|
export * from './core/kos-data-container';
|
package/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/kos-ui-sdk/src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,kBAAkB,EAClB,cAAc,EAEd,QAAQ,EACR,WAAW,EACX,IAAI,EACL,MAAM,MAAM,CAAC;AACd,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjE,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,oCAAoC,EACpC,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,SAAS,EACT,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,cAAc,GACf,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,OAAO,aAAO,CAAC;AAErB;;;GAGG;AACH,QAAA,MAAM,WAAW,iCAAW,CAAC;AAC7B;;;GAGG;AACH,QAAA,MAAM,SAAS,oBAAc,CAAC;AAE9B;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa,gBAAU,CAAC;AAE9B;;;GAGG;AACH,QAAA,MAAM,SAAS,iBAAW,CAAC;AAE3B;;;GAGG;AACH,QAAA,MAAM,aAAa,mCAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/kos-ui-sdk/src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,kBAAkB,EAClB,cAAc,EAEd,QAAQ,EACR,WAAW,EACX,IAAI,EACL,MAAM,MAAM,CAAC;AACd,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAA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