@woltz/rich-domain 0.2.2 → 1.1.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 +23 -75
- package/LICENSE +20 -20
- package/README.md +37 -20
- package/dist/base-entity.d.ts +2 -2
- package/dist/base-entity.d.ts.map +1 -1
- package/dist/base-entity.js +6 -4
- package/dist/base-entity.js.map +1 -1
- package/dist/criteria.d.ts +5 -11
- package/dist/criteria.d.ts.map +1 -1
- package/dist/criteria.js +4 -3
- package/dist/criteria.js.map +1 -1
- package/dist/deep-proxy.d.ts +3 -1
- package/dist/deep-proxy.d.ts.map +1 -1
- package/dist/deep-proxy.js +116 -29
- package/dist/deep-proxy.js.map +1 -1
- package/dist/domain-event-bus.d.ts +5 -6
- package/dist/domain-event-bus.d.ts.map +1 -1
- package/dist/domain-event-bus.js +3 -11
- package/dist/domain-event-bus.js.map +1 -1
- package/dist/domain-event.d.ts +1 -31
- package/dist/domain-event.d.ts.map +1 -1
- package/dist/domain-event.js +2 -1
- package/dist/domain-event.js.map +1 -1
- package/dist/entity.d.ts +2 -2
- package/dist/entity.js +1 -1
- package/dist/exceptions.d.ts +251 -0
- package/dist/exceptions.d.ts.map +1 -0
- package/dist/exceptions.js +321 -0
- package/dist/exceptions.js.map +1 -0
- package/dist/id.d.ts +3 -3
- package/dist/id.d.ts.map +1 -1
- package/dist/id.js +15 -4
- package/dist/id.js.map +1 -1
- package/dist/index.d.ts +2 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -8
- package/dist/index.js.map +1 -1
- package/dist/paginated-result.d.ts.map +1 -1
- package/dist/paginated-result.js +12 -1
- package/dist/paginated-result.js.map +1 -1
- package/dist/repository/index.d.ts +2 -39
- package/dist/repository/index.d.ts.map +1 -1
- package/dist/repository/index.js +2 -39
- package/dist/repository/index.js.map +1 -1
- package/dist/repository/unit-of-work.d.ts +0 -11
- package/dist/repository/unit-of-work.d.ts.map +1 -1
- package/dist/repository/unit-of-work.js +0 -35
- package/dist/repository/unit-of-work.js.map +1 -1
- package/dist/types/criteria.d.ts +6 -2
- package/dist/types/criteria.d.ts.map +1 -1
- package/dist/types/criteria.js +1 -1
- package/dist/types/criteria.js.map +1 -1
- package/dist/types/domain-event.d.ts +32 -0
- package/dist/types/domain-event.d.ts.map +1 -0
- package/dist/types/domain-event.js +2 -0
- package/dist/types/domain-event.js.map +1 -0
- package/dist/types/domain.d.ts +2 -2
- package/dist/types/domain.d.ts.map +1 -1
- package/dist/types/history-tracker.d.ts +1 -1
- package/dist/types/history-tracker.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/value-object.d.ts +1 -1
- package/dist/value-object.d.ts.map +1 -1
- package/dist/value-object.js +2 -5
- package/dist/value-object.js.map +1 -1
- package/eslint.config.js +3 -3
- package/jest.config.js +1 -1
- package/package.json +14 -20
- package/src/base-entity.ts +6 -5
- package/src/criteria.ts +11 -11
- package/src/deep-proxy.ts +447 -339
- package/src/domain-event-bus.ts +152 -166
- package/src/domain-event.ts +53 -90
- package/src/entity.ts +16 -16
- package/src/exceptions.ts +435 -0
- package/src/id.ts +107 -94
- package/src/index.ts +26 -9
- package/src/paginated-result.ts +14 -1
- package/src/repository/index.ts +2 -44
- package/src/repository/unit-of-work.ts +1 -44
- package/src/types/criteria.ts +7 -2
- package/src/types/domain-event.ts +38 -0
- package/src/types/domain.ts +2 -3
- package/src/types/history-tracker.ts +1 -1
- package/src/types/index.ts +1 -0
- package/src/validation-error.ts +97 -97
- package/src/value-object.ts +3 -6
- package/tests/criteria.test.ts +8 -0
- package/tests/domain-events.test.ts +431 -445
- package/tests/entity-validation.test.ts +2 -2
- package/tests/entity.test.ts +33 -33
- package/tests/history-tracker.spec.ts +57 -17
- package/tests/id.test.ts +341 -341
- package/tests/repository.test.ts +8 -4
- package/tests/to-json.test.ts +103 -91
- package/tests/utils.ts +254 -151
- package/tests/value-object-validation.test.ts +0 -9
- package/tests/value-objects.test.ts +52 -52
- package/tsconfig.json +2 -24
- package/.github/workflows/ci.yml +0 -40
- package/.husky/commit-msg +0 -1
- package/.husky/pre-commit +0 -1
- package/.vscode/settings.json +0 -3
- package/commitlint.config.js +0 -23
- package/dist/filtering.d.ts +0 -107
- package/dist/filtering.d.ts.map +0 -1
- package/dist/filtering.js +0 -202
- package/dist/filtering.js.map +0 -1
- package/dist/ordering.d.ts +0 -93
- package/dist/ordering.d.ts.map +0 -1
- package/dist/ordering.js +0 -154
- package/dist/ordering.js.map +0 -1
- package/dist/pagination.d.ts +0 -218
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pagination.js +0 -281
- package/dist/pagination.js.map +0 -1
- package/dist/repository/in-memory-repository.d.ts +0 -50
- package/dist/repository/in-memory-repository.d.ts.map +0 -1
- package/dist/repository/in-memory-repository.js +0 -93
- package/dist/repository/in-memory-repository.js.map +0 -1
- package/dist/repository/mapper.d.ts +0 -56
- package/dist/repository/mapper.d.ts.map +0 -1
- package/dist/repository/mapper.js +0 -15
- package/dist/repository/mapper.js.map +0 -1
- package/dist/repository/types.d.ts +0 -87
- package/dist/repository/types.d.ts.map +0 -1
- package/dist/repository/types.js +0 -6
- package/dist/repository/types.js.map +0 -1
- package/dist/repository.d.ts +0 -2
- package/dist/repository.d.ts.map +0 -1
- package/dist/repository.js +0 -21
- package/dist/repository.js.map +0 -1
- package/dist/specification.d.ts +0 -102
- package/dist/specification.d.ts.map +0 -1
- package/dist/specification.js +0 -187
- package/dist/specification.js.map +0 -1
- package/dist/types/repository.d.ts +0 -43
- package/dist/types/repository.d.ts.map +0 -1
- package/dist/types/repository.js +0 -2
- package/dist/types/repository.js.map +0 -1
- package/dist/types.d.ts +0 -88
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -12
- package/dist/types.js.map +0 -1
- package/src/repository/in-memory-repository.ts +0 -116
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { Address } from "./utils";
|
|
2
|
-
|
|
3
|
-
describe("Value Object", () => {
|
|
4
|
-
it("should create immutable value object", () => {
|
|
5
|
-
const address = new Address({
|
|
6
|
-
street: "Main St",
|
|
7
|
-
city: "NYC",
|
|
8
|
-
zipCode: "10001",
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
expect(address.street).toBe("Main St");
|
|
12
|
-
expect(address.city).toBe("NYC");
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it("should compare value objects by value", () => {
|
|
16
|
-
const address1 = new Address({
|
|
17
|
-
street: "Main St",
|
|
18
|
-
city: "NYC",
|
|
19
|
-
zipCode: "10001",
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const address2 = new Address({
|
|
23
|
-
street: "Main St",
|
|
24
|
-
city: "NYC",
|
|
25
|
-
zipCode: "10001",
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const address3 = new Address({
|
|
29
|
-
street: "Broadway",
|
|
30
|
-
city: "NYC",
|
|
31
|
-
zipCode: "10001",
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
expect(address1.equals(address2)).toBe(true);
|
|
35
|
-
expect(address1.equals(address3)).toBe(false);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("should convert value object to JSON", () => {
|
|
39
|
-
const address = new Address({
|
|
40
|
-
street: "Main St",
|
|
41
|
-
city: "NYC",
|
|
42
|
-
zipCode: "10001",
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const json = address.toJson();
|
|
46
|
-
expect(json).toEqual({
|
|
47
|
-
street: "Main St",
|
|
48
|
-
city: "NYC",
|
|
49
|
-
zipCode: "10001",
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
});
|
|
1
|
+
import { Address } from "./utils";
|
|
2
|
+
|
|
3
|
+
describe("Value Object", () => {
|
|
4
|
+
it("should create immutable value object", () => {
|
|
5
|
+
const address = new Address({
|
|
6
|
+
street: "Main St",
|
|
7
|
+
city: "NYC",
|
|
8
|
+
zipCode: "10001",
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
expect(address.street).toBe("Main St");
|
|
12
|
+
expect(address.city).toBe("NYC");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("should compare value objects by value", () => {
|
|
16
|
+
const address1 = new Address({
|
|
17
|
+
street: "Main St",
|
|
18
|
+
city: "NYC",
|
|
19
|
+
zipCode: "10001",
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const address2 = new Address({
|
|
23
|
+
street: "Main St",
|
|
24
|
+
city: "NYC",
|
|
25
|
+
zipCode: "10001",
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const address3 = new Address({
|
|
29
|
+
street: "Broadway",
|
|
30
|
+
city: "NYC",
|
|
31
|
+
zipCode: "10001",
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
expect(address1.equals(address2)).toBe(true);
|
|
35
|
+
expect(address1.equals(address3)).toBe(false);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("should convert value object to JSON", () => {
|
|
39
|
+
const address = new Address({
|
|
40
|
+
street: "Main St",
|
|
41
|
+
city: "NYC",
|
|
42
|
+
zipCode: "10001",
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const json = address.toJson();
|
|
46
|
+
expect(json).toEqual({
|
|
47
|
+
street: "Main St",
|
|
48
|
+
city: "NYC",
|
|
49
|
+
zipCode: "10001",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
});
|
package/tsconfig.json
CHANGED
|
@@ -1,30 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"lib": ["ES2020"],
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"sourceMap": true,
|
|
9
4
|
"outDir": "./dist",
|
|
10
|
-
"rootDir": "./src"
|
|
11
|
-
"strict": true,
|
|
12
|
-
"noImplicitAny": true,
|
|
13
|
-
"strictNullChecks": true,
|
|
14
|
-
"strictFunctionTypes": true,
|
|
15
|
-
"strictBindCallApply": true,
|
|
16
|
-
"strictPropertyInitialization": true,
|
|
17
|
-
"noImplicitThis": true,
|
|
18
|
-
"alwaysStrict": true,
|
|
19
|
-
"noUnusedLocals": false,
|
|
20
|
-
"noUnusedParameters": false,
|
|
21
|
-
"noImplicitReturns": true,
|
|
22
|
-
"noFallthroughCasesInSwitch": true,
|
|
23
|
-
"moduleResolution": "bundler",
|
|
24
|
-
"esModuleInterop": true,
|
|
25
|
-
"skipLibCheck": true,
|
|
26
|
-
"forceConsistentCasingInFileNames": true,
|
|
27
|
-
"resolveJsonModule": true
|
|
5
|
+
"rootDir": "./src"
|
|
28
6
|
},
|
|
29
7
|
"include": ["src/**/*"],
|
|
30
8
|
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"]
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ main ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ main ]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
test:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
|
-
strategy:
|
|
14
|
-
matrix:
|
|
15
|
-
node-version: [20.x]
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- name: Checkout code
|
|
19
|
-
uses: actions/checkout@v4
|
|
20
|
-
|
|
21
|
-
- name: Setup Node.js ${{ matrix.node-version }}
|
|
22
|
-
uses: actions/setup-node@v4
|
|
23
|
-
with:
|
|
24
|
-
node-version: ${{ matrix.node-version }}
|
|
25
|
-
cache: 'npm'
|
|
26
|
-
|
|
27
|
-
- name: Install dependencies
|
|
28
|
-
run: npm ci
|
|
29
|
-
|
|
30
|
-
- name: Run linter
|
|
31
|
-
run: npm run lint
|
|
32
|
-
|
|
33
|
-
- name: Run type checking
|
|
34
|
-
run: npx tsc --noEmit
|
|
35
|
-
|
|
36
|
-
- name: Run tests
|
|
37
|
-
run: npm test
|
|
38
|
-
|
|
39
|
-
- name: Build
|
|
40
|
-
run: npm run build
|
package/.husky/commit-msg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npx --no -- commitlint --edit $1
|
package/.husky/pre-commit
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npm test
|
package/.vscode/settings.json
DELETED
package/commitlint.config.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['@commitlint/config-conventional'],
|
|
3
|
-
rules: {
|
|
4
|
-
'type-enum': [
|
|
5
|
-
2,
|
|
6
|
-
'always',
|
|
7
|
-
[
|
|
8
|
-
'feat',
|
|
9
|
-
'fix',
|
|
10
|
-
'docs',
|
|
11
|
-
'style',
|
|
12
|
-
'refactor',
|
|
13
|
-
'perf',
|
|
14
|
-
'test',
|
|
15
|
-
'chore',
|
|
16
|
-
'revert',
|
|
17
|
-
'ci',
|
|
18
|
-
'build'
|
|
19
|
-
]
|
|
20
|
-
],
|
|
21
|
-
'subject-case': [0]
|
|
22
|
-
}
|
|
23
|
-
};
|
package/dist/filtering.d.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Supported filter operators
|
|
3
|
-
*/
|
|
4
|
-
export type FilterOperator = "equals" | "notEquals" | "greaterThan" | "greaterThanOrEquals" | "lessThan" | "lessThanOrEquals" | "in" | "notIn" | "contains" | "startsWith" | "endsWith" | "isNull" | "isNotNull";
|
|
5
|
-
/**
|
|
6
|
-
* Configuration for a single filter
|
|
7
|
-
*/
|
|
8
|
-
export interface FilterConfig<T> {
|
|
9
|
-
field: keyof T | string;
|
|
10
|
-
operator: FilterOperator;
|
|
11
|
-
value?: any;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Represents a single filter condition
|
|
15
|
-
* Can be used for in-memory filtering or converted to database-specific queries
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* const filter = new Filter('age', 'greaterThan', 18);
|
|
20
|
-
* const adults = users.filter(filter.predicateFn());
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare class Filter<T> {
|
|
24
|
-
private readonly _field;
|
|
25
|
-
private readonly _operator;
|
|
26
|
-
private readonly _value?;
|
|
27
|
-
constructor(field: keyof T | string, operator: FilterOperator, value?: any);
|
|
28
|
-
/**
|
|
29
|
-
* Gets the field to filter
|
|
30
|
-
*/
|
|
31
|
-
get field(): keyof T | string;
|
|
32
|
-
/**
|
|
33
|
-
* Gets the filter operator
|
|
34
|
-
*/
|
|
35
|
-
get operator(): FilterOperator;
|
|
36
|
-
/**
|
|
37
|
-
* Gets the filter value
|
|
38
|
-
*/
|
|
39
|
-
get value(): any;
|
|
40
|
-
/**
|
|
41
|
-
* Returns configuration object for serialization
|
|
42
|
-
*/
|
|
43
|
-
toConfig(): FilterConfig<T>;
|
|
44
|
-
/**
|
|
45
|
-
* Checks if the operator requires a value
|
|
46
|
-
* @private
|
|
47
|
-
*/
|
|
48
|
-
private requiresValue;
|
|
49
|
-
/**
|
|
50
|
-
* Creates a predicate function for in-memory filtering
|
|
51
|
-
* Handles nested properties using dot notation (e.g., "address.city")
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```typescript
|
|
55
|
-
* const filter = new Filter<User>('age', 'greaterThan', 18);
|
|
56
|
-
* const adults = users.filter(filter.predicateFn());
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
predicateFn(): (item: T) => boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Gets nested property value using dot notation
|
|
62
|
-
* @private
|
|
63
|
-
*/
|
|
64
|
-
private getNestedValue;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Logical operator for combining filters
|
|
68
|
-
*/
|
|
69
|
-
export type LogicalOperator = "and" | "or";
|
|
70
|
-
/**
|
|
71
|
-
* Represents a composite filter that combines multiple filters with AND/OR logic
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```typescript
|
|
75
|
-
* const composite = new CompositeFilter<User>('and', [
|
|
76
|
-
* new Filter('age', 'greaterThan', 18),
|
|
77
|
-
* new Filter('status', 'equals', 'active')
|
|
78
|
-
* ]);
|
|
79
|
-
* const filtered = users.filter(composite.predicateFn());
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
export declare class CompositeFilter<T> {
|
|
83
|
-
private readonly _operator;
|
|
84
|
-
private readonly _filters;
|
|
85
|
-
constructor(operator: LogicalOperator, filters: (Filter<T> | CompositeFilter<T>)[]);
|
|
86
|
-
/**
|
|
87
|
-
* Gets the logical operator
|
|
88
|
-
*/
|
|
89
|
-
get operator(): LogicalOperator;
|
|
90
|
-
/**
|
|
91
|
-
* Gets all filters
|
|
92
|
-
*/
|
|
93
|
-
get filters(): readonly (Filter<T> | CompositeFilter<T>)[];
|
|
94
|
-
/**
|
|
95
|
-
* Creates a predicate function that applies the logical operator
|
|
96
|
-
*/
|
|
97
|
-
predicateFn(): (item: T) => boolean;
|
|
98
|
-
/**
|
|
99
|
-
* Adds another filter with AND logic
|
|
100
|
-
*/
|
|
101
|
-
and(filter: Filter<T> | CompositeFilter<T>): CompositeFilter<T>;
|
|
102
|
-
/**
|
|
103
|
-
* Adds another filter with OR logic
|
|
104
|
-
*/
|
|
105
|
-
or(filter: Filter<T> | CompositeFilter<T>): CompositeFilter<T>;
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=filtering.d.ts.map
|
package/dist/filtering.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["../src/filtering.ts"],"names":[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QAAQ,CAAC,QAAQ,CAAqC;gBAElD,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE;IAQlF;;OAEG;IACH,IAAI,QAAQ,IAAI,eAAe,CAE9B;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAEzD;IAED;;OAEG;IACH,WAAW,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO;IAWnC;;OAEG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC;IAU/D;;OAEG;IACH,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC;CAS/D"}
|
package/dist/filtering.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// ============================================================================
|
|
3
|
-
// Filtering System
|
|
4
|
-
// ============================================================================
|
|
5
|
-
// Provides filtering/where clause capabilities for queries and in-memory collections
|
|
6
|
-
// Supports common comparison operators and can be extended for custom operators
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.CompositeFilter = exports.Filter = void 0;
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// Filter Class
|
|
11
|
-
// ============================================================================
|
|
12
|
-
/**
|
|
13
|
-
* Represents a single filter condition
|
|
14
|
-
* Can be used for in-memory filtering or converted to database-specific queries
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const filter = new Filter('age', 'greaterThan', 18);
|
|
19
|
-
* const adults = users.filter(filter.predicateFn());
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
class Filter {
|
|
23
|
-
constructor(field, operator, value) {
|
|
24
|
-
this._field = field;
|
|
25
|
-
this._operator = operator;
|
|
26
|
-
this._value = value;
|
|
27
|
-
// Validate that value is provided when required
|
|
28
|
-
if (this.requiresValue() && value === undefined) {
|
|
29
|
-
throw new Error(`Filter operator '${operator}' requires a value`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Gets the field to filter
|
|
34
|
-
*/
|
|
35
|
-
get field() {
|
|
36
|
-
return this._field;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Gets the filter operator
|
|
40
|
-
*/
|
|
41
|
-
get operator() {
|
|
42
|
-
return this._operator;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Gets the filter value
|
|
46
|
-
*/
|
|
47
|
-
get value() {
|
|
48
|
-
return this._value;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Returns configuration object for serialization
|
|
52
|
-
*/
|
|
53
|
-
toConfig() {
|
|
54
|
-
return {
|
|
55
|
-
field: this._field,
|
|
56
|
-
operator: this._operator,
|
|
57
|
-
value: this._value,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Checks if the operator requires a value
|
|
62
|
-
* @private
|
|
63
|
-
*/
|
|
64
|
-
requiresValue() {
|
|
65
|
-
return this._operator !== "isNull" && this._operator !== "isNotNull";
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Creates a predicate function for in-memory filtering
|
|
69
|
-
* Handles nested properties using dot notation (e.g., "address.city")
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```typescript
|
|
73
|
-
* const filter = new Filter<User>('age', 'greaterThan', 18);
|
|
74
|
-
* const adults = users.filter(filter.predicateFn());
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
predicateFn() {
|
|
78
|
-
return (item) => {
|
|
79
|
-
const fieldValue = this.getNestedValue(item, this._field);
|
|
80
|
-
switch (this._operator) {
|
|
81
|
-
case "equals":
|
|
82
|
-
return fieldValue === this._value;
|
|
83
|
-
case "notEquals":
|
|
84
|
-
return fieldValue !== this._value;
|
|
85
|
-
case "greaterThan":
|
|
86
|
-
return fieldValue > this._value;
|
|
87
|
-
case "greaterThanOrEquals":
|
|
88
|
-
return fieldValue >= this._value;
|
|
89
|
-
case "lessThan":
|
|
90
|
-
return fieldValue < this._value;
|
|
91
|
-
case "lessThanOrEquals":
|
|
92
|
-
return fieldValue <= this._value;
|
|
93
|
-
case "in":
|
|
94
|
-
return Array.isArray(this._value) && this._value.includes(fieldValue);
|
|
95
|
-
case "notIn":
|
|
96
|
-
return Array.isArray(this._value) && !this._value.includes(fieldValue);
|
|
97
|
-
case "contains":
|
|
98
|
-
return (typeof fieldValue === "string" &&
|
|
99
|
-
typeof this._value === "string" &&
|
|
100
|
-
fieldValue.includes(this._value));
|
|
101
|
-
case "startsWith":
|
|
102
|
-
return (typeof fieldValue === "string" &&
|
|
103
|
-
typeof this._value === "string" &&
|
|
104
|
-
fieldValue.startsWith(this._value));
|
|
105
|
-
case "endsWith":
|
|
106
|
-
return (typeof fieldValue === "string" &&
|
|
107
|
-
typeof this._value === "string" &&
|
|
108
|
-
fieldValue.endsWith(this._value));
|
|
109
|
-
case "isNull":
|
|
110
|
-
return fieldValue === null || fieldValue === undefined;
|
|
111
|
-
case "isNotNull":
|
|
112
|
-
return fieldValue !== null && fieldValue !== undefined;
|
|
113
|
-
default:
|
|
114
|
-
// This should never happen with proper typing
|
|
115
|
-
throw new Error(`Unknown filter operator: ${this._operator}`);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Gets nested property value using dot notation
|
|
121
|
-
* @private
|
|
122
|
-
*/
|
|
123
|
-
getNestedValue(obj, path) {
|
|
124
|
-
return path.split(".").reduce((current, prop) => current?.[prop], obj);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
exports.Filter = Filter;
|
|
128
|
-
/**
|
|
129
|
-
* Represents a composite filter that combines multiple filters with AND/OR logic
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* ```typescript
|
|
133
|
-
* const composite = new CompositeFilter<User>('and', [
|
|
134
|
-
* new Filter('age', 'greaterThan', 18),
|
|
135
|
-
* new Filter('status', 'equals', 'active')
|
|
136
|
-
* ]);
|
|
137
|
-
* const filtered = users.filter(composite.predicateFn());
|
|
138
|
-
* ```
|
|
139
|
-
*/
|
|
140
|
-
class CompositeFilter {
|
|
141
|
-
constructor(operator, filters) {
|
|
142
|
-
if (filters.length === 0) {
|
|
143
|
-
throw new Error("At least one filter is required");
|
|
144
|
-
}
|
|
145
|
-
this._operator = operator;
|
|
146
|
-
this._filters = filters;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Gets the logical operator
|
|
150
|
-
*/
|
|
151
|
-
get operator() {
|
|
152
|
-
return this._operator;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Gets all filters
|
|
156
|
-
*/
|
|
157
|
-
get filters() {
|
|
158
|
-
return this._filters;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Creates a predicate function that applies the logical operator
|
|
162
|
-
*/
|
|
163
|
-
predicateFn() {
|
|
164
|
-
return (item) => {
|
|
165
|
-
if (this._operator === "and") {
|
|
166
|
-
return this._filters.every((filter) => filter.predicateFn()(item));
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
// OR
|
|
170
|
-
return this._filters.some((filter) => filter.predicateFn()(item));
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Adds another filter with AND logic
|
|
176
|
-
*/
|
|
177
|
-
and(filter) {
|
|
178
|
-
if (this._operator === "and") {
|
|
179
|
-
// Flatten if already AND
|
|
180
|
-
return new CompositeFilter("and", [...this._filters, filter]);
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
// Wrap in new AND
|
|
184
|
-
return new CompositeFilter("and", [this, filter]);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Adds another filter with OR logic
|
|
189
|
-
*/
|
|
190
|
-
or(filter) {
|
|
191
|
-
if (this._operator === "or") {
|
|
192
|
-
// Flatten if already OR
|
|
193
|
-
return new CompositeFilter("or", [...this._filters, filter]);
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
// Wrap in new OR
|
|
197
|
-
return new CompositeFilter("or", [this, filter]);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
exports.CompositeFilter = CompositeFilter;
|
|
202
|
-
//# sourceMappingURL=filtering.js.map
|
package/dist/filtering.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.js","sourceRoot":"","sources":["../src/filtering.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAC/E,qFAAqF;AACrF,gFAAgF;;;AA6BhF,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E;;;;;;;;;GASG;AACH,MAAa,MAAM;IAKjB,YAAY,KAAuB,EAAE,QAAwB,EAAE,KAAW;QACxE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEpB,gDAAgD;QAChD,IAAI,IAAI,CAAC,aAAa,EAAE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,oBAAoB,QAAQ,oBAAoB,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,IA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AAI,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;YAC5B,wBAAwB;YACxB,OAAO,IAAI,eAAe,CAAI,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;QAClE,CAAC;aAAM,CAAC;YACN,iBAAiB;YACjB,OAAO,IAAI,eAAe,CAAI,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CACF;AAjED,0CAiEC"}
|
package/dist/ordering.d.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Direction for ordering
|
|
3
|
-
*/
|
|
4
|
-
export type OrderDirection = "asc" | "desc";
|
|
5
|
-
/**
|
|
6
|
-
* Configuration for a single field ordering
|
|
7
|
-
*/
|
|
8
|
-
export interface OrderByConfig<T> {
|
|
9
|
-
field: keyof T | string;
|
|
10
|
-
direction: OrderDirection;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Represents ordering configuration for a specific field
|
|
14
|
-
* Can be used for in-memory sorting or converted to database-specific queries
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const orderBy = new OrderBy('name', 'asc');
|
|
19
|
-
* const items = users.sort(orderBy.compareFn());
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare class OrderBy<T> {
|
|
23
|
-
private readonly _field;
|
|
24
|
-
private readonly _direction;
|
|
25
|
-
constructor(field: keyof T | string, direction?: OrderDirection);
|
|
26
|
-
/**
|
|
27
|
-
* Gets the field to order by
|
|
28
|
-
*/
|
|
29
|
-
get field(): keyof T | string;
|
|
30
|
-
/**
|
|
31
|
-
* Gets the order direction
|
|
32
|
-
*/
|
|
33
|
-
get direction(): OrderDirection;
|
|
34
|
-
/**
|
|
35
|
-
* Returns configuration object for serialization
|
|
36
|
-
*/
|
|
37
|
-
toConfig(): OrderByConfig<T>;
|
|
38
|
-
/**
|
|
39
|
-
* Creates a comparison function for in-memory sorting
|
|
40
|
-
* Handles nested properties using dot notation (e.g., "address.city")
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```typescript
|
|
44
|
-
* const orderBy = new OrderBy<User>('name', 'asc');
|
|
45
|
-
* const sorted = users.sort(orderBy.compareFn());
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
compareFn(): (a: T, b: T) => number;
|
|
49
|
-
/**
|
|
50
|
-
* Gets nested property value using dot notation
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
private getNestedValue;
|
|
54
|
-
/**
|
|
55
|
-
* Creates a new OrderBy with reversed direction
|
|
56
|
-
*/
|
|
57
|
-
reverse(): OrderBy<T>;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Represents multiple ordering configurations
|
|
61
|
-
* Allows sorting by multiple fields with different directions
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```typescript
|
|
65
|
-
* const multiOrder = new MultiOrderBy<User>([
|
|
66
|
-
* new OrderBy('status', 'asc'),
|
|
67
|
-
* new OrderBy('name', 'asc')
|
|
68
|
-
* ]);
|
|
69
|
-
* const sorted = users.sort(multiOrder.compareFn());
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
export declare class MultiOrderBy<T> {
|
|
73
|
-
private readonly _orderings;
|
|
74
|
-
constructor(orderings: OrderBy<T>[]);
|
|
75
|
-
/**
|
|
76
|
-
* Gets all ordering configurations
|
|
77
|
-
*/
|
|
78
|
-
get orderings(): readonly OrderBy<T>[];
|
|
79
|
-
/**
|
|
80
|
-
* Returns array of configuration objects for serialization
|
|
81
|
-
*/
|
|
82
|
-
toConfig(): OrderByConfig<T>[];
|
|
83
|
-
/**
|
|
84
|
-
* Creates a comparison function that applies all orderings in sequence
|
|
85
|
-
* If first ordering produces a tie, moves to next ordering, and so on
|
|
86
|
-
*/
|
|
87
|
-
compareFn(): (a: T, b: T) => number;
|
|
88
|
-
/**
|
|
89
|
-
* Adds another ordering to the end of the list
|
|
90
|
-
*/
|
|
91
|
-
thenBy(field: keyof T | string, direction?: OrderDirection): MultiOrderBy<T>;
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=ordering.d.ts.map
|
package/dist/ordering.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ordering.d.ts","sourceRoot":"","sources":["../src/ordering.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC;IACxB,SAAS,EAAE,cAAc,CAAC;CAC3B;AAMD;;;;;;;;;GASG;AACH,qBAAa,OAAO,CAAC,CAAC;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiB;gBAEhC,KAAK,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,SAAS,GAAE,cAAsB;IAKtE;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAAC,GAAG,MAAM,CAE5B;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,cAAc,CAE9B;IAED;;OAEG;IACH,QAAQ,IAAI,aAAa,CAAC,CAAC,CAAC;IAO5B;;;;;;;;;OASG;IACH,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM;IAsBnC;;;OAGG;IACH,OAAO,CAAC,cAAc;IAItB;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC;CAItB;AAMD;;;;;;;;;;;;GAYG;AACH,qBAAa,YAAY,CAAC,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAe;gBAE9B,SAAS,EAAE,OAAO,CAAC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