@fibery/expression-utils 9.7.3 → 10.0.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.
Files changed (53) hide show
  1. package/lib/_virtual/_rolldown/runtime.js +13 -0
  2. package/lib/index.d.ts +191 -585
  3. package/lib/index.js +15 -50
  4. package/lib/src/context-variables.d.ts +27 -22
  5. package/lib/src/context-variables.js +106 -138
  6. package/lib/src/errors.d.ts +5 -2
  7. package/lib/src/errors.js +14 -14
  8. package/lib/src/field-expression-visitor-type-aware.d.ts +18 -16
  9. package/lib/src/field-expression-visitor-type-aware.js +116 -131
  10. package/lib/src/filter-expression/index.d.ts +12 -9
  11. package/lib/src/filter-expression/index.js +34 -47
  12. package/lib/src/filter-expression/operator-utils.d.ts +14 -11
  13. package/lib/src/filter-expression/operator-utils.js +191 -185
  14. package/lib/src/filter-expression/operators.d.ts +111 -106
  15. package/lib/src/filter-expression/operators.js +1130 -846
  16. package/lib/src/filter-expression/pattern-match-placeholders.d.ts +63 -61
  17. package/lib/src/filter-expression/pattern-match-placeholders.js +107 -138
  18. package/lib/src/filter-expression/pattern-match.d.ts +17 -15
  19. package/lib/src/filter-expression/pattern-match.js +118 -130
  20. package/lib/src/filter-expression/pattern-to-expression.d.ts +13 -11
  21. package/lib/src/filter-expression/pattern-to-expression.js +42 -45
  22. package/lib/src/filter-expression/types.d.ts +29 -26
  23. package/lib/src/filter-expression/types.js +0 -3
  24. package/lib/src/params-placeholders.d.ts +55 -51
  25. package/lib/src/params-placeholders.js +199 -192
  26. package/lib/src/tsfixme.d.ts +4 -1
  27. package/lib/src/tsfixme.js +0 -3
  28. package/lib/src/types.d.ts +47 -45
  29. package/lib/src/types.js +0 -3
  30. package/lib/src/utils.d.ts +53 -48
  31. package/lib/src/utils.js +276 -337
  32. package/lib/src/visitors.d.ts +43 -37
  33. package/lib/src/visitors.js +306 -365
  34. package/lib/test-data/schema-mock.d.ts +68 -751
  35. package/lib/test-data/schema-mock.js +175 -139
  36. package/package.json +17 -10
  37. package/lib/index.js.map +0 -1
  38. package/lib/src/context-variables.js.map +0 -1
  39. package/lib/src/errors.js.map +0 -1
  40. package/lib/src/field-expression-visitor-type-aware.js.map +0 -1
  41. package/lib/src/filter-expression/index.js.map +0 -1
  42. package/lib/src/filter-expression/operator-utils.js.map +0 -1
  43. package/lib/src/filter-expression/operators.js.map +0 -1
  44. package/lib/src/filter-expression/pattern-match-placeholders.js.map +0 -1
  45. package/lib/src/filter-expression/pattern-match.js.map +0 -1
  46. package/lib/src/filter-expression/pattern-to-expression.js.map +0 -1
  47. package/lib/src/filter-expression/types.js.map +0 -1
  48. package/lib/src/params-placeholders.js.map +0 -1
  49. package/lib/src/tsfixme.js.map +0 -1
  50. package/lib/src/types.js.map +0 -1
  51. package/lib/src/utils.js.map +0 -1
  52. package/lib/src/visitors.js.map +0 -1
  53. package/lib/test-data/schema-mock.js.map +0 -1
@@ -1,44 +1,50 @@
1
- import type { TypeObject } from "@fibery/schema";
2
- import { fieldAccessVisitorTypeAware } from "./field-expression-visitor-type-aware";
3
- import type { Expression, ExpressionVisitor, FieldExpression } from "./types";
1
+ import { Expression, ExpressionVisitor, FieldExpression } from "./types.js";
2
+ import { fieldAccessVisitorTypeAware } from "./field-expression-visitor-type-aware.js";
3
+ import { TypeObject } from "@fibery/schema";
4
+ declare namespace visitors_d_exports {
5
+ export { UNKNOWN_EXPRESSION_TYPE, deleteExpressionsWithNotFoundFieldsVisitor, deleteExpressionsWithParamsVisitor, expressionContainsAggregation, fieldAccessVisitorTypeAware, getExpressionType, getReferencedParamNames, replaceIdsWithNamesVisitor, replaceNamesWithIdsVisitor };
6
+ }
4
7
  type OnFieldNotFoundInNamesTerms = (params: {
5
- fieldExpressionInNamesTerms: FieldExpression;
6
- fieldId: string;
7
- currentTypeObject: TypeObject | null;
8
- expression: FieldExpression;
8
+ fieldExpressionInNamesTerms: FieldExpression;
9
+ fieldId: string;
10
+ currentTypeObject: TypeObject | null;
11
+ expression: FieldExpression;
9
12
  }) => {
10
- currentTypeObject: TypeObject | null;
11
- fieldExpressionInNamesTerms: FieldExpression;
13
+ currentTypeObject: TypeObject | null;
14
+ fieldExpressionInNamesTerms: FieldExpression;
12
15
  };
13
16
  type OnFieldNotFoundInIdsTerms = (params: {
14
- fieldExpressionInIdsTerms: FieldExpression;
15
- field: string;
16
- currentTypeObject: TypeObject | null;
17
- expression: FieldExpression;
17
+ fieldExpressionInIdsTerms: FieldExpression;
18
+ field: string;
19
+ currentTypeObject: TypeObject | null;
20
+ expression: FieldExpression;
18
21
  }) => {
19
- currentTypeObject: TypeObject | null;
20
- fieldExpressionInIdsTerms: FieldExpression;
22
+ currentTypeObject: TypeObject | null;
23
+ fieldExpressionInIdsTerms: FieldExpression;
21
24
  };
22
- export declare const replaceIdsWithNamesVisitor: (typeObject: TypeObject, onFieldNotFound?: OnFieldNotFoundInNamesTerms) => Required<ExpressionVisitor>;
23
- export declare const replaceNamesWithIdsVisitor: (typeObject: TypeObject, onFieldNotFound?: OnFieldNotFoundInIdsTerms) => Required<ExpressionVisitor>;
24
- export declare const deleteExpressionsWithNotFoundFieldsVisitor: (typeObject: TypeObject) => Required<ExpressionVisitor>;
25
- export declare const expressionContainsAggregation: (expression: Expression) => boolean;
26
- export declare const UNKNOWN_EXPRESSION_TYPE = "unknown";
27
- export declare const getExpressionType: ({ expression, typeObject, functionsMeta, onFieldNotFound, returnRefTypeInsteadOfId, }: {
28
- expression: Expression;
29
- typeObject: TypeObject;
30
- functionsMeta: Record<string, {
31
- overloads: {
32
- "arg-types": string[];
33
- "result-type": string;
34
- }[];
35
- }>;
36
- onFieldNotFound?: ({ currentTypeObject, fieldId }: {
37
- currentTypeObject: TypeObject | null;
38
- fieldId: string;
39
- }) => {
40
- currentTypeObject: TypeObject | null;
41
- };
42
- returnRefTypeInsteadOfId: boolean;
25
+ declare const replaceIdsWithNamesVisitor: (typeObject: TypeObject, onFieldNotFound?: OnFieldNotFoundInNamesTerms) => Required<ExpressionVisitor>;
26
+ declare const replaceNamesWithIdsVisitor: (typeObject: TypeObject, onFieldNotFound?: OnFieldNotFoundInIdsTerms) => Required<ExpressionVisitor>;
27
+ declare const deleteExpressionsWithNotFoundFieldsVisitor: (typeObject: TypeObject) => Required<ExpressionVisitor>;
28
+ declare const deleteExpressionsWithParamsVisitor: (paramNames: Set<string>) => Required<ExpressionVisitor>;
29
+ declare const getReferencedParamNames: (expression: Expression) => Set<string>;
30
+ declare const expressionContainsAggregation: (expression: Expression) => boolean;
31
+ declare const UNKNOWN_EXPRESSION_TYPE = "unknown";
32
+ declare const getExpressionType: ({ expression, typeObject, functionsMeta, onFieldNotFound, returnRefTypeInsteadOfId }: {
33
+ expression: Expression;
34
+ typeObject: TypeObject;
35
+ functionsMeta?: Record<string, {
36
+ overloads: {
37
+ "arg-types": string[];
38
+ "result-type": string;
39
+ }[];
40
+ }>;
41
+ onFieldNotFound?: ({ currentTypeObject, fieldId }: {
42
+ currentTypeObject: TypeObject | null;
43
+ fieldId: string;
44
+ }) => {
45
+ currentTypeObject: TypeObject | null;
46
+ };
47
+ returnRefTypeInsteadOfId?: boolean;
43
48
  }) => string | null;
44
- export { fieldAccessVisitorTypeAware };
49
+ //#endregion
50
+ export { UNKNOWN_EXPRESSION_TYPE, deleteExpressionsWithNotFoundFieldsVisitor, deleteExpressionsWithParamsVisitor, expressionContainsAggregation, fieldAccessVisitorTypeAware, getExpressionType, getReferencedParamNames, replaceIdsWithNamesVisitor, replaceNamesWithIdsVisitor, visitors_d_exports };