@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/utils.d.ts
CHANGED
|
@@ -1,58 +1,63 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { Expression, ExpressionVisitor, ExpressionVisitorWithDefault, FieldExpression, FromRootExpression, FunctionCallExpression, MultiFieldAccess, OrderBy, SubQuery } from "./types.js";
|
|
2
|
+
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
3
|
+
declare namespace utils_d_exports {
|
|
4
|
+
export { assertIsValidExpression, convertableDateTypes, createExpressionVisitor, dateRangeFunctions, dateRangeTypes, dateTypes, extractFieldExpressions, firstLastFunctions, fromRootKeyword, getFieldObjectByFieldExpression, getFieldObjects, getFieldObjectsByFieldExpression, getFieldObjectsByFieldExpressionInIdsTerms, isAccessFunctionExpression, isBinaryExpression, isCollectionFunctionExpression, isDateRangeFunctionExpression, isDateTimeType, isDateType, isFieldExpression, isFieldExpressionValid, isFieldExpressionValidInIdsTerms, isFromRootFieldExpression, isFunctionCallExpression, isMultiFieldAccess, isMultiFieldExpression, isNaryExpression, isQueryExpression, isRangeType, isSingleDateType, isVariableExpression, logicalOperators, mathOperators, numberTypes, relationalOperators, textTypes };
|
|
5
|
+
}
|
|
6
|
+
declare const assertIsValidExpression: (expression: Expression) => void;
|
|
7
|
+
declare const textTypes: string[];
|
|
8
|
+
declare const dateTypes: string[];
|
|
9
|
+
declare const dateRangeTypes: string[];
|
|
10
|
+
declare const convertableDateTypes: string[];
|
|
11
|
+
declare const numberTypes: string[];
|
|
12
|
+
declare const dateRangeFunctions: Set<string>;
|
|
13
|
+
declare const firstLastFunctions: Set<string>;
|
|
14
|
+
declare const logicalOperators: Set<string>;
|
|
15
|
+
declare const relationalOperators: Set<string>;
|
|
16
|
+
declare const mathOperators: Set<string>;
|
|
17
|
+
declare const isDateType: (type: string) => type is "fibery/date" | "fibery/date-range";
|
|
18
|
+
declare const isDateTimeType: (type: string) => type is "fibery/date-time" | "fibery/date-time-range";
|
|
19
|
+
declare const isSingleDateType: (type: string) => type is "fibery/date" | "fibery/date-time";
|
|
20
|
+
declare const isRangeType: (type: string) => type is "fibery/date-range" | "fibery/date-time-range";
|
|
21
|
+
declare const isFunctionCallExpression: (expression: Expression | OrderBy | SubQuery) => expression is FunctionCallExpression;
|
|
22
|
+
declare const fromRootKeyword = "q/from-root";
|
|
23
|
+
declare const isFromRootFieldExpression: (expression: Expression | OrderBy | SubQuery) => expression is FromRootExpression;
|
|
24
|
+
declare const isDateRangeFunctionExpression: (expression: Expression) => boolean;
|
|
25
|
+
declare const isCollectionFunctionExpression: (expression: Expression) => boolean;
|
|
26
|
+
declare const isAccessFunctionExpression: (expression: Expression) => boolean;
|
|
27
|
+
declare const isBinaryExpression: (expression: Expression) => boolean;
|
|
28
|
+
declare const isNaryExpression: (expression: Expression) => boolean;
|
|
29
|
+
declare const isVariableExpression: (expression: Expression | OrderBy | SubQuery | null) => expression is string;
|
|
30
|
+
declare const isMultiFieldAccess: (expression: Expression | string) => expression is MultiFieldAccess;
|
|
31
|
+
declare const isMultiFieldExpression: (expression: Expression | OrderBy | SubQuery) => expression is FieldExpression;
|
|
32
|
+
declare const isFieldExpression: (expression: Expression | OrderBy | SubQuery) => expression is FieldExpression;
|
|
33
|
+
declare const isQueryExpression: (expression: Expression | OrderBy | SubQuery | null) => expression is SubQuery;
|
|
34
|
+
declare const getFieldObjectsByFieldExpression: ({ typeObject, expression }: {
|
|
35
|
+
typeObject: TypeObject;
|
|
36
|
+
expression: FieldExpression;
|
|
34
37
|
}) => FieldObject[];
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
declare const getFieldObjectsByFieldExpressionInIdsTerms: ({ typeObject, expression }: {
|
|
39
|
+
typeObject: TypeObject;
|
|
40
|
+
expression: FieldExpression;
|
|
38
41
|
}) => FieldObject[];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
declare const isFieldExpressionValid: ({ typeObject, expression }: {
|
|
43
|
+
typeObject: TypeObject;
|
|
44
|
+
expression: FieldExpression;
|
|
42
45
|
}) => boolean;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
declare const isFieldExpressionValidInIdsTerms: ({ typeObject, expression }: {
|
|
47
|
+
typeObject: TypeObject;
|
|
48
|
+
expression: FieldExpression;
|
|
46
49
|
}) => boolean;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
declare const getFieldObjectByFieldExpression: (x: {
|
|
51
|
+
typeObject: TypeObject;
|
|
52
|
+
expression: FieldExpression;
|
|
50
53
|
}) => FieldObject;
|
|
51
|
-
|
|
54
|
+
declare const getFieldObjects: (expression: Expression, typeObject: TypeObject) => FieldObject[];
|
|
52
55
|
/** @deprecated
|
|
53
56
|
* This method checks few expression forms, that we do not generate on frontend anymore(field-access shortcut, direct value as parameter).
|
|
54
57
|
* I'm afraid to replace it with implementation based on visitor everywhere, as visitors don't allow such expression forms and I don't want to extend visitor with those forms.
|
|
55
58
|
* If you need this method in new places, consider implementing same logic on visitors and use it.
|
|
56
59
|
**/
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
declare const extractFieldExpressions: (expression: Expression) => FieldExpression[];
|
|
61
|
+
declare const createExpressionVisitor: (visitor: ExpressionVisitor) => ExpressionVisitorWithDefault;
|
|
62
|
+
//#endregion
|
|
63
|
+
export { assertIsValidExpression, convertableDateTypes, createExpressionVisitor, dateRangeFunctions, dateRangeTypes, dateTypes, extractFieldExpressions, firstLastFunctions, fromRootKeyword, getFieldObjectByFieldExpression, getFieldObjects, getFieldObjectsByFieldExpression, getFieldObjectsByFieldExpressionInIdsTerms, isAccessFunctionExpression, isBinaryExpression, isCollectionFunctionExpression, isDateRangeFunctionExpression, isDateTimeType, isDateType, isFieldExpression, isFieldExpressionValid, isFieldExpressionValidInIdsTerms, isFromRootFieldExpression, isFunctionCallExpression, isMultiFieldAccess, isMultiFieldExpression, isNaryExpression, isQueryExpression, isRangeType, isSingleDateType, isVariableExpression, logicalOperators, mathOperators, numberTypes, relationalOperators, textTypes, utils_d_exports };
|