@spine-event-engine/storage-datastore 2.0.0-snapshot.21 → 2.0.0-snapshot.23

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.
@@ -15,10 +15,16 @@ import { Datastore } from "@google-cloud/datastore";
15
15
  import { StringifierRegistry } from "@spine-event-engine/core";
16
16
  import { RecordStorage, StorageFactory, } from "@spine-event-engine/storage";
17
17
  import {} from "@spine-event-engine/storage/provider";
18
+ import { AgentExecutionRecords, AgentHistoryRecords, eventHistorySpec, stateHistorySpec, } from "@spine-event-engine/storage/provider";
19
+ import { eventStoreRecordSpec } from "@spine-event-engine/storage/provider";
18
20
  import { EntityCommitStorageFactories } from "@spine-event-engine/storage/provider";
19
21
  import { DeliveryCleanupStorageFactories } from "@spine-event-engine/storage/provider";
22
+ import { AgentHistoryStorageFactories } from "@spine-event-engine/storage/provider";
23
+ import { AgentExecutionStorageFactories } from "@spine-event-engine/storage/provider";
20
24
  import { DatastoreEntityCommitStorage, DatastoreEntityStorage, } from "./entity-history.js";
21
25
  import { DatastoreRecordStorage } from "./record-storage.js";
26
+ import { DatastoreAgentHistory, AgentHistoryHash } from "./agent-history.js";
27
+ import { DatastoreAgentExecution } from "./agent-execution.js";
22
28
  import { DatastoreDeliveryCleanupStorage } from "./delivery-cleanup.js";
23
29
  import { DefaultNamespaceConverter, NamespaceAssignments, } from "./namespace.js";
24
30
  import { DatastoreTenantCatalog } from "./tenant-catalog.js";
@@ -27,12 +33,45 @@ const maxClientSideScan = 1_000;
27
33
  * A Google Cloud Datastore-backed implementation of the Spine TS storage port.
28
34
  */
29
35
  export class DatastoreStorageFactory extends StorageFactory {
36
+ /**
37
+ * Caller-supplied Datastore client.
38
+ */
30
39
  #client;
40
+ /**
41
+
42
+ * Custom record providers by family.
43
+
44
+ */
31
45
  #recordCreators;
46
+ /**
47
+
48
+ * Physical kinds by record family.
49
+
50
+ */
32
51
  #layouts;
52
+ /**
53
+
54
+ * Custom Entity providers by state type.
55
+
56
+ */
33
57
  #entityCreators;
58
+ /**
59
+
60
+ * Complete tenant-to-namespace conversion.
61
+
62
+ */
34
63
  #namespaceConverter;
64
+ /**
65
+
66
+ * Schema-bound message stringifiers.
67
+
68
+ */
35
69
  #stringifiers;
70
+ /**
71
+
72
+ * Native tenant catalog for the selected client.
73
+
74
+ */
36
75
  #catalog;
37
76
  /**
38
77
  * Starts a mutable factory configuration.
@@ -68,12 +107,113 @@ export class DatastoreStorageFactory extends StorageFactory {
68
107
  DeliveryCleanupStorageFactories.register(this, {
69
108
  createDeliveryCleanupStorage: () => new DatastoreDeliveryCleanupStorage((context, spec) => this.cleanupStorage(context, spec)),
70
109
  });
110
+ this.registerAgentHistory();
111
+ this.registerAgentExecution();
112
+ }
113
+ /**
114
+ * Registers the required provider-only Agent history capability.
115
+ */
116
+ registerAgentHistory() {
117
+ AgentHistoryStorageFactories.register(this, {
118
+ createAgentHistoryStorage: (input) => {
119
+ if (!this.isOpen())
120
+ throw new Error("StorageFactory is closed.");
121
+ return new DatastoreAgentHistory(input, new DatastoreRecordStorage(input.context, AgentHistoryRecords.spec((value) => AgentHistoryHash.value(value)), this.#client, maxClientSideScan, AgentHistoryRecords.group, "spine_agent_history", this.#namespaceConverter, this.#stringifiers));
122
+ },
123
+ });
124
+ }
125
+ /**
126
+ * Registers the native transactional Agent execution capability.
127
+ */
128
+ registerAgentExecution() {
129
+ AgentExecutionStorageFactories.register(this, {
130
+ createAgentExecutionStorage: (input) => this.createAgentExecution(input),
131
+ });
132
+ }
133
+ /**
134
+ * Opens one Agent execution handle after factory lifecycle validation.
135
+ *
136
+ * @param input Requested fenced execution change.
137
+ * @returns Tenant-scoped Agent execution storage handle.
138
+ * @typeParam I Typed entity identifier.
139
+ * @typeParam S Generated Entity state.
140
+ */
141
+ createAgentExecution(input) {
142
+ if (!this.isOpen())
143
+ throw new Error("StorageFactory is closed.");
144
+ return new DatastoreAgentExecution(input, this.executionRows(input));
145
+ }
146
+ /**
147
+ * Opens the fixed execution kinds and existing Entity record families.
148
+ *
149
+ * @param input Requested fenced execution change.
150
+ * @returns Tenant-scoped native record handles.
151
+ * @typeParam I Typed entity identifier.
152
+ * @typeParam S Generated Entity state.
153
+ */
154
+ executionRows(input) {
155
+ const context = input.entity.context;
156
+ const digest = (value) => AgentHistoryHash.value(value);
157
+ return {
158
+ invocation: this.executionRecord(context, AgentExecutionRecords.invocationSpec(digest), AgentExecutionRecords.invocationGroup, "spine_agent_execution"),
159
+ head: this.executionRecord(context, AgentExecutionRecords.headSpec(digest), AgentExecutionRecords.headGroup, "spine_agent_execution_head"),
160
+ history: this.executionRecord(context, AgentHistoryRecords.spec(digest), AgentHistoryRecords.group, "spine_agent_history"),
161
+ current: this.executionRecord(context, input.entity.recordSpec),
162
+ ...this.optionalExecutionRows(input),
163
+ events: this.executionRecord(context, eventStoreRecordSpec),
164
+ };
165
+ }
166
+ /**
167
+ * Opens optional existing Entity state and diagnostic record families.
168
+ *
169
+ * @param input Typed Agent repository and history configuration.
170
+ * @returns Optional native state and diagnostic handles.
171
+ * @typeParam I Typed Agent identifier.
172
+ * @typeParam S Generated Agent state.
173
+ */
174
+ optionalExecutionRows(input) {
175
+ const context = input.entity.context;
176
+ const state = input.entity.stateHistory
177
+ ? stateHistorySpec(input.entity.stateSchema)
178
+ : undefined;
179
+ const diagnostic = input.entity.eventHistory
180
+ ? eventHistorySpec(input.entity.stateSchema)
181
+ : undefined;
182
+ return {
183
+ ...(state === undefined
184
+ ? {}
185
+ : {
186
+ states: this.executionRecord(context, state.spec, state.group),
187
+ }),
188
+ ...(diagnostic === undefined
189
+ ? {}
190
+ : {
191
+ diagnostics: this.executionRecord(context, diagnostic.spec, diagnostic.group),
192
+ }),
193
+ };
194
+ }
195
+ /**
196
+ * Resolves one native kind through the existing record layout.
197
+ *
198
+ * @param context Captured event storage context.
199
+ * @param fixedKind Fixed native Datastore kind.
200
+ * @param group Fixed storage group.
201
+ * @param spec Typed record layout.
202
+ * @returns Typed native record handle.
203
+ * @typeParam I Typed entity identifier.
204
+ * @typeParam R Typed persisted record.
205
+ */
206
+ executionRecord(context, spec, group, fixedKind) {
207
+ const kind = fixedKind ?? this.resolve(spec, group, false).layout?.kind;
208
+ return new DatastoreRecordStorage(context, spec, this.#client, maxClientSideScan, group, kind, this.#namespaceConverter, this.#stringifiers);
71
209
  }
72
210
  /**
73
211
  * Creates the selected Entity provider bundle.
74
212
  *
75
213
  * @param input The Entity persistence contract.
76
214
  * @returns The coherent Entity storage handle.
215
+ * @typeParam I Typed Entity identifier.
216
+ * @typeParam S Entity state message.
77
217
  */
78
218
  createEntityStorage(input) {
79
219
  if (!this.isOpen())
@@ -93,6 +233,8 @@ export class DatastoreStorageFactory extends StorageFactory {
93
233
  * @param recordSpec The record specification.
94
234
  * @param group Separates records that share one source type.
95
235
  * @returns The created Datastore record storage.
236
+ * @typeParam I Typed record identifier.
237
+ * @typeParam R Stored record message.
96
238
  */
97
239
  onCreateRecordStorage(context, recordSpec, group) {
98
240
  const resolved = this.resolve(recordSpec, group, true);
@@ -101,14 +243,43 @@ export class DatastoreStorageFactory extends StorageFactory {
101
243
  return creator(context, recordSpec, this.#client, maxClientSideScan);
102
244
  return new DatastoreRecordStorage(context, recordSpec, this.#client, maxClientSideScan, group, resolved.layout?.kind, this.#namespaceConverter, this.#stringifiers);
103
245
  }
246
+ /**
247
+ * Creates a canonical Entity record handle without a custom provider callback.
248
+ *
249
+ * @param context Complete storage and tenant scope.
250
+ * @param recordSpec Generated record layout.
251
+ * @param group Optional record family group.
252
+ * @returns Native record handle.
253
+ * @typeParam I Typed record identifier.
254
+ * @typeParam R Stored record message.
255
+ */
104
256
  createEntityRecordStorage(context, recordSpec, group) {
105
257
  const resolved = this.resolve(recordSpec, group, false);
106
258
  return new DatastoreRecordStorage(context, recordSpec, this.#client, maxClientSideScan, group, resolved.layout?.kind, this.#namespaceConverter, this.#stringifiers);
107
259
  }
260
+ /**
261
+ * Creates a canonical delivery-cleanup record handle.
262
+ *
263
+ * @param context Complete storage and tenant scope.
264
+ * @param recordSpec Generated record layout.
265
+ * @returns Native record handle.
266
+ * @typeParam I Typed record identifier.
267
+ * @typeParam R Stored record message.
268
+ */
108
269
  cleanupStorage(context, recordSpec) {
109
270
  const resolved = this.resolve(recordSpec, undefined, false);
110
271
  return new DatastoreRecordStorage(context, recordSpec, this.#client, maxClientSideScan, undefined, resolved.layout?.kind, this.#namespaceConverter, this.#stringifiers);
111
272
  }
273
+ /**
274
+ * Resolves a declared record family's native kind and optional callback.
275
+ *
276
+ * @param recordSpec Generated record layout.
277
+ * @param group Optional record family group.
278
+ * @param includeCreator Whether custom callbacks are permitted.
279
+ * @returns Matching custom provider and physical layout, when configured.
280
+ * @typeParam I Typed record identifier.
281
+ * @typeParam R Stored record message.
282
+ */
112
283
  resolve(recordSpec, group, includeCreator) {
113
284
  const source = recordSpec.sourceType.typeName;
114
285
  const record = recordSpec.recordType.typeName;
@@ -137,34 +308,108 @@ export class DatastoreStorageFactory extends StorageFactory {
137
308
  void this.#catalog.close();
138
309
  }
139
310
  }
311
+ /**
312
+
313
+ * Builds a Datastore factory from caller-supplied client and layout options.
314
+
315
+ */
140
316
  class Builder {
141
317
  create;
318
+ /**
319
+ * Caller-supplied Datastore client.
320
+ */
142
321
  #client;
322
+ /**
323
+
324
+ * Custom providers by record-family identity.
325
+
326
+ */
143
327
  #recordCreators = new Map();
328
+ /**
329
+
330
+ * Physical kinds by record-family identity.
331
+
332
+ */
144
333
  #layouts = new Map();
334
+ /**
335
+
336
+ * Custom Entity providers by generated state type.
337
+
338
+ */
145
339
  #entityCreators = new Map();
340
+ /**
341
+
342
+ * Complete tenant-to-namespace converter.
343
+
344
+ */
146
345
  #namespaceConverter = new DefaultNamespaceConverter();
346
+ /**
347
+
348
+ * Schema-bound message stringifiers.
349
+
350
+ */
147
351
  #stringifiers = new StringifierRegistry();
352
+ /**
353
+ * Binds the resolved configuration to a factory constructor.
354
+ *
355
+ * @param create Creates the configured Datastore factory.
356
+ */
148
357
  constructor(create) {
149
358
  this.create = create;
150
359
  }
360
+ /**
361
+ * Sets the caller-supplied Datastore client.
362
+ *
363
+ * @param client Datastore client.
364
+ * @returns This builder.
365
+ */
151
366
  setClient(client) {
152
367
  this.#client = client;
153
368
  return this;
154
369
  }
370
+ /**
371
+ * Sets reversible complete tenant namespace conversion.
372
+ *
373
+ * @param converter Tenant namespace converter.
374
+ * @returns This builder.
375
+ */
155
376
  setNamespaceConverter(converter) {
156
377
  this.#namespaceConverter = converter;
157
378
  return this;
158
379
  }
380
+ /**
381
+ * Sets schema-bound message stringifiers for IDs and columns.
382
+ *
383
+ * @param registry Custom message stringifiers.
384
+ * @returns This builder.
385
+ */
159
386
  setStringifierRegistry(registry) {
160
387
  this.#stringifiers = new StringifierRegistry(registry);
161
388
  return this;
162
389
  }
390
+ /**
391
+ * Maps a record family to one native Datastore kind.
392
+ *
393
+ * @param first Source or record message type.
394
+ * @param second Record message type or kind layout.
395
+ * @param third Kind layout for a source-record pair.
396
+ * @returns This builder.
397
+ * @typeParam R Stored record message.
398
+ */
163
399
  organizeRecords(first, second, third) {
164
400
  const [source, record, layout] = third === undefined ? [undefined, first, second] : [first, second, third];
165
401
  this.#layouts.set(key(source?.typeName ?? record.typeName, record.typeName), checkedLayout(layout));
166
402
  return this;
167
403
  }
404
+ /**
405
+ * Registers one custom record provider for a record family.
406
+ *
407
+ * @param first Source or record message type.
408
+ * @param second Record message type or provider callback.
409
+ * @param third Provider callback for a source-record pair.
410
+ * @returns This builder.
411
+ * @typeParam R Stored record message.
412
+ */
168
413
  useRecordStorage(first, second, third) {
169
414
  const [source, record, creator] = third === undefined
170
415
  ? [undefined, first, second]
@@ -172,10 +417,23 @@ class Builder {
172
417
  this.#recordCreators.set(key(source?.typeName ?? record.typeName, record.typeName), creator);
173
418
  return this;
174
419
  }
420
+ /**
421
+ * Registers one custom Entity provider for a generated state type.
422
+ *
423
+ * @param sourceType Generated Entity state type.
424
+ * @param creator Custom Entity provider callback.
425
+ * @returns This builder.
426
+ * @typeParam S Entity state message.
427
+ */
175
428
  useEntityStorage(sourceType, creator) {
176
429
  this.#entityCreators.set(sourceType.typeName, creator);
177
430
  return this;
178
431
  }
432
+ /**
433
+ * Builds the configured Datastore factory.
434
+ *
435
+ * @returns Factory bound to the supplied client and layout configuration.
436
+ */
179
437
  build() {
180
438
  if (this.#client === undefined)
181
439
  throw new Error("DatastoreStorageFactory builder requires a client.");
@@ -183,12 +441,47 @@ class Builder {
183
441
  return this.create(this.#client, new Map(this.#recordCreators), new Map(this.#layouts), new Map(this.#entityCreators), this.#namespaceConverter, this.#stringifiers);
184
442
  }
185
443
  }
444
+ /**
445
+ * Groups current Entity records, histories, and commit access in one handle.
446
+ *
447
+ * @typeParam I Typed Entity identifier.
448
+ * @typeParam S Entity state message.
449
+ */
186
450
  class DefaultEntityHandle {
451
+ /**
452
+ * Current Entity record access.
453
+ */
187
454
  current;
455
+ /**
456
+
457
+ * Retained Entity state history.
458
+
459
+ */
188
460
  states;
461
+ /**
462
+
463
+ * Retained diagnostic Event history.
464
+
465
+ */
189
466
  events;
467
+ /**
468
+
469
+ * Atomic Entity commit access.
470
+
471
+ */
190
472
  commits;
473
+ /**
474
+
475
+ * Backing Entity storage handle.
476
+
477
+ */
191
478
  #storage;
479
+ /**
480
+ * Binds Entity storage and commit access to one closeable handle.
481
+ *
482
+ * @param storage Current record and history access.
483
+ * @param commits Atomic Entity commit access.
484
+ */
192
485
  constructor(storage, commits) {
193
486
  this.#storage = storage;
194
487
  this.current = storage.current;
@@ -196,9 +489,19 @@ class DefaultEntityHandle {
196
489
  this.events = storage.events;
197
490
  this.commits = commits;
198
491
  }
492
+ /**
493
+ * Checks whether the backing Entity storage remains open.
494
+ *
495
+ * @returns Whether operations are accepted.
496
+ */
199
497
  isOpen() {
200
498
  return this.#storage.isOpen();
201
499
  }
500
+ /**
501
+
502
+ * Closes all Entity storage and commit handles.
503
+
504
+ */
202
505
  close() {
203
506
  this.#storage.close();
204
507
  this.commits.close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,GAAG,MAAM,SAAS,MAAM,EAAE,CAAC;AACpC,CAAC;AAED,SAAS,aAAa,CAAC,MAAoB;IACzC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,KAAK;QACnF,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,oBAAoB,CAAC,OAA0C;IACtE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC7C,KAAK,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACzC,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,QAAQ;YACjD,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACzF,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;AACH,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { Datastore } from "@google-cloud/datastore";
2
- import { type TenantBoundary as TenantBoundaryValue, type TenantCatalog } from "@spine-event-engine/storage/provider";
2
+ import { type TenantBoundary as TenantBoundaryValue, type TenantCatalog, type TenantCatalogPage, type TenantCatalogRead } from "@spine-event-engine/storage/provider";
3
3
  import { type NamespaceConverter } from "./namespace.js";
4
4
  interface EarlyTenantOptions {
5
5
  readonly now?: () => number;
@@ -26,6 +26,13 @@ export declare class DatastoreTenantCatalog implements TenantCatalog {
26
26
  * @returns The discovered and early-admitted tenant boundaries.
27
27
  */
28
28
  all(): Promise<readonly TenantBoundaryValue[]>;
29
+ /**
30
+ * Reads one bounded early-admission or native namespace page.
31
+ *
32
+ * @param request Finite candidate limit and instance-bound continuation.
33
+ * @returns A possibly empty continuing tenant page.
34
+ */
35
+ page(request: TenantCatalogRead): Promise<TenantCatalogPage>;
29
36
  /**
30
37
  * Records an admitted tenant until native metadata becomes visible.
31
38
  *
@@ -36,6 +43,11 @@ export declare class DatastoreTenantCatalog implements TenantCatalog {
36
43
  * @returns Completion of the in-memory catalog update.
37
44
  */
38
45
  keep(boundary: TenantBoundaryValue): Promise<void>;
46
+ /**
47
+ * Stores a tenant namespace until native Datastore metadata becomes visible.
48
+ *
49
+ * @param boundary The tenant admitted for early reads.
50
+ */
39
51
  private keepNow;
40
52
  /**
41
53
  * Closes this catalog without closing the caller-owned Datastore client.
@@ -43,7 +55,13 @@ export declare class DatastoreTenantCatalog implements TenantCatalog {
43
55
  * @returns Completion of catalog closure.
44
56
  */
45
57
  close(): Promise<void>;
58
+ /**
59
+ * Rejects catalog operations after closure.
60
+ */
46
61
  private requireOpen;
62
+ /**
63
+ * Removes early tenant admissions after their configured TTL.
64
+ */
47
65
  private purgeExpired;
48
66
  }
49
67
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"tenant-catalog.d.ts","sourceRoot":"","sources":["../../src/datastore/tenant-catalog.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAEL,KAAK,cAAc,IAAI,mBAAmB,EAC1C,KAAK,aAAa,EACnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAwB,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAK/E,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;GAEG;AACH,qBAAa,sB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