@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.
Files changed (45) hide show
  1. package/package.json +4 -1
  2. package/CHANGELOG.md +0 -168
  3. package/__tests__/builder.test.ts +0 -363
  4. package/__tests__/cache.test.ts +0 -130
  5. package/__tests__/config.test.ts +0 -35
  6. package/__tests__/engine.test.ts +0 -1213
  7. package/__tests__/evaluate.test.ts +0 -339
  8. package/__tests__/exports.test.ts +0 -30
  9. package/__tests__/filter-sort.test.ts +0 -303
  10. package/__tests__/integration.test.ts +0 -419
  11. package/__tests__/money-integration.test.ts +0 -149
  12. package/__tests__/validation.test.ts +0 -862
  13. package/biome.json +0 -39
  14. package/docs/MIGRATION-v3.md +0 -118
  15. package/fot.config.ts +0 -5
  16. package/src/analyzer/analysis.ts +0 -401
  17. package/src/builder/conditions.ts +0 -321
  18. package/src/builder/rule.ts +0 -192
  19. package/src/cache/cache.ts +0 -135
  20. package/src/cache/noop.ts +0 -20
  21. package/src/core/evaluate.ts +0 -185
  22. package/src/core/filter.ts +0 -85
  23. package/src/core/group.ts +0 -103
  24. package/src/core/sort.ts +0 -90
  25. package/src/engine/engine.ts +0 -462
  26. package/src/engine/hooks.ts +0 -235
  27. package/src/engine/state.ts +0 -322
  28. package/src/index.ts +0 -303
  29. package/src/optimizer/index-builder.ts +0 -381
  30. package/src/serialization/serializer.ts +0 -408
  31. package/src/simulation/simulator.ts +0 -359
  32. package/src/types/config.ts +0 -184
  33. package/src/types/consequence.ts +0 -38
  34. package/src/types/evaluation.ts +0 -87
  35. package/src/types/rule.ts +0 -112
  36. package/src/types/state.ts +0 -116
  37. package/src/utils/conditions.ts +0 -108
  38. package/src/utils/hash.ts +0 -30
  39. package/src/utils/id.ts +0 -6
  40. package/src/utils/time.ts +0 -42
  41. package/src/validation/conflicts.ts +0 -440
  42. package/src/validation/integrity.ts +0 -473
  43. package/src/validation/schema.ts +0 -386
  44. package/src/versioning/version-store.ts +0 -337
  45. package/tsconfig.json +0 -29
@@ -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
- });