@bett3r-dev/pv3-types 1.0.0 → 1.11.0
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/CHANGELOG.md +305 -0
- package/build/adminPlugin.d.ts +24 -0
- package/build/adminPlugin.d.ts.map +1 -0
- package/build/{eventsourcing/utils.js → adminPlugin.js} +1 -1
- package/build/adminPlugin.js.map +1 -0
- package/build/aggregateSchema.d.ts +94 -0
- package/build/aggregateSchema.d.ts.map +1 -0
- package/build/aggregateSchema.js +287 -0
- package/build/aggregateSchema.js.map +1 -0
- package/build/authentication.d.ts +179 -78
- package/build/authentication.d.ts.map +1 -1
- package/build/authentication.js +62 -19
- package/build/authentication.js.map +1 -1
- package/build/cache.d.ts +50 -4
- package/build/cache.d.ts.map +1 -1
- package/build/clusterAdministration.d.ts +712 -225
- package/build/clusterAdministration.d.ts.map +1 -1
- package/build/clusterAdministration.js +175 -52
- package/build/clusterAdministration.js.map +1 -1
- package/build/configuration.d.ts +26 -5
- package/build/configuration.d.ts.map +1 -1
- package/build/database.d.ts +240 -56
- package/build/database.d.ts.map +1 -1
- package/build/database.js +102 -20
- package/build/database.js.map +1 -1
- package/build/endpoints.d.ts +141 -41
- package/build/endpoints.d.ts.map +1 -1
- package/build/endpoints.js +50 -26
- package/build/endpoints.js.map +1 -1
- package/build/errors.d.ts +166 -0
- package/build/errors.d.ts.map +1 -0
- package/build/errors.js +276 -0
- package/build/errors.js.map +1 -0
- package/build/evenstore.d.ts +47 -7
- package/build/evenstore.d.ts.map +1 -1
- package/build/eventsourcing/aggregateBuilder.d.ts +17 -8
- package/build/eventsourcing/aggregateBuilder.d.ts.map +1 -1
- package/build/eventsourcing/commandBuilder.d.ts +20 -13
- package/build/eventsourcing/commandBuilder.d.ts.map +1 -1
- package/build/eventsourcing/commandHandlers.d.ts +155 -33
- package/build/eventsourcing/commandHandlers.d.ts.map +1 -1
- package/build/eventsourcing/commandHandlers.js +62 -14
- package/build/eventsourcing/commandHandlers.js.map +1 -1
- package/build/eventsourcing/eventHandlers.d.ts +173 -44
- package/build/eventsourcing/eventHandlers.d.ts.map +1 -1
- package/build/eventsourcing/eventHandlers.js +29 -21
- package/build/eventsourcing/eventHandlers.js.map +1 -1
- package/build/eventsourcing/eventHandlersBuilder.d.ts +18 -12
- package/build/eventsourcing/eventHandlersBuilder.d.ts.map +1 -1
- package/build/eventsourcing/eventHandlersBuilder.js.map +1 -1
- package/build/eventsourcing/eventsourcing.types.d.ts +322 -0
- package/build/eventsourcing/eventsourcing.types.d.ts.map +1 -0
- package/build/eventsourcing/eventsourcing.types.js +26 -0
- package/build/eventsourcing/eventsourcing.types.js.map +1 -0
- package/build/eventsourcing/externalSystemBuilder.d.ts +8 -7
- package/build/eventsourcing/externalSystemBuilder.d.ts.map +1 -1
- package/build/eventsourcing/index.d.ts +2 -378
- package/build/eventsourcing/index.d.ts.map +1 -1
- package/build/eventsourcing/index.js +2 -23
- package/build/eventsourcing/index.js.map +1 -1
- package/build/eventsourcing/invariants.d.ts +34 -10
- package/build/eventsourcing/invariants.d.ts.map +1 -1
- package/build/eventsourcing/shapeChangeForSubscriber.d.ts +33 -0
- package/build/eventsourcing/shapeChangeForSubscriber.d.ts.map +1 -0
- package/build/eventsourcing/shapeChangeForSubscriber.js +47 -0
- package/build/eventsourcing/shapeChangeForSubscriber.js.map +1 -0
- package/build/index.d.ts +6 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -1
- package/build/index.js.map +1 -1
- package/build/infrastructure.d.ts +9 -1
- package/build/infrastructure.d.ts.map +1 -1
- package/build/infrastructure.js +33 -1
- package/build/infrastructure.js.map +1 -1
- package/build/livenessWatchdog.d.ts +28 -0
- package/build/livenessWatchdog.d.ts.map +1 -0
- package/build/livenessWatchdog.js +43 -0
- package/build/livenessWatchdog.js.map +1 -0
- package/build/logger.d.ts +8 -9
- package/build/logger.d.ts.map +1 -1
- package/build/logger.js +18 -6
- package/build/logger.js.map +1 -1
- package/build/outboxManager.d.ts +858 -14
- package/build/outboxManager.d.ts.map +1 -1
- package/build/outboxManager.js +173 -15
- package/build/outboxManager.js.map +1 -1
- package/build/permissions.d.ts +47 -0
- package/build/permissions.d.ts.map +1 -0
- package/build/permissions.js +3 -0
- package/build/permissions.js.map +1 -0
- package/build/ports.d.ts +10 -10
- package/build/ports.d.ts.map +1 -1
- package/build/routesAuth.d.ts +17 -25
- package/build/routesAuth.d.ts.map +1 -1
- package/build/routesAuth.js +4 -14
- package/build/routesAuth.js.map +1 -1
- package/build/typedEventEmitter.d.ts +7 -13
- package/build/typedEventEmitter.d.ts.map +1 -1
- package/build/typedEventEmitter.js +2 -2
- package/build/typedEventEmitter.js.map +1 -1
- package/build/userSession.d.ts +8 -0
- package/build/userSession.d.ts.map +1 -0
- package/build/userSession.js +3 -0
- package/build/userSession.js.map +1 -0
- package/package.json +22 -7
- package/build/eventsourcing/utils.d.ts +0 -4
- package/build/eventsourcing/utils.d.ts.map +0 -1
- package/build/eventsourcing/utils.js.map +0 -1
- package/build/validation.d.ts +0 -64
- package/build/validation.d.ts.map +0 -1
- package/build/validation.js +0 -57
- package/build/validation.js.map +0 -1
- package/src/authentication.ts +0 -273
- package/src/cache.ts +0 -109
- package/src/clusterAdministration.ts +0 -216
- package/src/configuration.ts +0 -71
- package/src/database.ts +0 -157
- package/src/endpoints.ts +0 -198
- package/src/evenstore.ts +0 -27
- package/src/eventsourcing/aggregateBuilder.ts +0 -11
- package/src/eventsourcing/commandBuilder.ts +0 -64
- package/src/eventsourcing/commandHandlers.ts +0 -137
- package/src/eventsourcing/eventHandlers.ts +0 -118
- package/src/eventsourcing/eventHandlersBuilder.ts +0 -42
- package/src/eventsourcing/externalSystemBuilder.ts +0 -20
- package/src/eventsourcing/index.ts +0 -111
- package/src/eventsourcing/invariants.ts +0 -27
- package/src/eventsourcing/utils.ts +0 -4
- package/src/index.ts +0 -15
- package/src/infrastructure.ts +0 -41
- package/src/logger.ts +0 -45
- package/src/outboxManager.ts +0 -36
- package/src/ports.ts +0 -42
- package/src/routesAuth.ts +0 -58
- package/src/typedEventEmitter.ts +0 -73
- package/src/validation.ts +0 -89
- package/tsconfig.json +0 -15
package/build/database.d.ts
CHANGED
|
@@ -1,120 +1,304 @@
|
|
|
1
|
+
import { BaseSchema } from '@bett3r-dev/jsonschema-definer';
|
|
1
2
|
import { AdapterBase, PortEmitter } from './ports';
|
|
2
|
-
export type Document =
|
|
3
|
-
id: string | number;
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
};
|
|
3
|
+
export type Document = Record<string, any>;
|
|
6
4
|
export type IndexOptions = {
|
|
7
|
-
isUnique
|
|
5
|
+
isUnique?: boolean;
|
|
6
|
+
isNumeric?: boolean;
|
|
7
|
+
isString?: boolean;
|
|
8
|
+
strategy?: 'gin';
|
|
8
9
|
};
|
|
9
|
-
export type DatabaseOps = 'eq' | 'neq' | 'lt' | 'gt' | 'lte' | 'gte' | 'in' | 'nin' | 'contains' | 'notContains' | 'some' | 'none' | 'every' | 'exists' | 'notExists';
|
|
10
|
+
export type DatabaseOps = 'eq' | 'neq' | 'lt' | 'gt' | 'lte' | 'gte' | 'in' | 'nin' | 'contains' | 'notContains' | 'some' | 'none' | 'every' | 'exists' | 'notExists' | 'notEmpty';
|
|
10
11
|
export declare const filterOpMap: {
|
|
11
12
|
eq: <T>(a: T, b: T) => boolean;
|
|
12
|
-
neq: <
|
|
13
|
-
lt: <
|
|
14
|
-
gt: <
|
|
15
|
-
lte: <
|
|
16
|
-
gte: <
|
|
17
|
-
in: <
|
|
18
|
-
nin: <
|
|
19
|
-
contains: <
|
|
20
|
-
notContains: <
|
|
21
|
-
some: <
|
|
22
|
-
none: <
|
|
23
|
-
every: <
|
|
24
|
-
exists: <
|
|
25
|
-
notExists: <
|
|
13
|
+
neq: <T>(a: T, b: T) => boolean;
|
|
14
|
+
lt: <T>(a: T, b: T) => boolean;
|
|
15
|
+
gt: <T>(a: T, b: T) => boolean;
|
|
16
|
+
lte: <T>(a: T, b: T) => boolean;
|
|
17
|
+
gte: <T>(a: T, b: T) => boolean;
|
|
18
|
+
in: <T>(a: T, b: T[]) => boolean;
|
|
19
|
+
nin: <T>(a: T, b: T[]) => boolean;
|
|
20
|
+
contains: <T>(a: T[], b: T) => boolean;
|
|
21
|
+
notContains: <T>(a: T[], b: T) => boolean;
|
|
22
|
+
some: <T>(a: T[], b: T[]) => boolean;
|
|
23
|
+
none: <T>(a: T[], b: T[]) => boolean;
|
|
24
|
+
every: <T>(a: T[], b: T[]) => boolean;
|
|
25
|
+
exists: <T>(a: T) => boolean;
|
|
26
|
+
notExists: <T>(a: T) => boolean;
|
|
27
|
+
notEmpty: <T>(a: T[]) => boolean;
|
|
26
28
|
};
|
|
27
|
-
export declare const CollectionFilterSchema: import("@bett3r-dev/jsonschema-definer").ObjectSchema<{
|
|
28
|
-
value?: import("@bett3r-dev/jsonschema-definer/dist/base").Any;
|
|
29
|
-
field: string;
|
|
30
|
-
op: string[];
|
|
31
|
-
}, true>;
|
|
32
29
|
export type CollectionFilterOR<T extends Document = any> = {
|
|
33
30
|
OR: CollectionFilter<T>[];
|
|
34
31
|
};
|
|
35
32
|
export type CollectionFilterAND<T extends Document = any> = {
|
|
36
33
|
AND: CollectionFilter<T>[];
|
|
37
34
|
};
|
|
35
|
+
export declare const CollectionFilterInstanceSchema: import("@bett3r-dev/jsonschema-definer").ObjectSchema<{
|
|
36
|
+
field: string;
|
|
37
|
+
op: "contains" | "eq" | "every" | "exists" | "gt" | "gte" | "in" | "lt" | "lte" | "neq" | "nin" | "none" | "notContains" | "notEmpty" | "notExists" | "some";
|
|
38
|
+
value?: import("@bett3r-dev/jsonschema-definer/dist/base").Any;
|
|
39
|
+
}, true>;
|
|
38
40
|
export type CollectionFilterInstance<Model extends Document> = {
|
|
39
41
|
field: keyof Model;
|
|
40
42
|
op: DatabaseOps;
|
|
41
43
|
value: any;
|
|
42
44
|
};
|
|
43
45
|
export type CollectionFilter<T extends Document = any> = Partial<CollectionFilterOR<T> & CollectionFilterAND<T> & CollectionFilterInstance<T>>;
|
|
46
|
+
/**
|
|
47
|
+
* The recursive filter schema, PARAMETERISED BY `$id` — and the parameter is not a nicety.
|
|
48
|
+
*
|
|
49
|
+
* A schema document may carry a given `$id` only ONCE: ajv rejects a document that materialises
|
|
50
|
+
* the same `$id` twice with `reference "<id>" resolves to more than one schema`, and it does so at
|
|
51
|
+
* `compile` time, so the whole endpoint's validator dies rather than one field. That is exactly
|
|
52
|
+
* what happens the moment two properties of one document each embed a filter — as
|
|
53
|
+
* `ReadmodelDefaultQuerySchema` does, with `filter` and `aggregate.filter` (TV1-2342). The `$id` is
|
|
54
|
+
* load-bearing and cannot simply be dropped: it is the base against which the self-reference
|
|
55
|
+
* `#/$defs/<id>` resolves, which is what makes OR/AND recursive.
|
|
56
|
+
*
|
|
57
|
+
* So each EMBEDDING SITE takes its own id, from one definition. Add a site → give it a new id here.
|
|
58
|
+
*/
|
|
59
|
+
export declare const collectionFilterSchemaWithId: (id: string) => BaseSchema<Partial<CollectionFilterOR<any> & CollectionFilterAND<any> & CollectionFilterInstance<any>>, true, Readonly<import("@bett3r-dev/jsonschema-definer/dist/base").BaseJsonSchema>>;
|
|
60
|
+
export declare const CollectionFilterSchema: BaseSchema<Partial<CollectionFilterOR<any> & CollectionFilterAND<any> & CollectionFilterInstance<any>>, true, Readonly<import("@bett3r-dev/jsonschema-definer/dist/base").BaseJsonSchema>>;
|
|
44
61
|
export declare const CollectionSortSchema: import("@bett3r-dev/jsonschema-definer").ObjectSchema<{
|
|
45
62
|
field: string;
|
|
46
|
-
direction:
|
|
63
|
+
direction: "asc" | "desc";
|
|
47
64
|
}, true>;
|
|
48
65
|
export type CollectionSort<Model extends Document> = {
|
|
49
66
|
field: keyof Model;
|
|
50
67
|
direction?: 'asc' | 'desc';
|
|
51
68
|
};
|
|
52
69
|
export declare const CollectionQueryParamsSchema: import("@bett3r-dev/jsonschema-definer").ObjectSchema<{
|
|
53
|
-
limit?: number | undefined;
|
|
54
|
-
after?: string | undefined;
|
|
55
70
|
sort?: {
|
|
56
71
|
field: string;
|
|
57
|
-
direction:
|
|
58
|
-
}[] | undefined;
|
|
59
|
-
filter?: {
|
|
60
|
-
value?: import("@bett3r-dev/jsonschema-definer/dist/base").Any;
|
|
61
|
-
field: string;
|
|
62
|
-
op: string[];
|
|
72
|
+
direction: "asc" | "desc";
|
|
63
73
|
}[] | undefined;
|
|
74
|
+
filter?: Partial<CollectionFilterOR<any> & CollectionFilterAND<any> & CollectionFilterInstance<any>>[] | undefined;
|
|
75
|
+
limit?: number | undefined;
|
|
76
|
+
offset?: number | undefined;
|
|
77
|
+
after?: string | number | undefined;
|
|
64
78
|
select?: string[] | undefined;
|
|
79
|
+
byDistinctField?: string | undefined;
|
|
65
80
|
}, true>;
|
|
81
|
+
export type KeyWithBang<T> = {
|
|
82
|
+
[K in keyof T]: (K & string) | `!${K & string}` | `DISTINCT:${K & string}`;
|
|
83
|
+
}[keyof T];
|
|
66
84
|
export type CollectionQueryParams<Model extends Document> = {
|
|
67
|
-
|
|
85
|
+
idValue?: string | number;
|
|
68
86
|
limit?: number;
|
|
69
87
|
after?: string | number;
|
|
88
|
+
offset?: number;
|
|
70
89
|
sort?: CollectionSort<Model>[];
|
|
71
90
|
filter?: CollectionFilter<Model>[];
|
|
72
|
-
select?:
|
|
91
|
+
select?: KeyWithBang<Model> | KeyWithBang<Model>[];
|
|
92
|
+
byDistinctField?: keyof Model & string;
|
|
93
|
+
/**
|
|
94
|
+
* TV1-2342 slice 7 — present ONLY when the caller asked for an aggregation. It selects the
|
|
95
|
+
* `aggregate` OPERATION instead of `query`, rather than modifying `query`'s behaviour: the two
|
|
96
|
+
* return different shapes, and that is exactly why `aggregate` is a separate operation.
|
|
97
|
+
*/
|
|
98
|
+
aggregate?: AggregateSpec<Model>;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* TV1-2342 — AGGREGATION over a readmodel.
|
|
102
|
+
*
|
|
103
|
+
* The whole design rests on ONE static spec value being readable by three consumers that can
|
|
104
|
+
* therefore never drift: this TS type, `deriveAggregateSchema` (the response schema), and the
|
|
105
|
+
* adapter's `translateAggregate` (the SQL).
|
|
106
|
+
*/
|
|
107
|
+
export type AggregateFn = 'sum' | 'count' | 'min' | 'max' | 'avg';
|
|
108
|
+
/**
|
|
109
|
+
* `count` is the ONLY function legal without a `field` — counting is a property of the GROUP,
|
|
110
|
+
* every other function is a property of a COLUMN. Modelling that as a union (rather than an
|
|
111
|
+
* optional `field`) is what makes `{ fn:'sum', as:'net' }` a compile error at the spec.
|
|
112
|
+
*/
|
|
113
|
+
export type AggregateTerm<Model extends Document> = {
|
|
114
|
+
fn: 'count';
|
|
115
|
+
field?: string & keyof Model;
|
|
116
|
+
as: string;
|
|
117
|
+
} | {
|
|
118
|
+
fn: Exclude<AggregateFn, 'count'>;
|
|
119
|
+
field: string & keyof Model;
|
|
120
|
+
as: string;
|
|
121
|
+
};
|
|
122
|
+
export type AggregateSpec<Model extends Document> = {
|
|
123
|
+
groupBy: readonly (string & keyof Model)[];
|
|
124
|
+
aggregates: readonly AggregateTerm<Model>[];
|
|
125
|
+
/**
|
|
126
|
+
* TV1-2342 slice 4 — applies BEFORE the grouping (a `WHERE`, never a `HAVING`). It narrows the
|
|
127
|
+
* INPUT ROWS, exactly as it does on `query`, so its meaning is identical in both operations.
|
|
128
|
+
* Filtering ON an aggregated value is a DIFFERENT capability and is deliberately not folded in
|
|
129
|
+
* here: doing so would silently change what `filter` means for every existing caller.
|
|
130
|
+
*/
|
|
131
|
+
filter?: CollectionFilter<Model>[];
|
|
132
|
+
/**
|
|
133
|
+
* RESERVED, and implemented NOWHERE — typed `never` so that supplying a value is a compile
|
|
134
|
+
* error rather than a key that is quietly ignored at runtime. A half-implemented `having` is
|
|
135
|
+
* worse than none: the caller believes their predicate ran.
|
|
136
|
+
*/
|
|
137
|
+
having?: never;
|
|
138
|
+
/**
|
|
139
|
+
* THE RESULT-COUNT BOUND. Exceeding it THROWS; the result is never truncated. Grouped output is
|
|
140
|
+
* small only in the motivating cases, so a silently short list is the reassuring-failure shape —
|
|
141
|
+
* the caller cannot tell a complete answer from a clipped one.
|
|
142
|
+
*/
|
|
143
|
+
maxGroups?: number;
|
|
144
|
+
/**
|
|
145
|
+
* THE GROUP-SIZE (i.e. MEMORY) BOUND, and a DIFFERENT AXIS from `maxGroups`. `min`/`max` and the
|
|
146
|
+
* group KEYS all compile to `(ARRAY_AGG(x))[1]` in the Postgres adapter — Postgres ships no
|
|
147
|
+
* `min(jsonb)` — so one array per group is materialised and memory is O(group size). Under the
|
|
148
|
+
* Option B design the composer picks the grouping, which makes a LOW-CARDINALITY key over a
|
|
149
|
+
* LARGE readmodel the EXPECTED shape: one result row, one enormous array. `maxGroups` cannot
|
|
150
|
+
* see that at all. Exceeding it THROWS, for the same reason as above.
|
|
151
|
+
*/
|
|
152
|
+
maxGroupSize?: number;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* The one subtle branch in the whole design (invariant I4), and it MUST be widened in the same
|
|
156
|
+
* edit as `AggregateTerm['fn']`: a function present in the spec type but missing here resolves
|
|
157
|
+
* to `never`, which is assignable to everything, so the mistake shows up as nothing at all
|
|
158
|
+
* rather than as an error at the spec.
|
|
159
|
+
*
|
|
160
|
+
* - `count` / `sum` / `avg` → number (they answer with a tally, a total or a mean, none of
|
|
161
|
+
* which have anything to do with the source column's type);
|
|
162
|
+
* - `min` / `max` → the SOURCE field's type, preserved. They return one of the values that
|
|
163
|
+
* were there, so a max over a `date-time` string is a string, not a number.
|
|
164
|
+
*
|
|
165
|
+
* NULLABILITY is part of the same rule and is decided HERE rather than deferred, because an
|
|
166
|
+
* adapter-parity suite can only make two implementations AGREE — including on a wrong answer.
|
|
167
|
+
* A group whose every row LACKS the aggregated field is not hypothetical (the model schema is
|
|
168
|
+
* not enforced on write) and the three functions differ on it:
|
|
169
|
+
*
|
|
170
|
+
* - `count` cannot be empty (a group exists because a row exists) and `sum` has an identity
|
|
171
|
+
* element, 0, which the SQL COALESCEs to — so both are strictly `number`;
|
|
172
|
+
* - `avg`/`min`/`max` have NO identity element. The mean of nothing is not 0 and the minimum
|
|
173
|
+
* of nothing is not 0; inventing one would be a worse lie than the null. So they are
|
|
174
|
+
* `| null`, and the null is expressed in the TYPE instead of being an undeclared runtime
|
|
175
|
+
* surprise.
|
|
176
|
+
*
|
|
177
|
+
* `deriveAggregateSchema` carries the same rule at the schema level, including the facets
|
|
178
|
+
* (`enum`, `format`) that a TS type cannot express.
|
|
179
|
+
*/
|
|
180
|
+
export type AggregateTermType<Model extends Document, Term> = Term extends {
|
|
181
|
+
fn: 'count' | 'sum';
|
|
182
|
+
} ? number : Term extends {
|
|
183
|
+
fn: 'avg';
|
|
184
|
+
} ? number | null : Term extends {
|
|
185
|
+
fn: 'min' | 'max';
|
|
186
|
+
field: infer F extends string & keyof Model;
|
|
187
|
+
} ? Model[F] | null : never;
|
|
188
|
+
/**
|
|
189
|
+
* THE BOUND DEFAULTS, single-sourced here (TV1-2342, collapsed in /verify-build) because both
|
|
190
|
+
* adapters apply them and the shared conformance suite pins BOTH to these exact numbers. They
|
|
191
|
+
* previously lived as literals in the Postgres adapter with a hand-copied pair in MemoryDb —
|
|
192
|
+
* two sites, one contract, and nothing but a test standing between them and a silent drift.
|
|
193
|
+
* `pv3-types` is the one package both adapters already depend on.
|
|
194
|
+
*/
|
|
195
|
+
export declare const DEFAULT_MAX_AGGREGATE_GROUPS = 1000;
|
|
196
|
+
export declare const DEFAULT_MAX_AGGREGATE_GROUP_SIZE = 50000;
|
|
197
|
+
/**
|
|
198
|
+
* An aggregate row is a NEW type, not a partial model: a field that is neither grouped by nor
|
|
199
|
+
* aggregated is ABSENT from it.
|
|
200
|
+
*
|
|
201
|
+
* A GROUP KEY IS NULLABLE (TV1-2342 slice 10, corrected in /verify-build). The model schema is not
|
|
202
|
+
* enforced on write, so a declared-required key can be physically absent from a row; both adapters
|
|
203
|
+
* then group it under a NULL key and `deriveAggregateSchema` marks every group property
|
|
204
|
+
* `.nullable()`. Typing it as `Model[K]` made the TS derivation the ONLY one of the three that
|
|
205
|
+
* denied a value the other two produce — `row.bucket.toUpperCase()` would compile and throw.
|
|
206
|
+
*/
|
|
207
|
+
export type AggregateRow<Model extends Document, Spec extends AggregateSpec<Model>> = {
|
|
208
|
+
[K in Spec['groupBy'][number]]: Model[K] | null;
|
|
209
|
+
} & {
|
|
210
|
+
[Term in Spec['aggregates'][number] as Term['as']]: AggregateTermType<Model, Term>;
|
|
73
211
|
};
|
|
74
212
|
export type CollectionOperations<Model extends Document> = {
|
|
75
|
-
readById: (id: string | number
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
213
|
+
readById: (id: string | number, params?: Pick<CollectionQueryParams<Model>, 'select'> & {
|
|
214
|
+
forUpdate?: boolean;
|
|
215
|
+
}, options?: any) => Promise<Model | null>;
|
|
216
|
+
query: (params: CollectionQueryParams<Model>, options?: any) => Promise<Model[]>;
|
|
217
|
+
aggregate: <const Spec extends AggregateSpec<Model>>(spec: Spec, options?: any) => Promise<AggregateRow<Model, Spec>[]>;
|
|
218
|
+
count: (params: CollectionQueryParams<Model>, options?: any) => Promise<number>;
|
|
219
|
+
forEach: (params: CollectionQueryParams<Model>, callback: (record: Model, stop: () => void) => void | Promise<void>, options?: any) => Promise<void>;
|
|
220
|
+
upsert: (id: string | number, data: Partial<Model>, options?: any) => Promise<Model>;
|
|
221
|
+
unset: (id: string | number, key: string, options?: any) => Promise<Model>;
|
|
222
|
+
destroyById: (id: string | number, options?: any) => Promise<void>;
|
|
223
|
+
createMany: (documents: Model[], options?: any) => Promise<Model[]>;
|
|
224
|
+
upsertMany: (documents: Model[], options?: {
|
|
225
|
+
replace?: boolean;
|
|
226
|
+
}) => Promise<Model[]>;
|
|
227
|
+
updateMany: (filter: CollectionFilter<Model>[], data: Partial<Model>, options?: {
|
|
228
|
+
upsert?: boolean;
|
|
229
|
+
replace?: boolean;
|
|
230
|
+
}) => Promise<Model[]>;
|
|
231
|
+
arrayPush: <T>(filter: CollectionFilter<Model>[], propertyPath: string[], data: T | T[], options?: {
|
|
232
|
+
unique?: boolean;
|
|
233
|
+
}) => Promise<Model[]>;
|
|
234
|
+
arrayPull: <T>(filter: CollectionFilter<Model>[], propertyPath: string[], data: T | T[], options?: any) => Promise<Model[]>;
|
|
235
|
+
destroyMany: (filter: CollectionFilter<Model>[], options?: any) => Promise<number>;
|
|
83
236
|
atomicIncrement: (name: string, filter?: CollectionFilter<Model>, amount?: number) => Promise<number>;
|
|
237
|
+
explain: (params: CollectionQueryParams<Model>) => Promise<{
|
|
238
|
+
query: string;
|
|
239
|
+
isUsingIndex: boolean;
|
|
240
|
+
rawResult: any;
|
|
241
|
+
}>;
|
|
84
242
|
};
|
|
85
243
|
export type DatabaseChange<Model extends Document = any> = {
|
|
86
|
-
changeType: 'insert' | 'update' | 'delete';
|
|
87
|
-
|
|
244
|
+
changeType: 'insert' | 'update' | 'delete' | 'snapshot' | 'signal' | 'invalidate';
|
|
245
|
+
ref?: string;
|
|
246
|
+
data?: Model | Model[];
|
|
88
247
|
previous?: Model;
|
|
248
|
+
count?: number;
|
|
249
|
+
accountId?: string;
|
|
89
250
|
};
|
|
90
251
|
export type Collection<Model extends Document> = CollectionOperations<Model> & {
|
|
91
|
-
ensureIndex: (properties: string[], options?: Partial<IndexOptions>) => Promise<void>;
|
|
252
|
+
ensureIndex: (properties: (string & keyof Model)[] | Record<keyof Model, IndexOptions>, options?: Partial<IndexOptions>) => Promise<void>;
|
|
92
253
|
destroyIndex: (properties: string[]) => Promise<void>;
|
|
93
|
-
watch: (changeTypes: ('insert' | 'update' | 'delete')[], onData: (data: DatabaseChange<Model>) => void, onError?: (e: Error) => void) => Promise<{
|
|
254
|
+
watch: (changeTypes: ('insert' | 'update' | 'delete' | 'invalidate')[], onData: (data: DatabaseChange<Model>) => void, onError?: (e: Error) => void) => Promise<{
|
|
94
255
|
close: () => void;
|
|
95
256
|
}>;
|
|
96
257
|
};
|
|
97
258
|
/**
|
|
98
259
|
* @category Main Types
|
|
99
260
|
*/
|
|
100
|
-
export type DatabaseTransaction = {
|
|
101
|
-
getCollection: <Model extends Document>(collection: string) => CollectionOperations<Model>;
|
|
261
|
+
export type DatabaseTransaction<T = any> = {
|
|
262
|
+
getCollection: <Model extends Document>(collection: string, idProperty?: string & keyof Model, sequenceIdProperty?: string & keyof Model) => CollectionOperations<Model>;
|
|
263
|
+
connectionId: string;
|
|
264
|
+
txId?: string;
|
|
265
|
+
/**
|
|
266
|
+
* SAVEPOINT capability — take a rewind point INSIDE this transaction, roll back to it, and
|
|
267
|
+
* release it. Returns an opaque token identifying the savepoint: the ADAPTER names it, so
|
|
268
|
+
* nesting is safe (a savepoint taken inside another is a distinct token, never a shadowing
|
|
269
|
+
* re-use of one name) and no caller-supplied string can ever reach the statement.
|
|
270
|
+
*
|
|
271
|
+
* Why a capability on the transaction and not a query issued by whoever needs it: the callers
|
|
272
|
+
* that need it are adapter-agnostic core (`executeCommand` rewinds an optimistic-concurrency
|
|
273
|
+
* conflict inside a transaction its CALLER owns), and reaching through `_adapter()` to run SQL
|
|
274
|
+
* would break both the hexagon and every non-Postgres adapter.
|
|
275
|
+
*
|
|
276
|
+
* OPTIONAL, and the absence is a FIRST-CLASS behavior, not a silent skip: MemoryDb has no
|
|
277
|
+
* savepoints (its transactions are atomic but not isolated) and Mongo cannot partially roll one
|
|
278
|
+
* back. A caller must detect the absence EXPLICITLY and fall back to something safe — for
|
|
279
|
+
* `executeCommand` that is refusing to retry and propagating the conflict to the transaction's
|
|
280
|
+
* owner, the only party that can roll it back. Never `transaction.savepoint?.()`: a savepoint
|
|
281
|
+
* that silently does not exist turns a rewind into a no-op and a retry into a re-execution on
|
|
282
|
+
* top of its own uncommitted rows.
|
|
283
|
+
*/
|
|
284
|
+
savepoint?: () => Promise<string>;
|
|
285
|
+
rollbackToSavepoint?: (savepoint: string) => Promise<void>;
|
|
286
|
+
releaseSavepoint?: (savepoint: string) => Promise<void>;
|
|
287
|
+
_adapter: () => T;
|
|
102
288
|
};
|
|
103
289
|
/**
|
|
104
290
|
* @category Main Types
|
|
105
291
|
*/
|
|
106
292
|
export type DatabaseType = {
|
|
107
|
-
getCollection: <Model extends Document>(
|
|
108
|
-
initTransaction: <Result = any>(operations: (
|
|
293
|
+
getCollection: <Model extends Document>(collection: string, idProperty?: string & keyof Model, sequenceIdProperty?: string & keyof Model) => Collection<Model>;
|
|
294
|
+
initTransaction: <Result = any>(operations: (transaction: DatabaseTransaction) => Promise<Result>, retryBackoff?: number, options?: any) => Promise<Result>;
|
|
109
295
|
};
|
|
110
296
|
/**
|
|
111
297
|
* @category Main Types
|
|
112
298
|
*/
|
|
113
|
-
export type
|
|
114
|
-
_adapter: DatabaseAdapter;
|
|
115
|
-
};
|
|
299
|
+
export type DatabaseAdapter<T = any> = DatabaseType & AdapterBase<T>;
|
|
116
300
|
/**
|
|
117
301
|
* @category Main Types
|
|
118
302
|
*/
|
|
119
|
-
export type
|
|
303
|
+
export type DatabasePort<T = any> = PortEmitter & DatabaseAdapter<T>;
|
|
120
304
|
//# sourceMappingURL=database.d.ts.map
|
package/build/database.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"AAAA,OAAU,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAMnD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE3C,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,C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Y,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CACjK,CAAC;AACF;;EAEE;AACF,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,GAAG,IAAI,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAErE;;EAEE;AAIF,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,GAAG,IAAI,WAAW,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC"}
|
package/build/database.js
CHANGED
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
5
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CollectionQueryParamsSchema = exports.CollectionSortSchema = exports.CollectionFilterSchema = exports.filterOpMap = void 0;
|
|
7
|
-
const jsonschema_definer_1 =
|
|
36
|
+
exports.DEFAULT_MAX_AGGREGATE_GROUP_SIZE = exports.DEFAULT_MAX_AGGREGATE_GROUPS = exports.CollectionQueryParamsSchema = exports.CollectionSortSchema = exports.CollectionFilterSchema = exports.collectionFilterSchemaWithId = exports.CollectionFilterInstanceSchema = exports.filterOpMap = void 0;
|
|
37
|
+
const jsonschema_definer_1 = __importStar(require("@bett3r-dev/jsonschema-definer"));
|
|
8
38
|
exports.filterOpMap = {
|
|
9
39
|
eq: (a, b) => a === b,
|
|
10
40
|
neq: (a, b) => a !== b,
|
|
@@ -12,30 +42,82 @@ exports.filterOpMap = {
|
|
|
12
42
|
gt: (a, b) => a > b,
|
|
13
43
|
lte: (a, b) => a <= b,
|
|
14
44
|
gte: (a, b) => a >= b,
|
|
15
|
-
in: (a, b) => b.includes(a),
|
|
16
|
-
nin: (a, b) => !b.includes(a),
|
|
17
|
-
contains: (a, b) => a.includes(b),
|
|
18
|
-
notContains: (a, b) => !a.includes(b),
|
|
19
|
-
some: (a, b) => a.some(x => b.includes(x)),
|
|
20
|
-
none: (a, b) => !a.some(x => b.includes(x)),
|
|
21
|
-
every: (a, b) => a.every(x => b.includes(x)),
|
|
45
|
+
in: (a, b) => (b || []).includes(a),
|
|
46
|
+
nin: (a, b) => !(b || []).includes(a),
|
|
47
|
+
contains: (a, b) => (a || []).includes(b),
|
|
48
|
+
notContains: (a, b) => !(a || []).includes(b),
|
|
49
|
+
some: (a, b) => (a || []).some(x => (b || []).includes(x)),
|
|
50
|
+
none: (a, b) => !(a || []).some(x => (b || []).includes(x)),
|
|
51
|
+
every: (a, b) => (a || []).every(x => (b || []).includes(x)),
|
|
22
52
|
exists: (a) => !!a,
|
|
23
|
-
notExists: (a) => !a
|
|
53
|
+
notExists: (a) => !a,
|
|
54
|
+
// Array-valued: matches a present, non-empty array. Distinct from `exists`
|
|
55
|
+
// (which is presence-only and is therefore degenerate-true for an always-`[]`
|
|
56
|
+
// field). No `value` operand.
|
|
57
|
+
notEmpty: (a) => Array.isArray(a) && a.length > 0
|
|
24
58
|
};
|
|
25
|
-
exports.
|
|
59
|
+
exports.CollectionFilterInstanceSchema = jsonschema_definer_1.default.shape({
|
|
26
60
|
field: jsonschema_definer_1.default.string(),
|
|
27
|
-
op: jsonschema_definer_1.default.enum(
|
|
61
|
+
op: jsonschema_definer_1.default.string().enum('eq', 'neq', 'lt', 'gt', 'lte', 'gte', 'in', 'nin', 'contains', 'notContains', 'some', 'none', 'every', 'exists', 'notExists', 'notEmpty'),
|
|
28
62
|
value: jsonschema_definer_1.default.any()
|
|
29
63
|
});
|
|
64
|
+
/**
|
|
65
|
+
* The recursive filter schema, PARAMETERISED BY `$id` — and the parameter is not a nicety.
|
|
66
|
+
*
|
|
67
|
+
* A schema document may carry a given `$id` only ONCE: ajv rejects a document that materialises
|
|
68
|
+
* the same `$id` twice with `reference "<id>" resolves to more than one schema`, and it does so at
|
|
69
|
+
* `compile` time, so the whole endpoint's validator dies rather than one field. That is exactly
|
|
70
|
+
* what happens the moment two properties of one document each embed a filter — as
|
|
71
|
+
* `ReadmodelDefaultQuerySchema` does, with `filter` and `aggregate.filter` (TV1-2342). The `$id` is
|
|
72
|
+
* load-bearing and cannot simply be dropped: it is the base against which the self-reference
|
|
73
|
+
* `#/$defs/<id>` resolves, which is what makes OR/AND recursive.
|
|
74
|
+
*
|
|
75
|
+
* So each EMBEDDING SITE takes its own id, from one definition. Add a site → give it a new id here.
|
|
76
|
+
*/
|
|
77
|
+
const collectionFilterSchemaWithId = (id) => jsonschema_definer_1.default.shape({})
|
|
78
|
+
.id(id)
|
|
79
|
+
.definition(id, jsonschema_definer_1.default.shape({
|
|
80
|
+
OR: jsonschema_definer_1.default.array().items(jsonschema_definer_1.default.ref(`#/$defs/${id}`))
|
|
81
|
+
.optional(),
|
|
82
|
+
AND: jsonschema_definer_1.default.array().items(jsonschema_definer_1.default.ref(`#/$defs/${id}`))
|
|
83
|
+
.optional(),
|
|
84
|
+
field: jsonschema_definer_1.default.string().optional(),
|
|
85
|
+
op: jsonschema_definer_1.default.string()
|
|
86
|
+
.enum('eq', 'neq', 'lt', 'gt', 'lte', 'gte', 'in', 'nin', 'contains', 'notContains', 'some', 'none', 'every', 'exists', 'notExists', 'notEmpty')
|
|
87
|
+
.optional(),
|
|
88
|
+
value: jsonschema_definer_1.default.any()
|
|
89
|
+
.optional()
|
|
90
|
+
})
|
|
91
|
+
.anyOf((new jsonschema_definer_1.BaseSchema()).raw({ required: ['OR'] }), (new jsonschema_definer_1.BaseSchema()).raw({ required: ['AND'] }), (new jsonschema_definer_1.BaseSchema()).raw({ required: ['field', 'op'] })))
|
|
92
|
+
.additionalProperties(true)
|
|
93
|
+
.ref(`#/$defs/${id}`);
|
|
94
|
+
exports.collectionFilterSchemaWithId = collectionFilterSchemaWithId;
|
|
95
|
+
exports.CollectionFilterSchema = (0, exports.collectionFilterSchemaWithId)('CollectionFilter');
|
|
30
96
|
exports.CollectionSortSchema = jsonschema_definer_1.default.shape({
|
|
31
97
|
field: jsonschema_definer_1.default.string(),
|
|
32
|
-
direction: jsonschema_definer_1.default.enum(
|
|
98
|
+
direction: jsonschema_definer_1.default.string().enum('asc', 'desc')
|
|
33
99
|
});
|
|
34
100
|
exports.CollectionQueryParamsSchema = jsonschema_definer_1.default.shape({
|
|
35
|
-
sort: jsonschema_definer_1.default.array().items(exports.CollectionSortSchema)
|
|
36
|
-
|
|
101
|
+
sort: jsonschema_definer_1.default.array().items(exports.CollectionSortSchema)
|
|
102
|
+
.optional(),
|
|
103
|
+
filter: jsonschema_definer_1.default.array().items(exports.CollectionFilterSchema)
|
|
104
|
+
.optional(),
|
|
37
105
|
limit: jsonschema_definer_1.default.number().optional(),
|
|
38
|
-
|
|
39
|
-
|
|
106
|
+
offset: jsonschema_definer_1.default.number().optional(),
|
|
107
|
+
// `string | number` — matches `CollectionQueryParams['after']`; the cursor is the key column's
|
|
108
|
+
// value, and readmodels are keyed on text OR numeric columns.
|
|
109
|
+
after: jsonschema_definer_1.default.anyOf(jsonschema_definer_1.default.string(), jsonschema_definer_1.default.number()).optional(),
|
|
110
|
+
select: jsonschema_definer_1.default.array().items(jsonschema_definer_1.default.string())
|
|
111
|
+
.optional(),
|
|
112
|
+
byDistinctField: jsonschema_definer_1.default.string().optional()
|
|
40
113
|
});
|
|
114
|
+
/**
|
|
115
|
+
* THE BOUND DEFAULTS, single-sourced here (TV1-2342, collapsed in /verify-build) because both
|
|
116
|
+
* adapters apply them and the shared conformance suite pins BOTH to these exact numbers. They
|
|
117
|
+
* previously lived as literals in the Postgres adapter with a hand-copied pair in MemoryDb —
|
|
118
|
+
* two sites, one contract, and nothing but a test standing between them and a silent drift.
|
|
119
|
+
* `pv3-types` is the one package both adapters already depend on.
|
|
120
|
+
*/
|
|
121
|
+
exports.DEFAULT_MAX_AGGREGATE_GROUPS = 1000;
|
|
122
|
+
exports.DEFAULT_MAX_AGGREGATE_GROUP_SIZE = 50000;
|
|
41
123
|
//# sourceMappingURL=database.js.map
|
package/build/database.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.js","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,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