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