@spine-event-engine/storage-postgres 2.0.0-snapshot.23 → 2.0.0-snapshot.24
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 +5 -4
- package/REFERENCE.md +27 -5
- package/dist/postgres/agent-execution.d.ts +3 -2
- package/dist/postgres/agent-execution.d.ts.map +1 -1
- package/dist/postgres/agent-execution.js +3 -3
- package/dist/postgres/agent-execution.js.map +1 -1
- package/dist/postgres/entity-commit.d.ts +16 -51
- package/dist/postgres/entity-commit.d.ts.map +1 -1
- package/dist/postgres/entity-commit.js +83 -154
- package/dist/postgres/entity-commit.js.map +1 -1
- package/dist/postgres/entity-history.d.ts.map +1 -1
- package/dist/postgres/entity-history.js +60 -232
- package/dist/postgres/entity-history.js.map +1 -1
- package/dist/postgres/errors.d.ts +1 -1
- package/dist/postgres/errors.d.ts.map +1 -1
- package/dist/postgres/errors.js +5 -3
- package/dist/postgres/errors.js.map +1 -1
- package/dist/postgres/record-storage.d.ts +87 -111
- package/dist/postgres/record-storage.d.ts.map +1 -1
- package/dist/postgres/record-storage.js +159 -186
- package/dist/postgres/record-storage.js.map +1 -1
- package/dist/postgres/storage-factory.d.ts +2 -8
- package/dist/postgres/storage-factory.d.ts.map +1 -1
- package/dist/postgres/storage-factory.js +4 -23
- package/dist/postgres/storage-factory.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/postgres/delivery-cleanup.d.ts +0 -76
- package/dist/postgres/delivery-cleanup.d.ts.map +0 -1
- package/dist/postgres/delivery-cleanup.js +0 -224
- package/dist/postgres/delivery-cleanup.js.map +0 -1
|
@@ -14,57 +14,9 @@
|
|
|
14
14
|
import { toBinary } from "@bufbuild/protobuf";
|
|
15
15
|
import { EntityRecordSchema, } from "@spine-event-engine/proto/generated/spine/server/entity/entity_pb.js";
|
|
16
16
|
import {} from "@spine-event-engine/storage";
|
|
17
|
-
import { TenantBoundary, eventHistorySpec, eventStoreRecordSpec, stateHistorySpec, } from "@spine-event-engine/storage/provider";
|
|
18
|
-
import {
|
|
19
|
-
import { PostgresRecordStorage
|
|
20
|
-
/**
|
|
21
|
-
* Acquires fresh clients for a complete Entity transaction and one safe retry.
|
|
22
|
-
*/
|
|
23
|
-
class PostgresEntityCommitCoordinator {
|
|
24
|
-
lifecycle;
|
|
25
|
-
/**
|
|
26
|
-
* Creates a coordinator for one tenant-bound record lifecycle.
|
|
27
|
-
*
|
|
28
|
-
* @param lifecycle Acquires transaction clients for the selected database.
|
|
29
|
-
*/
|
|
30
|
-
constructor(lifecycle) {
|
|
31
|
-
this.lifecycle = lifecycle;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Commits one complete Entity change with one serialization retry.
|
|
35
|
-
*
|
|
36
|
-
* @typeParam T Result returned by the transaction work.
|
|
37
|
-
* @param work Applies the Entity commit on an acquired client.
|
|
38
|
-
* @returns The committed work result.
|
|
39
|
-
*/
|
|
40
|
-
async commit(work) {
|
|
41
|
-
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
42
|
-
const client = await this.lifecycle.acquire();
|
|
43
|
-
let discard;
|
|
44
|
-
try {
|
|
45
|
-
await client.query("BEGIN");
|
|
46
|
-
const result = await work(client);
|
|
47
|
-
await client.query("COMMIT");
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
try {
|
|
52
|
-
await client.query("ROLLBACK");
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
discard = PostgresRollbackErrors.discard(error);
|
|
56
|
-
}
|
|
57
|
-
if (attempt === 0 && PostgresTransactionErrors.retryable(error))
|
|
58
|
-
continue;
|
|
59
|
-
throw PostgresCommitErrors.operation(error);
|
|
60
|
-
}
|
|
61
|
-
finally {
|
|
62
|
-
client.release(discard);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
throw new Error("Unreachable PostgreSQL Entity commit retry.");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
17
|
+
import { TenantBoundary, EntityCommitSnapshots, eventHistorySpec, eventStoreRecordSpec, stateHistorySpec, } from "@spine-event-engine/storage/provider";
|
|
18
|
+
import { PostgresStorageErrors, PostgresStorageOperationError } from "./errors.js";
|
|
19
|
+
import { PostgresRecordStorage } from "./record-storage.js";
|
|
68
20
|
/**
|
|
69
21
|
* Opens and closes the exact record families participating in one commit.
|
|
70
22
|
*
|
|
@@ -86,7 +38,7 @@ class PostgresCommitRecords {
|
|
|
86
38
|
constructor(input, open) {
|
|
87
39
|
const current = open(input.entity.recordSpec);
|
|
88
40
|
const handles = [current];
|
|
89
|
-
this.current = current
|
|
41
|
+
this.current = current;
|
|
90
42
|
this.states = input.states?.length ? this.openState(input, open, handles) : undefined;
|
|
91
43
|
this.diagnostics = input.diagnostics?.length
|
|
92
44
|
? this.openDiagnostic(input, open, handles)
|
|
@@ -95,7 +47,7 @@ class PostgresCommitRecords {
|
|
|
95
47
|
this.#handles = handles;
|
|
96
48
|
}
|
|
97
49
|
/**
|
|
98
|
-
* Prepares every record family before
|
|
50
|
+
* Prepares every record family before ordered writes begin.
|
|
99
51
|
*
|
|
100
52
|
* @returns Completion after all required tables are ready.
|
|
101
53
|
*/
|
|
@@ -103,6 +55,29 @@ class PostgresCommitRecords {
|
|
|
103
55
|
for (const handle of this.#handles)
|
|
104
56
|
await handle.prepare();
|
|
105
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Writes the fenced Entity mutation through the transaction's client.
|
|
60
|
+
*
|
|
61
|
+
* @param client Existing conditional-completion transaction client.
|
|
62
|
+
* @param snapshot Captured immutable Entity mutation.
|
|
63
|
+
* @param expectedVersion Version checked under the current-record lock.
|
|
64
|
+
* @returns Completion after current and history records are written.
|
|
65
|
+
*/
|
|
66
|
+
async applyConditional(client, snapshot, expectedVersion) {
|
|
67
|
+
const current = await this.current
|
|
68
|
+
.historyExecutor()
|
|
69
|
+
.read(client, snapshot.entityId, "for-update");
|
|
70
|
+
if ((current?.version?.number ?? 0) !== expectedVersion)
|
|
71
|
+
throw new Error("Agent execution initial Entity Version is no longer current.");
|
|
72
|
+
for (const state of snapshot.states ?? [])
|
|
73
|
+
await this.states?.historyExecutor().appendImmutable(client, state);
|
|
74
|
+
for (const diagnostic of snapshot.diagnostics ?? [])
|
|
75
|
+
await this.diagnostics?.historyExecutor().appendImmutable(client, diagnostic);
|
|
76
|
+
for (const event of snapshot.events ?? [])
|
|
77
|
+
await this.events?.historyExecutor().appendImmutable(client, event);
|
|
78
|
+
if (!PostgresCommitValues.same(current, snapshot.next))
|
|
79
|
+
await this.current.historyExecutor().write(client, snapshot.next);
|
|
80
|
+
}
|
|
106
81
|
/**
|
|
107
82
|
* Closes every temporary record-family handle.
|
|
108
83
|
*/
|
|
@@ -116,13 +91,13 @@ class PostgresCommitRecords {
|
|
|
116
91
|
* @param input Describes the Entity state schema.
|
|
117
92
|
* @param open Opens one record family.
|
|
118
93
|
* @param handles Collects handles that must close after the commit.
|
|
119
|
-
* @returns The state-history
|
|
94
|
+
* @returns The state-history record storage.
|
|
120
95
|
*/
|
|
121
96
|
openState(input, open, handles) {
|
|
122
97
|
const layout = stateHistorySpec(input.entity.stateSchema);
|
|
123
98
|
const handle = open(layout.spec, layout.group);
|
|
124
99
|
handles.push(handle);
|
|
125
|
-
return handle
|
|
100
|
+
return handle;
|
|
126
101
|
}
|
|
127
102
|
/**
|
|
128
103
|
* Opens the Entity diagnostic-event history record family.
|
|
@@ -130,25 +105,25 @@ class PostgresCommitRecords {
|
|
|
130
105
|
* @param input Describes the Entity state schema.
|
|
131
106
|
* @param open Opens one record family.
|
|
132
107
|
* @param handles Collects handles that must close after the commit.
|
|
133
|
-
* @returns The diagnostic-history
|
|
108
|
+
* @returns The diagnostic-history record storage.
|
|
134
109
|
*/
|
|
135
110
|
openDiagnostic(input, open, handles) {
|
|
136
111
|
const layout = eventHistorySpec(input.entity.stateSchema);
|
|
137
112
|
const handle = open(layout.spec, layout.group);
|
|
138
113
|
handles.push(handle);
|
|
139
|
-
return handle
|
|
114
|
+
return handle;
|
|
140
115
|
}
|
|
141
116
|
/**
|
|
142
117
|
* Opens the shared event-store record family.
|
|
143
118
|
*
|
|
144
119
|
* @param open Opens one record family.
|
|
145
120
|
* @param handles Collects handles that must close after the commit.
|
|
146
|
-
* @returns The event-store
|
|
121
|
+
* @returns The event-store record storage.
|
|
147
122
|
*/
|
|
148
123
|
openEvents(open, handles) {
|
|
149
124
|
const handle = open(eventStoreRecordSpec);
|
|
150
125
|
handles.push(handle);
|
|
151
|
-
return handle
|
|
126
|
+
return handle;
|
|
152
127
|
}
|
|
153
128
|
}
|
|
154
129
|
/**
|
|
@@ -162,20 +137,17 @@ export class PostgresEntityCommitStorage {
|
|
|
162
137
|
open;
|
|
163
138
|
onClose;
|
|
164
139
|
#open = true;
|
|
165
|
-
#coordinator;
|
|
166
140
|
/**
|
|
167
141
|
* Creates a PostgreSQL Entity commit handle for one Entity storage boundary.
|
|
168
142
|
*
|
|
169
143
|
* @param entity Defines the captured Entity source, state, and tenant scope.
|
|
170
144
|
* @param open Opens temporary current and history record-family handles.
|
|
171
|
-
* @param lifecycle Acquires transaction clients for the captured database.
|
|
172
145
|
* @param onClose Removes this handle from the factory's live-handle set.
|
|
173
146
|
*/
|
|
174
|
-
constructor(entity, open,
|
|
147
|
+
constructor(entity, open, onClose) {
|
|
175
148
|
this.entity = entity;
|
|
176
149
|
this.open = open;
|
|
177
150
|
this.onClose = onClose;
|
|
178
|
-
this.#coordinator = new PostgresEntityCommitCoordinator(lifecycle);
|
|
179
151
|
}
|
|
180
152
|
/**
|
|
181
153
|
* Commits one current Entity record and its optional immutable records.
|
|
@@ -183,30 +155,42 @@ export class PostgresEntityCommitStorage {
|
|
|
183
155
|
* @typeParam Id Entity identifier type supplied by the commit.
|
|
184
156
|
* @typeParam State Entity state message type supplied by the commit.
|
|
185
157
|
* @param input Defines the next current record plus histories.
|
|
186
|
-
* @returns Completion after
|
|
158
|
+
* @returns Completion after every requested record write.
|
|
187
159
|
*/
|
|
188
160
|
async commit(input) {
|
|
189
161
|
this.validate(input);
|
|
190
|
-
const
|
|
162
|
+
const prepared = EntityCommitSnapshots.capture(input);
|
|
163
|
+
const records = new PostgresCommitRecords(prepared, this.open);
|
|
191
164
|
try {
|
|
192
165
|
await records.prepare();
|
|
193
|
-
|
|
166
|
+
try {
|
|
167
|
+
await this.apply(prepared, records);
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
if (!this.retryable(error))
|
|
171
|
+
throw error;
|
|
172
|
+
await this.apply(prepared, records);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
throw PostgresStorageErrors.operation(error);
|
|
194
177
|
}
|
|
195
178
|
finally {
|
|
196
179
|
records.close();
|
|
197
180
|
}
|
|
198
181
|
}
|
|
199
182
|
/**
|
|
200
|
-
* Prepares
|
|
183
|
+
* Prepares one Agent-fenced Entity mutation for its existing transaction client.
|
|
201
184
|
*
|
|
202
185
|
* @typeParam Id Typed Entity identifier.
|
|
203
|
-
* @typeParam State
|
|
204
|
-
* @param input
|
|
205
|
-
* @returns
|
|
186
|
+
* @typeParam State Entity state message type.
|
|
187
|
+
* @param input Changed Entity state and immutable history.
|
|
188
|
+
* @returns A transaction-bound conditional mutation and its close callback.
|
|
206
189
|
*/
|
|
207
|
-
async
|
|
190
|
+
async prepareAgentConditional(input) {
|
|
208
191
|
this.validate(input);
|
|
209
|
-
const
|
|
192
|
+
const snapshot = EntityCommitSnapshots.capture(input);
|
|
193
|
+
const records = new PostgresCommitRecords(snapshot, this.open);
|
|
210
194
|
try {
|
|
211
195
|
await records.prepare();
|
|
212
196
|
}
|
|
@@ -215,12 +199,30 @@ export class PostgresEntityCommitStorage {
|
|
|
215
199
|
throw error;
|
|
216
200
|
}
|
|
217
201
|
return {
|
|
218
|
-
apply: (client, expectedVersion) =>
|
|
202
|
+
apply: (client, expectedVersion) => records.applyConditional(client, snapshot, expectedVersion),
|
|
219
203
|
close: () => {
|
|
220
204
|
records.close();
|
|
221
205
|
},
|
|
222
206
|
};
|
|
223
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* Determines whether a driver serialization failure occurred through provider error causes.
|
|
210
|
+
*
|
|
211
|
+
* @param error Supplies the operation failure.
|
|
212
|
+
* @returns Whether one captured-input retry is safe.
|
|
213
|
+
*/
|
|
214
|
+
retryable(error) {
|
|
215
|
+
let current = error;
|
|
216
|
+
for (let depth = 0; depth < 4; depth += 1) {
|
|
217
|
+
if (typeof current !== "object" || current === null)
|
|
218
|
+
return false;
|
|
219
|
+
const failure = current;
|
|
220
|
+
if (failure.code === "40P01" || failure.code === "40001")
|
|
221
|
+
return true;
|
|
222
|
+
current = failure.cause;
|
|
223
|
+
}
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
224
226
|
/**
|
|
225
227
|
* Closes this handle to new commits while allowing started work to settle.
|
|
226
228
|
*/
|
|
@@ -231,84 +233,24 @@ export class PostgresEntityCommitStorage {
|
|
|
231
233
|
}
|
|
232
234
|
}
|
|
233
235
|
/**
|
|
234
|
-
* Applies one validated Entity commit
|
|
236
|
+
* Applies one validated Entity commit as ordered independent writes.
|
|
235
237
|
*
|
|
236
238
|
* @typeParam Id Entity identifier type supplied by the commit.
|
|
237
239
|
* @typeParam State Entity state message type supplied by the commit.
|
|
238
|
-
* @param client PostgreSQL transaction client.
|
|
239
240
|
* @param input Defines the Entity records to commit.
|
|
240
241
|
* @param records Provides the prepared record families.
|
|
241
242
|
* @returns Completion after records are committed.
|
|
242
|
-
* @param expectedVersion Expected current Entity Version.
|
|
243
243
|
*/
|
|
244
|
-
async apply(
|
|
245
|
-
await this.locks(client, input, records);
|
|
246
|
-
const current = await records.current.read(client, input.entityId, "for-update");
|
|
247
|
-
if (expectedVersion !== undefined && (current?.version?.number ?? 0) !== expectedVersion)
|
|
248
|
-
throw new Error("Agent execution initial Entity Version is no longer current.");
|
|
249
|
-
await this.preflight(client, input, records);
|
|
250
|
-
await this.append(client, input, records);
|
|
251
|
-
if (!PostgresCommitValues.same(current, input.next))
|
|
252
|
-
await records.current.write(client, input.next);
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Acquires locks for each mutable or append-only family in the commit.
|
|
256
|
-
*
|
|
257
|
-
* @typeParam Id Entity identifier type supplied by the commit.
|
|
258
|
-
* @typeParam State Entity state message type supplied by the commit.
|
|
259
|
-
* @param client PostgreSQL transaction client.
|
|
260
|
-
* @param input Defines the Entity records to commit.
|
|
261
|
-
* @param records Provides the prepared record families.
|
|
262
|
-
* @returns Completion after all transaction locks are acquired.
|
|
263
|
-
*/
|
|
264
|
-
async locks(client, input, records) {
|
|
265
|
-
if (records.states)
|
|
266
|
-
await client.query("SELECT pg_advisory_xact_lock_shared($1)", [
|
|
267
|
-
records.states.lock("history-family", records.states.table()),
|
|
268
|
-
]);
|
|
269
|
-
if (records.diagnostics)
|
|
270
|
-
await client.query("SELECT pg_advisory_xact_lock_shared($1)", [
|
|
271
|
-
records.diagnostics.lock("history-family", records.diagnostics.table()),
|
|
272
|
-
]);
|
|
273
|
-
await client.query("SELECT pg_advisory_xact_lock($1)", [
|
|
274
|
-
records.current.lock("entity-mutation", input.entity.sourceType.typeName, this.entity.id.key(input.entityId)),
|
|
275
|
-
]);
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Verifies that every immutable record can be appended.
|
|
279
|
-
*
|
|
280
|
-
* @typeParam Id Entity identifier type supplied by the commit.
|
|
281
|
-
* @typeParam State Entity state message type supplied by the commit.
|
|
282
|
-
* @param client PostgreSQL transaction client.
|
|
283
|
-
* @param input Defines the immutable records to verify.
|
|
284
|
-
* @param records Provides the prepared record families.
|
|
285
|
-
* @returns Completion after all immutable checks pass.
|
|
286
|
-
*/
|
|
287
|
-
async preflight(client, input, records) {
|
|
244
|
+
async apply(input, records) {
|
|
288
245
|
for (const record of input.states ?? [])
|
|
289
|
-
await records.states?.
|
|
246
|
+
await records.states?.writeImmutable(record);
|
|
290
247
|
for (const record of input.diagnostics ?? [])
|
|
291
|
-
await records.diagnostics?.
|
|
248
|
+
await records.diagnostics?.writeImmutable(record);
|
|
292
249
|
for (const record of input.events ?? [])
|
|
293
|
-
await records.events?.
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
*
|
|
298
|
-
* @typeParam Id Entity identifier type supplied by the commit.
|
|
299
|
-
* @typeParam State Entity state message type supplied by the commit.
|
|
300
|
-
* @param client PostgreSQL transaction client.
|
|
301
|
-
* @param input Defines the immutable records to append.
|
|
302
|
-
* @param records Provides the prepared record families.
|
|
303
|
-
* @returns Completion after all records are appended.
|
|
304
|
-
*/
|
|
305
|
-
async append(client, input, records) {
|
|
306
|
-
for (const record of input.states ?? [])
|
|
307
|
-
await records.states?.appendImmutable(client, record);
|
|
308
|
-
for (const record of input.diagnostics ?? [])
|
|
309
|
-
await records.diagnostics?.appendImmutable(client, record);
|
|
310
|
-
for (const record of input.events ?? [])
|
|
311
|
-
await records.events?.appendImmutable(client, record);
|
|
250
|
+
await records.events?.writeImmutable(record);
|
|
251
|
+
const current = await records.current.read(input.entityId);
|
|
252
|
+
if (!PostgresCommitValues.same(current, input.next))
|
|
253
|
+
await records.current.write(input.next);
|
|
312
254
|
}
|
|
313
255
|
/**
|
|
314
256
|
* Validates the commit against the Entity boundary captured by this handle.
|
|
@@ -391,17 +333,4 @@ const PostgresCommitValues = Object.freeze({
|
|
|
391
333
|
return TenantBoundary.of(left).key === TenantBoundary.of(right).key;
|
|
392
334
|
},
|
|
393
335
|
});
|
|
394
|
-
const PostgresCommitErrors = Object.freeze({
|
|
395
|
-
/**
|
|
396
|
-
* Converts an internal commit failure to the stable provider error.
|
|
397
|
-
*
|
|
398
|
-
* @param error Failure raised during the Entity commit.
|
|
399
|
-
* @returns Stable public commit error.
|
|
400
|
-
*/
|
|
401
|
-
operation(error) {
|
|
402
|
-
return error instanceof PostgresStorageOperationError
|
|
403
|
-
? error
|
|
404
|
-
: new PostgresStorageOperationError("PostgreSQL Entity commit failed.");
|
|
405
|
-
},
|
|
406
|
-
});
|
|
407
336
|
//# sourceMappingURL=entity-commit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-commit.js","sourceRoot":"","sources":["../../src/postgres/entity-commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAgB,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EACL,kBAAkB,GAEnB,MAAM,sEAAsE,CAAC;AAE9E,OAAO,EAAsC,MAAM,6BAA6B,CAAC;AACjF,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,GAIjB,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"entity-commit.js","sourceRoot":"","sources":["../../src/postgres/entity-commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAgB,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EACL,kBAAkB,GAEnB,MAAM,sEAAsE,CAAC;AAE9E,OAAO,EAAsC,MAAM,6BAA6B,CAAC;AACjF,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,GAIjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAc5D;;;;;GAKG;AACH,MAAM,qBAAqB;IAChB,OAAO,CAAyC;IAEhD,MAAM,CAAkE;IAExE,WAAW,CAAoD;IAE/D,MAAM,CAAoD;IAE1D,QAAQ,CAA4C;IAE7D;;;;;OAKG;IACH,YAAY,KAA8B,EAAE,IAAiB;QAC3D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC9C,MAAM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AC,CAAC;gBACrF,CAAC,CAAC;IACV,CAAC;IAED;;;;;;OAMG;IACH,YAAY,CAAC,IAAY,EAAE,KAAa;QACtC,OAAO,cAAc,CAAC,EAAE,CAAC,IAAa,CAAC,CAAC,GAAG,KAAK,cAAc,CAAC,EAAE,CAAC,KAAc,CAAC,CAAC,GAAG,CAAC;IACxF,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-history.d.ts","sourceRoot":"","sources":["../../src/postgres/entity-history.ts"],"names":[],"mappings":"AAcA,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sEAAsE,CAAC;AAEzG,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"entity-history.d.ts","sourceRoot":"","sources":["../../src/postgres/entity-history.ts"],"names":[],"mappings":"AAcA,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sEAAsE,CAAC;AAEzG,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,sCAAsC,CAAC;AAc9C,OAAO,EAAE,qBAAqB,EAA+B,MAAM,qBAAqB,CAAC;AAGzF;;;;;GAKG;AACH,KAAK,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EACtC,IAAI,EAAE,OAAO,6BAA6B,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,EAC5D,KAAK,CAAC,EAAE,OAAO,6BAA6B,EAAE,YAAY,KACvD,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B,CAAC,CAA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