@fibery/expression-utils 9.3.0 → 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/lib/index.d.ts +6 -0
- package/lib/index.js +44 -0
- package/lib/src/context-variables.d.ts +22 -0
- package/lib/src/context-variables.js +122 -0
- package/lib/src/errors.d.ts +4 -0
- package/lib/src/errors.js +15 -0
- package/lib/src/fieldExpressionVisitorTypeAware.d.ts +5 -0
- package/lib/src/fieldExpressionVisitorTypeAware.js +133 -0
- package/lib/src/params-placeholders.d.ts +55 -0
- package/lib/src/params-placeholders.js +204 -0
- package/lib/src/tsfixme.d.ts +1 -0
- package/lib/src/tsfixme.js +2 -0
- package/lib/src/types.d.ts +35 -0
- package/lib/src/types.js +2 -0
- package/lib/src/utils.d.ts +42 -0
- package/lib/src/utils.js +260 -0
- package/lib/src/visitors.d.ts +44 -0
- package/lib/src/visitors.js +382 -0
- package/lib/testData/schemaMock.d.ts +502 -0
- package/lib/testData/schemaMock.js +138 -0
- package/package.json +22 -22
- package/lib/contextVariables.js +0 -106
- package/lib/expression-utils.js +0 -1121
- package/lib/paramsPlaceholders.js +0 -232
- package/lib/utils.js +0 -223
- package/lib/visitors.js +0 -660
- package/types.d.ts +0 -139
package/types.d.ts
DELETED
|
@@ -1,139 +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
|
-
type TContextVariable = {
|
|
74
|
-
typeObject: TypeObject;
|
|
75
|
-
id: string;
|
|
76
|
-
title: string;
|
|
77
|
-
isCollection: boolean;
|
|
78
|
-
description: string;
|
|
79
|
-
};
|
|
80
|
-
export const contextVariables: {
|
|
81
|
-
getEntityQueryVariables: (schema: Schema) => Array<TContextVariable>;
|
|
82
|
-
getAutomationButtonContextVariables: (
|
|
83
|
-
typeId: string,
|
|
84
|
-
typeName: string,
|
|
85
|
-
fiberySchema?: Schema
|
|
86
|
-
) => Array<TContextVariable>;
|
|
87
|
-
getAutomationTriggersContextVariables: (
|
|
88
|
-
triggers: Array<{trigger: string; args: Record<string, unknown>}>,
|
|
89
|
-
typeId: string,
|
|
90
|
-
fiberySchema?: Schema
|
|
91
|
-
) => Array<TContextVariable>;
|
|
92
|
-
getTriggerCollectionFieldObject: (
|
|
93
|
-
typeId: string,
|
|
94
|
-
collectionFieldId: string,
|
|
95
|
-
fiberySchema?: Schema
|
|
96
|
-
) => FieldObject | undefined;
|
|
97
|
-
};
|
|
98
|
-
export const paramsPlaceholders: {
|
|
99
|
-
formulaTodayDateParamPlaceholder: string;
|
|
100
|
-
formulaNowDateTimeParamPlaceholder: string;
|
|
101
|
-
dynamicFilterParamPrefix: string;
|
|
102
|
-
|
|
103
|
-
isDynamicFilterParam(paramValue: string): boolean;
|
|
104
|
-
|
|
105
|
-
getFieldIdFromDynamicParam(paramValue: string): string;
|
|
106
|
-
|
|
107
|
-
mapDynamicParams(
|
|
108
|
-
params: Record<string, $TSFixMe> | null,
|
|
109
|
-
onDynamicParam: (value: string) => string
|
|
110
|
-
): Record<string, $TSFixMe> | null;
|
|
111
|
-
|
|
112
|
-
replacePlaceholdersInParams(
|
|
113
|
-
params: Record<string, $TSFixMe> | null | undefined
|
|
114
|
-
): Record<string, $TSFixMe> | null | undefined;
|
|
115
|
-
|
|
116
|
-
paramsPlaceholdersLookup: Record<string, () => string>;
|
|
117
|
-
tomorrowStartDateTimeParamPlaceholder: string;
|
|
118
|
-
dateToDateTimeIntervalLookup: Record<string, {start: string; end: string}>;
|
|
119
|
-
|
|
120
|
-
monthAgoDateParamPlaceholder: string;
|
|
121
|
-
monthAgoStartDateTimeParamPlaceholder: string;
|
|
122
|
-
monthFromNowDateParamPlaceholder: string;
|
|
123
|
-
monthFromNowEndDateTimeParamPlaceholder: string;
|
|
124
|
-
todayDateParamPlaceholder: string;
|
|
125
|
-
todayEndDateTimeParamPlaceholder: string;
|
|
126
|
-
tomorrowDateParamPlaceholder: string;
|
|
127
|
-
weekAgoDateParamPlaceholder: string;
|
|
128
|
-
weekAgoStartDateTimeParamPlaceholder: string;
|
|
129
|
-
weekFromNowDateParamPlaceholder: string;
|
|
130
|
-
weekFromNowEndDateTimeParamPlaceholder: string;
|
|
131
|
-
yesterdayDateParamPlaceholder: string;
|
|
132
|
-
yesterdayEndDateTimeParamPlaceholder: string;
|
|
133
|
-
yesterdayStartDateTimeParamPlaceholder: string;
|
|
134
|
-
yearAgoDateParamPlaceholder: string;
|
|
135
|
-
yearAgoStartDateTimeParamPlaceholder: string;
|
|
136
|
-
yearFromNowDateParamPlaceholder: string;
|
|
137
|
-
yearFromNowEndDateTimeParamPlaceholder: string;
|
|
138
|
-
};
|
|
139
|
-
}
|