@spine-event-engine/storage 2.0.0-snapshot.10
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/LICENSE +201 -0
- package/README.md +190 -0
- package/REFERENCE.md +122 -0
- package/dist/entity/entity-history-record-spec.d.ts +26 -0
- package/dist/entity/entity-history-record-spec.d.ts.map +1 -0
- package/dist/entity/entity-history-record-spec.js +77 -0
- package/dist/entity/entity-history-record-spec.js.map +1 -0
- package/dist/entity/entity-history-storage.d.ts +111 -0
- package/dist/entity/entity-history-storage.d.ts.map +1 -0
- package/dist/entity/entity-history-storage.js +40 -0
- package/dist/entity/entity-history-storage.js.map +1 -0
- package/dist/entity/entity-record.d.ts +31 -0
- package/dist/entity/entity-record.d.ts.map +1 -0
- package/dist/entity/entity-record.js +15 -0
- package/dist/entity/entity-record.js.map +1 -0
- package/dist/entity/history-conformance.d.ts +55 -0
- package/dist/entity/history-conformance.d.ts.map +1 -0
- package/dist/entity/history-conformance.js +165 -0
- package/dist/entity/history-conformance.js.map +1 -0
- package/dist/event/event-store.d.ts +141 -0
- package/dist/event/event-store.d.ts.map +1 -0
- package/dist/event/event-store.js +407 -0
- package/dist/event/event-store.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/delivery-cleanup.d.ts +99 -0
- package/dist/internal/delivery-cleanup.d.ts.map +1 -0
- package/dist/internal/delivery-cleanup.js +38 -0
- package/dist/internal/delivery-cleanup.js.map +1 -0
- package/dist/internal/entity-commit.d.ts +108 -0
- package/dist/internal/entity-commit.d.ts.map +1 -0
- package/dist/internal/entity-commit.js +32 -0
- package/dist/internal/entity-commit.js.map +1 -0
- package/dist/internal/entity-history.d.ts +12 -0
- package/dist/internal/entity-history.d.ts.map +1 -0
- package/dist/internal/entity-history.js +17 -0
- package/dist/internal/entity-history.js.map +1 -0
- package/dist/internal/event-store.d.ts +8 -0
- package/dist/internal/event-store.d.ts.map +1 -0
- package/dist/internal/event-store.js +21 -0
- package/dist/internal/event-store.js.map +1 -0
- package/dist/internal/query-values.d.ts +5 -0
- package/dist/internal/query-values.d.ts.map +1 -0
- package/dist/internal/query-values.js +18 -0
- package/dist/internal/query-values.js.map +1 -0
- package/dist/internal/tenancy.d.ts +89 -0
- package/dist/internal/tenancy.d.ts.map +1 -0
- package/dist/internal/tenancy.js +97 -0
- package/dist/internal/tenancy.js.map +1 -0
- package/dist/memory/canonical-utf8.d.ts +21 -0
- package/dist/memory/canonical-utf8.d.ts.map +1 -0
- package/dist/memory/canonical-utf8.js +65 -0
- package/dist/memory/canonical-utf8.js.map +1 -0
- package/dist/memory/in-memory-entity-commit.d.ts +35 -0
- package/dist/memory/in-memory-entity-commit.d.ts.map +1 -0
- package/dist/memory/in-memory-entity-commit.js +183 -0
- package/dist/memory/in-memory-entity-commit.js.map +1 -0
- package/dist/memory/in-memory-entity-history.d.ts +379 -0
- package/dist/memory/in-memory-entity-history.d.ts.map +1 -0
- package/dist/memory/in-memory-entity-history.js +756 -0
- package/dist/memory/in-memory-entity-history.js.map +1 -0
- package/dist/memory/in-memory-record-storage.d.ts +78 -0
- package/dist/memory/in-memory-record-storage.d.ts.map +1 -0
- package/dist/memory/in-memory-record-storage.js +127 -0
- package/dist/memory/in-memory-record-storage.js.map +1 -0
- package/dist/memory/in-memory-storage-backend.d.ts +38 -0
- package/dist/memory/in-memory-storage-backend.d.ts.map +1 -0
- package/dist/memory/in-memory-storage-backend.js +108 -0
- package/dist/memory/in-memory-storage-backend.js.map +1 -0
- package/dist/memory/in-memory-storage-factory.d.ts +58 -0
- package/dist/memory/in-memory-storage-factory.d.ts.map +1 -0
- package/dist/memory/in-memory-storage-factory.js +148 -0
- package/dist/memory/in-memory-storage-factory.js.map +1 -0
- package/dist/memory/memory-delivery-cleanup.d.ts +32 -0
- package/dist/memory/memory-delivery-cleanup.d.ts.map +1 -0
- package/dist/memory/memory-delivery-cleanup.js +61 -0
- package/dist/memory/memory-delivery-cleanup.js.map +1 -0
- package/dist/memory/tenant-records.d.ts +66 -0
- package/dist/memory/tenant-records.d.ts.map +1 -0
- package/dist/memory/tenant-records.js +573 -0
- package/dist/memory/tenant-records.js.map +1 -0
- package/dist/provider.d.ts +18 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +23 -0
- package/dist/provider.js.map +1 -0
- package/dist/query/query-execution.d.ts +50 -0
- package/dist/query/query-execution.d.ts.map +1 -0
- package/dist/query/query-execution.js +222 -0
- package/dist/query/query-execution.js.map +1 -0
- package/dist/query/query-policy.d.ts +115 -0
- package/dist/query/query-policy.d.ts.map +1 -0
- package/dist/query/query-policy.js +294 -0
- package/dist/query/query-policy.js.map +1 -0
- package/dist/record/column-mapping.d.ts +41 -0
- package/dist/record/column-mapping.d.ts.map +1 -0
- package/dist/record/column-mapping.js +36 -0
- package/dist/record/column-mapping.js.map +1 -0
- package/dist/record/column-type.d.ts +75 -0
- package/dist/record/column-type.d.ts.map +1 -0
- package/dist/record/column-type.js +69 -0
- package/dist/record/column-type.js.map +1 -0
- package/dist/record/record-column.d.ts +23 -0
- package/dist/record/record-column.d.ts.map +1 -0
- package/dist/record/record-column.js +41 -0
- package/dist/record/record-column.js.map +1 -0
- package/dist/record/record-mask.d.ts +11 -0
- package/dist/record/record-mask.d.ts.map +1 -0
- package/dist/record/record-mask.js +82 -0
- package/dist/record/record-mask.js.map +1 -0
- package/dist/record/record-query.d.ts +102 -0
- package/dist/record/record-query.d.ts.map +1 -0
- package/dist/record/record-query.js +44 -0
- package/dist/record/record-query.js.map +1 -0
- package/dist/record/record-spec.d.ts +101 -0
- package/dist/record/record-spec.d.ts.map +1 -0
- package/dist/record/record-spec.js +159 -0
- package/dist/record/record-spec.js.map +1 -0
- package/dist/record/record-storage.d.ts +202 -0
- package/dist/record/record-storage.d.ts.map +1 -0
- package/dist/record/record-storage.js +234 -0
- package/dist/record/record-storage.js.map +1 -0
- package/dist/record/storage-group.d.ts +17 -0
- package/dist/record/storage-group.d.ts.map +1 -0
- package/dist/record/storage-group.js +37 -0
- package/dist/record/storage-group.js.map +1 -0
- package/dist/storage/storage-factory.d.ts +44 -0
- package/dist/storage/storage-factory.d.ts.map +1 -0
- package/dist/storage/storage-factory.js +54 -0
- package/dist/storage/storage-factory.js.map +1 -0
- package/dist/storage/storage.d.ts +62 -0
- package/dist/storage/storage.d.ts.map +1 -0
- package/dist/storage/storage.js +15 -0
- package/dist/storage/storage.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, CodeMatters. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
|
5
|
+
* in compliance with the License. You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
10
|
+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
11
|
+
* or implied. See the License for the specific language governing permissions and limitations under
|
|
12
|
+
* the License.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Provides record-mask operations.
|
|
16
|
+
*/
|
|
17
|
+
export const RecordMask = Object.freeze({
|
|
18
|
+
// prettier-ignore
|
|
19
|
+
/**
|
|
20
|
+
* Applies a simple field mask to a cloned record.
|
|
21
|
+
* @param record The cloned record to prune.
|
|
22
|
+
* @param mask The paths to retain.
|
|
23
|
+
* @returns The pruned record.
|
|
24
|
+
*/
|
|
25
|
+
apply(record, mask) {
|
|
26
|
+
if (mask === undefined || mask.length === 0) {
|
|
27
|
+
return record;
|
|
28
|
+
}
|
|
29
|
+
const root = MaskTree.create(mask);
|
|
30
|
+
MaskTree.prune(record, root);
|
|
31
|
+
return record;
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Builds and applies the tree used by one record-mask operation.
|
|
36
|
+
*/
|
|
37
|
+
const MaskTree = Object.freeze({
|
|
38
|
+
create(mask) {
|
|
39
|
+
const root = this.node();
|
|
40
|
+
for (const path of mask) {
|
|
41
|
+
if (path.trim().length === 0) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
let node = root;
|
|
45
|
+
for (const segment of path.split(".").filter((part) => part.length > 0)) {
|
|
46
|
+
let next = node.children.get(segment);
|
|
47
|
+
if (next === undefined) {
|
|
48
|
+
next = this.node();
|
|
49
|
+
node.children.set(segment, next);
|
|
50
|
+
}
|
|
51
|
+
node = next;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return root;
|
|
55
|
+
},
|
|
56
|
+
node() {
|
|
57
|
+
return { children: new Map() };
|
|
58
|
+
},
|
|
59
|
+
prune(value, node) {
|
|
60
|
+
if (typeof value !== "object" || value === null || node.children.size === 0) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (Array.isArray(value)) {
|
|
64
|
+
for (const item of value) {
|
|
65
|
+
this.prune(item, node);
|
|
66
|
+
}
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
for (const key of Object.keys(value)) {
|
|
70
|
+
if (key === "$typeName") {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const child = node.children.get(key);
|
|
74
|
+
if (child === undefined) {
|
|
75
|
+
Reflect.deleteProperty(value, key);
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
this.prune(Reflect.get(value, key), child);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=record-mask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-mask.js","sourceRoot":"","sources":["../../src/record/record-mask.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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C;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI;QACF,OAAO,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAoB,EAAE,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,KAAc,EAAE,IAAc;QAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC5E,OAAO;QACT,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACzB,CAAC;YACD,OAAO;QACT,CAAC;QAED,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACrC,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;gBACxB,SAAS;YACX,CAAC;YACD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAErC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,OAAO,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;gBACnC,SAAS;YACX,CAAC;YAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines a deterministic record query by IDs, columns, sorting, continuations,
|
|
3
|
+
* offsets, limits, and masks.
|
|
4
|
+
*/
|
|
5
|
+
export interface RecordQuery<I> extends RecordReadOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Exact storage slot identifier filter.
|
|
8
|
+
*/
|
|
9
|
+
readonly ids?: readonly I[];
|
|
10
|
+
/**
|
|
11
|
+
* Exact column filters.
|
|
12
|
+
*/
|
|
13
|
+
readonly filters?: readonly RecordFilter[];
|
|
14
|
+
/**
|
|
15
|
+
* Deterministic sort order.
|
|
16
|
+
*/
|
|
17
|
+
readonly sort?: readonly RecordOrder[];
|
|
18
|
+
/**
|
|
19
|
+
* Stable ordered row key after which the query should continue.
|
|
20
|
+
*/
|
|
21
|
+
readonly after?: RecordContinuation<I>;
|
|
22
|
+
/**
|
|
23
|
+
* Positive limit applied after sorting.
|
|
24
|
+
*/
|
|
25
|
+
readonly limit?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Non-negative row offset applied after sorting and before the limit.
|
|
28
|
+
*/
|
|
29
|
+
readonly offset?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Provides record-query validation operations.
|
|
33
|
+
*/
|
|
34
|
+
export declare const RecordQuery: Readonly<{
|
|
35
|
+
validate<I>(query: RecordQuery<I>): void;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Read-time options for one record fetch.
|
|
39
|
+
*/
|
|
40
|
+
export interface RecordReadOptions {
|
|
41
|
+
/**
|
|
42
|
+
* Optional simple mask applied to the cloned result.
|
|
43
|
+
*/
|
|
44
|
+
readonly mask?: import("./record-mask.js").RecordMask;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Query sort order against one stored column, `id`, or a dotted record path.
|
|
48
|
+
*/
|
|
49
|
+
export interface RecordOrder {
|
|
50
|
+
/**
|
|
51
|
+
* Stored column name, `id`, or a dotted record path.
|
|
52
|
+
*/
|
|
53
|
+
readonly field: string;
|
|
54
|
+
/**
|
|
55
|
+
* Sort direction, ascending by default.
|
|
56
|
+
*/
|
|
57
|
+
readonly direction?: "asc" | "desc";
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Stable ordered row key used to continue a sorted query after one row.
|
|
61
|
+
*
|
|
62
|
+
* `values` must name the same fields, in the same order, as `RecordQuery.sort`.
|
|
63
|
+
* `id` is the actual storage slot identifier for the row and breaks any
|
|
64
|
+
* remaining ties.
|
|
65
|
+
*/
|
|
66
|
+
export interface RecordContinuation<I> {
|
|
67
|
+
/**
|
|
68
|
+
* Ordered field values captured from the last row of the previous page.
|
|
69
|
+
*/
|
|
70
|
+
readonly values: readonly RecordContinuationValue[];
|
|
71
|
+
/**
|
|
72
|
+
* Actual storage slot identifier captured from the last row of the previous page.
|
|
73
|
+
*/
|
|
74
|
+
readonly id: I;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* One captured sort-field value in a record continuation.
|
|
78
|
+
*/
|
|
79
|
+
export interface RecordContinuationValue {
|
|
80
|
+
/**
|
|
81
|
+
* Sort field this value was captured from.
|
|
82
|
+
*/
|
|
83
|
+
readonly field: string;
|
|
84
|
+
/**
|
|
85
|
+
* Captured value for the sort field.
|
|
86
|
+
*/
|
|
87
|
+
readonly value: unknown;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Equality filter against one stored column or the `id` field.
|
|
91
|
+
*/
|
|
92
|
+
export interface RecordFilter {
|
|
93
|
+
/**
|
|
94
|
+
* Stored column name or `id`.
|
|
95
|
+
*/
|
|
96
|
+
readonly column: string;
|
|
97
|
+
/**
|
|
98
|
+
* One accepted value or a small accepted set.
|
|
99
|
+
*/
|
|
100
|
+
readonly value: unknown;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=record-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-query.d.ts","sourceRoot":"","sources":["../../src/record/record-query.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,CAAE,SAAQ,iBAAiB;IAGvD;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,OAAO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G;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, CodeMatters. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
|
5
|
+
* in compliance with the License. You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
10
|
+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
11
|
+
* or implied. See the License for the specific language governing permissions and limitations under
|
|
12
|
+
* the License.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Provides record-query validation operations.
|
|
16
|
+
*/
|
|
17
|
+
export const RecordQuery = Object.freeze({
|
|
18
|
+
// prettier-ignore
|
|
19
|
+
/**
|
|
20
|
+
* Validate a record query before execution.
|
|
21
|
+
*/
|
|
22
|
+
validate(query) {
|
|
23
|
+
if (query.limit !== undefined &&
|
|
24
|
+
(!Number.isInteger(query.limit) || !Number.isFinite(query.limit) || query.limit <= 0)) {
|
|
25
|
+
throw new Error("Record query limit must be positive.");
|
|
26
|
+
}
|
|
27
|
+
if (query.offset !== undefined &&
|
|
28
|
+
(!Number.isInteger(query.offset) || !Number.isFinite(query.offset) || query.offset < 0)) {
|
|
29
|
+
throw new Error("Record query offset must be non-negative.");
|
|
30
|
+
}
|
|
31
|
+
if (query.after !== undefined) {
|
|
32
|
+
const sort = query.sort ?? [];
|
|
33
|
+
if (query.after.values.length !== sort.length) {
|
|
34
|
+
throw new Error("Record query continuation must match the sort order.");
|
|
35
|
+
}
|
|
36
|
+
for (let index = 0; index < sort.length; index += 1) {
|
|
37
|
+
if (query.after.values[index]?.field !== sort[index]?.field) {
|
|
38
|
+
throw new Error("Record query continuation must match the sort order.");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=record-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-query.js","sourceRoot":"","sources":["../../src/record/record-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAwCH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAEnB,MAAM,CAAC,MAAM,CAAC;IACjB,kBAAkB;IAElB;;OAEG;IACH,QAAQ,CAAI,KAAqB;QAC/B,IACE,KAAK,CAAC,KAAK,KAAK,SAAS;YACzB,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,EACrF,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC1D,CAAC;QACD,IACE,KAAK,CAAC,MAAM,KAAK,SAAS;YAC1B,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EACvF,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;YAC9B,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;gBAC9C,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;YAC1E,CAAC;YACD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;gBACpD,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;oBAC5D,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;gBAC1E,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
2
|
+
import type { GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
3
|
+
import { RecordColumn } from "./record-column.js";
|
|
4
|
+
/**
|
|
5
|
+
* Configures one direct Protobuf record family and its identity.
|
|
6
|
+
*/
|
|
7
|
+
export type RecordSpecOptions<I, R extends Message> = {
|
|
8
|
+
/**
|
|
9
|
+
* Original message type represented by the stored records.
|
|
10
|
+
*/
|
|
11
|
+
readonly sourceType?: GenMessage<Message>;
|
|
12
|
+
/**
|
|
13
|
+
* Protobuf record type stored by the family.
|
|
14
|
+
*/
|
|
15
|
+
readonly recordType: GenMessage<R>;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the authoritative identity extracted from a direct record.
|
|
18
|
+
*
|
|
19
|
+
* @param record Supplies the direct record.
|
|
20
|
+
* @returns The authoritative record identity.
|
|
21
|
+
*/
|
|
22
|
+
readonly extractId: (record: R) => I;
|
|
23
|
+
/**
|
|
24
|
+
* Declared query columns materialized from each record.
|
|
25
|
+
*/
|
|
26
|
+
readonly columns?: readonly RecordColumn<R>[];
|
|
27
|
+
} & ([I] extends [Message] ? {
|
|
28
|
+
/**
|
|
29
|
+
* Generated schema for a message-valued identity.
|
|
30
|
+
*/
|
|
31
|
+
readonly idSchema: GenMessage<I & Message>;
|
|
32
|
+
readonly idKind?: never;
|
|
33
|
+
} : {
|
|
34
|
+
readonly idSchema?: never;
|
|
35
|
+
/**
|
|
36
|
+
* Stable kind name for a primitive identity.
|
|
37
|
+
*/
|
|
38
|
+
readonly idKind: string;
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Declarative specification for one identified Protobuf record type.
|
|
42
|
+
*/
|
|
43
|
+
export declare class RecordSpec<I, R extends Message> {
|
|
44
|
+
#private;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a record specification.
|
|
47
|
+
*
|
|
48
|
+
* @throws Error if the ID type is invalid or two declared columns have the same name.
|
|
49
|
+
* @param input The source, record, identity, and column definitions.
|
|
50
|
+
*/
|
|
51
|
+
constructor(input: RecordSpecOptions<I, R>);
|
|
52
|
+
/**
|
|
53
|
+
* Returns the original message type represented by these records.
|
|
54
|
+
* @returns The source message type.
|
|
55
|
+
*/
|
|
56
|
+
get sourceType(): GenMessage<Message>;
|
|
57
|
+
/**
|
|
58
|
+
* Returns the type used to identify stored records.
|
|
59
|
+
* @returns The message ID type or primitive ID kind.
|
|
60
|
+
*/
|
|
61
|
+
get idType(): I extends Message ? GenMessage<I> : string;
|
|
62
|
+
/**
|
|
63
|
+
* Returns the Protobuf record type stored by this specification.
|
|
64
|
+
* @returns The managed record type.
|
|
65
|
+
*/
|
|
66
|
+
get recordType(): GenMessage<R>;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the columns materialized from stored records.
|
|
69
|
+
* @returns The declared record columns.
|
|
70
|
+
*/
|
|
71
|
+
get columns(): readonly RecordColumn<R>[];
|
|
72
|
+
/**
|
|
73
|
+
* Copies an ID value according to this specification.
|
|
74
|
+
* @param id The ID to clone.
|
|
75
|
+
* @returns The cloned ID.
|
|
76
|
+
*/
|
|
77
|
+
cloneId(id: I): I;
|
|
78
|
+
/**
|
|
79
|
+
* Copies one record value according to this specification.
|
|
80
|
+
* @param record The record to clone.
|
|
81
|
+
* @returns The cloned record.
|
|
82
|
+
*/
|
|
83
|
+
cloneRecord(record: R): R;
|
|
84
|
+
/**
|
|
85
|
+
* Gets the identifier from one stored record.
|
|
86
|
+
* @param record The stored record.
|
|
87
|
+
* @returns The logical record identifier.
|
|
88
|
+
*/
|
|
89
|
+
idValueIn(record: R): I;
|
|
90
|
+
/**
|
|
91
|
+
* Creates materialized record values with cloned identifiers and columns.
|
|
92
|
+
* @param record The record to materialize.
|
|
93
|
+
* @returns The materialized record values.
|
|
94
|
+
*/
|
|
95
|
+
materialize(record: R): {
|
|
96
|
+
readonly columns: ReadonlyMap<string, unknown>;
|
|
97
|
+
readonly id: I;
|
|
98
|
+
readonly record: R;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=record-spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-spec.d.ts","sourceRoot":"","sources":["../../src/record/record-spec.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAMlD;;GAEG;AAEH,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,IAAI;IAEpD;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAE1C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAEnC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;CAC/C,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,GACtB;IAEE;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,UAAU,C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 2.0 (the "License"); you may not use this file except
|
|
5
|
+
* in compliance with the License. You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
10
|
+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
11
|
+
* or implied. See the License for the specific language governing permissions and limitations under
|
|
12
|
+
* the License.
|
|
13
|
+
*/
|
|
14
|
+
import { clone } from "@bufbuild/protobuf";
|
|
15
|
+
import { RecordColumn } from "./record-column.js";
|
|
16
|
+
const storageHost = globalThis;
|
|
17
|
+
/**
|
|
18
|
+
* Declarative specification for one identified Protobuf record type.
|
|
19
|
+
*/
|
|
20
|
+
export class RecordSpec {
|
|
21
|
+
#columns;
|
|
22
|
+
#extractId;
|
|
23
|
+
#idSchema;
|
|
24
|
+
#idKind;
|
|
25
|
+
#recordType;
|
|
26
|
+
#sourceType;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a record specification.
|
|
29
|
+
*
|
|
30
|
+
* @throws Error if the ID type is invalid or two declared columns have the same name.
|
|
31
|
+
* @param input The source, record, identity, and column definitions.
|
|
32
|
+
*/
|
|
33
|
+
constructor(input) {
|
|
34
|
+
const runtimeInput = input;
|
|
35
|
+
this.#columns = input.columns ?? [];
|
|
36
|
+
const names = new Set();
|
|
37
|
+
for (const column of this.#columns) {
|
|
38
|
+
if (names.has(column.name)) {
|
|
39
|
+
throw new Error(`Storage record specification has duplicate record column "${column.name}".`);
|
|
40
|
+
}
|
|
41
|
+
names.add(column.name);
|
|
42
|
+
}
|
|
43
|
+
this.#extractId = input.extractId;
|
|
44
|
+
if (runtimeInput.idSchema === undefined &&
|
|
45
|
+
(runtimeInput.idKind === undefined || runtimeInput.idKind.trim().length === 0)) {
|
|
46
|
+
throw new Error("Storage record specification requires a non-blank primitive ID kind.");
|
|
47
|
+
}
|
|
48
|
+
if (runtimeInput.idSchema !== undefined && runtimeInput.idKind !== undefined) {
|
|
49
|
+
throw new Error("Storage record specification must not declare both an ID schema and primitive ID kind.");
|
|
50
|
+
}
|
|
51
|
+
this.#idSchema = input.idSchema;
|
|
52
|
+
this.#idKind = input.idKind ?? "";
|
|
53
|
+
this.#recordType = input.recordType;
|
|
54
|
+
this.#sourceType = input.sourceType ?? input.recordType;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Returns the original message type represented by these records.
|
|
58
|
+
* @returns The source message type.
|
|
59
|
+
*/
|
|
60
|
+
get sourceType() {
|
|
61
|
+
return this.#sourceType;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Returns the type used to identify stored records.
|
|
65
|
+
* @returns The message ID type or primitive ID kind.
|
|
66
|
+
*/
|
|
67
|
+
get idType() {
|
|
68
|
+
return (this.#idSchema ?? this.#idKind);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Returns the Protobuf record type stored by this specification.
|
|
72
|
+
* @returns The managed record type.
|
|
73
|
+
*/
|
|
74
|
+
get recordType() {
|
|
75
|
+
return this.#recordType;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Returns the columns materialized from stored records.
|
|
79
|
+
* @returns The declared record columns.
|
|
80
|
+
*/
|
|
81
|
+
get columns() {
|
|
82
|
+
return this.#columns;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Copies an ID value according to this specification.
|
|
86
|
+
* @param id The ID to clone.
|
|
87
|
+
* @returns The cloned ID.
|
|
88
|
+
*/
|
|
89
|
+
cloneId(id) {
|
|
90
|
+
const idSchema = this.#idSchema;
|
|
91
|
+
return idSchema === undefined ? RecordCloner.value(id) : RecordCloner.message(idSchema, id);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Copies one record value according to this specification.
|
|
95
|
+
* @param record The record to clone.
|
|
96
|
+
* @returns The cloned record.
|
|
97
|
+
*/
|
|
98
|
+
cloneRecord(record) {
|
|
99
|
+
return RecordCloner.message(this.#recordType, record);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Gets the identifier from one stored record.
|
|
103
|
+
* @param record The stored record.
|
|
104
|
+
* @returns The logical record identifier.
|
|
105
|
+
*/
|
|
106
|
+
idValueIn(record) {
|
|
107
|
+
return this.#extractId(record);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Creates materialized record values with cloned identifiers and columns.
|
|
111
|
+
* @param record The record to materialize.
|
|
112
|
+
* @returns The materialized record values.
|
|
113
|
+
*/
|
|
114
|
+
materialize(record) {
|
|
115
|
+
const storedRecord = this.cloneRecord(record);
|
|
116
|
+
const id = this.cloneId(this.idValueIn(storedRecord));
|
|
117
|
+
return {
|
|
118
|
+
id,
|
|
119
|
+
record: storedRecord,
|
|
120
|
+
columns: new Map(this.#columns.map((column) => [
|
|
121
|
+
column.name,
|
|
122
|
+
RecordCloner.value(column.valueIn(storedRecord)),
|
|
123
|
+
])),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const RecordCloner = Object.freeze({
|
|
128
|
+
message(schema, record) {
|
|
129
|
+
const cloneMethod = this.findCloneMethod(record);
|
|
130
|
+
if (cloneMethod !== undefined) {
|
|
131
|
+
return Reflect.apply(cloneMethod, record, []);
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
return clone(schema, record);
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
throw new Error("Storage record could not be cloned.");
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
value(value) {
|
|
141
|
+
const cloneMethod = this.findCloneMethod(value);
|
|
142
|
+
if (cloneMethod !== undefined) {
|
|
143
|
+
return Reflect.apply(cloneMethod, value, []);
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
return storageHost.structuredClone(value);
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
throw new Error("Storage value could not be cloned.");
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
findCloneMethod(value) {
|
|
153
|
+
if (typeof value !== "object" || value === null)
|
|
154
|
+
return undefined;
|
|
155
|
+
const candidate = Reflect.get(value, "clone");
|
|
156
|
+
return typeof candidate === "function" ? candidate : undefined;
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
//# sourceMappingURL=record-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-spec.js","sourceRoot":"","sources":["../../src/record/record-spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,WAAW,GAAG,UAEnB,CAAC;AAqDF;;GAEG;AACH,MAAM,OAAO,UAAU;IACZ,QAAQ,CAA6B;IACrC,UAAU,CAAmB;IAC7B,SAAS,CAA8D;IACvE,OAAO,CAAS;IAChB,WAAW,CAAgB;IAC3B,WAAW,CAAsB;IAE1C;;;;;OAKG;IACH,YAAY,KAA8B;QACxC,MAAM,YAAY,GAAG,KAA+B,CAAC;QACrD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;QAChC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnC,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CACb,6DAA6D,MAAM,CAAC,IAAI,IAAI,CAC7E,CAAC;YACJ,CAAC;YACD,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC;QAClC,IACE,YAAY,CAAC,QAAQ,K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