@fibery/expression-utils 9.2.1 → 9.4.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/types.d.ts DELETED
@@ -1,119 +0,0 @@
1
- // eslint-disable-next-line import/no-extraneous-dependencies
2
- import {FieldObject, Schema, TypeObject} from "@fibery/schema";
3
-
4
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
- export type $TSFixMe = any;
6
-
7
- declare module "@fibery/expression-utils" {
8
- export const visitors: {
9
- replaceNamesWithIdsVisitor(
10
- typeObject: TypeObject,
11
- onFieldNotFound?: (input: {
12
- currentTypeObject: TypeObject;
13
- fieldExpressionInIdsTerms: Array<string>;
14
- field: string;
15
- expression: Array<string>;
16
- }) => $TSFixMe
17
- ): $TSFixMe;
18
-
19
- replaceIdsWithNamesVisitor(
20
- typeObject: TypeObject,
21
- onFieldNotFound?: (input: {
22
- currentTypeObject: TypeObject;
23
- fieldExpressionInNamesTerms: Array<string>;
24
- fieldId: string;
25
- expression: Array<string>;
26
- }) => $TSFixMe
27
- ): $TSFixMe;
28
-
29
- deleteExpressionsWithNotFoundFieldsVisitor(typeObject: TypeObject): $TSFixMe;
30
- getExpressionType({
31
- expression,
32
- typeObject,
33
- functionsMeta,
34
- onFieldNotFound,
35
- returnRefTypeInsteadOfId,
36
- }: {
37
- expression: $TSFixMe;
38
- typeObject: TypeObject;
39
- functionsMeta: Record<string, $TSFixMe>;
40
- onFieldNotFound?: (input: {currentTypeObject: TypeObject; fieldId: string}) => {
41
- currentTypeObject: TypeObject;
42
- };
43
- returnRefTypeInsteadOfId?: boolean;
44
- });
45
- fieldAccessVisitorTypeAware: (input: {
46
- typeObject: TypeObject;
47
- onField?: (onField: {
48
- fieldAccess: string | [string, string];
49
- fieldObject: FieldObject;
50
- typeObject: TypeObject;
51
- }) => {typeObject: TypeObject; fieldAccess: string | [string, string]} | null;
52
- onFieldNotFound?: (onFieldNotFound: {
53
- fieldAccess: string | [string, string];
54
- currentTypeObject: TypeObject;
55
- expression: $TSFixMe;
56
- }) => {typeObject: TypeObject; fieldAccess: string | [string, string]} | null;
57
- }) => $TSFixMe;
58
- };
59
- export const utils: {
60
- createExpressionVisitor: (visitor: $TSFixMe) => {visitExpression: (expression: $TSFixMe) => $TSFixMe};
61
- firstLastFunctions: Set<string>;
62
- isQueryExpression: (expression: $TSFixMe) => boolean;
63
- isVariableExpression: (expression: $TSFixMe) => boolean;
64
- isFunctionCallExpression: (expression: $TSFixMe) => boolean;
65
- getFieldObjectByFieldExpression: (x: {typeObject: TypeObject; expression: Expression}) => FieldObject | undefined;
66
- isFieldExpression: (expression: $TSFixMe) => boolean;
67
- isBinaryExpression: (expression: $TSFixMe) => boolean;
68
- isMultiFieldAccess: (expression: $TSFixMe) => boolean;
69
- logicalOperators: Set<string>;
70
- relationalOperators: Set<string>;
71
- mathOperators: Set<string>;
72
- };
73
- export const contextVariables: {
74
- getEntityQueryVariables: (
75
- schema: Schema
76
- ) => Array<{typeObject: TypeObject; id: string; title: string; isCollection: boolean; description: string}>;
77
- };
78
- export const paramsPlaceholders: {
79
- formulaTodayDateParamPlaceholder: string;
80
- formulaNowDateTimeParamPlaceholder: string;
81
- dynamicFilterParamPrefix: string;
82
-
83
- isDynamicFilterParam(paramValue: string): boolean;
84
-
85
- getFieldIdFromDynamicParam(paramValue: string): string;
86
-
87
- mapDynamicParams(
88
- params: Record<string, $TSFixMe> | null,
89
- onDynamicParam: (value: string) => string
90
- ): Record<string, $TSFixMe> | null;
91
-
92
- replacePlaceholdersInParams(
93
- params: Record<string, $TSFixMe> | null | undefined
94
- ): Record<string, $TSFixMe> | null | undefined;
95
-
96
- paramsPlaceholdersLookup: Record<string, () => string>;
97
- tomorrowStartDateTimeParamPlaceholder: string;
98
- dateToDateTimeIntervalLookup: Record<string, {start: string; end: string}>;
99
-
100
- monthAgoDateParamPlaceholder: string;
101
- monthAgoStartDateTimeParamPlaceholder: string;
102
- monthFromNowDateParamPlaceholder: string;
103
- monthFromNowEndDateTimeParamPlaceholder: string;
104
- todayDateParamPlaceholder: string;
105
- todayEndDateTimeParamPlaceholder: string;
106
- tomorrowDateParamPlaceholder: string;
107
- weekAgoDateParamPlaceholder: string;
108
- weekAgoStartDateTimeParamPlaceholder: string;
109
- weekFromNowDateParamPlaceholder: string;
110
- weekFromNowEndDateTimeParamPlaceholder: string;
111
- yesterdayDateParamPlaceholder: string;
112
- yesterdayEndDateTimeParamPlaceholder: string;
113
- yesterdayStartDateTimeParamPlaceholder: string;
114
- yearAgoDateParamPlaceholder: string;
115
- yearAgoStartDateTimeParamPlaceholder: string;
116
- yearFromNowDateParamPlaceholder: string;
117
- yearFromNowEndDateTimeParamPlaceholder: string;
118
- };
119
- }