@spine-event-engine/storage-datastore 2.0.0-snapshot.23 → 2.0.0-snapshot.25
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/README.md +25 -10
- package/REFERENCE.md +66 -50
- package/dist/datastore/agent-history.d.ts +36 -6
- package/dist/datastore/agent-history.d.ts.map +1 -1
- package/dist/datastore/agent-history.js +92 -6
- package/dist/datastore/agent-history.js.map +1 -1
- package/dist/datastore/column-mapping.d.ts.map +1 -1
- package/dist/datastore/column-mapping.js +6 -3
- package/dist/datastore/column-mapping.js.map +1 -1
- package/dist/datastore/entity-history.d.ts +206 -55
- package/dist/datastore/entity-history.d.ts.map +1 -1
- package/dist/datastore/entity-history.js +556 -239
- package/dist/datastore/entity-history.js.map +1 -1
- package/dist/datastore/id-column.d.ts +7 -0
- package/dist/datastore/id-column.d.ts.map +1 -1
- package/dist/datastore/id-column.js +27 -3
- package/dist/datastore/id-column.js.map +1 -1
- package/dist/datastore/record-kind.d.ts +8 -0
- package/dist/datastore/record-kind.d.ts.map +1 -0
- package/dist/datastore/record-kind.js +26 -0
- package/dist/datastore/record-kind.js.map +1 -0
- package/dist/datastore/record-storage.d.ts +11 -10
- package/dist/datastore/record-storage.d.ts.map +1 -1
- package/dist/datastore/record-storage.js +31 -32
- package/dist/datastore/record-storage.js.map +1 -1
- package/dist/datastore/storage-factory.d.ts +293 -89
- package/dist/datastore/storage-factory.d.ts.map +1 -1
- package/dist/datastore/storage-factory.js +734 -222
- package/dist/datastore/storage-factory.js.map +1 -1
- package/dist/datastore/tenant-catalog.d.ts +12 -25
- package/dist/datastore/tenant-catalog.d.ts.map +1 -1
- package/dist/datastore/tenant-catalog.js +43 -121
- package/dist/datastore/tenant-catalog.js.map +1 -1
- package/dist/datastore/transaction-rows.d.ts +30 -0
- package/dist/datastore/transaction-rows.d.ts.map +1 -0
- package/dist/datastore/transaction-rows.js +43 -0
- package/dist/datastore/transaction-rows.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/index.yaml +0 -9
- package/package.json +5 -5
- package/dist/datastore/agent-execution.d.ts +0 -337
- package/dist/datastore/agent-execution.d.ts.map +0 -1
- package/dist/datastore/agent-execution.js +0 -789
- package/dist/datastore/agent-execution.js.map +0 -1
- package/dist/datastore/delivery-cleanup.d.ts +0 -31
- package/dist/datastore/delivery-cleanup.d.ts.map +0 -1
- package/dist/datastore/delivery-cleanup.js +0 -111
- package/dist/datastore/delivery-cleanup.js.map +0 -1
|
@@ -3,9 +3,40 @@ import type { GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
|
3
3
|
import { Datastore } from "@google-cloud/datastore";
|
|
4
4
|
import { StringifierRegistry } from "@spine-event-engine/core";
|
|
5
5
|
import { RecordStorage, StorageFactory, type RecordSpec, type StorageContext, type StorageGroup } from "@spine-event-engine/storage";
|
|
6
|
-
import { type TenantCatalog, type TenantCatalogProvider } from "@spine-event-engine/storage/provider";
|
|
6
|
+
import { type TenantCatalog, type TenantCatalogProvider, type EntityStoragePreparationInput, type StoragePreparationMode } from "@spine-event-engine/storage/provider";
|
|
7
7
|
import type { EntityCommitStorage, EntityEventHistoryPort, EntityRecordStorage, EntityStateHistoryPort, EntityStorageInput } from "@spine-event-engine/storage/provider";
|
|
8
8
|
import { type NamespaceConverter } from "./namespace.js";
|
|
9
|
+
/**
|
|
10
|
+
* Checks one custom record declaration without constructing storage.
|
|
11
|
+
* @typeParam R Stored record message type.
|
|
12
|
+
*/
|
|
13
|
+
export interface PrepareDatastoreRecordStorage<R extends Message = Message> {
|
|
14
|
+
/**
|
|
15
|
+
* Checks the selected record family.
|
|
16
|
+
* @typeParam I Record identifier type.
|
|
17
|
+
* @param context Complete storage context.
|
|
18
|
+
* @param spec Declarative record family.
|
|
19
|
+
* @param client Caller-supplied Datastore client.
|
|
20
|
+
* @param mode Creation or read-only checking.
|
|
21
|
+
* @returns Completion after custom preparation.
|
|
22
|
+
*/
|
|
23
|
+
<I>(context: StorageContext, spec: RecordSpec<I, R>, client: Datastore, mode: StoragePreparationMode): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Checks one coherent custom Entity declaration without constructing storage.
|
|
27
|
+
* @typeParam S Entity state message type.
|
|
28
|
+
*/
|
|
29
|
+
export interface PrepareDatastoreEntityStorage<S extends Message = Message> {
|
|
30
|
+
/**
|
|
31
|
+
* Checks the selected coherent Entity provider.
|
|
32
|
+
* @typeParam I Entity identifier type.
|
|
33
|
+
* @param input Declarative Entity family.
|
|
34
|
+
* @param client Caller-supplied Datastore client.
|
|
35
|
+
* @param mode Creation or read-only checking.
|
|
36
|
+
* @returns Completion after custom preparation.
|
|
37
|
+
*/
|
|
38
|
+
<I>(input: EntityStoragePreparationInput<I, S>, client: Datastore, mode: StoragePreparationMode): Promise<void>;
|
|
39
|
+
}
|
|
9
40
|
/**
|
|
10
41
|
* Describes the physical Datastore kind used for a record family.
|
|
11
42
|
*/
|
|
@@ -21,18 +52,23 @@ export interface RecordLayout {
|
|
|
21
52
|
* The custom provider handles tenant, ID, and column mapping. Builder-configured
|
|
22
53
|
* namespace converters and stringifiers are not passed to this callback.
|
|
23
54
|
*
|
|
24
|
-
* @
|
|
55
|
+
* @param context The storage context.
|
|
56
|
+
* @param recordSpec The record-family contract.
|
|
57
|
+
* @param client The caller-owned Datastore client.
|
|
58
|
+
* @param maxClientSideScan The finite reconciliation bound.
|
|
59
|
+
* @returns The customized storage handle.
|
|
60
|
+
* @typeParam R Stored record message type.
|
|
25
61
|
*/
|
|
26
62
|
export interface CreateRecordStorage<R extends Message = Message> {
|
|
27
63
|
/**
|
|
28
|
-
* Creates
|
|
64
|
+
* Creates the custom record handle for one identifier type.
|
|
29
65
|
*
|
|
30
|
-
* @
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @
|
|
35
|
-
* @
|
|
66
|
+
* @typeParam I Record identifier type.
|
|
67
|
+
* @param context Identifies the storage context.
|
|
68
|
+
* @param recordSpec Defines the record family.
|
|
69
|
+
* @param client Supplies the Datastore client.
|
|
70
|
+
* @param maxClientSideScan Bounds local query reconciliation.
|
|
71
|
+
* @returns The custom record handle.
|
|
36
72
|
*/
|
|
37
73
|
<I>(context: StorageContext, recordSpec: RecordSpec<I, R>, client: Datastore, maxClientSideScan: number): RecordStorage<I, R>;
|
|
38
74
|
}
|
|
@@ -42,24 +78,27 @@ export interface CreateRecordStorage<R extends Message = Message> {
|
|
|
42
78
|
* The custom provider handles tenant, ID, and column mapping. Builder-configured
|
|
43
79
|
* namespace converters and stringifiers are not passed to this callback.
|
|
44
80
|
*
|
|
45
|
-
* @
|
|
81
|
+
* @param input The Entity storage contract.
|
|
82
|
+
* @param client The caller-owned Datastore client.
|
|
83
|
+
* @returns The customized Entity storage handle.
|
|
84
|
+
* @typeParam S Entity state message type.
|
|
46
85
|
*/
|
|
47
86
|
export interface CreateEntityStorage<S extends Message = Message> {
|
|
48
87
|
/**
|
|
49
|
-
* Creates
|
|
88
|
+
* Creates custom Entity persistence for one identifier type.
|
|
50
89
|
*
|
|
51
|
-
* @
|
|
52
|
-
* @param
|
|
53
|
-
* @
|
|
54
|
-
* @
|
|
90
|
+
* @typeParam I Entity identifier type.
|
|
91
|
+
* @param input Defines the Entity storage contract.
|
|
92
|
+
* @param client Supplies the Datastore client.
|
|
93
|
+
* @returns The custom Entity storage handle.
|
|
55
94
|
*/
|
|
56
95
|
<I>(input: EntityStorageInput<I, S>, client: Datastore): DatastoreEntityStorageHandle<I, S>;
|
|
57
96
|
}
|
|
58
97
|
/**
|
|
59
98
|
* Groups the current state, histories, and commits for one Entity type.
|
|
60
99
|
*
|
|
61
|
-
* @typeParam I
|
|
62
|
-
* @typeParam S Entity state message.
|
|
100
|
+
* @typeParam I Entity identifier type.
|
|
101
|
+
* @typeParam S Entity state message type.
|
|
63
102
|
*/
|
|
64
103
|
export interface DatastoreEntityStorageHandle<I, S extends Message> {
|
|
65
104
|
/**
|
|
@@ -75,7 +114,7 @@ export interface DatastoreEntityStorageHandle<I, S extends Message> {
|
|
|
75
114
|
*/
|
|
76
115
|
readonly events: EntityEventHistoryPort<I>;
|
|
77
116
|
/**
|
|
78
|
-
* Provides
|
|
117
|
+
* Provides ordered Entity commit access.
|
|
79
118
|
*/
|
|
80
119
|
readonly commits: EntityCommitStorage;
|
|
81
120
|
/**
|
|
@@ -86,8 +125,14 @@ export interface DatastoreEntityStorageHandle<I, S extends Message> {
|
|
|
86
125
|
isOpen(): boolean;
|
|
87
126
|
/**
|
|
88
127
|
* Closes the handle.
|
|
128
|
+
*
|
|
129
|
+
* @returns Completion after retained resources are closed.
|
|
130
|
+
*/
|
|
131
|
+
close(): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Closes an idle bundle during synchronous assembly rollback.
|
|
89
134
|
*/
|
|
90
|
-
|
|
135
|
+
closeIdle(): void;
|
|
91
136
|
}
|
|
92
137
|
/**
|
|
93
138
|
* Configures a Datastore storage factory before it is built.
|
|
@@ -114,55 +159,67 @@ export interface DatastoreStorageFactoryBuilder {
|
|
|
114
159
|
* @returns Returns this builder.
|
|
115
160
|
*/
|
|
116
161
|
setStringifierRegistry(registry: StringifierRegistry): this;
|
|
162
|
+
/**
|
|
163
|
+
* Sets the kind for one named domain or System Event Store.
|
|
164
|
+
*
|
|
165
|
+
* @param boundedContextName Actual selected Bounded Context name.
|
|
166
|
+
* @param kind Physical Datastore kind.
|
|
167
|
+
* @param role Domain or System Event Store role.
|
|
168
|
+
* @returns This builder.
|
|
169
|
+
*/
|
|
170
|
+
setEventStoreKind(boundedContextName: string, kind: string, role?: "domain" | "system"): this;
|
|
117
171
|
/**
|
|
118
172
|
* Sets a physical kind for every use of a record type.
|
|
119
173
|
*
|
|
174
|
+
* @typeParam R Stored record message type.
|
|
120
175
|
* @param recordType The record type that receives the layout.
|
|
121
176
|
* @param layout The selected physical layout.
|
|
122
177
|
* @returns This builder.
|
|
123
|
-
* @typeParam R Stored record message.
|
|
124
178
|
*/
|
|
125
179
|
organizeRecords<R extends Message>(recordType: GenMessage<R>, layout: RecordLayout): this;
|
|
126
180
|
/**
|
|
127
181
|
* Sets a physical kind for one source and record-type pair.
|
|
128
182
|
*
|
|
183
|
+
* @typeParam S Entity state message type.
|
|
184
|
+
* @typeParam R Stored record message type.
|
|
129
185
|
* @param sourceType The Entity state type that owns the records.
|
|
130
186
|
* @param recordType The record type that receives the layout.
|
|
131
187
|
* @param layout The selected physical layout.
|
|
132
188
|
* @returns This builder.
|
|
133
|
-
* @typeParam S Source Entity state message.
|
|
134
|
-
* @typeParam R Stored record message.
|
|
135
189
|
*/
|
|
136
190
|
organizeRecords<S extends Message, R extends Message>(sourceType: GenMessage<S>, recordType: GenMessage<R>, layout: RecordLayout): this;
|
|
137
191
|
/**
|
|
138
192
|
* Sets a custom provider for every use of a record type.
|
|
139
193
|
*
|
|
194
|
+
* @typeParam R Stored record message type.
|
|
140
195
|
* @param recordType The record type served by the provider.
|
|
141
196
|
* @param creator The custom record-storage provider.
|
|
197
|
+
* @param prepare Optional declarative preparation for the selected custom provider.
|
|
142
198
|
* @returns This builder.
|
|
143
|
-
* @typeParam R Stored record message.
|
|
144
199
|
*/
|
|
145
|
-
useRecordStorage<R extends Message>(recordType: GenMessage<R>, creator: CreateRecordStorage<R>): this;
|
|
200
|
+
useRecordStorage<R extends Message>(recordType: GenMessage<R>, creator: CreateRecordStorage<R>, prepare?: PrepareDatastoreRecordStorage<R>): this;
|
|
146
201
|
/**
|
|
147
202
|
* Sets a custom provider for one source and record-type pair.
|
|
148
203
|
*
|
|
204
|
+
* @typeParam S Entity state message type.
|
|
205
|
+
* @typeParam R Stored record message type.
|
|
149
206
|
* @param sourceType The Entity state type that owns the records.
|
|
150
207
|
* @param recordType The record type served by the provider.
|
|
151
208
|
* @param creator The custom record-storage provider.
|
|
209
|
+
* @param prepare Optional declarative preparation for the selected custom provider.
|
|
152
210
|
* @returns This builder.
|
|
153
|
-
* @typeParam S Source Entity state message.
|
|
154
|
-
* @typeParam R Stored record message.
|
|
155
211
|
*/
|
|
156
|
-
useRecordStorage<S extends Message, R extends Message>(sourceType: GenMessage<S>, recordType: GenMessage<R>, creator: CreateRecordStorage<R>): this;
|
|
212
|
+
useRecordStorage<S extends Message, R extends Message>(sourceType: GenMessage<S>, recordType: GenMessage<R>, creator: CreateRecordStorage<R>, prepare?: PrepareDatastoreRecordStorage<R>): this;
|
|
157
213
|
/**
|
|
158
214
|
* Sets a custom persistence provider for one Entity state type.
|
|
159
215
|
*
|
|
216
|
+
* @typeParam S Entity state message type.
|
|
160
217
|
* @param sourceType The Entity state type served by the provider.
|
|
161
218
|
* @param creator The custom Entity persistence provider.
|
|
219
|
+
* @param prepare Optional declarative preparation for the coherent custom provider.
|
|
162
220
|
* @returns This builder.
|
|
163
|
-
* @typeParam S Entity state message.
|
|
164
221
|
*/
|
|
165
|
-
useEntityStorage<S extends Message>(sourceType: GenMessage<S>, creator: CreateEntityStorage<S>): this;
|
|
222
|
+
useEntityStorage<S extends Message>(sourceType: GenMessage<S>, creator: CreateEntityStorage<S>, prepare?: PrepareDatastoreEntityStorage<S>): this;
|
|
166
223
|
/**
|
|
167
224
|
* Builds a Datastore storage factory from this configuration.
|
|
168
225
|
*
|
|
@@ -186,110 +243,249 @@ export declare class DatastoreStorageFactory extends StorageFactory implements T
|
|
|
186
243
|
*
|
|
187
244
|
* @param client The caller-owned Datastore client.
|
|
188
245
|
* @param recordCreators Custom record-storage providers by record family.
|
|
246
|
+
* @param recordPreparers Declarative preparation callbacks by record family.
|
|
189
247
|
* @param layouts Physical record layouts by record family.
|
|
190
248
|
* @param entityCreators Custom Entity persistence providers by Entity type.
|
|
249
|
+
* @param entityPreparers Declarative preparation callbacks by Entity type.
|
|
191
250
|
* @param namespaceConverter Converts complete tenants to native namespaces.
|
|
192
251
|
* @param stringifiers Converts message-valued IDs and columns.
|
|
252
|
+
* @param eventStoreKinds Explicit native kinds by Event Store identity.
|
|
193
253
|
* @internal
|
|
194
254
|
*/
|
|
195
255
|
private constructor();
|
|
196
256
|
/**
|
|
197
|
-
*
|
|
257
|
+
* Checks the shared namespace metadata with a bounded read-only query.
|
|
258
|
+
* @returns Completion after the metadata read; failures can be retried.
|
|
198
259
|
*/
|
|
199
|
-
|
|
260
|
+
checkConnection(): Promise<void>;
|
|
200
261
|
/**
|
|
201
|
-
*
|
|
262
|
+
* Performs one exact-key metadata read for a native namespace.
|
|
263
|
+
* @param namespace Native namespace to inspect.
|
|
264
|
+
* @returns Completion after the metadata query.
|
|
202
265
|
*/
|
|
203
|
-
private
|
|
266
|
+
private probe;
|
|
204
267
|
/**
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
* @
|
|
208
|
-
* @returns Tenant-scoped Agent execution storage handle.
|
|
209
|
-
* @typeParam I Typed entity identifier.
|
|
210
|
-
* @typeParam S Generated Entity state.
|
|
268
|
+
* Admits asynchronous physical preparation before invoking callbacks.
|
|
269
|
+
* @param operation Work to perform within the factory lifetime.
|
|
270
|
+
* @returns Completion or rejection from the admitted work.
|
|
211
271
|
*/
|
|
212
|
-
private
|
|
272
|
+
private admit;
|
|
213
273
|
/**
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* @
|
|
217
|
-
* @returns Tenant-scoped native record handles.
|
|
218
|
-
* @typeParam I Typed entity identifier.
|
|
219
|
-
* @typeParam S Generated Entity state.
|
|
274
|
+
* Tracks a history batch before synchronously capturing caller-supplied values.
|
|
275
|
+
* @param operation Complete immutable audit group.
|
|
276
|
+
* @returns The admitted group outcome.
|
|
220
277
|
*/
|
|
221
|
-
private
|
|
278
|
+
private admitHistory;
|
|
222
279
|
/**
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
* @
|
|
226
|
-
* @
|
|
280
|
+
* Prepares a declared record family without opening a storage handle.
|
|
281
|
+
* @typeParam I Record identifier type.
|
|
282
|
+
* @typeParam R Stored record type.
|
|
283
|
+
* @param context Captured tenant context.
|
|
284
|
+
* @param spec The physical record declaration.
|
|
285
|
+
* @param group Optional history family.
|
|
286
|
+
* @param mode Creation or read-only checking.
|
|
287
|
+
* @returns Completion after native or custom preparation.
|
|
288
|
+
*/
|
|
289
|
+
private prepareRecord;
|
|
290
|
+
/**
|
|
291
|
+
* Prepares a family within an existing factory admission.
|
|
292
|
+
* @typeParam I Record identifier type.
|
|
293
|
+
* @typeParam R Stored record type.
|
|
294
|
+
* @param context Captured tenant context.
|
|
295
|
+
* @param spec The physical record declaration.
|
|
296
|
+
* @param group Optional history family.
|
|
297
|
+
* @param mode Creation or read-only checking.
|
|
298
|
+
* @param allowCustom Whether ordinary custom creators are selected.
|
|
299
|
+
* @returns Completion after compatible preparation.
|
|
300
|
+
*/
|
|
301
|
+
private prepareRecordAdmitted;
|
|
302
|
+
/**
|
|
303
|
+
* Prepares current Entity and enabled history declarations without storage handles.
|
|
304
|
+
* @typeParam I Entity identifier type.
|
|
305
|
+
* @typeParam S Entity state type.
|
|
306
|
+
* @param input The declarative Entity family.
|
|
307
|
+
* @param mode Creation or read-only checking.
|
|
308
|
+
* @returns Completion after all requested families are checked.
|
|
309
|
+
*/
|
|
310
|
+
private prepareEntity;
|
|
311
|
+
/**
|
|
312
|
+
* Prepares the surviving Agent audit family.
|
|
313
|
+
* @typeParam I Agent identifier type.
|
|
314
|
+
* @param input Agent state and complete tenant context.
|
|
315
|
+
* @returns Completion after audit record compatibility is checked.
|
|
316
|
+
*/
|
|
317
|
+
private prepareAgentHistory;
|
|
318
|
+
/**
|
|
319
|
+
* Creates native live Agent current, audit, and preference requirements.
|
|
320
|
+
* @param input Declarative Agent Entity layout.
|
|
321
|
+
* @param mode Creation or read-only metadata check.
|
|
322
|
+
* @returns Completion after native definitions are compatible.
|
|
227
323
|
* @typeParam I Typed Agent identifier.
|
|
228
324
|
* @typeParam S Generated Agent state.
|
|
229
325
|
*/
|
|
230
|
-
private
|
|
231
|
-
/**
|
|
232
|
-
*
|
|
326
|
+
private prepareAgentCommit;
|
|
327
|
+
/**
|
|
328
|
+
* Checks the two native Agent audit families after current Entity declarations.
|
|
329
|
+
* @param context Complete tenant context.
|
|
330
|
+
* @returns Completion after both families are accessible.
|
|
331
|
+
*/
|
|
332
|
+
private prepareAgentMetadata;
|
|
333
|
+
/**
|
|
334
|
+
* Checks one native physical definition and its namespace read access.
|
|
335
|
+
* @typeParam I Record identifier type.
|
|
336
|
+
* @typeParam R Stored record type.
|
|
337
|
+
* @param context Complete tenant context.
|
|
338
|
+
* @param spec The declared record family.
|
|
339
|
+
* @param group Optional physical group.
|
|
340
|
+
* @param explicitKind Configured or fixed native kind.
|
|
341
|
+
* @returns Completion after a compatible namespace read.
|
|
342
|
+
*/
|
|
343
|
+
private prepareNative;
|
|
344
|
+
/**
|
|
345
|
+
* Checks one retained definition and records only successful readiness.
|
|
346
|
+
* @param namespace Native namespace to inspect.
|
|
347
|
+
* @param family Canonical physical family key.
|
|
348
|
+
* @param entry Existing compatible physical declaration.
|
|
349
|
+
* @returns Completion after the read-only metadata check.
|
|
350
|
+
*/
|
|
351
|
+
private probePrepared;
|
|
352
|
+
/**
|
|
353
|
+
* Records a successful native handle's pure layout for later compatibility checks.
|
|
354
|
+
* @typeParam I Record identifier type.
|
|
355
|
+
* @typeParam R Stored record type.
|
|
356
|
+
* @param context Complete tenant context.
|
|
357
|
+
* @param spec The declared record family.
|
|
358
|
+
* @param group Optional physical group.
|
|
359
|
+
* @param explicitKind Configured or fixed native kind.
|
|
360
|
+
* @param mapping Actual native mapping from an opened handle.
|
|
361
|
+
*/
|
|
362
|
+
private declareNative;
|
|
363
|
+
/**
|
|
364
|
+
* Finds the pure native namespace, kind, and record layout declaration.
|
|
365
|
+
* @typeParam I Record identifier type.
|
|
366
|
+
* @typeParam R Stored record type.
|
|
367
|
+
* @param context Complete tenant context.
|
|
368
|
+
* @param spec The declared record family.
|
|
369
|
+
* @param group Optional physical group.
|
|
370
|
+
* @param explicitKind Configured or fixed native kind.
|
|
371
|
+
* @param mapping Actual native mapping from an opened handle.
|
|
372
|
+
* @returns Canonical physical identity and signature.
|
|
373
|
+
*/
|
|
374
|
+
private nativeDefinition;
|
|
375
|
+
/**
|
|
376
|
+
* Returns a configured or default native record kind.
|
|
233
377
|
*
|
|
234
|
-
* @
|
|
235
|
-
* @
|
|
236
|
-
* @param
|
|
237
|
-
* @param
|
|
238
|
-
* @
|
|
239
|
-
* @
|
|
240
|
-
|
|
378
|
+
* @typeParam I Record identifier type.
|
|
379
|
+
* @typeParam R Stored record message type.
|
|
380
|
+
* @param spec Declared record family.
|
|
381
|
+
* @param group Optional physical group.
|
|
382
|
+
* @param explicitKind Kind from a record layout.
|
|
383
|
+
* @returns The selected native kind.
|
|
384
|
+
*/
|
|
385
|
+
private selectedKind;
|
|
386
|
+
/**
|
|
387
|
+
* Converts one complete tenant boundary to its native namespace.
|
|
388
|
+
* @param context Complete tenant context.
|
|
389
|
+
* @returns Its native Datastore namespace.
|
|
241
390
|
*/
|
|
242
|
-
private
|
|
391
|
+
private nativeNamespace;
|
|
392
|
+
/**
|
|
393
|
+
* Captures physical column declarations without evaluating record callbacks.
|
|
394
|
+
* @typeParam R Stored record type.
|
|
395
|
+
* @param columns Declared query columns.
|
|
396
|
+
* @returns Stable physical column signature.
|
|
397
|
+
*/
|
|
398
|
+
private columnSignature;
|
|
399
|
+
/**
|
|
400
|
+
* Registers the required provider-only Agent history capability.
|
|
401
|
+
*/
|
|
402
|
+
private registerAgentHistory;
|
|
243
403
|
/**
|
|
244
404
|
* Creates the selected Entity provider bundle.
|
|
245
405
|
*
|
|
406
|
+
* @typeParam I Entity identifier type.
|
|
407
|
+
* @typeParam S Entity state message type.
|
|
246
408
|
* @param input The Entity persistence contract.
|
|
247
409
|
* @returns The coherent Entity storage handle.
|
|
248
|
-
* @typeParam I Typed Entity identifier.
|
|
249
|
-
* @typeParam S Entity state message.
|
|
250
410
|
*/
|
|
251
411
|
createEntityStorage<I, S extends Message>(input: EntityStorageInput<I, S>): DatastoreEntityStorageHandle<I, S>;
|
|
412
|
+
/**
|
|
413
|
+
* Registers a coherent Entity bundle for factory shutdown.
|
|
414
|
+
*
|
|
415
|
+
* @param bundle The coherent Entity storage bundle.
|
|
416
|
+
* @returns The tracked Entity storage bundle.
|
|
417
|
+
* @typeParam I Entity identifier or record type.
|
|
418
|
+
* @typeParam S Generated Entity state message type.
|
|
419
|
+
*/
|
|
420
|
+
private retainBundle;
|
|
421
|
+
/**
|
|
422
|
+
* Acquires direct built-in commit access without an unused Entity read bundle.
|
|
423
|
+
*
|
|
424
|
+
* @param input The captured Entity persistence input.
|
|
425
|
+
* @returns The provider commit handle.
|
|
426
|
+
* @typeParam I Entity identifier or record type.
|
|
427
|
+
* @typeParam S Generated Entity state message type.
|
|
428
|
+
*/
|
|
429
|
+
private createEntityCommitStorage;
|
|
430
|
+
/**
|
|
431
|
+
* Wraps a custom bundle while retaining its complete cleanup obligation.
|
|
432
|
+
* @param custom Registered custom Entity storage creator.
|
|
433
|
+
* @param input Captured Entity storage layout.
|
|
434
|
+
* @typeParam I Typed Entity identifier.
|
|
435
|
+
* @typeParam S Generated Entity state.
|
|
436
|
+
* @returns The adapted custom commit handle.
|
|
437
|
+
*/
|
|
438
|
+
private createCustomCommitStorage;
|
|
439
|
+
/**
|
|
440
|
+
* Creates repeatable cleanup methods that retain a bundle until closure settles.
|
|
441
|
+
*
|
|
442
|
+
* @param bundle The complete provider bundle.
|
|
443
|
+
* @param onRemove Removes the settled factory root.
|
|
444
|
+
* @returns Repeatable close methods.
|
|
445
|
+
*/
|
|
446
|
+
private retainCleanup;
|
|
252
447
|
/**
|
|
253
448
|
* Creates provider-specific Datastore record storage.
|
|
254
449
|
*
|
|
450
|
+
* @typeParam I Record identifier type.
|
|
451
|
+
* @typeParam R Stored record message type.
|
|
255
452
|
* @param context The storage context.
|
|
256
453
|
* @param recordSpec The record specification.
|
|
257
454
|
* @param group Separates records that share one source type.
|
|
258
455
|
* @returns The created Datastore record storage.
|
|
259
|
-
* @typeParam I Typed record identifier.
|
|
260
|
-
* @typeParam R Stored record message.
|
|
261
456
|
*/
|
|
262
457
|
protected onCreateRecordStorage<I, R extends Message>(context: StorageContext, recordSpec: RecordSpec<I, R>, group?: StorageGroup): RecordStorage<I, R>;
|
|
263
458
|
/**
|
|
264
|
-
*
|
|
459
|
+
* Acquires the built-in record provider for generated Entity families.
|
|
265
460
|
*
|
|
266
|
-
* @
|
|
267
|
-
* @
|
|
268
|
-
* @param
|
|
269
|
-
* @
|
|
270
|
-
* @
|
|
271
|
-
* @
|
|
461
|
+
* @typeParam I Record identifier type.
|
|
462
|
+
* @typeParam R Stored record message type.
|
|
463
|
+
* @param context Identifies the storage tenant and context.
|
|
464
|
+
* @param recordSpec Defines the generated record family.
|
|
465
|
+
* @param group Selects an optional grouped history family.
|
|
466
|
+
* @returns A built-in Datastore record handle.
|
|
272
467
|
*/
|
|
273
468
|
private createEntityRecordStorage;
|
|
274
469
|
/**
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
* @
|
|
278
|
-
* @param
|
|
279
|
-
* @
|
|
280
|
-
* @
|
|
281
|
-
* @
|
|
470
|
+
* Acquires one native record handle and retains its pure physical definition.
|
|
471
|
+
* @typeParam I Record identifier type.
|
|
472
|
+
* @typeParam R Stored record type.
|
|
473
|
+
* @param context Complete tenant context.
|
|
474
|
+
* @param spec The declared record family.
|
|
475
|
+
* @param group Optional physical group.
|
|
476
|
+
* @param kind Configured or fixed native kind.
|
|
477
|
+
* @returns The native record handle.
|
|
282
478
|
*/
|
|
283
|
-
private
|
|
479
|
+
private openNative;
|
|
284
480
|
/**
|
|
285
|
-
*
|
|
481
|
+
* Finds the registered creator and physical layout for a record family.
|
|
286
482
|
*
|
|
287
|
-
* @
|
|
288
|
-
* @
|
|
289
|
-
* @param
|
|
290
|
-
* @
|
|
291
|
-
* @
|
|
292
|
-
* @
|
|
483
|
+
* @typeParam I Record identifier type.
|
|
484
|
+
* @typeParam R Stored record message type.
|
|
485
|
+
* @param recordSpec Defines the requested family.
|
|
486
|
+
* @param group Selects an optional grouped family.
|
|
487
|
+
* @param includeCreator Allows a custom record creator for ordinary records.
|
|
488
|
+
* @returns Matching custom creator and physical layout, when registered.
|
|
293
489
|
*/
|
|
294
490
|
private resolve;
|
|
295
491
|
/**
|
|
@@ -300,7 +496,15 @@ export declare class DatastoreStorageFactory extends StorageFactory implements T
|
|
|
300
496
|
tenantCatalog(): TenantCatalog;
|
|
301
497
|
/**
|
|
302
498
|
* Closes the factory and its native tenant catalog.
|
|
499
|
+
*
|
|
500
|
+
* @returns Completion after retained resources are closed.
|
|
501
|
+
*/
|
|
502
|
+
close(): Promise<void>;
|
|
503
|
+
/**
|
|
504
|
+
* Waits for admitted commits before closing remaining factory resources.
|
|
505
|
+
*
|
|
506
|
+
* @returns Completion after admitted work and cleanup settle.
|
|
303
507
|
*/
|
|
304
|
-
|
|
508
|
+
private drain;
|
|
305
509
|
}
|
|
306
510
|
//# sourceMappingURL=storage-factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-factory.d.ts","sourceRoot":"","sources":["../../src/datastore/storage-factory.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"storage-factory.d.ts","sourceRoot":"","sources":["../../src/datastore/storage-factory.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAO,SAAS,EAAkB,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAA8B,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EACL,aAAa,EACb,cAAc,EAC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