@enspirit/bmg-js 1.0.1 → 1.0.2
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.md +21 -0
- package/dist/{src/Relation → Relation}/Memory.d.ts +45 -46
- package/dist/{src/src/Relation → Relation}/index.d.ts +1 -1
- package/dist/bmg.cjs +1 -1
- package/dist/bmg.cjs.map +1 -1
- package/dist/bmg.modern.js +1 -1
- package/dist/bmg.modern.js.map +1 -1
- package/dist/bmg.module.js +1 -1
- package/dist/bmg.module.js.map +1 -1
- package/dist/bmg.umd.js +1 -1
- package/dist/bmg.umd.js.map +1 -1
- package/dist/index.d.ts +27 -1
- package/dist/lib-definitions.d.ts +1 -0
- package/dist/{src/operators → operators}/_helpers.d.ts +142 -142
- package/dist/{src/operators → operators}/allbut.d.ts +2 -2
- package/dist/{src/operators → operators}/autowrap.d.ts +2 -2
- package/dist/{src/operators → operators}/constants.d.ts +2 -2
- package/dist/{src/operators → operators}/cross_product.d.ts +3 -3
- package/dist/{src/operators → operators}/exclude.d.ts +2 -2
- package/dist/{src/operators → operators}/extend.d.ts +2 -2
- package/dist/{src/src/operators → operators}/group.d.ts +2 -2
- package/dist/{src/operators → operators}/image.d.ts +2 -2
- package/dist/{src/operators → operators}/index.d.ts +30 -30
- package/dist/{src/src/operators → operators}/intersect.d.ts +2 -2
- package/dist/{src/src/operators → operators}/isEqual.d.ts +2 -2
- package/dist/{src/operators → operators}/isRelation.d.ts +1 -1
- package/dist/{src/operators → operators}/join.d.ts +2 -2
- package/dist/{src/operators → operators}/left_join.d.ts +2 -2
- package/dist/{src/src/operators → operators}/matching.d.ts +2 -2
- package/dist/{src/src/operators → operators}/minus.d.ts +2 -2
- package/dist/{src/src/operators → operators}/not_matching.d.ts +2 -2
- package/dist/{src/operators → operators}/one.d.ts +2 -2
- package/dist/{src/operators → operators}/prefix.d.ts +2 -2
- package/dist/{src/src/operators → operators}/project.d.ts +2 -2
- package/dist/{src/operators → operators}/rename.d.ts +2 -2
- package/dist/{src/operators → operators}/restrict.d.ts +2 -2
- package/dist/{src/operators → operators}/suffix.d.ts +2 -2
- package/dist/{src/operators → operators}/summarize.d.ts +2 -2
- package/dist/{src/operators → operators}/transform.d.ts +2 -2
- package/dist/{src/src/operators → operators}/ungroup.d.ts +2 -2
- package/dist/{src/operators → operators}/union.d.ts +2 -2
- package/dist/{src/operators → operators}/unwrap.d.ts +2 -2
- package/dist/{src/operators → operators}/where.d.ts +1 -1
- package/dist/{src/operators → operators}/wrap.d.ts +2 -2
- package/dist/{src/operators → operators}/yByX.d.ts +2 -2
- package/dist/{src/src/support → support}/toPredicateFunc.d.ts +2 -2
- package/dist/{src/src/types.d.ts → types.d.ts} +162 -101
- package/package.json +6 -4
- package/src/Relation/Memory.ts +13 -12
- package/src/index.ts +1 -1
- package/src/lib-definitions.ts +281 -0
- package/src/types.ts +142 -54
- package/dist/src/Relation/index.d.ts +0 -1
- package/dist/src/Relation.d.ts +0 -8
- package/dist/src/index.d.ts +0 -27
- package/dist/src/operators/group.d.ts +0 -2
- package/dist/src/operators/intersect.d.ts +0 -2
- package/dist/src/operators/isEqual.d.ts +0 -2
- package/dist/src/operators/matching.d.ts +0 -2
- package/dist/src/operators/minus.d.ts +0 -2
- package/dist/src/operators/not_matching.d.ts +0 -2
- package/dist/src/operators/project.d.ts +0 -2
- package/dist/src/operators/ungroup.d.ts +0 -2
- package/dist/src/src/Relation/Memory.d.ts +0 -46
- package/dist/src/src/index.d.ts +0 -27
- package/dist/src/src/operators/_helpers.d.ts +0 -142
- package/dist/src/src/operators/allbut.d.ts +0 -2
- package/dist/src/src/operators/autowrap.d.ts +0 -2
- package/dist/src/src/operators/constants.d.ts +0 -2
- package/dist/src/src/operators/cross_product.d.ts +0 -3
- package/dist/src/src/operators/exclude.d.ts +0 -2
- package/dist/src/src/operators/extend.d.ts +0 -2
- package/dist/src/src/operators/image.d.ts +0 -2
- package/dist/src/src/operators/index.d.ts +0 -30
- package/dist/src/src/operators/isRelation.d.ts +0 -1
- package/dist/src/src/operators/join.d.ts +0 -2
- package/dist/src/src/operators/left_join.d.ts +0 -2
- package/dist/src/src/operators/one.d.ts +0 -2
- package/dist/src/src/operators/prefix.d.ts +0 -2
- package/dist/src/src/operators/rename.d.ts +0 -2
- package/dist/src/src/operators/restrict.d.ts +0 -2
- package/dist/src/src/operators/suffix.d.ts +0 -2
- package/dist/src/src/operators/summarize.d.ts +0 -2
- package/dist/src/src/operators/transform.d.ts +0 -2
- package/dist/src/src/operators/union.d.ts +0 -2
- package/dist/src/src/operators/unwrap.d.ts +0 -2
- package/dist/src/src/operators/where.d.ts +0 -1
- package/dist/src/src/operators/wrap.d.ts +0 -2
- package/dist/src/src/operators/yByX.d.ts +0 -2
- package/dist/src/src/utility-types.d.ts +0 -43
- package/dist/src/support/toPredicateFunc.d.ts +0 -2
- package/dist/src/tests/bmg.test.d.ts +0 -1
- package/dist/src/tests/fixtures.d.ts +0 -6
- package/dist/src/tests/operators/allbut.test.d.ts +0 -1
- package/dist/src/tests/operators/autowrap.test.d.ts +0 -1
- package/dist/src/tests/operators/constants.test.d.ts +0 -1
- package/dist/src/tests/operators/cross_product.test.d.ts +0 -1
- package/dist/src/tests/operators/exclude.test.d.ts +0 -1
- package/dist/src/tests/operators/extend.test.d.ts +0 -1
- package/dist/src/tests/operators/group.test.d.ts +0 -1
- package/dist/src/tests/operators/image.test.d.ts +0 -1
- package/dist/src/tests/operators/intersect.test.d.ts +0 -1
- package/dist/src/tests/operators/isEqual.test.d.ts +0 -1
- package/dist/src/tests/operators/join.test.d.ts +0 -1
- package/dist/src/tests/operators/left_join.test.d.ts +0 -1
- package/dist/src/tests/operators/matching.test.d.ts +0 -1
- package/dist/src/tests/operators/minus.test.d.ts +0 -1
- package/dist/src/tests/operators/not_matching.test.d.ts +0 -1
- package/dist/src/tests/operators/one.test.d.ts +0 -1
- package/dist/src/tests/operators/prefix.test.d.ts +0 -1
- package/dist/src/tests/operators/project.test.d.ts +0 -1
- package/dist/src/tests/operators/rename.test.d.ts +0 -1
- package/dist/src/tests/operators/restrict.test.d.ts +0 -1
- package/dist/src/tests/operators/suffix.test.d.ts +0 -1
- package/dist/src/tests/operators/summarize.test.d.ts +0 -1
- package/dist/src/tests/operators/transform.test.d.ts +0 -1
- package/dist/src/tests/operators/ungroup.test.d.ts +0 -1
- package/dist/src/tests/operators/union.test.d.ts +0 -1
- package/dist/src/tests/operators/unwrap.test.d.ts +0 -1
- package/dist/src/tests/operators/where.test.d.ts +0 -1
- package/dist/src/tests/operators/wrap.test.d.ts +0 -1
- package/dist/src/tests/operators/yByX.test.d.ts +0 -1
- package/dist/src/tests/types/relation.test.d.ts +0 -1
- package/dist/src/types.d.ts +0 -101
- package/dist/src/utility-types.d.ts +0 -43
- package/dist/tests/bmg.test.d.ts +0 -1
- package/dist/tests/fixtures.d.ts +0 -6
- package/dist/tests/operators/allbut.test.d.ts +0 -1
- package/dist/tests/operators/autowrap.test.d.ts +0 -1
- package/dist/tests/operators/constants.test.d.ts +0 -1
- package/dist/tests/operators/cross_product.test.d.ts +0 -1
- package/dist/tests/operators/exclude.test.d.ts +0 -1
- package/dist/tests/operators/extend.test.d.ts +0 -1
- package/dist/tests/operators/group.test.d.ts +0 -1
- package/dist/tests/operators/image.test.d.ts +0 -1
- package/dist/tests/operators/intersect.test.d.ts +0 -1
- package/dist/tests/operators/isEqual.test.d.ts +0 -1
- package/dist/tests/operators/join.test.d.ts +0 -1
- package/dist/tests/operators/left_join.test.d.ts +0 -1
- package/dist/tests/operators/matching.test.d.ts +0 -1
- package/dist/tests/operators/minus.test.d.ts +0 -1
- package/dist/tests/operators/not_matching.test.d.ts +0 -1
- package/dist/tests/operators/one.test.d.ts +0 -1
- package/dist/tests/operators/prefix.test.d.ts +0 -1
- package/dist/tests/operators/project.test.d.ts +0 -1
- package/dist/tests/operators/rename.test.d.ts +0 -1
- package/dist/tests/operators/restrict.test.d.ts +0 -1
- package/dist/tests/operators/suffix.test.d.ts +0 -1
- package/dist/tests/operators/summarize.test.d.ts +0 -1
- package/dist/tests/operators/transform.test.d.ts +0 -1
- package/dist/tests/operators/ungroup.test.d.ts +0 -1
- package/dist/tests/operators/union.test.d.ts +0 -1
- package/dist/tests/operators/unwrap.test.d.ts +0 -1
- package/dist/tests/operators/where.test.d.ts +0 -1
- package/dist/tests/operators/wrap.test.d.ts +0 -1
- package/dist/tests/operators/yByX.test.d.ts +0 -1
- package/dist/tests/types/relation.test.d.ts +0 -1
- package/src/utility-types.ts +0 -77
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/utility-types.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility types for type transformations in relational operators.
|
|
3
|
-
* These enable compile-time tracking of how operators transform tuple types.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { Tuple } from './types';
|
|
7
|
-
|
|
8
|
-
// ============================================================================
|
|
9
|
-
// Rename Types
|
|
10
|
-
// ============================================================================
|
|
11
|
-
|
|
12
|
-
/** Map from old attribute names to new attribute names */
|
|
13
|
-
export type RenameMap<T> = { [K in keyof T]?: string };
|
|
14
|
-
|
|
15
|
-
/** Transform tuple type by renaming keys according to RenameMap */
|
|
16
|
-
export type Renamed<T, R extends RenameMap<T>> = {
|
|
17
|
-
[K in keyof T as K extends keyof R ? (R[K] extends string ? R[K] : K) : K]: T[K];
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// ============================================================================
|
|
21
|
-
// Prefix/Suffix Types
|
|
22
|
-
// ============================================================================
|
|
23
|
-
|
|
24
|
-
/** Prefix all keys except those in Except */
|
|
25
|
-
export type Prefixed<T, P extends string, Except extends keyof T = never> = {
|
|
26
|
-
[K in keyof T as K extends Except ? K : `${P}${K & string}`]: T[K];
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/** Suffix all keys except those in Except */
|
|
30
|
-
export type Suffixed<T, S extends string, Except extends keyof T = never> = {
|
|
31
|
-
[K in keyof T as K extends Except ? K : `${K & string}${S}`]: T[K];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// ============================================================================
|
|
35
|
-
// Join Types
|
|
36
|
-
// ============================================================================
|
|
37
|
-
|
|
38
|
-
/** Extract common keys between two tuple types */
|
|
39
|
-
export type CommonKeys<L, R> = Extract<keyof L, keyof R>;
|
|
40
|
-
|
|
41
|
-
/** Result of inner join: L & R with R's common keys removed */
|
|
42
|
-
export type Joined<L, R> = L & Omit<R, CommonKeys<L, R>>;
|
|
43
|
-
|
|
44
|
-
/** Result of left join: L & optional R attributes (common keys removed) */
|
|
45
|
-
export type LeftJoined<L, R> = L & Partial<Omit<R, CommonKeys<L, R>>>;
|
|
46
|
-
|
|
47
|
-
// ============================================================================
|
|
48
|
-
// Wrap/Unwrap Types
|
|
49
|
-
// ============================================================================
|
|
50
|
-
|
|
51
|
-
/** Result of wrap: remove wrapped attrs, add nested object */
|
|
52
|
-
export type Wrapped<T, K extends keyof T, As extends string> =
|
|
53
|
-
Omit<T, K> & Record<As, Pick<T, K>>;
|
|
54
|
-
|
|
55
|
-
/** Result of unwrap: remove object attr, spread its properties */
|
|
56
|
-
export type Unwrapped<T, K extends keyof T> =
|
|
57
|
-
T[K] extends Record<string, unknown> ? Omit<T, K> & T[K] : Omit<T, K>;
|
|
58
|
-
|
|
59
|
-
// Note: Ungrouped is defined in types.ts since it references Relation
|
|
60
|
-
|
|
61
|
-
// ============================================================================
|
|
62
|
-
// Aggregator Result Types
|
|
63
|
-
// ============================================================================
|
|
64
|
-
|
|
65
|
-
/** Infer result type from aggregator specification */
|
|
66
|
-
export type AggregatorResult<A> =
|
|
67
|
-
A extends 'count' ? number :
|
|
68
|
-
A extends { op: 'count' } ? number :
|
|
69
|
-
A extends { op: 'sum' | 'avg' | 'min' | 'max' } ? number | null :
|
|
70
|
-
A extends { op: 'collect' } ? unknown[] :
|
|
71
|
-
A extends (tuples: Tuple[]) => infer R ? R :
|
|
72
|
-
unknown;
|
|
73
|
-
|
|
74
|
-
/** Map aggregator definitions to their result types */
|
|
75
|
-
export type AggregatorResults<Aggs extends Record<string, unknown>> = {
|
|
76
|
-
[K in keyof Aggs]: AggregatorResult<Aggs[K]>;
|
|
77
|
-
};
|