@f-o-t/rules-engine 3.0.0 → 3.0.1
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/package.json +4 -1
- package/CHANGELOG.md +0 -168
- package/__tests__/builder.test.ts +0 -363
- package/__tests__/cache.test.ts +0 -130
- package/__tests__/config.test.ts +0 -35
- package/__tests__/engine.test.ts +0 -1213
- package/__tests__/evaluate.test.ts +0 -339
- package/__tests__/exports.test.ts +0 -30
- package/__tests__/filter-sort.test.ts +0 -303
- package/__tests__/integration.test.ts +0 -419
- package/__tests__/money-integration.test.ts +0 -149
- package/__tests__/validation.test.ts +0 -862
- package/biome.json +0 -39
- package/docs/MIGRATION-v3.md +0 -118
- package/fot.config.ts +0 -5
- package/src/analyzer/analysis.ts +0 -401
- package/src/builder/conditions.ts +0 -321
- package/src/builder/rule.ts +0 -192
- package/src/cache/cache.ts +0 -135
- package/src/cache/noop.ts +0 -20
- package/src/core/evaluate.ts +0 -185
- package/src/core/filter.ts +0 -85
- package/src/core/group.ts +0 -103
- package/src/core/sort.ts +0 -90
- package/src/engine/engine.ts +0 -462
- package/src/engine/hooks.ts +0 -235
- package/src/engine/state.ts +0 -322
- package/src/index.ts +0 -303
- package/src/optimizer/index-builder.ts +0 -381
- package/src/serialization/serializer.ts +0 -408
- package/src/simulation/simulator.ts +0 -359
- package/src/types/config.ts +0 -184
- package/src/types/consequence.ts +0 -38
- package/src/types/evaluation.ts +0 -87
- package/src/types/rule.ts +0 -112
- package/src/types/state.ts +0 -116
- package/src/utils/conditions.ts +0 -108
- package/src/utils/hash.ts +0 -30
- package/src/utils/id.ts +0 -6
- package/src/utils/time.ts +0 -42
- package/src/validation/conflicts.ts +0 -440
- package/src/validation/integrity.ts +0 -473
- package/src/validation/schema.ts +0 -386
- package/src/versioning/version-store.ts +0 -337
- package/tsconfig.json +0 -29
package/__tests__/config.test.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { createEvaluator } from "@f-o-t/condition-evaluator";
|
|
3
|
-
import { createEngine } from "../src/engine/engine";
|
|
4
|
-
|
|
5
|
-
describe("Engine config with evaluator", () => {
|
|
6
|
-
test("should accept evaluator instance in config", () => {
|
|
7
|
-
const evaluator = createEvaluator();
|
|
8
|
-
|
|
9
|
-
const engine = createEngine({
|
|
10
|
-
evaluator,
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
expect(engine).toBeDefined();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
test("should accept operators map in config", () => {
|
|
17
|
-
const customOp = {
|
|
18
|
-
name: "custom_op" as const,
|
|
19
|
-
type: "custom" as const,
|
|
20
|
-
evaluate: () => true,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const engine = createEngine({
|
|
24
|
-
operators: { custom_op: customOp },
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
expect(engine).toBeDefined();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
test("should throw error if neither evaluator nor operators provided", () => {
|
|
31
|
-
expect(() => {
|
|
32
|
-
createEngine({});
|
|
33
|
-
}).toThrow("Engine requires either 'evaluator' or 'operators' config");
|
|
34
|
-
});
|
|
35
|
-
});
|