@spine-event-engine/storage 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 +12 -3
- package/REFERENCE.md +90 -63
- package/dist/entity/agent-history-record-spec.d.ts +8 -0
- package/dist/entity/agent-history-record-spec.d.ts.map +1 -1
- package/dist/entity/agent-history-record-spec.js +12 -1
- package/dist/entity/agent-history-record-spec.js.map +1 -1
- package/dist/entity/agent-history.d.ts +25 -0
- package/dist/entity/agent-history.d.ts.map +1 -1
- package/dist/entity/agent-history.js.map +1 -1
- package/dist/entity/history-conformance.d.ts +38 -8
- package/dist/entity/history-conformance.d.ts.map +1 -1
- package/dist/entity/history-conformance.js +103 -58
- package/dist/entity/history-conformance.js.map +1 -1
- package/dist/event/event-store.d.ts +80 -74
- package/dist/event/event-store.d.ts.map +1 -1
- package/dist/event/event-store.js +264 -264
- package/dist/event/event-store.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/agent-model-preferences.d.ts +76 -0
- package/dist/internal/agent-model-preferences.d.ts.map +1 -0
- package/dist/internal/agent-model-preferences.js +133 -0
- package/dist/internal/agent-model-preferences.js.map +1 -0
- package/dist/internal/entity-commit.d.ts +92 -17
- package/dist/internal/entity-commit.d.ts.map +1 -1
- package/dist/internal/entity-commit.js +45 -2
- package/dist/internal/entity-commit.js.map +1 -1
- package/dist/internal/entity-history.d.ts +1 -7
- package/dist/internal/entity-history.d.ts.map +1 -1
- package/dist/internal/entity-history.js +0 -5
- package/dist/internal/entity-history.js.map +1 -1
- package/dist/internal/event-store.d.ts +1 -1
- package/dist/internal/event-store.d.ts.map +1 -1
- package/dist/internal/event-store.js +1 -1
- package/dist/internal/event-store.js.map +1 -1
- package/dist/internal/storage-preparation.d.ts +88 -0
- package/dist/internal/storage-preparation.d.ts.map +1 -0
- package/dist/internal/storage-preparation.js +41 -0
- package/dist/internal/storage-preparation.js.map +1 -0
- package/dist/internal/tenancy.d.ts +7 -0
- package/dist/internal/tenancy.d.ts.map +1 -1
- package/dist/memory/in-memory-agent-history.d.ts.map +1 -1
- package/dist/memory/in-memory-agent-history.js +22 -7
- package/dist/memory/in-memory-agent-history.js.map +1 -1
- package/dist/memory/in-memory-entity-commit.d.ts +237 -42
- package/dist/memory/in-memory-entity-commit.d.ts.map +1 -1
- package/dist/memory/in-memory-entity-commit.js +529 -325
- package/dist/memory/in-memory-entity-commit.js.map +1 -1
- package/dist/memory/in-memory-entity-history.d.ts.map +1 -1
- package/dist/memory/in-memory-entity-history.js +4 -3
- package/dist/memory/in-memory-entity-history.js.map +1 -1
- package/dist/memory/in-memory-storage-backend.d.ts +33 -1
- package/dist/memory/in-memory-storage-backend.d.ts.map +1 -1
- package/dist/memory/in-memory-storage-backend.js +118 -1
- package/dist/memory/in-memory-storage-backend.js.map +1 -1
- package/dist/memory/in-memory-storage-factory.d.ts +72 -13
- package/dist/memory/in-memory-storage-factory.d.ts.map +1 -1
- package/dist/memory/in-memory-storage-factory.js +199 -30
- package/dist/memory/in-memory-storage-factory.js.map +1 -1
- package/dist/memory/tenant-records.d.ts +1 -1
- package/dist/memory/tenant-records.d.ts.map +1 -1
- package/dist/memory/tenant-records.js +3 -2
- package/dist/memory/tenant-records.js.map +1 -1
- package/dist/provider.d.ts +2 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +2 -1
- package/dist/provider.js.map +1 -1
- package/dist/record/record-query.d.ts +10 -2
- package/dist/record/record-query.d.ts.map +1 -1
- package/dist/record/record-query.js +9 -0
- package/dist/record/record-query.js.map +1 -1
- package/dist/storage/storage-factory.d.ts +27 -4
- package/dist/storage/storage-factory.d.ts.map +1 -1
- package/dist/storage/storage-factory.js +30 -1
- package/dist/storage/storage-factory.js.map +1 -1
- package/dist/storage/storage.d.ts +2 -1
- package/dist/storage/storage.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/entity/agent-execution-record-spec.d.ts +0 -87
- package/dist/entity/agent-execution-record-spec.d.ts.map +0 -1
- package/dist/entity/agent-execution-record-spec.js +0 -230
- package/dist/entity/agent-execution-record-spec.js.map +0 -1
- package/dist/entity/agent-execution-sizes.d.ts +0 -30
- package/dist/entity/agent-execution-sizes.d.ts.map +0 -1
- package/dist/entity/agent-execution-sizes.js +0 -51
- package/dist/entity/agent-execution-sizes.js.map +0 -1
- package/dist/entity/agent-execution-transitions.d.ts +0 -71
- package/dist/entity/agent-execution-transitions.d.ts.map +0 -1
- package/dist/entity/agent-execution-transitions.js +0 -182
- package/dist/entity/agent-execution-transitions.js.map +0 -1
- package/dist/entity/agent-execution-values.d.ts +0 -142
- package/dist/entity/agent-execution-values.d.ts.map +0 -1
- package/dist/entity/agent-execution-values.js +0 -250
- package/dist/entity/agent-execution-values.js.map +0 -1
- package/dist/entity/agent-execution.d.ts +0 -234
- package/dist/entity/agent-execution.d.ts.map +0 -1
- package/dist/entity/agent-execution.js +0 -15
- package/dist/entity/agent-execution.js.map +0 -1
- package/dist/internal/agent-execution.d.ts +0 -51
- package/dist/internal/agent-execution.d.ts.map +0 -1
- package/dist/internal/agent-execution.js +0 -53
- package/dist/internal/agent-execution.js.map +0 -1
- package/dist/internal/delivery-cleanup.d.ts +0 -99
- package/dist/internal/delivery-cleanup.d.ts.map +0 -1
- package/dist/internal/delivery-cleanup.js +0 -38
- package/dist/internal/delivery-cleanup.js.map +0 -1
- package/dist/memory/agent-execution-head-index.d.ts +0 -52
- package/dist/memory/agent-execution-head-index.d.ts.map +0 -1
- package/dist/memory/agent-execution-head-index.js +0 -91
- package/dist/memory/agent-execution-head-index.js.map +0 -1
- package/dist/memory/in-memory-agent-execution.d.ts +0 -21
- package/dist/memory/in-memory-agent-execution.d.ts.map +0 -1
- package/dist/memory/in-memory-agent-execution.js +0 -587
- package/dist/memory/in-memory-agent-execution.js.map +0 -1
- package/dist/memory/memory-delivery-cleanup.d.ts +0 -32
- package/dist/memory/memory-delivery-cleanup.d.ts.map +0 -1
- package/dist/memory/memory-delivery-cleanup.js +0 -61
- package/dist/memory/memory-delivery-cleanup.js.map +0 -1
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
* or implied. See the License for the specific language governing permissions and limitations under
|
|
12
12
|
* the License.
|
|
13
13
|
*/
|
|
14
|
-
import { create,
|
|
15
|
-
import {
|
|
14
|
+
import { create, ScalarType } from "@bufbuild/protobuf";
|
|
15
|
+
import { AnyPacker } from "@spine-event-engine/core";
|
|
16
|
+
import { StringValueSchema, TimestampSchema } from "@bufbuild/protobuf/wkt";
|
|
16
17
|
import { EntityRecordSchema, } from "@spine-event-engine/proto/generated/spine/server/entity/entity_pb.js";
|
|
17
18
|
import { EventIdSchema, EventSchema, VersionSchema } from "@spine-event-engine/proto";
|
|
18
19
|
import { RecordColumn } from "../record/record-column.js";
|
|
@@ -25,30 +26,30 @@ export const EntityHistoryConformance = Object.freeze({
|
|
|
25
26
|
// prettier-ignore
|
|
26
27
|
/**
|
|
27
28
|
* Checks the shared current-record behavior.
|
|
28
|
-
*
|
|
29
|
+
* @typeParam S Generated Entity state type.
|
|
29
30
|
* @param adapter Supplies the provider under test.
|
|
30
31
|
* @returns Completes when the behavior is verified.
|
|
31
32
|
*/
|
|
32
33
|
async checkCurrentQueries(adapter) {
|
|
33
|
-
const storage = adapter.create(EntityHistoryFixture.input());
|
|
34
|
+
const storage = adapter.create(EntityHistoryFixture.input(adapter));
|
|
34
35
|
try {
|
|
35
|
-
await storage.current.write(EntityHistoryFixture.record("task", "task", 3));
|
|
36
|
-
await storage.current.write(EntityHistoryFixture.record("later", "later", 4));
|
|
36
|
+
await storage.current.write(EntityHistoryFixture.record(adapter, "task", "task", 3));
|
|
37
|
+
await storage.current.write(EntityHistoryFixture.record(adapter, "later", "later", 4));
|
|
37
38
|
const queried = await storage.current.query({
|
|
38
|
-
predicate: { kind: "comparison", column: "
|
|
39
|
-
order: [{ column: "
|
|
39
|
+
predicate: { kind: "comparison", column: "title", operator: "equal", value: "task" },
|
|
40
|
+
order: [{ column: "title", direction: "asc" }],
|
|
40
41
|
limit: 1,
|
|
41
42
|
candidateLimit: 2,
|
|
42
43
|
});
|
|
43
44
|
const current = await storage.current.read("task");
|
|
44
45
|
EntityHistoryFixture.assert(current !== undefined, "current state must round-trip");
|
|
45
|
-
EntityHistoryFixture.assert(EntityHistoryFixture.state(current)
|
|
46
|
-
EntityHistoryFixture.assert(queried.length === 1 && queried[0]?.id === "
|
|
46
|
+
EntityHistoryFixture.assert(adapter.value(EntityHistoryFixture.state(adapter, current)) === "task", "current state must round-trip");
|
|
47
|
+
EntityHistoryFixture.assert(queried.length === 1 && queried[0]?.id === "task", "current queries must filter, order, and limit generated records");
|
|
47
48
|
}
|
|
48
49
|
finally {
|
|
49
50
|
storage.close?.();
|
|
50
51
|
}
|
|
51
|
-
const reopened = adapter.reopen(EntityHistoryFixture.input());
|
|
52
|
+
const reopened = adapter.reopen(EntityHistoryFixture.input(adapter));
|
|
52
53
|
try {
|
|
53
54
|
EntityHistoryFixture.assert((await reopened.current.read("task")) !== undefined, "current record must survive reopen");
|
|
54
55
|
}
|
|
@@ -58,31 +59,27 @@ export const EntityHistoryConformance = Object.freeze({
|
|
|
58
59
|
},
|
|
59
60
|
/**
|
|
60
61
|
* Checks the generated state-history behavior.
|
|
61
|
-
*
|
|
62
|
+
* @typeParam S Generated Entity state type.
|
|
62
63
|
* @param adapter Supplies the provider under test.
|
|
63
64
|
* @returns Completes when the behavior is verified.
|
|
64
65
|
*/
|
|
65
66
|
async check(adapter) {
|
|
66
67
|
await EntityHistoryConformance.checkCurrentQueries(adapter);
|
|
67
|
-
const input = EntityHistoryFixture.input();
|
|
68
|
+
const input = EntityHistoryFixture.input(adapter);
|
|
68
69
|
const storage = adapter.create(input);
|
|
69
70
|
try {
|
|
70
|
-
await storage.states.append(EntityHistoryFixture.record("task", "first", 1));
|
|
71
|
-
await storage.states.append(EntityHistoryFixture.record("task", "second", 2));
|
|
71
|
+
await storage.states.append(EntityHistoryFixture.record(adapter, "task", "first", 1));
|
|
72
|
+
await storage.states.append(EntityHistoryFixture.record(adapter, "task", "second", 2));
|
|
72
73
|
const backward = await storage.states.backward("task", 2);
|
|
73
74
|
const newest = backward[0];
|
|
74
75
|
const older = backward[1];
|
|
75
76
|
EntityHistoryFixture.assert(newest !== undefined &&
|
|
76
77
|
older !== undefined &&
|
|
77
|
-
EntityHistoryFixture.state(newest)
|
|
78
|
-
EntityHistoryFixture.state(older)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
await storage.events.append(event);
|
|
83
|
-
EntityHistoryFixture.assert((await storage.events.backward("task", 1))[0]?.id?.value === "event", "event history must retain generated events");
|
|
84
|
-
await storage.events.truncate(create(TimestampSchema, { seconds: 3n }));
|
|
85
|
-
EntityHistoryFixture.assert((await storage.events.backward("task", 1)).length === 0, "event history truncation must remove older generated events");
|
|
78
|
+
adapter.value(EntityHistoryFixture.state(adapter, newest)) === "second" &&
|
|
79
|
+
adapter.value(EntityHistoryFixture.state(adapter, older)) === "first", "state history must return newest records first");
|
|
80
|
+
const stateAt = await storage.states.stateAt("task", create(TimestampSchema, { seconds: 1n }));
|
|
81
|
+
EntityHistoryFixture.assert(stateAt !== undefined && adapter.value(stateAt) === "first", "state history must return the state at an inclusive timestamp");
|
|
82
|
+
await EntityHistoryFixture.checkEvents(storage.events);
|
|
86
83
|
}
|
|
87
84
|
finally {
|
|
88
85
|
storage.close?.();
|
|
@@ -90,73 +87,121 @@ export const EntityHistoryConformance = Object.freeze({
|
|
|
90
87
|
},
|
|
91
88
|
});
|
|
92
89
|
const EntityHistoryFixture = Object.freeze({
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Builds provider input using the caller's generated Entity state schema.
|
|
92
|
+
* @typeParam S Generated Entity state type.
|
|
93
|
+
* @param adapter Generated state fixture and provider port factory.
|
|
94
|
+
* @returns Entity storage input for conformance checks.
|
|
95
|
+
*/
|
|
96
|
+
input(adapter) {
|
|
97
|
+
const unpack = (id) => AnyPacker.tryUnpack(id, StringValueSchema)?.value;
|
|
97
98
|
const columns = [
|
|
98
|
-
new RecordColumn("
|
|
99
|
+
new RecordColumn("title", ColumnTypes.scalar(ScalarType.STRING), (record) => adapter.value(EntityHistoryFixture.state(adapter, record))),
|
|
99
100
|
];
|
|
100
101
|
return {
|
|
101
102
|
context: { name: "EntityHistoryConformance", multitenant: false },
|
|
102
103
|
id: {
|
|
103
104
|
clone: (id) => id,
|
|
104
105
|
key: (id) => id,
|
|
105
|
-
pack: (id) =>
|
|
106
|
+
pack: (id) => AnyPacker.pack(StringValueSchema, create(StringValueSchema, { value: id })),
|
|
106
107
|
unpack,
|
|
107
108
|
},
|
|
108
109
|
columns,
|
|
109
|
-
recordSpec:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
idKind: "string",
|
|
113
|
-
extractId: (record) => {
|
|
114
|
-
if (record.entityId === undefined)
|
|
115
|
-
throw new Error("EntityRecord requires entityId.");
|
|
116
|
-
const id = unpack(record.entityId);
|
|
117
|
-
if (id === undefined)
|
|
118
|
-
throw new Error("EntityRecord has an incompatible ID.");
|
|
119
|
-
return id;
|
|
120
|
-
},
|
|
121
|
-
columns,
|
|
122
|
-
}),
|
|
123
|
-
sourceType: StringValueSchema,
|
|
124
|
-
stateSchema: StringValueSchema,
|
|
110
|
+
recordSpec: EntityHistoryFixture.spec(adapter, unpack, columns),
|
|
111
|
+
sourceType: adapter.stateSchema,
|
|
112
|
+
stateSchema: adapter.stateSchema,
|
|
125
113
|
stateHistory: true,
|
|
126
114
|
eventHistory: true,
|
|
127
115
|
};
|
|
128
116
|
},
|
|
129
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Creates a generated Entity record for one state version.
|
|
119
|
+
* @typeParam S Generated Entity state type.
|
|
120
|
+
* @param adapter Generated state fixture and provider port factory.
|
|
121
|
+
* @param id Entity identifier.
|
|
122
|
+
* @param value State title.
|
|
123
|
+
* @param version Entity version.
|
|
124
|
+
* @returns Generated Entity record.
|
|
125
|
+
*/
|
|
126
|
+
record(adapter, id, value, version) {
|
|
130
127
|
return create(EntityRecordSchema, {
|
|
131
|
-
entityId:
|
|
132
|
-
state:
|
|
128
|
+
entityId: AnyPacker.pack(StringValueSchema, create(StringValueSchema, { value: id })),
|
|
129
|
+
state: AnyPacker.pack(adapter.stateSchema, adapter.state(id, value)),
|
|
133
130
|
version: {
|
|
134
131
|
number: version,
|
|
135
132
|
timestamp: create(TimestampSchema, { seconds: BigInt(version) }),
|
|
136
133
|
},
|
|
137
134
|
});
|
|
138
135
|
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Decodes the caller's Entity state from a generated record.
|
|
138
|
+
* @typeParam S Generated Entity state type.
|
|
139
|
+
* @param adapter Generated state fixture and provider port factory.
|
|
140
|
+
* @param record Generated Entity record.
|
|
141
|
+
* @returns Decoded generated Entity state.
|
|
142
|
+
*/
|
|
143
|
+
state(adapter, record) {
|
|
146
144
|
if (record.state === undefined)
|
|
147
145
|
throw new Error("Entity record has no state.");
|
|
148
|
-
return
|
|
146
|
+
return AnyPacker.unpack(record.state, adapter.stateSchema);
|
|
149
147
|
},
|
|
148
|
+
/**
|
|
149
|
+
* Builds the current-record specification for the generated state.
|
|
150
|
+
* @typeParam S Generated Entity state type.
|
|
151
|
+
* @param adapter Generated state fixture.
|
|
152
|
+
* @param unpack Decodes scalar Entity identifiers.
|
|
153
|
+
* @param columns Declared query columns.
|
|
154
|
+
* @returns Record specification.
|
|
155
|
+
*/
|
|
156
|
+
spec(adapter, unpack, columns) {
|
|
157
|
+
return new RecordSpec({
|
|
158
|
+
sourceType: adapter.stateSchema,
|
|
159
|
+
recordType: EntityRecordSchema,
|
|
160
|
+
idKind: "string",
|
|
161
|
+
extractId: (record) => {
|
|
162
|
+
if (record.entityId === undefined)
|
|
163
|
+
throw new Error("EntityRecord requires entityId.");
|
|
164
|
+
const id = unpack(record.entityId);
|
|
165
|
+
if (id === undefined)
|
|
166
|
+
throw new Error("EntityRecord has an incompatible ID.");
|
|
167
|
+
return id;
|
|
168
|
+
},
|
|
169
|
+
columns,
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
/**
|
|
173
|
+
* Checks generated Event retention and truncation.
|
|
174
|
+
* @param events Event-history port.
|
|
175
|
+
* @returns Completion after Event assertions.
|
|
176
|
+
*/
|
|
177
|
+
async checkEvents(events) {
|
|
178
|
+
await events.append(EntityHistoryFixture.event("event", "task", 2));
|
|
179
|
+
EntityHistoryFixture.assert((await events.backward("task", 1))[0]?.id?.value === "event", "event history must retain generated events");
|
|
180
|
+
await events.truncate(create(TimestampSchema, { seconds: 3n }));
|
|
181
|
+
EntityHistoryFixture.assert((await events.backward("task", 1)).length === 0, "event history truncation must remove older generated events");
|
|
182
|
+
},
|
|
183
|
+
/**
|
|
184
|
+
* Creates a generated diagnostic Event.
|
|
185
|
+
* @param id Event identifier.
|
|
186
|
+
* @param producer Producer Entity identifier.
|
|
187
|
+
* @param version Event version.
|
|
188
|
+
* @returns Generated Event.
|
|
189
|
+
*/
|
|
150
190
|
event(id, producer, version) {
|
|
151
191
|
return create(EventSchema, {
|
|
152
192
|
id: create(EventIdSchema, { value: id }),
|
|
153
193
|
context: {
|
|
154
|
-
producerId:
|
|
194
|
+
producerId: AnyPacker.pack(StringValueSchema, create(StringValueSchema, { value: producer })),
|
|
155
195
|
timestamp: create(TimestampSchema, { seconds: BigInt(version) }),
|
|
156
196
|
version: create(VersionSchema, { number: version }),
|
|
157
197
|
},
|
|
158
198
|
});
|
|
159
199
|
},
|
|
200
|
+
/**
|
|
201
|
+
* Checks one conformance condition.
|
|
202
|
+
* @param condition Expected condition.
|
|
203
|
+
* @param message Failure explanation.
|
|
204
|
+
*/
|
|
160
205
|
assert(condition, message) {
|
|
161
206
|
if (!condition)
|
|
162
207
|
throw new Error(`Entity storage conformance failed: ${message}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-conformance.js","sourceRoot":"","sources":["../../src/entity/history-conformance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"history-conformance.js","sourceRoot":"","sources":["../../src/entity/history-conformance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAgB,MAAM,oBAAoB,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAY,MAAM,wBAAwB,CAAC;AACtF,OAAO,EACL,kBAAkB,GAEnB,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAKtF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AA6FtD;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAmC,MAAM,CAAC,MAAM,CAAC;IACpF,kBAAkB;IAElB;;;;;OAKG;IACH,KAAK,CAAC,mBAAmB,CAAoB,OAA2C;QACtF,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACpE,IAAI,CAAC;YACH,MAAM,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;Y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AM,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAC/C;gBACD,SAAS,EAAE,MAAM,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;gBAChE,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;aACpD;SACF,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,SAAkB,EAAE,OAAe;QACxC,IAAI,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import type { Event, EventId, TenantId } from "@spine-event-engine/proto";
|
|
2
2
|
import type { RecordQuery } from "../record/record-query.js";
|
|
3
3
|
import { RecordSpec } from "../record/record-spec.js";
|
|
4
|
-
import
|
|
4
|
+
import { StorageGroup } from "../record/storage-group.js";
|
|
5
5
|
import type { StorageFactory } from "../storage/storage-factory.js";
|
|
6
|
+
/**
|
|
7
|
+
* Stable physical Event record family for one logical context and store role.
|
|
8
|
+
*/
|
|
9
|
+
export declare const EventStoreGroups: Readonly<{
|
|
10
|
+
forContext(contextName: string, role?: "domain" | "system"): StorageGroup;
|
|
11
|
+
identity(group: StorageGroup): string | undefined;
|
|
12
|
+
}>;
|
|
6
13
|
/**
|
|
7
14
|
* Framework event store backed by record storage.
|
|
8
15
|
*
|
|
9
|
-
* Snapshots input
|
|
10
|
-
*
|
|
11
|
-
*
|
|
16
|
+
* Snapshots input Events and rejects missing, blank, or repeated IDs within a
|
|
17
|
+
* batch. Immutable append accepts identical complete stored Events and leaves
|
|
18
|
+
* completed prefixes when a later insert fails. Admission methods reject every
|
|
19
|
+
* existing ID, including an identical Event.
|
|
12
20
|
*/
|
|
13
21
|
export declare class EventStore {
|
|
14
22
|
#private;
|
|
@@ -17,8 +25,9 @@ export declare class EventStore {
|
|
|
17
25
|
*
|
|
18
26
|
* @param context Specifies the storage context.
|
|
19
27
|
* @param factory Creates the backing record storage.
|
|
28
|
+
* @param group Selects a separate Event record family when supplied.
|
|
20
29
|
*/
|
|
21
|
-
constructor(context: EventStoreContext, factory: StorageFactory);
|
|
30
|
+
constructor(context: EventStoreContext, factory: StorageFactory, group?: StorageGroup);
|
|
22
31
|
/**
|
|
23
32
|
* Returns whether this Event Store still accepts operations.
|
|
24
33
|
*
|
|
@@ -26,19 +35,34 @@ export declare class EventStore {
|
|
|
26
35
|
*/
|
|
27
36
|
isOpen(): boolean;
|
|
28
37
|
/**
|
|
29
|
-
*
|
|
38
|
+
* Rejects new work, drains admitted storage groups, and closes retained handles.
|
|
39
|
+
* Repeated calls return the same close result.
|
|
40
|
+
*
|
|
41
|
+
* @returns Completion after all admitted work and storage cleanup settle.
|
|
30
42
|
*/
|
|
31
|
-
close(): void
|
|
43
|
+
close(): Promise<void>;
|
|
32
44
|
/**
|
|
33
|
-
*
|
|
45
|
+
* Waits for admitted physical work and then closes every retained handle.
|
|
46
|
+
*
|
|
47
|
+
* @returns Completion after admitted work and cleanup settle.
|
|
48
|
+
*/
|
|
49
|
+
private drainAndClose;
|
|
50
|
+
/**
|
|
51
|
+
* Closes every retained handle and reports all cleanup failures.
|
|
52
|
+
*/
|
|
53
|
+
private closeStorages;
|
|
54
|
+
/**
|
|
55
|
+
* Validates strict new admission without storing an Event. An identical
|
|
56
|
+
* existing Event still rejects; this precheck does not reserve its ID.
|
|
34
57
|
*
|
|
35
58
|
* @param event Supplies the event to validate.
|
|
36
59
|
* @returns Completes when the event is accepted.
|
|
37
60
|
*/
|
|
38
61
|
accept(event: Event): Promise<void>;
|
|
39
62
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
63
|
+
* Checks strict new admission, runs caller acceptance, then atomically inserts
|
|
64
|
+
* under one captured context. Competing callbacks may both run, but only one
|
|
65
|
+
* absent-slot insertion can succeed.
|
|
42
66
|
*
|
|
43
67
|
* @param event Supplies the event to accept.
|
|
44
68
|
* @param onAccepted Runs after uniqueness validation and before append.
|
|
@@ -46,26 +70,21 @@ export declare class EventStore {
|
|
|
46
70
|
*/
|
|
47
71
|
acceptThenAppend(event: Event, onAccepted: OnEventAccepted): Promise<Event>;
|
|
48
72
|
/**
|
|
49
|
-
* Writes one
|
|
73
|
+
* Writes one complete Event, accepting an identical immutable retry without
|
|
74
|
+
* overwriting it. A conflicting Event at the same ID rejects.
|
|
50
75
|
*
|
|
51
76
|
* @param event Supplies the event to append.
|
|
52
77
|
* @returns Completes when the event is appended.
|
|
53
78
|
*/
|
|
54
79
|
append(event: Event): Promise<void>;
|
|
55
80
|
/**
|
|
56
|
-
* Writes generated
|
|
81
|
+
* Writes generated Events in order, accepting identical immutable retries.
|
|
82
|
+
* A later failure retains the completed prefix for retry with the same IDs.
|
|
57
83
|
*
|
|
58
84
|
* @param events Supplies the events to append.
|
|
59
85
|
* @returns Completes when the events are appended.
|
|
60
86
|
*/
|
|
61
87
|
appendAll(events: Iterable<Event>): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* Writes generated Spine events and returns a one-shot rollback token.
|
|
64
|
-
*
|
|
65
|
-
* @param events Supplies the events to append.
|
|
66
|
-
* @returns Resolves to the rollback token for this append.
|
|
67
|
-
*/
|
|
68
|
-
appendAllWithRollback(events: Iterable<Event>): Promise<EventRollback>;
|
|
69
88
|
/**
|
|
70
89
|
* Reads persisted events through the underlying record-storage query seam.
|
|
71
90
|
*
|
|
@@ -74,34 +93,62 @@ export declare class EventStore {
|
|
|
74
93
|
*/
|
|
75
94
|
read(query?: RecordQuery<EventId>): Promise<readonly Event[]>;
|
|
76
95
|
/**
|
|
77
|
-
*
|
|
96
|
+
* Writes strictly new Events after caller acceptance.
|
|
78
97
|
*
|
|
79
|
-
* @param records
|
|
80
|
-
* @param context
|
|
81
|
-
* @returns Completion after
|
|
98
|
+
* @param records Supplies validated Event snapshots.
|
|
99
|
+
* @param context Selects their storage boundary.
|
|
100
|
+
* @returns Completion after every strict insertion.
|
|
82
101
|
*/
|
|
83
102
|
private appendUnique;
|
|
84
103
|
/**
|
|
85
|
-
*
|
|
104
|
+
* Writes captured immutable Events, accepting identical stored retries.
|
|
86
105
|
*
|
|
87
|
-
* @param
|
|
88
|
-
* @param context
|
|
89
|
-
* @returns Completion after
|
|
106
|
+
* @param records Supplies ordered Event snapshots.
|
|
107
|
+
* @param context Selects their single storage boundary.
|
|
108
|
+
* @returns Completion after every immutable Event is confirmed.
|
|
90
109
|
*/
|
|
91
|
-
private
|
|
110
|
+
private appendImmutable;
|
|
92
111
|
/**
|
|
93
|
-
* Checks
|
|
112
|
+
* Checks strict admission without writing an Event.
|
|
94
113
|
*
|
|
95
|
-
* @param ids
|
|
96
|
-
* @param context
|
|
97
|
-
* @returns Completion
|
|
114
|
+
* @param ids Supplies IDs that must be absent.
|
|
115
|
+
* @param context Selects the storage boundary.
|
|
116
|
+
* @returns Completion when no ID is stored.
|
|
98
117
|
*/
|
|
99
118
|
private checkUnique;
|
|
100
119
|
/**
|
|
101
|
-
*
|
|
120
|
+
* Executes one complete physical storage operation through settlement.
|
|
121
|
+
*
|
|
122
|
+
* @typeParam T Operation result type.
|
|
123
|
+
* @param context Captured tenant scope.
|
|
124
|
+
* @param onStorage Work admitted against the retained handle.
|
|
125
|
+
* @returns The operation result or its original failure.
|
|
126
|
+
*/
|
|
127
|
+
private runStorage;
|
|
128
|
+
/**
|
|
129
|
+
* Returns retained record storage for the captured tenant boundary.
|
|
130
|
+
*
|
|
131
|
+
* @param context Complete tenant-scoped storage context.
|
|
132
|
+
* @returns The retained record storage.
|
|
133
|
+
*/
|
|
134
|
+
private storageFor;
|
|
135
|
+
/**
|
|
136
|
+
* Rejects operations after this Event Store closes.
|
|
102
137
|
*/
|
|
103
138
|
private requireOpen;
|
|
104
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Gives server assembly access to synchronous idle cleanup through the provider entrypoint.
|
|
142
|
+
* @internal
|
|
143
|
+
*/
|
|
144
|
+
export declare const eventStoreAccess: {
|
|
145
|
+
/**
|
|
146
|
+
* Closes an idle Event Store during synchronous assembly rollback.
|
|
147
|
+
*
|
|
148
|
+
* @param store Framework Event Store to close.
|
|
149
|
+
*/
|
|
150
|
+
closeIdle(store: EventStore): void;
|
|
151
|
+
};
|
|
105
152
|
/**
|
|
106
153
|
* Selects Event Store tenancy before an event envelope supplies a tenant.
|
|
107
154
|
*
|
|
@@ -139,51 +186,10 @@ export type EventStoreContext = {
|
|
|
139
186
|
* @returns Completes after caller acceptance finishes.
|
|
140
187
|
*/
|
|
141
188
|
export type OnEventAccepted = (event: Event) => Promise<void> | void;
|
|
142
|
-
/**
|
|
143
|
-
* One-shot rollback token scoped to one successful event-store append.
|
|
144
|
-
*/
|
|
145
|
-
export interface EventRollback {
|
|
146
|
-
/**
|
|
147
|
-
* Deletes the events appended by the operation that created this token.
|
|
148
|
-
*
|
|
149
|
-
* @returns Completes when the events are deleted.
|
|
150
|
-
*/
|
|
151
|
-
rollback(): Promise<void>;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Provider-only Event Store coordination bound to a captured Bounded Context and tenant.
|
|
155
|
-
* @internal
|
|
156
|
-
*/
|
|
157
|
-
interface EventStoreAccess {
|
|
158
|
-
/**
|
|
159
|
-
* Serializes work for one captured storage context.
|
|
160
|
-
*
|
|
161
|
-
* @param factory Storage provider used for the Event family.
|
|
162
|
-
* @param context Captured tenant and Bounded Context.
|
|
163
|
-
* @param work Operation run under the Bounded Context and tenant lock.
|
|
164
|
-
* @returns Result returned by the operation.
|
|
165
|
-
* @typeParam T Result of the serialized operation.
|
|
166
|
-
*/
|
|
167
|
-
withLock<T>(factory: StorageFactory, context: StorageContext, work: () => Promise<T>): Promise<T>;
|
|
168
|
-
/**
|
|
169
|
-
* Accepts an original saved Event ID or verifies its exact stored envelope.
|
|
170
|
-
*
|
|
171
|
-
* @param store Event Store with a captured Bounded Context and tenant.
|
|
172
|
-
* @param event Original saved Event envelope.
|
|
173
|
-
* @returns Stored or newly appended original Event.
|
|
174
|
-
*/
|
|
175
|
-
appendOrVerifyOriginal(store: EventStore, event: Event): Promise<Event>;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Exposes captured Event Store coordination to provider and Agent delivery paths.
|
|
179
|
-
* @internal
|
|
180
|
-
*/
|
|
181
|
-
export declare const eventStoreAccess: EventStoreAccess;
|
|
182
189
|
/**
|
|
183
190
|
* Provides the canonical event-store record layout to provider-only internals.
|
|
184
191
|
*
|
|
185
192
|
* @internal
|
|
186
193
|
*/
|
|
187
194
|
export declare const eventStoreRecordSpec: RecordSpec<EventId, Event>;
|
|
188
|
-
export {};
|
|
189
195
|
//# sourceMappingURL=event-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-store.d.ts","sourceRoot":"","sources":["../../src/event/event-store.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAK1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,
|
|
1
|
+
{"version":3,"file":"event-store.d.ts","sourceRoot":"","sources":["../../src/event/event-store.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAK1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AASpE;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAA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