@oimdb/core 4.2.0 → 4.3.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to `@oimdb/core` are recorded here. This file starts at 4.0.0; releases
4
4
  before it were not changelogged.
5
5
 
6
+ ## 4.3.0
7
+
8
+ ### Added
9
+
10
+ - `OIMSlotCollectionStoreAggregate`, `OIMWritableSlotCollectionStoreAggregate`, `OIMSingleSlotStoreAggregate`, `OIMWritableSingleSlotStoreAggregate`, `OIMSlotCollectionIndexStoreAggregate`.
11
+ - `createStoreAggregate(storeSlot)` on `OIMSlotCollectionService`, `OIMWritableSlotCollectionService`, `OIMSingleSlotService`, `OIMWritableSingleSlotService`, `OIMSlotCollectionIndexService`.
12
+ - `createOIMSlotCollectionStoreAggregate(db, options)`, `createOIMSingleSlotStoreAggregate(db, options)`.
13
+
14
+ ### Changed
15
+
16
+ - `TOIMComputedStoreSlot` has a fourth type parameter, the slot service. The store slots of the computed services carry their service's type in `slotService`.
17
+
6
18
  ## 4.2.0
7
19
 
8
20
  ### Added
package/README.md CHANGED
@@ -90,11 +90,11 @@ What each consumer ships, bundled with esbuild (minified, tree-shaken, ESM).
90
90
  <!-- bundle-size:begin -->
91
91
  | Consumer | Minified | Minified + gzip |
92
92
  |---|---:|---:|
93
- | Everything `@oimdb/core` exports | 102669 B | 24555 B |
94
- | One entity store slot: `OIMDB`, `createOIMSlotCollectionService`, `createOIMSlotContentEntityService`, `writeSlotContentByKey`, `getSlotByKey` | 35413 B | 9161 B |
95
- | The same, plus one effect and `db.flush()` | 45582 B | 11543 B |
96
- | The same, plus one index: `createOIMSlotCollectionIndexService` | 65835 B | 16192 B |
97
- | An ordered bucket with commands: `OIMSlotContentPositionalArrayBucketService`, `OIMBucketCommands` | 48469 B | 12117 B |
93
+ | Everything `@oimdb/core` exports | 105563 B | 25051 B |
94
+ | One entity store slot: `OIMDB`, `createOIMSlotCollectionService`, `createOIMSlotContentEntityService`, `writeSlotContentByKey`, `getSlotByKey` | 36382 B | 9314 B |
95
+ | The same, plus one effect and `db.flush()` | 46546 B | 11711 B |
96
+ | The same, plus one index: `createOIMSlotCollectionIndexService` | 67554 B | 16458 B |
97
+ | An ordered bucket with commands: `OIMSlotContentPositionalArrayBucketService`, `OIMBucketCommands` | 49435 B | 12310 B |
98
98
  <!-- bundle-size:end -->
99
99
 
100
100
  ---
@@ -106,7 +106,7 @@ the domain of what it builds. Where a file goes is in `packages/core/src/README.
106
106
 
107
107
  | Domain | Contents |
108
108
  |---|---|
109
- | `slot/` | `OIMSlotOwner`, `OIMSlotOwnerService` (type-only export), `OIMSlotCollectionService`, `OIMWritableSlotCollectionService`, `OIMSingleSlotService`, `OIMWritableSingleSlotService`, `OIMSlotContentChangeListenerService`, `createOIMSlotCollectionService`, `createOIMSingleSlotService`, `TOIMSlot`, `TOIMEditable` |
109
+ | `slot/` | `OIMSlotOwner`, `OIMSlotOwnerService` (type-only export), `OIMSlotCollectionService`, `OIMWritableSlotCollectionService`, `OIMSingleSlotService`, `OIMWritableSingleSlotService`, `OIMSlotContentChangeListenerService`, `createOIMSlotCollectionService`, `createOIMSingleSlotService`, the store aggregates and their factories, `TOIMSlot`, `TOIMEditable` |
110
110
  | `store/` | `TOIMStoreSlot`, the slot store services |
111
111
  | `channel/` | `OIMChannelService`, `TOIMChannelSlot` |
112
112
  | `effect/` | `OIMEffectService`, `TOIMEffect` |
@@ -114,7 +114,7 @@ the domain of what it builds. Where a file goes is in `packages/core/src/README.
114
114
  | `entity/` | `OIMSlotContentEntityService`, `createOIMSlotContentEntityService`, `createOIMInPlaceEntityWriter`, `createOIMReplacingEntityWriter` |
115
115
  | `column/` | abstract `OIMColumnSlotOwner` with `OIMPushColumnSlotOwner` and `OIMPullColumnSlotOwner`, `OIMColumnSlotService` |
116
116
  | `bucket/` | `OIMSlotContentBucketService` (abstract), `OIMSlotContentSetBucketService`, `OIMSlotContentArrayBucketService` (abstract), `OIMSlotContentPositionalArrayBucketService`, `OIMSlotContentSortedArrayBucketService`, `OIMBucketCommands` |
117
- | `index/` | `OIMSlotCollectionIndexService`, `OIMSlotCollectionSortedArrayIndexService`, their factories, the index keys services |
117
+ | `index/` | `OIMSlotCollectionIndexService`, `OIMSlotCollectionSortedArrayIndexService`, their factories, `OIMSlotCollectionIndexStoreAggregate`, the index keys services |
118
118
  | `key/` | the key tree walks |
119
119
  | `collector/` | the release policies, `OIMSlotReleaseWheel`, `OIMSlotRefetchWheel`, `OIMUnusedSlotCollectorService` |
120
120
  | `schedule/` | `OIMFlushSchedulerService` |
@@ -169,9 +169,8 @@ effectService.disposeEffect(effect);
169
169
 
170
170
  `OIMDB` is the shared state and nothing else: one `clock` (`{ revision, epoch }`), one
171
171
  `defaultChannelSlot` (a `TOIMChannelSlot`, the struct a channel's state lives in), one
172
- `collectorSlot` (the unused-slot collector's slot and the release wheels, made on first use), and the
173
- `entityWriter`, `slotStamp`, `slotReleasePolicy` and `indexKeysService` its constructor is handed,
174
- which it keeps as the default that every door below reads. It is an `IOIMChannelMap`, so
172
+ `collectorSlot` (the unused-slot collector's slot and the release wheels, made on first use). It holds
173
+ no defaults: those are an `OIMDefaults` passed to each door as `defaults`. It is an `IOIMChannelMap`, so
175
174
  anything that takes a `channelMap` takes the `db`. `flush()` is
176
175
  `OIMChannelService.INSTANCE.flush(db.defaultChannelSlot)`: it runs the pending frame, then the
177
176
  unused-slot collector, then the after-each-flush handlers, in that order. It builds nothing.
@@ -195,8 +194,8 @@ Every mutation goes through a domain neuron. See
195
194
  [With cnstra](https://oimdb.org/docs/guides/with-cnstra).
196
195
 
197
196
  The doors are free functions, one module each, and each builds a **service**, once per
198
- type; an instance is the store slot that service creates. A collection, a single and an index take
199
- `db` first and ONE options object second. Every collection is `createOIMSlotCollectionService` over a content
197
+ type; an instance is the store slot that service creates. Every door takes ONE options object and no
198
+ `db`; the `db` goes to `createStoreSlot(db)`. Every collection is `createOIMSlotCollectionService` over a content
200
199
  service, and every single is `createOIMSingleSlotService`; an array key needs a tree store
201
200
  (`slotStoreService: new OIMSlotTreeStoreService(…)`, or `bucketSlotStoreService` on an index), because a
202
201
  map-driven store compares arrays by reference. See [The six shapes](#the-six-shapes). The computed doors
@@ -233,14 +232,55 @@ const sameShapeCardService = createOIMSlotCollectionService({ slotContentService
233
232
  const sameShapeCards = sameShapeCardService.createStoreSlot(db);
234
233
  ```
235
234
 
235
+ ### A store aggregate: the store slot with its store methods
236
+
237
+ A **store aggregate** is a store slot together with the methods of its service that take that
238
+ store slot first, so a call no longer passes it. `service.createStoreAggregate(storeSlot)` wraps a
239
+ store slot you already have; `createOIMSlotCollectionStoreAggregate(db, options)` and
240
+ `createOIMSingleSlotStoreAggregate(db, options)` build the service, the store slot and the aggregate
241
+ in one call, with the options of `createOIMSlotCollectionService` / `createOIMSingleSlotService`.
242
+
243
+ ```typescript
244
+ import { createOIMSlotCollectionStoreAggregate, createOIMSingleSlotStoreAggregate } from '@oimdb/core';
245
+
246
+ const deckStoreAggregate = createOIMSlotCollectionStoreAggregate(db, {
247
+ slotContentService: createOIMSlotContentEntityService<Card>(),
248
+ });
249
+ const aceSlot = deckStoreAggregate.writeSlotContentByKey('c9', { id: 'c9', deck: 'hearts', title: 'Ace', rank: 1 });
250
+ deckStoreAggregate.slotContentService.updateEntity(aceSlot, { rank: 14 });
251
+ deckStoreAggregate.getSlotByKey('c9') === aceSlot; // true
252
+
253
+ const cardStoreAggregate = cardService.createStoreAggregate(cards);
254
+ cardStoreAggregate.storeSlot === cards; // true: hooks, indexes and computeds still take the store slot
255
+
256
+ const focusStoreAggregate = createOIMSingleSlotStoreAggregate(db, {
257
+ slotContentService: createOIMSlotContentEntityService<{ isFocused: boolean }>(),
258
+ });
259
+ focusStoreAggregate.writeSingleSlotContent({ isFocused: true });
260
+ ```
261
+
262
+ | Aggregate | Over | Methods |
263
+ |---|---|---|
264
+ | `OIMSlotCollectionStoreAggregate` | `OIMSlotCollectionService` | `findSlotByKey`, `hasSlotContentByKey`, `getSlotByKey`, `holdSlotByKey`, `getSlots`, `getSlotCount`, `openBatch`, `closeBatch`, `writeInBatch` |
265
+ | `OIMWritableSlotCollectionStoreAggregate` | `OIMWritableSlotCollectionService` | the above and `writeSlotContentByKey` |
266
+ | `OIMSingleSlotStoreAggregate` | `OIMSingleSlotService` | `findSingleSlot`, `hasSingleSlotContent`, `getSingleSlot`, `holdSingleSlot` |
267
+ | `OIMWritableSingleSlotStoreAggregate` | `OIMWritableSingleSlotService` | the above, `writeSingleSlotContent` and `clearSingleSlotContent` |
268
+ | `OIMSlotCollectionIndexStoreAggregate` | `OIMSlotCollectionIndexService` | the collection methods, `getEntitiesByKey`, `getSlotsByKeys`, `holdSlotsByKeys`, `getBucketColumnByKey`, `holdBucketColumnByKey`, `getAnyBucketColumnByKey`, `holdAnyBucketColumnByKey`, `disposeIndexStoreSlot` |
269
+
270
+ Every aggregate also carries `storeSlot`, `slotService` (typed as the service it came from) and
271
+ `slotContentService`. A method that takes a slot rather than the store slot stays on its service.
272
+ Each aggregate method calls the service with the store slot; the service and the store slot stay
273
+ usable directly. `createOIMSlotCollectionStoreAggregate` builds a new service per call, so for
274
+ many store slots of one type build the service once and call `createStoreAggregate` on it.
275
+
236
276
  The bucket doors take the type of the bucket member slots, `TBucketMemberSlot extends TOIMSlot`
237
277
  (default `TOIMEntitySlot`). A bucket holds bucket member slots of any slot type (entity slots,
238
278
  bucket slots, computeds), and an index's `getEntitiesByKey` is there because its members are
239
279
  entity slots.
240
280
 
241
- Each door reads the globals that the class it builds would otherwise fall back to and
242
- **always passes them**, so there is one answer to each question and no class
243
- reaches for a default of its own.
281
+ Each door resolves every optional dependency as its own option, then `defaults` (or
282
+ `OIMDefaults.INSTANCE`), then the built-in `OIMDefaultValue`, and **always passes the result**, so
283
+ there is one answer to each question and no class reaches for a default of its own.
244
284
 
245
285
  The doors are free functions, not methods on `OIMDB`, so a consumer who wires
246
286
  nothing does not import the bucket machinery. This is pinned by
@@ -267,8 +307,8 @@ live** (`slotStoreService`, the strategy every store slot of the service files i
267
307
  with), **how a key comes out of an entity** (`keyOf`), **how a write lands** (`entityWriter`),
268
308
  **what counts as empty** (`slotEmptinessPolicy`), **when a slot goes** (`slotReleasePolicy`), and
269
309
  **where column slots live** (`columnSlotStoreService`, or `columnNames` for the ordinal store; the
270
- slot owner makes its own column owner over it). Everything but `keyOf` falls back to the `db` or
271
- to a lazy `OIMDefaultValue` on [`OIMDefaults`](#every-optional-dependency-has-a-default).
310
+ slot owner makes its own column owner over it). Everything but `keyOf` falls back to `defaults`, then
311
+ to a lazy `OIMDefaultValue` (see [`OIMDefaults`](#every-optional-dependency-has-a-default)).
272
312
 
273
313
  ---
274
314
 
@@ -2053,7 +2093,7 @@ a throwing disposer does not stop the rest. The engine ships no scope to do that
2053
2093
 
2054
2094
  ## Export reference
2055
2095
 
2056
- **230 names. This list is `src/index.ts`; nothing else is exported.**
2096
+ **237 names. This list is `src/index.ts`; nothing else is exported.**
2057
2097
 
2058
2098
  **The channel slot** — `OIMChannelService`, `TOIMChannelSlot`, `TOIMChannelSlotOptions`, `createOIMChannelSlot`,
2059
2099
  `IOIMChannelMap`, `TOIMChannelFrame`, `TOIMChannelClock`, `TOIMChannelScheduler`, `OIMChannelQueue` (**type only**),
@@ -2084,6 +2124,10 @@ a throwing disposer does not stop the rest. The engine ships no scope to do that
2084
2124
  `OIMSlotContentChangeListenerService`, `IOIMSlotContentChangeListener`, `IOIMStoreSlotListener`, `OIMNoStoreSlotListener`,
2085
2125
  `IOIMSlotSubscriptionListener`, `OIMNoSlotSubscriptionListener`.
2086
2126
 
2127
+ **Store aggregates** — `OIMSlotCollectionStoreAggregate`, `OIMWritableSlotCollectionStoreAggregate`,
2128
+ `OIMSingleSlotStoreAggregate`, `OIMWritableSingleSlotStoreAggregate`, `createOIMSlotCollectionStoreAggregate`,
2129
+ `createOIMSingleSlotStoreAggregate`, `OIMSlotCollectionIndexStoreAggregate`.
2130
+
2087
2131
  **Slots and their owners** — `TOIMSlot`, `TOIMStoreSlot`, `TOIMSingleSlotStoreSlot`, `TOIMEditable`, `TOIMKeyedSlot`,
2088
2132
  `TOIMIndexableSlot`, `OIMSlotOwner`, `IOIMSlotOwner`, `IOIMSlotEmptinessPolicy`, `IOIMSlotStamp`, `TOIMSameValueGuard`,
2089
2133
  `oimSameValueZeroGuard`, `oimIsSlotEmpty`, `oimIsSlotReleased`, `oimHoldSlots`, `oimUnholdSlotsIfAlive`,
package/dist/index.cjs CHANGED
@@ -46,6 +46,7 @@ __export(index_exports, {
46
46
  OIMScalarKeyTreeWalk: () => OIMScalarKeyTreeWalk,
47
47
  OIMSingleComputedService: () => OIMSingleComputedService,
48
48
  OIMSingleSlotService: () => OIMSingleSlotService,
49
+ OIMSingleSlotStoreAggregate: () => OIMSingleSlotStoreAggregate,
49
50
  OIMSingleSlotStoreService: () => OIMSingleSlotStoreService,
50
51
  OIMSingleSourceTrackingComputedService: () => OIMSingleSourceTrackingComputedService,
51
52
  OIMSlotAfterIdleReleasePolicy: () => OIMSlotAfterIdleReleasePolicy,
@@ -54,8 +55,10 @@ __export(index_exports, {
54
55
  OIMSlotAtEmptyReleasePolicy: () => OIMSlotAtEmptyReleasePolicy,
55
56
  OIMSlotAtUnholdReleasePolicy: () => OIMSlotAtUnholdReleasePolicy,
56
57
  OIMSlotCollectionIndexService: () => OIMSlotCollectionIndexService,
58
+ OIMSlotCollectionIndexStoreAggregate: () => OIMSlotCollectionIndexStoreAggregate,
57
59
  OIMSlotCollectionService: () => OIMSlotCollectionService,
58
60
  OIMSlotCollectionSortedArrayIndexService: () => OIMSlotCollectionSortedArrayIndexService,
61
+ OIMSlotCollectionStoreAggregate: () => OIMSlotCollectionStoreAggregate,
59
62
  OIMSlotContentArrayBucketService: () => OIMSlotContentArrayBucketService,
60
63
  OIMSlotContentBucketService: () => OIMSlotContentBucketService,
61
64
  OIMSlotContentChangeListenerService: () => OIMSlotContentChangeListenerService,
@@ -78,7 +81,9 @@ __export(index_exports, {
78
81
  OIMThrowAtOnceErrorPolicy: () => OIMThrowAtOnceErrorPolicy,
79
82
  OIMUnusedSlotCollectorService: () => OIMUnusedSlotCollectorService,
80
83
  OIMWritableSingleSlotService: () => OIMWritableSingleSlotService,
84
+ OIMWritableSingleSlotStoreAggregate: () => OIMWritableSingleSlotStoreAggregate,
81
85
  OIMWritableSlotCollectionService: () => OIMWritableSlotCollectionService,
86
+ OIMWritableSlotCollectionStoreAggregate: () => OIMWritableSlotCollectionStoreAggregate,
82
87
  OIM_FROZEN_EMPTY_SLOTS: () => OIM_FROZEN_EMPTY_SLOTS,
83
88
  OIM_NOTHING_WAS_INSERTED: () => OIM_NOTHING_WAS_INSERTED,
84
89
  OIM_NOTHING_WAS_REMOVED: () => OIM_NOTHING_WAS_REMOVED,
@@ -92,10 +97,12 @@ __export(index_exports, {
92
97
  createOIMReplacingEntityWriter: () => createOIMReplacingEntityWriter,
93
98
  createOIMSingleComputedService: () => createOIMSingleComputedService,
94
99
  createOIMSingleSlotService: () => createOIMSingleSlotService,
100
+ createOIMSingleSlotStoreAggregate: () => createOIMSingleSlotStoreAggregate,
95
101
  createOIMSingleSourceTrackingComputedService: () => createOIMSingleSourceTrackingComputedService,
96
102
  createOIMSlotCollectionIndexService: () => createOIMSlotCollectionIndexService,
97
103
  createOIMSlotCollectionService: () => createOIMSlotCollectionService,
98
104
  createOIMSlotCollectionSortedArrayIndexService: () => createOIMSlotCollectionSortedArrayIndexService,
105
+ createOIMSlotCollectionStoreAggregate: () => createOIMSlotCollectionStoreAggregate,
99
106
  createOIMSlotContentEntityService: () => createOIMSlotContentEntityService,
100
107
  createOIMSortedComputedService: () => createOIMSortedComputedService,
101
108
  createOIMSourceTrackingComputedService: () => createOIMSourceTrackingComputedService,
@@ -1992,6 +1999,44 @@ function createOIMStoreSlot(store, channelSlot, slotService, sourceStoreSlot) {
1992
1999
  };
1993
2000
  }
1994
2001
 
2002
+ // src/slot/OIMSlotCollectionStoreAggregate.ts
2003
+ var OIMSlotCollectionStoreAggregate = class {
2004
+ constructor(slotService, storeSlot) {
2005
+ this.slotService = slotService;
2006
+ this.storeSlot = storeSlot;
2007
+ }
2008
+ get slotContentService() {
2009
+ return this.slotService.slotContentService;
2010
+ }
2011
+ findSlotByKey(key) {
2012
+ return this.slotService.findSlotByKey(this.storeSlot, key);
2013
+ }
2014
+ hasSlotContentByKey(key) {
2015
+ return this.slotService.hasSlotContentByKey(this.storeSlot, key);
2016
+ }
2017
+ getSlotByKey(key) {
2018
+ return this.slotService.getSlotByKey(this.storeSlot, key);
2019
+ }
2020
+ holdSlotByKey(key) {
2021
+ return this.slotService.holdSlotByKey(this.storeSlot, key);
2022
+ }
2023
+ getSlots() {
2024
+ return this.slotService.getSlots(this.storeSlot);
2025
+ }
2026
+ getSlotCount() {
2027
+ return this.slotService.getSlotCount(this.storeSlot);
2028
+ }
2029
+ openBatch() {
2030
+ this.slotService.openBatch(this.storeSlot);
2031
+ }
2032
+ closeBatch() {
2033
+ this.slotService.closeBatch(this.storeSlot);
2034
+ }
2035
+ writeInBatch(write) {
2036
+ return this.slotService.writeInBatch(this.storeSlot, write);
2037
+ }
2038
+ };
2039
+
1995
2040
  // src/slot/OIMSlotCollectionService.ts
1996
2041
  var OIMSlotCollectionService = class {
1997
2042
  constructor(options) {
@@ -2018,6 +2063,9 @@ var OIMSlotCollectionService = class {
2018
2063
  sourceStoreSlot
2019
2064
  ));
2020
2065
  }
2066
+ createStoreAggregate(storeSlot) {
2067
+ return new OIMSlotCollectionStoreAggregate(this, storeSlot);
2068
+ }
2021
2069
  createStoreSlotOverNewStore(createStoreSlotLiteral) {
2022
2070
  const storeSlot = createStoreSlotLiteral(this.slotStoreService.createStore());
2023
2071
  if (this.storeSlotListener !== void 0) this.storeSlotListener.onStoreSlotCreated(storeSlot);
@@ -2079,8 +2127,18 @@ var OIMSlotCollectionService = class {
2079
2127
  }
2080
2128
  };
2081
2129
 
2130
+ // src/slot/OIMWritableSlotCollectionStoreAggregate.ts
2131
+ var OIMWritableSlotCollectionStoreAggregate = class extends OIMSlotCollectionStoreAggregate {
2132
+ writeSlotContentByKey(key, content, changedSlots) {
2133
+ return this.slotService.writeSlotContentByKey(this.storeSlot, key, content, changedSlots);
2134
+ }
2135
+ };
2136
+
2082
2137
  // src/slot/OIMWritableSlotCollectionService.ts
2083
2138
  var OIMWritableSlotCollectionService = class extends OIMSlotCollectionService {
2139
+ createStoreAggregate(storeSlot) {
2140
+ return new OIMWritableSlotCollectionStoreAggregate(this, storeSlot);
2141
+ }
2084
2142
  writeSlotContentByKey(storeSlot, key, content, changedSlots) {
2085
2143
  const filed = this.slotStoreService.get(storeSlot.store, key);
2086
2144
  if (filed !== void 0) {
@@ -2093,6 +2151,29 @@ var OIMWritableSlotCollectionService = class extends OIMSlotCollectionService {
2093
2151
  }
2094
2152
  };
2095
2153
 
2154
+ // src/slot/OIMSingleSlotStoreAggregate.ts
2155
+ var OIMSingleSlotStoreAggregate = class {
2156
+ constructor(slotService, storeSlot) {
2157
+ this.slotService = slotService;
2158
+ this.storeSlot = storeSlot;
2159
+ }
2160
+ get slotContentService() {
2161
+ return this.slotService.slotContentService;
2162
+ }
2163
+ findSingleSlot() {
2164
+ return this.slotService.findSingleSlot(this.storeSlot);
2165
+ }
2166
+ hasSingleSlotContent() {
2167
+ return this.slotService.hasSingleSlotContent(this.storeSlot);
2168
+ }
2169
+ getSingleSlot() {
2170
+ return this.slotService.getSingleSlot(this.storeSlot);
2171
+ }
2172
+ holdSingleSlot() {
2173
+ return this.slotService.holdSingleSlot(this.storeSlot);
2174
+ }
2175
+ };
2176
+
2096
2177
  // src/slot/OIMSingleSlotService.ts
2097
2178
  var OIMSingleSlotService = class {
2098
2179
  constructor(options) {
@@ -2116,6 +2197,9 @@ var OIMSingleSlotService = class {
2116
2197
  if (this.storeSlotListener !== void 0) this.storeSlotListener.onStoreSlotCreated(storeSlot);
2117
2198
  return storeSlot;
2118
2199
  }
2200
+ createStoreAggregate(storeSlot) {
2201
+ return new OIMSingleSlotStoreAggregate(this, storeSlot);
2202
+ }
2119
2203
  findSingleSlot(storeSlot) {
2120
2204
  return this.slotStoreService.getSingleSlot(storeSlot.store);
2121
2205
  }
@@ -2144,8 +2228,21 @@ var OIMSingleSlotService = class {
2144
2228
  }
2145
2229
  };
2146
2230
 
2231
+ // src/slot/OIMWritableSingleSlotStoreAggregate.ts
2232
+ var OIMWritableSingleSlotStoreAggregate = class extends OIMSingleSlotStoreAggregate {
2233
+ writeSingleSlotContent(content, changedSlots) {
2234
+ return this.slotService.writeSingleSlotContent(this.storeSlot, content, changedSlots);
2235
+ }
2236
+ clearSingleSlotContent() {
2237
+ this.slotService.clearSingleSlotContent(this.storeSlot);
2238
+ }
2239
+ };
2240
+
2147
2241
  // src/slot/OIMWritableSingleSlotService.ts
2148
2242
  var OIMWritableSingleSlotService = class extends OIMSingleSlotService {
2243
+ createStoreAggregate(storeSlot) {
2244
+ return new OIMWritableSingleSlotStoreAggregate(this, storeSlot);
2245
+ }
2149
2246
  writeSingleSlotContent(storeSlot, content, changedSlots) {
2150
2247
  const filed = this.slotStoreService.getSingleSlot(storeSlot.store);
2151
2248
  if (filed !== void 0) {
@@ -2714,6 +2811,18 @@ function createOIMSingleSlotService(options) {
2714
2811
  });
2715
2812
  }
2716
2813
 
2814
+ // src/slot/createOIMSlotCollectionStoreAggregate.ts
2815
+ function createOIMSlotCollectionStoreAggregate(channelMap, options) {
2816
+ const slotCollectionService = createOIMSlotCollectionService(options);
2817
+ return slotCollectionService.createStoreAggregate(slotCollectionService.createStoreSlot(channelMap));
2818
+ }
2819
+
2820
+ // src/slot/createOIMSingleSlotStoreAggregate.ts
2821
+ function createOIMSingleSlotStoreAggregate(channelMap, options) {
2822
+ const singleSlotService = createOIMSingleSlotService(options);
2823
+ return singleSlotService.createStoreAggregate(singleSlotService.createStoreSlot(channelMap));
2824
+ }
2825
+
2717
2826
  // src/db/constants/OIM_DEFAULT_ENTITY_SLOT_EMPTINESS_POLICY.ts
2718
2827
  var OIM_DEFAULT_ENTITY_SLOT_EMPTINESS_POLICY = /* @__PURE__ */ new OIMDefaultValue(() => OIMSlotEntityPresenceEmptinessPolicy.INSTANCE);
2719
2828
 
@@ -4252,6 +4361,34 @@ function createOIMIndexStoreSlot(store, slotService, sourceStoreSlot, contentCha
4252
4361
  };
4253
4362
  }
4254
4363
 
4364
+ // src/index/OIMSlotCollectionIndexStoreAggregate.ts
4365
+ var OIMSlotCollectionIndexStoreAggregate = class extends OIMSlotCollectionStoreAggregate {
4366
+ getEntitiesByKey(key) {
4367
+ return this.slotService.getEntitiesByKey(this.storeSlot, key);
4368
+ }
4369
+ getSlotsByKeys(keys) {
4370
+ return this.slotService.getSlotsByKeys(this.storeSlot, keys);
4371
+ }
4372
+ holdSlotsByKeys(keys) {
4373
+ return this.slotService.holdSlotsByKeys(this.storeSlot, keys);
4374
+ }
4375
+ getAnyBucketColumnByKey(key) {
4376
+ return this.slotService.getAnyBucketColumnByKey(this.storeSlot, key);
4377
+ }
4378
+ holdAnyBucketColumnByKey(key) {
4379
+ return this.slotService.holdAnyBucketColumnByKey(this.storeSlot, key);
4380
+ }
4381
+ getBucketColumnByKey(key, columnName) {
4382
+ return this.slotService.getBucketColumnByKey(this.storeSlot, key, columnName);
4383
+ }
4384
+ holdBucketColumnByKey(key, columnName) {
4385
+ return this.slotService.holdBucketColumnByKey(this.storeSlot, key, columnName);
4386
+ }
4387
+ disposeIndexStoreSlot() {
4388
+ this.slotService.disposeIndexStoreSlot(this.storeSlot);
4389
+ }
4390
+ };
4391
+
4255
4392
  // src/index/OIMSlotCollectionIndexService.ts
4256
4393
  var OIMSlotCollectionIndexService = class extends OIMSlotCollectionService {
4257
4394
  constructor(options) {
@@ -4278,6 +4415,9 @@ var OIMSlotCollectionIndexService = class extends OIMSlotCollectionService {
4278
4415
  OIMSlotContentChangeListenerService.INSTANCE.addContentChangeListener(sourceStoreSlot, contentChangeListener, this.keyColumns);
4279
4416
  return indexStoreSlot;
4280
4417
  }
4418
+ createStoreAggregate(indexStoreSlot) {
4419
+ return new OIMSlotCollectionIndexStoreAggregate(this, indexStoreSlot);
4420
+ }
4281
4421
  disposeIndexStoreSlot(indexStoreSlot) {
4282
4422
  this.assertNotDisposed(indexStoreSlot);
4283
4423
  OIMChannelService.INSTANCE.assertNotFlushing(indexStoreSlot.channelSlot);
@@ -5580,6 +5720,7 @@ oimRegisterCoreInstance(OIMDB);
5580
5720
  OIMScalarKeyTreeWalk,
5581
5721
  OIMSingleComputedService,
5582
5722
  OIMSingleSlotService,
5723
+ OIMSingleSlotStoreAggregate,
5583
5724
  OIMSingleSlotStoreService,
5584
5725
  OIMSingleSourceTrackingComputedService,
5585
5726
  OIMSlotAfterIdleReleasePolicy,
@@ -5588,8 +5729,10 @@ oimRegisterCoreInstance(OIMDB);
5588
5729
  OIMSlotAtEmptyReleasePolicy,
5589
5730
  OIMSlotAtUnholdReleasePolicy,
5590
5731
  OIMSlotCollectionIndexService,
5732
+ OIMSlotCollectionIndexStoreAggregate,
5591
5733
  OIMSlotCollectionService,
5592
5734
  OIMSlotCollectionSortedArrayIndexService,
5735
+ OIMSlotCollectionStoreAggregate,
5593
5736
  OIMSlotContentArrayBucketService,
5594
5737
  OIMSlotContentBucketService,
5595
5738
  OIMSlotContentChangeListenerService,
@@ -5612,7 +5755,9 @@ oimRegisterCoreInstance(OIMDB);
5612
5755
  OIMThrowAtOnceErrorPolicy,
5613
5756
  OIMUnusedSlotCollectorService,
5614
5757
  OIMWritableSingleSlotService,
5758
+ OIMWritableSingleSlotStoreAggregate,
5615
5759
  OIMWritableSlotCollectionService,
5760
+ OIMWritableSlotCollectionStoreAggregate,
5616
5761
  OIM_FROZEN_EMPTY_SLOTS,
5617
5762
  OIM_NOTHING_WAS_INSERTED,
5618
5763
  OIM_NOTHING_WAS_REMOVED,
@@ -5626,10 +5771,12 @@ oimRegisterCoreInstance(OIMDB);
5626
5771
  createOIMReplacingEntityWriter,
5627
5772
  createOIMSingleComputedService,
5628
5773
  createOIMSingleSlotService,
5774
+ createOIMSingleSlotStoreAggregate,
5629
5775
  createOIMSingleSourceTrackingComputedService,
5630
5776
  createOIMSlotCollectionIndexService,
5631
5777
  createOIMSlotCollectionService,
5632
5778
  createOIMSlotCollectionSortedArrayIndexService,
5779
+ createOIMSlotCollectionStoreAggregate,
5633
5780
  createOIMSlotContentEntityService,
5634
5781
  createOIMSortedComputedService,
5635
5782
  createOIMSourceTrackingComputedService,