@fibery/expression-utils 16.0.4 → 17.0.1
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/context-variables.d.ts +10 -10
- package/lib/errors.d.ts +2 -3
- package/lib/expression-grammar.test-d.d.ts +1 -0
- package/lib/expression-grammar.test-d.js +0 -0
- package/lib/field-expression-visitor-type-aware.d.ts +4 -5
- package/lib/filter-expression/index.d.ts +4 -5
- package/lib/filter-expression/operator-utils.d.ts +7 -8
- package/lib/filter-expression/operators.d.ts +92 -92
- package/lib/filter-expression/pattern-match-placeholders.d.ts +28 -29
- package/lib/filter-expression/pattern-match.d.ts +11 -12
- package/lib/filter-expression/pattern-to-expression.d.ts +2 -3
- package/lib/filter-expression/types.d.ts +17 -18
- package/lib/index.d.ts +2 -2
- package/lib/params-placeholders.d.ts +43 -42
- package/lib/select.test-d.d.ts +3 -4
- package/lib/types.d.ts +19 -47
- package/lib/utils.d.ts +50 -49
- package/lib/visitors.d.ts +18 -18
- package/package.json +5 -5
|
@@ -2,24 +2,24 @@ import { Schema, TypeId, TypeObject } from "@fibery/schema";
|
|
|
2
2
|
declare namespace context_variables_d_exports {
|
|
3
3
|
export { ContextVariable, currentUserContextVariableId, getAutomationButtonContextVariables, getAutomationTriggersContextVariables, getEntityQueryVariables, getTriggerCollectionFieldObject, previousTriggeredEntityContextVariableId, triggeredCollectionItemContextVariableId, triggeredEntityContextVariableId };
|
|
4
4
|
}
|
|
5
|
-
type ContextVariable = {
|
|
5
|
+
export type ContextVariable = {
|
|
6
6
|
description: string;
|
|
7
7
|
id: string;
|
|
8
8
|
title: string;
|
|
9
9
|
typeObject: TypeObject;
|
|
10
10
|
isCollection: boolean;
|
|
11
11
|
};
|
|
12
|
-
declare const triggeredEntityContextVariableId = "triggeredEntity";
|
|
13
|
-
declare const previousTriggeredEntityContextVariableId = "previousTriggeredEntity";
|
|
14
|
-
declare const currentUserContextVariableId = "currentUser";
|
|
15
|
-
declare const triggeredCollectionItemContextVariableId = "triggered-collection-item";
|
|
16
|
-
declare const getAutomationButtonContextVariables: (typeId: TypeId, fiberySchema: Schema) => Array<ContextVariable>;
|
|
17
|
-
declare const getTriggerCollectionFieldObject: (typeId: TypeId, collectionFieldId: string, fiberySchema: Schema) => import("@fibery/schema").FieldObject | null;
|
|
18
|
-
declare const getAutomationTriggersContextVariables: (triggers: Array<{
|
|
12
|
+
export declare const triggeredEntityContextVariableId = "triggeredEntity";
|
|
13
|
+
export declare const previousTriggeredEntityContextVariableId = "previousTriggeredEntity";
|
|
14
|
+
export declare const currentUserContextVariableId = "currentUser";
|
|
15
|
+
export declare const triggeredCollectionItemContextVariableId = "triggered-collection-item";
|
|
16
|
+
export declare const getAutomationButtonContextVariables: (typeId: TypeId, fiberySchema: Schema) => Array<ContextVariable>;
|
|
17
|
+
export declare const getTriggerCollectionFieldObject: (typeId: TypeId, collectionFieldId: string, fiberySchema: Schema) => import("@fibery/schema").FieldObject | null;
|
|
18
|
+
export declare const getAutomationTriggersContextVariables: (triggers: Array<{
|
|
19
19
|
trigger: string;
|
|
20
20
|
args: Record<string, unknown>;
|
|
21
21
|
}>, typeId: TypeId, fiberySchema: Schema) => Array<ContextVariable>;
|
|
22
|
-
declare const getEntityQueryVariables: (schema: Schema) => {
|
|
22
|
+
export declare const getEntityQueryVariables: (schema: Schema) => {
|
|
23
23
|
typeObject: TypeObject;
|
|
24
24
|
id: string;
|
|
25
25
|
title: string;
|
|
@@ -27,4 +27,4 @@ declare const getEntityQueryVariables: (schema: Schema) => {
|
|
|
27
27
|
description: string;
|
|
28
28
|
}[];
|
|
29
29
|
//#endregion
|
|
30
|
-
export {
|
|
30
|
+
export { context_variables_d_exports };
|
package/lib/errors.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExpressionVisitor, FieldExpression, MultiFieldAccess } from "./types.js";
|
|
1
|
+
import { ExpressionVisitor, FieldExpression as FieldExpression$1, MultiFieldAccess } from "./types.js";
|
|
2
2
|
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
3
3
|
//#region src/field-expression-visitor-type-aware.d.ts
|
|
4
4
|
type FieldAccess = string | MultiFieldAccess;
|
|
@@ -13,13 +13,12 @@ type OnField = (params: {
|
|
|
13
13
|
}) => OnFieldResult;
|
|
14
14
|
type OnFieldNotFound = (params: {
|
|
15
15
|
currentTypeObject: TypeObject;
|
|
16
|
-
expression: FieldExpression;
|
|
16
|
+
expression: FieldExpression$1;
|
|
17
17
|
fieldAccess: FieldAccess;
|
|
18
18
|
}) => OnFieldResult;
|
|
19
|
-
declare const fieldAccessVisitorTypeAware: ({ typeObject, onField, onFieldNotFound }: {
|
|
19
|
+
export declare const fieldAccessVisitorTypeAware: ({ typeObject, onField, onFieldNotFound }: {
|
|
20
20
|
typeObject: TypeObject;
|
|
21
21
|
onField?: OnField;
|
|
22
22
|
onFieldNotFound?: OnFieldNotFound;
|
|
23
23
|
}) => Required<ExpressionVisitor>;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { fieldAccessVisitorTypeAware };
|
|
24
|
+
//#endregion
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExpressionArgument as ExpressionArgument$1 } from "../types.js";
|
|
2
2
|
import { Operator } from "./types.js";
|
|
3
3
|
import { Schema } from "@fibery/schema";
|
|
4
4
|
//#region src/filter-expression/index.d.ts
|
|
5
|
-
declare const findMatchedFilter: (filterExpression:
|
|
5
|
+
export declare const findMatchedFilter: (filterExpression: ExpressionArgument$1, params: Record<string, unknown>, operators: Array<Operator>, schema: Schema | null, type: string) => {
|
|
6
6
|
operator: Operator;
|
|
7
7
|
value: unknown;
|
|
8
|
-
expression: Expression;
|
|
8
|
+
expression: import("@fibery/schema").Expression;
|
|
9
9
|
type: string;
|
|
10
10
|
id: string;
|
|
11
11
|
} | null;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { findMatchedFilter };
|
|
12
|
+
//#endregion
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Expression } from "../types.js";
|
|
2
2
|
import { ConvertResult, CustomMatchFn, ExpressionPlaceholder, Operator } from "./types.js";
|
|
3
3
|
//#region src/filter-expression/operator-utils.d.ts
|
|
4
|
-
declare const isDateTime: (dateString: string) => boolean;
|
|
5
|
-
declare const NO_VALUE: undefined;
|
|
6
|
-
declare const isNoValue: (value: unknown) => boolean;
|
|
7
|
-
declare const getCompareOperatorForDateTime: (id: string, title: string, operator: string, compareByStartInterval: boolean, isNegative: boolean) => Operator;
|
|
8
|
-
declare const getWithinOperatorCustomConvertFn: (leftPartExcluded: boolean) => (expression: Expression, value: unknown, getNextParamName: () => string) => ConvertResult;
|
|
9
|
-
declare const getWithinOperatorCustomMatchFn: (fieldPlaceholder: ExpressionPlaceholder, leftPartExcluded: boolean) => CustomMatchFn;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { NO_VALUE, getCompareOperatorForDateTime, getWithinOperatorCustomConvertFn, getWithinOperatorCustomMatchFn, isDateTime, isNoValue };
|
|
4
|
+
export declare const isDateTime: (dateString: string) => boolean;
|
|
5
|
+
export declare const NO_VALUE: undefined;
|
|
6
|
+
export declare const isNoValue: (value: unknown) => boolean;
|
|
7
|
+
export declare const getCompareOperatorForDateTime: (id: string, title: string, operator: string, compareByStartInterval: boolean, isNegative: boolean) => Operator;
|
|
8
|
+
export declare const getWithinOperatorCustomConvertFn: (leftPartExcluded: boolean) => (expression: Expression, value: unknown, getNextParamName: () => string) => ConvertResult;
|
|
9
|
+
export declare const getWithinOperatorCustomMatchFn: (fieldPlaceholder: ExpressionPlaceholder, leftPartExcluded: boolean) => CustomMatchFn;
|
|
10
|
+
//#endregion
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Expression } from "../types.js";
|
|
1
|
+
import { Expression as Expression$1, ExpressionArgument as ExpressionArgument$1 } from "../types.js";
|
|
2
2
|
import { Operator } from "./types.js";
|
|
3
3
|
import { TypeObject } from "@fibery/schema";
|
|
4
4
|
declare namespace operators_d_exports {
|
|
5
5
|
export { hiddenValidOperators, operatorBoolIs, operatorCollectionContains, operatorCollectionContainsAnyOf, operatorCollectionContainsMe, operatorCollectionCountDoesNotEqual, operatorCollectionCountEquals, operatorCollectionCountGreaterThan, operatorCollectionCountGreaterThanOrEqual, operatorCollectionCountLessThan, operatorCollectionCountLessThanOrEqual, operatorCollectionDoesNotContain, operatorCollectionDoesNotContainAnyOf, operatorCollectionDoesNotContainMe, operatorCollectionIsEmpty, operatorCollectionIsNotEmpty, operatorDateIs, operatorDateIsAfter, operatorDateIsBefore, operatorDateIsEmptyV1, operatorDateIsEmptyV2, operatorDateIsNotEmptyV1, operatorDateIsNotEmptyV2, operatorDateIsOnOrAfter, operatorDateIsOnOrBefore, operatorDateIsWithin, operatorDateTimeIs, operatorDateTimeIsAfter, operatorDateTimeIsBefore, operatorDateTimeIsOnOrAfter, operatorDateTimeIsOnOrBefore, operatorDateTimeIsWithin, operatorGreaterThan, operatorGreaterThanOrEqual, operatorLessThan, operatorLessThanOrEqual, operatorLocationContains, operatorLocationDoesNotContain, operatorLocationIsEmpty, operatorLocationIsNotEmpty, operatorNumberDoesNotEqual, operatorNumberEquals, operatorNumberIsEmptyV1, operatorNumberIsEmptyV2, operatorNumberIsNotEmptyV1, operatorNumberIsNotEmptyV2, operatorReferenceIs, operatorReferenceIsAnyOf, operatorReferenceIsEmpty, operatorReferenceIsMe, operatorReferenceIsNoneOf, operatorReferenceIsNot, operatorReferenceIsNotEmpty, operatorReferenceIsNotMe, operatorTextContains, operatorTextDoesNotContain, operatorTextEndsWith, operatorTextExactlyIs, operatorTextIs, operatorTextIsEmptyV1, operatorTextIsEmptyV2, operatorTextIsNot, operatorTextIsNotEmptyV1, operatorTextIsNotEmptyV2, operatorTextStartsWith, operatorUserRoleIsAnyOf, operators, operatorsGroups, operatorsGroupsWithoutMe, withoutLastIdAccess };
|
|
6
6
|
}
|
|
7
|
-
declare const operatorReferenceIsMe: Operator;
|
|
8
|
-
declare const operatorReferenceIsNotMe: Operator;
|
|
9
|
-
declare const operatorReferenceIs: Operator;
|
|
10
|
-
declare const operatorReferenceIsAnyOf: Operator;
|
|
11
|
-
declare const operatorReferenceIsNot: Operator;
|
|
12
|
-
declare const operatorReferenceIsNoneOf: Operator;
|
|
13
|
-
declare const operatorReferenceIsEmpty: Operator;
|
|
14
|
-
declare const operatorReferenceIsNotEmpty: Operator;
|
|
15
|
-
declare const operatorUserRoleIsAnyOf: Operator;
|
|
16
|
-
declare const operatorTextIs: {
|
|
7
|
+
export declare const operatorReferenceIsMe: Operator;
|
|
8
|
+
export declare const operatorReferenceIsNotMe: Operator;
|
|
9
|
+
export declare const operatorReferenceIs: Operator;
|
|
10
|
+
export declare const operatorReferenceIsAnyOf: Operator;
|
|
11
|
+
export declare const operatorReferenceIsNot: Operator;
|
|
12
|
+
export declare const operatorReferenceIsNoneOf: Operator;
|
|
13
|
+
export declare const operatorReferenceIsEmpty: Operator;
|
|
14
|
+
export declare const operatorReferenceIsNotEmpty: Operator;
|
|
15
|
+
export declare const operatorUserRoleIsAnyOf: Operator;
|
|
16
|
+
export declare const operatorTextIs: {
|
|
17
17
|
id: string;
|
|
18
18
|
title: string;
|
|
19
19
|
pattern: (string | {
|
|
20
20
|
id: ":expression-pattern/expression-placeholder";
|
|
21
|
-
matchFn: (expression:
|
|
21
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
22
22
|
} | {
|
|
23
23
|
id: ":expression-pattern/param-placeholder";
|
|
24
24
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -26,63 +26,63 @@ declare const operatorTextIs: {
|
|
|
26
26
|
type: string;
|
|
27
27
|
isNegative: false;
|
|
28
28
|
};
|
|
29
|
-
declare const operatorTextExactlyIs: Operator;
|
|
30
|
-
declare const operatorTextIsNot: Operator;
|
|
31
|
-
declare const operatorTextContains: Operator;
|
|
32
|
-
declare const operatorTextDoesNotContain: Operator;
|
|
33
|
-
declare const operatorTextStartsWith: Operator;
|
|
34
|
-
declare const operatorTextEndsWith: Operator;
|
|
35
|
-
declare const operatorNumberEquals: Operator;
|
|
36
|
-
declare const operatorNumberDoesNotEqual: Operator;
|
|
37
|
-
declare const operatorGreaterThan: Operator;
|
|
38
|
-
declare const operatorLessThan: Operator;
|
|
39
|
-
declare const operatorGreaterThanOrEqual: Operator;
|
|
40
|
-
declare const operatorLessThanOrEqual: Operator;
|
|
41
|
-
declare const operatorCollectionCountEquals: Operator;
|
|
42
|
-
declare const operatorCollectionCountDoesNotEqual: Operator;
|
|
43
|
-
declare const operatorCollectionCountGreaterThan: Operator;
|
|
44
|
-
declare const operatorCollectionCountLessThan: Operator;
|
|
45
|
-
declare const operatorCollectionCountGreaterThanOrEqual: Operator;
|
|
46
|
-
declare const operatorCollectionCountLessThanOrEqual: Operator;
|
|
47
|
-
declare const operatorNumberIsEmptyV1: Operator;
|
|
48
|
-
declare const operatorNumberIsEmptyV2: Operator;
|
|
49
|
-
declare const operatorNumberIsNotEmptyV1: Operator;
|
|
50
|
-
declare const operatorNumberIsNotEmptyV2: Operator;
|
|
51
|
-
declare const operatorTextIsEmptyV1: Operator;
|
|
52
|
-
declare const operatorTextIsEmptyV2: Operator;
|
|
53
|
-
declare const operatorTextIsNotEmptyV1: Operator;
|
|
54
|
-
declare const operatorTextIsNotEmptyV2: Operator;
|
|
55
|
-
declare const operatorLocationContains: Operator;
|
|
56
|
-
declare const operatorLocationDoesNotContain: Operator;
|
|
57
|
-
declare const operatorLocationIsEmpty: Operator;
|
|
58
|
-
declare const operatorLocationIsNotEmpty: Operator;
|
|
59
|
-
declare const operatorCollectionContains: Operator;
|
|
60
|
-
declare const operatorCollectionContainsMe: Operator;
|
|
61
|
-
declare const withoutLastIdAccess: (expression: Expression) => Expression;
|
|
62
|
-
declare const operatorCollectionContainsAnyOf: Operator;
|
|
63
|
-
declare const operatorCollectionDoesNotContain: Operator;
|
|
64
|
-
declare const operatorCollectionDoesNotContainMe: Operator;
|
|
65
|
-
declare const operatorCollectionDoesNotContainAnyOf: Operator;
|
|
66
|
-
declare const operatorCollectionIsEmpty: Operator;
|
|
67
|
-
declare const operatorCollectionIsNotEmpty: Operator;
|
|
68
|
-
declare const operatorBoolIs: Operator;
|
|
69
|
-
declare const operatorDateIs: Operator;
|
|
70
|
-
declare const operatorDateIsEmptyV1: Operator;
|
|
71
|
-
declare const operatorDateIsEmptyV2: Operator;
|
|
72
|
-
declare const operatorDateIsNotEmptyV1: Operator;
|
|
73
|
-
declare const operatorDateIsNotEmptyV2: Operator;
|
|
74
|
-
declare const operatorDateIsWithin: Operator;
|
|
75
|
-
declare const operatorDateIsBefore: Operator;
|
|
76
|
-
declare const operatorDateIsOnOrBefore: Operator;
|
|
77
|
-
declare const operatorDateIsAfter: Operator;
|
|
78
|
-
declare const operatorDateIsOnOrAfter: Operator;
|
|
79
|
-
declare const operatorDateTimeIs: Operator;
|
|
80
|
-
declare const operatorDateTimeIsWithin: Operator;
|
|
81
|
-
declare const operatorDateTimeIsBefore: Operator;
|
|
82
|
-
declare const operatorDateTimeIsAfter: Operator;
|
|
83
|
-
declare const operatorDateTimeIsOnOrBefore: Operator;
|
|
84
|
-
declare const operatorDateTimeIsOnOrAfter: Operator;
|
|
85
|
-
declare const operatorsGroupsWithoutMe: {
|
|
29
|
+
export declare const operatorTextExactlyIs: Operator;
|
|
30
|
+
export declare const operatorTextIsNot: Operator;
|
|
31
|
+
export declare const operatorTextContains: Operator;
|
|
32
|
+
export declare const operatorTextDoesNotContain: Operator;
|
|
33
|
+
export declare const operatorTextStartsWith: Operator;
|
|
34
|
+
export declare const operatorTextEndsWith: Operator;
|
|
35
|
+
export declare const operatorNumberEquals: Operator;
|
|
36
|
+
export declare const operatorNumberDoesNotEqual: Operator;
|
|
37
|
+
export declare const operatorGreaterThan: Operator;
|
|
38
|
+
export declare const operatorLessThan: Operator;
|
|
39
|
+
export declare const operatorGreaterThanOrEqual: Operator;
|
|
40
|
+
export declare const operatorLessThanOrEqual: Operator;
|
|
41
|
+
export declare const operatorCollectionCountEquals: Operator;
|
|
42
|
+
export declare const operatorCollectionCountDoesNotEqual: Operator;
|
|
43
|
+
export declare const operatorCollectionCountGreaterThan: Operator;
|
|
44
|
+
export declare const operatorCollectionCountLessThan: Operator;
|
|
45
|
+
export declare const operatorCollectionCountGreaterThanOrEqual: Operator;
|
|
46
|
+
export declare const operatorCollectionCountLessThanOrEqual: Operator;
|
|
47
|
+
export declare const operatorNumberIsEmptyV1: Operator;
|
|
48
|
+
export declare const operatorNumberIsEmptyV2: Operator;
|
|
49
|
+
export declare const operatorNumberIsNotEmptyV1: Operator;
|
|
50
|
+
export declare const operatorNumberIsNotEmptyV2: Operator;
|
|
51
|
+
export declare const operatorTextIsEmptyV1: Operator;
|
|
52
|
+
export declare const operatorTextIsEmptyV2: Operator;
|
|
53
|
+
export declare const operatorTextIsNotEmptyV1: Operator;
|
|
54
|
+
export declare const operatorTextIsNotEmptyV2: Operator;
|
|
55
|
+
export declare const operatorLocationContains: Operator;
|
|
56
|
+
export declare const operatorLocationDoesNotContain: Operator;
|
|
57
|
+
export declare const operatorLocationIsEmpty: Operator;
|
|
58
|
+
export declare const operatorLocationIsNotEmpty: Operator;
|
|
59
|
+
export declare const operatorCollectionContains: Operator;
|
|
60
|
+
export declare const operatorCollectionContainsMe: Operator;
|
|
61
|
+
export declare const withoutLastIdAccess: (expression: Expression$1) => Expression$1;
|
|
62
|
+
export declare const operatorCollectionContainsAnyOf: Operator;
|
|
63
|
+
export declare const operatorCollectionDoesNotContain: Operator;
|
|
64
|
+
export declare const operatorCollectionDoesNotContainMe: Operator;
|
|
65
|
+
export declare const operatorCollectionDoesNotContainAnyOf: Operator;
|
|
66
|
+
export declare const operatorCollectionIsEmpty: Operator;
|
|
67
|
+
export declare const operatorCollectionIsNotEmpty: Operator;
|
|
68
|
+
export declare const operatorBoolIs: Operator;
|
|
69
|
+
export declare const operatorDateIs: Operator;
|
|
70
|
+
export declare const operatorDateIsEmptyV1: Operator;
|
|
71
|
+
export declare const operatorDateIsEmptyV2: Operator;
|
|
72
|
+
export declare const operatorDateIsNotEmptyV1: Operator;
|
|
73
|
+
export declare const operatorDateIsNotEmptyV2: Operator;
|
|
74
|
+
export declare const operatorDateIsWithin: Operator;
|
|
75
|
+
export declare const operatorDateIsBefore: Operator;
|
|
76
|
+
export declare const operatorDateIsOnOrBefore: Operator;
|
|
77
|
+
export declare const operatorDateIsAfter: Operator;
|
|
78
|
+
export declare const operatorDateIsOnOrAfter: Operator;
|
|
79
|
+
export declare const operatorDateTimeIs: Operator;
|
|
80
|
+
export declare const operatorDateTimeIsWithin: Operator;
|
|
81
|
+
export declare const operatorDateTimeIsBefore: Operator;
|
|
82
|
+
export declare const operatorDateTimeIsAfter: Operator;
|
|
83
|
+
export declare const operatorDateTimeIsOnOrBefore: Operator;
|
|
84
|
+
export declare const operatorDateTimeIsOnOrAfter: Operator;
|
|
85
|
+
export declare const operatorsGroupsWithoutMe: {
|
|
86
86
|
":filter-type/comment-reference-collection": Operator[];
|
|
87
87
|
":filter-type/file-reference": Operator[];
|
|
88
88
|
":filter-type/file-reference-collection": Operator[];
|
|
@@ -97,7 +97,7 @@ declare const operatorsGroupsWithoutMe: {
|
|
|
97
97
|
title: string;
|
|
98
98
|
pattern: (string | {
|
|
99
99
|
id: ":expression-pattern/expression-placeholder";
|
|
100
|
-
matchFn: (expression:
|
|
100
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
101
101
|
} | {
|
|
102
102
|
id: ":expression-pattern/param-placeholder";
|
|
103
103
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -113,13 +113,13 @@ declare const operatorsGroupsWithoutMe: {
|
|
|
113
113
|
":filter-type/user-role": Operator[];
|
|
114
114
|
":filter-type/collection-count": Operator[];
|
|
115
115
|
};
|
|
116
|
-
declare const operatorsGroups: {
|
|
116
|
+
export declare const operatorsGroups: {
|
|
117
117
|
":filter-type/comment-reference-collection": (Operator | {
|
|
118
118
|
id: string;
|
|
119
119
|
title: string;
|
|
120
120
|
pattern: (string | {
|
|
121
121
|
id: ":expression-pattern/expression-placeholder";
|
|
122
|
-
matchFn: (expression:
|
|
122
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
123
123
|
} | {
|
|
124
124
|
id: ":expression-pattern/param-placeholder";
|
|
125
125
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -132,7 +132,7 @@ declare const operatorsGroups: {
|
|
|
132
132
|
title: string;
|
|
133
133
|
pattern: (string | {
|
|
134
134
|
id: ":expression-pattern/expression-placeholder";
|
|
135
|
-
matchFn: (expression:
|
|
135
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
136
136
|
} | {
|
|
137
137
|
id: ":expression-pattern/param-placeholder";
|
|
138
138
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -145,7 +145,7 @@ declare const operatorsGroups: {
|
|
|
145
145
|
title: string;
|
|
146
146
|
pattern: (string | {
|
|
147
147
|
id: ":expression-pattern/expression-placeholder";
|
|
148
|
-
matchFn: (expression:
|
|
148
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
149
149
|
} | {
|
|
150
150
|
id: ":expression-pattern/param-placeholder";
|
|
151
151
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -158,7 +158,7 @@ declare const operatorsGroups: {
|
|
|
158
158
|
title: string;
|
|
159
159
|
pattern: (string | {
|
|
160
160
|
id: ":expression-pattern/expression-placeholder";
|
|
161
|
-
matchFn: (expression:
|
|
161
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
162
162
|
} | {
|
|
163
163
|
id: ":expression-pattern/param-placeholder";
|
|
164
164
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -171,7 +171,7 @@ declare const operatorsGroups: {
|
|
|
171
171
|
title: string;
|
|
172
172
|
pattern: (string | {
|
|
173
173
|
id: ":expression-pattern/expression-placeholder";
|
|
174
|
-
matchFn: (expression:
|
|
174
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
175
175
|
} | {
|
|
176
176
|
id: ":expression-pattern/param-placeholder";
|
|
177
177
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -184,7 +184,7 @@ declare const operatorsGroups: {
|
|
|
184
184
|
title: string;
|
|
185
185
|
pattern: (string | {
|
|
186
186
|
id: ":expression-pattern/expression-placeholder";
|
|
187
|
-
matchFn: (expression:
|
|
187
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
188
188
|
} | {
|
|
189
189
|
id: ":expression-pattern/param-placeholder";
|
|
190
190
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -197,7 +197,7 @@ declare const operatorsGroups: {
|
|
|
197
197
|
title: string;
|
|
198
198
|
pattern: (string | {
|
|
199
199
|
id: ":expression-pattern/expression-placeholder";
|
|
200
|
-
matchFn: (expression:
|
|
200
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
201
201
|
} | {
|
|
202
202
|
id: ":expression-pattern/param-placeholder";
|
|
203
203
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -210,7 +210,7 @@ declare const operatorsGroups: {
|
|
|
210
210
|
title: string;
|
|
211
211
|
pattern: (string | {
|
|
212
212
|
id: ":expression-pattern/expression-placeholder";
|
|
213
|
-
matchFn: (expression:
|
|
213
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
214
214
|
} | {
|
|
215
215
|
id: ":expression-pattern/param-placeholder";
|
|
216
216
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -223,7 +223,7 @@ declare const operatorsGroups: {
|
|
|
223
223
|
title: string;
|
|
224
224
|
pattern: (string | {
|
|
225
225
|
id: ":expression-pattern/expression-placeholder";
|
|
226
|
-
matchFn: (expression:
|
|
226
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
227
227
|
} | {
|
|
228
228
|
id: ":expression-pattern/param-placeholder";
|
|
229
229
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -236,7 +236,7 @@ declare const operatorsGroups: {
|
|
|
236
236
|
title: string;
|
|
237
237
|
pattern: (string | {
|
|
238
238
|
id: ":expression-pattern/expression-placeholder";
|
|
239
|
-
matchFn: (expression:
|
|
239
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
240
240
|
} | {
|
|
241
241
|
id: ":expression-pattern/param-placeholder";
|
|
242
242
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -249,7 +249,7 @@ declare const operatorsGroups: {
|
|
|
249
249
|
title: string;
|
|
250
250
|
pattern: (string | {
|
|
251
251
|
id: ":expression-pattern/expression-placeholder";
|
|
252
|
-
matchFn: (expression:
|
|
252
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
253
253
|
} | {
|
|
254
254
|
id: ":expression-pattern/param-placeholder";
|
|
255
255
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -262,7 +262,7 @@ declare const operatorsGroups: {
|
|
|
262
262
|
title: string;
|
|
263
263
|
pattern: (string | {
|
|
264
264
|
id: ":expression-pattern/expression-placeholder";
|
|
265
|
-
matchFn: (expression:
|
|
265
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
266
266
|
} | {
|
|
267
267
|
id: ":expression-pattern/param-placeholder";
|
|
268
268
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -275,7 +275,7 @@ declare const operatorsGroups: {
|
|
|
275
275
|
title: string;
|
|
276
276
|
pattern: (string | {
|
|
277
277
|
id: ":expression-pattern/expression-placeholder";
|
|
278
|
-
matchFn: (expression:
|
|
278
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
279
279
|
} | {
|
|
280
280
|
id: ":expression-pattern/param-placeholder";
|
|
281
281
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -288,7 +288,7 @@ declare const operatorsGroups: {
|
|
|
288
288
|
title: string;
|
|
289
289
|
pattern: (string | {
|
|
290
290
|
id: ":expression-pattern/expression-placeholder";
|
|
291
|
-
matchFn: (expression:
|
|
291
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
292
292
|
} | {
|
|
293
293
|
id: ":expression-pattern/param-placeholder";
|
|
294
294
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -301,7 +301,7 @@ declare const operatorsGroups: {
|
|
|
301
301
|
title: string;
|
|
302
302
|
pattern: (string | {
|
|
303
303
|
id: ":expression-pattern/expression-placeholder";
|
|
304
|
-
matchFn: (expression:
|
|
304
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
305
305
|
} | {
|
|
306
306
|
id: ":expression-pattern/param-placeholder";
|
|
307
307
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -314,7 +314,7 @@ declare const operatorsGroups: {
|
|
|
314
314
|
title: string;
|
|
315
315
|
pattern: (string | {
|
|
316
316
|
id: ":expression-pattern/expression-placeholder";
|
|
317
|
-
matchFn: (expression:
|
|
317
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
318
318
|
} | {
|
|
319
319
|
id: ":expression-pattern/param-placeholder";
|
|
320
320
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -327,7 +327,7 @@ declare const operatorsGroups: {
|
|
|
327
327
|
title: string;
|
|
328
328
|
pattern: (string | {
|
|
329
329
|
id: ":expression-pattern/expression-placeholder";
|
|
330
|
-
matchFn: (expression:
|
|
330
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
331
331
|
} | {
|
|
332
332
|
id: ":expression-pattern/param-placeholder";
|
|
333
333
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -336,12 +336,12 @@ declare const operatorsGroups: {
|
|
|
336
336
|
isNegative: false;
|
|
337
337
|
})[];
|
|
338
338
|
};
|
|
339
|
-
declare const operators: (Operator | {
|
|
339
|
+
export declare const operators: (Operator | {
|
|
340
340
|
id: string;
|
|
341
341
|
title: string;
|
|
342
342
|
pattern: (string | {
|
|
343
343
|
id: ":expression-pattern/expression-placeholder";
|
|
344
|
-
matchFn: (expression:
|
|
344
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
345
345
|
} | {
|
|
346
346
|
id: ":expression-pattern/param-placeholder";
|
|
347
347
|
matchFn: (_x: unknown) => boolean;
|
|
@@ -349,6 +349,6 @@ declare const operators: (Operator | {
|
|
|
349
349
|
type: string;
|
|
350
350
|
isNegative: false;
|
|
351
351
|
})[];
|
|
352
|
-
declare const hiddenValidOperators: Operator[];
|
|
352
|
+
export declare const hiddenValidOperators: Operator[];
|
|
353
353
|
//#endregion
|
|
354
|
-
export {
|
|
354
|
+
export { operators_d_exports };
|
|
@@ -1,83 +1,82 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExpressionArgument as ExpressionArgument$1 } from "../types.js";
|
|
2
2
|
import { TypeObject } from "@fibery/schema";
|
|
3
3
|
//#region src/filter-expression/pattern-match-placeholders.d.ts
|
|
4
|
-
type MatchFn = (expression:
|
|
5
|
-
declare const anyExpressionPlaceholder: {
|
|
4
|
+
type MatchFn = (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
5
|
+
export declare const anyExpressionPlaceholder: {
|
|
6
6
|
id: ":expression-pattern/expression-placeholder";
|
|
7
7
|
matchFn: () => boolean;
|
|
8
8
|
};
|
|
9
|
-
declare const idFieldPlaceholder: {
|
|
9
|
+
export declare const idFieldPlaceholder: {
|
|
10
10
|
id: ":expression-pattern/expression-placeholder";
|
|
11
11
|
matchFn: MatchFn;
|
|
12
12
|
};
|
|
13
|
-
declare const basicFieldPlaceholder: {
|
|
13
|
+
export declare const basicFieldPlaceholder: {
|
|
14
14
|
id: ":expression-pattern/expression-placeholder";
|
|
15
15
|
matchFn: MatchFn;
|
|
16
16
|
};
|
|
17
|
-
declare const textFieldPlaceholder: {
|
|
17
|
+
export declare const textFieldPlaceholder: {
|
|
18
18
|
id: ":expression-pattern/expression-placeholder";
|
|
19
|
-
matchFn: (expression:
|
|
19
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
20
20
|
};
|
|
21
|
-
declare const numberFieldPlaceholder: {
|
|
21
|
+
export declare const numberFieldPlaceholder: {
|
|
22
22
|
id: ":expression-pattern/expression-placeholder";
|
|
23
23
|
matchFn: MatchFn;
|
|
24
24
|
};
|
|
25
|
-
declare const dateFieldPlaceholder: {
|
|
25
|
+
export declare const dateFieldPlaceholder: {
|
|
26
26
|
id: ":expression-pattern/expression-placeholder";
|
|
27
27
|
matchFn: MatchFn;
|
|
28
28
|
};
|
|
29
|
-
declare const dateTimeFieldPlaceholder: {
|
|
29
|
+
export declare const dateTimeFieldPlaceholder: {
|
|
30
30
|
id: ":expression-pattern/expression-placeholder";
|
|
31
31
|
matchFn: MatchFn;
|
|
32
32
|
};
|
|
33
|
-
declare const boolFieldPlaceholder: {
|
|
33
|
+
export declare const boolFieldPlaceholder: {
|
|
34
34
|
id: ":expression-pattern/expression-placeholder";
|
|
35
35
|
matchFn: MatchFn;
|
|
36
36
|
};
|
|
37
|
-
declare const locationFieldPlaceholder: {
|
|
37
|
+
export declare const locationFieldPlaceholder: {
|
|
38
38
|
id: ":expression-pattern/expression-placeholder";
|
|
39
39
|
matchFn: MatchFn;
|
|
40
40
|
};
|
|
41
|
-
declare const referenceCollectionFieldPlaceholder: {
|
|
41
|
+
export declare const referenceCollectionFieldPlaceholder: {
|
|
42
42
|
id: ":expression-pattern/expression-placeholder";
|
|
43
43
|
matchFn: MatchFn;
|
|
44
44
|
};
|
|
45
|
-
declare const referenceExpressionPlaceholder: {
|
|
45
|
+
export declare const referenceExpressionPlaceholder: {
|
|
46
46
|
id: ":expression-pattern/expression-placeholder";
|
|
47
47
|
matchFn: MatchFn;
|
|
48
48
|
};
|
|
49
|
-
declare const referenceCollectionExpressionPlaceholder: {
|
|
49
|
+
export declare const referenceCollectionExpressionPlaceholder: {
|
|
50
50
|
id: ":expression-pattern/expression-placeholder";
|
|
51
51
|
matchFn: MatchFn;
|
|
52
52
|
};
|
|
53
|
-
declare const collectionCountExpressionPlaceholder: {
|
|
53
|
+
export declare const collectionCountExpressionPlaceholder: {
|
|
54
54
|
id: ":expression-pattern/expression-placeholder";
|
|
55
|
-
matchFn: (expression:
|
|
55
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
56
56
|
};
|
|
57
|
-
declare const dateOrDateRangeExpressionPlaceholder: {
|
|
57
|
+
export declare const dateOrDateRangeExpressionPlaceholder: {
|
|
58
58
|
id: ":expression-pattern/expression-placeholder";
|
|
59
|
-
matchFn: (expression:
|
|
59
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
60
60
|
};
|
|
61
|
-
declare const dateTimeOrDateTimeRangeExpressionPlaceholder: {
|
|
61
|
+
export declare const dateTimeOrDateTimeRangeExpressionPlaceholder: {
|
|
62
62
|
id: ":expression-pattern/expression-placeholder";
|
|
63
|
-
matchFn: (expression:
|
|
63
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
64
64
|
};
|
|
65
|
-
declare const anyDateExpressionPlaceholder: {
|
|
65
|
+
export declare const anyDateExpressionPlaceholder: {
|
|
66
66
|
id: ":expression-pattern/expression-placeholder";
|
|
67
|
-
matchFn: (expression:
|
|
67
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
68
68
|
};
|
|
69
|
-
declare const getParamPlaceholder: (matchFn?: (_x: unknown) => boolean) => {
|
|
69
|
+
export declare const getParamPlaceholder: (matchFn?: (_x: unknown) => boolean) => {
|
|
70
70
|
id: ":expression-pattern/param-placeholder";
|
|
71
71
|
matchFn: (_x: unknown) => boolean;
|
|
72
72
|
};
|
|
73
|
-
declare const getConstantPlaceholder: (value: unknown) => {
|
|
73
|
+
export declare const getConstantPlaceholder: (value: unknown) => {
|
|
74
74
|
id: ":expression-pattern/constant-placeholder";
|
|
75
75
|
value: unknown;
|
|
76
76
|
matchFn: (x: unknown) => boolean;
|
|
77
77
|
};
|
|
78
|
-
declare const referenceTitleOrRankExpressionPlaceholder: {
|
|
78
|
+
export declare const referenceTitleOrRankExpressionPlaceholder: {
|
|
79
79
|
id: ":expression-pattern/expression-placeholder";
|
|
80
|
-
matchFn: (expression:
|
|
80
|
+
matchFn: (expression: ExpressionArgument$1, typeObject: TypeObject) => boolean;
|
|
81
81
|
};
|
|
82
|
-
//#endregion
|
|
83
|
-
export { anyDateExpressionPlaceholder, anyExpressionPlaceholder, basicFieldPlaceholder, boolFieldPlaceholder, collectionCountExpressionPlaceholder, dateFieldPlaceholder, dateOrDateRangeExpressionPlaceholder, dateTimeFieldPlaceholder, dateTimeOrDateTimeRangeExpressionPlaceholder, getConstantPlaceholder, getParamPlaceholder, idFieldPlaceholder, locationFieldPlaceholder, numberFieldPlaceholder, referenceCollectionExpressionPlaceholder, referenceCollectionFieldPlaceholder, referenceExpressionPlaceholder, referenceTitleOrRankExpressionPlaceholder, textFieldPlaceholder };
|
|
82
|
+
//#endregion
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { Expression } from "../types.js";
|
|
1
|
+
import { Expression as Expression$1, ExpressionArgument as ExpressionArgument$1 } from "../types.js";
|
|
2
2
|
import { PatternNode } from "./types.js";
|
|
3
3
|
import { TypeObject } from "@fibery/schema";
|
|
4
4
|
//#region src/filter-expression/pattern-match.d.ts
|
|
5
|
-
type ParamPatternMatch = {
|
|
5
|
+
export type ParamPatternMatch = {
|
|
6
6
|
matchType: ":expression-match-type/param";
|
|
7
7
|
value: unknown;
|
|
8
8
|
};
|
|
9
|
-
type ExpressionPatternMatch = {
|
|
9
|
+
export type ExpressionPatternMatch = {
|
|
10
10
|
matchType: ":expression-match-type/expression";
|
|
11
|
-
value: Expression;
|
|
11
|
+
value: Expression$1;
|
|
12
12
|
};
|
|
13
|
-
type PatternMatch = ParamPatternMatch | ExpressionPatternMatch;
|
|
14
|
-
declare const isParamPatternMatch: (match: PatternMatch | undefined) => match is ParamPatternMatch;
|
|
15
|
-
declare const isExpressionPatternMatch: (match: PatternMatch | undefined) => match is ExpressionPatternMatch;
|
|
16
|
-
declare const getExpressionArrayMatchValue: (match: PatternMatch | undefined) =>
|
|
17
|
-
type PatternMatchResult = {
|
|
13
|
+
export type PatternMatch = ParamPatternMatch | ExpressionPatternMatch;
|
|
14
|
+
export declare const isParamPatternMatch: (match: PatternMatch | undefined) => match is ParamPatternMatch;
|
|
15
|
+
export declare const isExpressionPatternMatch: (match: PatternMatch | undefined) => match is ExpressionPatternMatch;
|
|
16
|
+
export declare const getExpressionArrayMatchValue: (match: PatternMatch | undefined) => ExpressionArgument$1[] | null;
|
|
17
|
+
export type PatternMatchResult = {
|
|
18
18
|
matchSuccess: boolean;
|
|
19
19
|
matches: PatternMatch[];
|
|
20
20
|
};
|
|
21
|
-
declare const doPatternMatch: (expression: unknown, params: Record<string, unknown>, pattern: PatternNode, typeObject: TypeObject) => PatternMatchResult;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { ExpressionPatternMatch, ParamPatternMatch, PatternMatch, PatternMatchResult, doPatternMatch, getExpressionArrayMatchValue, isExpressionPatternMatch, isParamPatternMatch };
|
|
21
|
+
export declare const doPatternMatch: (expression: unknown, params: Record<string, unknown>, pattern: PatternNode, typeObject: TypeObject) => PatternMatchResult;
|
|
22
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Expression } from "../types.js";
|
|
2
2
|
import { ConvertResult, PatternNode } from "./types.js";
|
|
3
3
|
//#region src/filter-expression/pattern-to-expression.d.ts
|
|
4
|
-
declare const convertToExpression: (pattern: PatternNode[], filterExpression: Expression, value: unknown, getNextParamName: () => string) => ConvertResult;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { convertToExpression };
|
|
4
|
+
export declare const convertToExpression: (pattern: PatternNode[], filterExpression: Expression, value: unknown, getNextParamName: () => string) => ConvertResult;
|
|
5
|
+
//#endregion
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { Expression, QueryLimit } from "../types.js";
|
|
1
|
+
import { Expression as Expression$1, ExpressionArgument as ExpressionArgument$1, QueryLimit } from "../types.js";
|
|
2
2
|
import { TypeObject } from "@fibery/schema";
|
|
3
3
|
//#region src/filter-expression/types.d.ts
|
|
4
|
-
type CustomMatchResult = {
|
|
4
|
+
export type CustomMatchResult = {
|
|
5
5
|
matchSuccess: false;
|
|
6
6
|
} | {
|
|
7
7
|
matchSuccess: true;
|
|
8
8
|
value?: unknown;
|
|
9
|
-
expression: Expression;
|
|
9
|
+
expression: Expression$1;
|
|
10
10
|
};
|
|
11
|
-
type CustomMatchFn = (where:
|
|
12
|
-
type ExpressionPlaceholder = {
|
|
11
|
+
export type CustomMatchFn = (where: ExpressionArgument$1, params: Record<string, unknown>, typeObject: TypeObject) => CustomMatchResult;
|
|
12
|
+
export type ExpressionPlaceholder = {
|
|
13
13
|
id: ":expression-pattern/expression-placeholder";
|
|
14
|
-
matchFn: (expression: Expression, typeObject: TypeObject) => boolean;
|
|
14
|
+
matchFn: (expression: Expression$1, typeObject: TypeObject) => boolean;
|
|
15
15
|
};
|
|
16
|
-
type ParamPlaceholder = {
|
|
16
|
+
export type ParamPlaceholder = {
|
|
17
17
|
id: ":expression-pattern/param-placeholder";
|
|
18
18
|
matchFn: (value: unknown) => boolean;
|
|
19
19
|
};
|
|
20
|
-
type ConstantPlaceholder = {
|
|
20
|
+
export type ConstantPlaceholder = {
|
|
21
21
|
id: ":expression-pattern/constant-placeholder";
|
|
22
22
|
value: unknown;
|
|
23
23
|
matchFn: (value: unknown) => boolean;
|
|
24
24
|
};
|
|
25
|
-
type QueryPatternNode = {
|
|
25
|
+
export type QueryPatternNode = {
|
|
26
26
|
"q/from": PatternNode;
|
|
27
27
|
"q/select"?: PatternNode | Record<string, PatternNode>;
|
|
28
28
|
"q/where"?: PatternNode;
|
|
29
29
|
"q/limit"?: QueryLimit;
|
|
30
30
|
};
|
|
31
|
-
type PatternNode = string | ExpressionPlaceholder | ParamPlaceholder | ConstantPlaceholder | QueryPatternNode | PatternNode[];
|
|
32
|
-
type ConvertResult = {
|
|
33
|
-
expression: Expression;
|
|
31
|
+
export type PatternNode = string | ExpressionPlaceholder | ParamPlaceholder | ConstantPlaceholder | QueryPatternNode | PatternNode[];
|
|
32
|
+
export type ConvertResult = {
|
|
33
|
+
expression: Expression$1;
|
|
34
34
|
params: Record<string, unknown>;
|
|
35
35
|
};
|
|
36
|
-
type Operator = {
|
|
36
|
+
export type Operator = {
|
|
37
37
|
id: string;
|
|
38
38
|
type: string;
|
|
39
39
|
title: string;
|
|
@@ -41,16 +41,15 @@ type Operator = {
|
|
|
41
41
|
isNegative: boolean;
|
|
42
42
|
pattern?: PatternNode[];
|
|
43
43
|
customMatch?: CustomMatchFn;
|
|
44
|
-
customConvertToWhereExpression?: (expression: Expression, value: unknown, getNextParamName: () => string) => ConvertResult;
|
|
44
|
+
customConvertToWhereExpression?: (expression: Expression$1, value: unknown, getNextParamName: () => string) => ConvertResult;
|
|
45
45
|
};
|
|
46
|
-
type ExpressionToFilterBy = {
|
|
46
|
+
export type ExpressionToFilterBy = {
|
|
47
47
|
title?: string;
|
|
48
48
|
icon?: string;
|
|
49
49
|
itemExpressions: Array<{
|
|
50
|
-
expression: Expression;
|
|
50
|
+
expression: Expression$1;
|
|
51
51
|
type: string;
|
|
52
52
|
}>;
|
|
53
53
|
calculateRelationFieldExpressions?: () => ExpressionToFilterBy[];
|
|
54
54
|
};
|
|
55
|
-
//#endregion
|
|
56
|
-
export { ConstantPlaceholder, ConvertResult, CustomMatchFn, CustomMatchResult, ExpressionPlaceholder, ExpressionToFilterBy, Operator, ParamPlaceholder, PatternNode, QueryPatternNode };
|
|
55
|
+
//#endregion
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContextVariable, context_variables_d_exports } from "./context-variables.js";
|
|
2
|
-
import { Expression, ExpressionVisitor, ExpressionVisitorWithDefault, FieldExpression, FromRootExpression, FunctionCallExpression, MultiFieldAccess, OrderBy, Query, Select, SubQuery } from "./types.js";
|
|
2
|
+
import { Expression, ExpressionArgument, ExpressionVisitor, ExpressionVisitorWithDefault, FieldExpression, FromRootExpression, FunctionCallExpression, MultiFieldAccess, NormalizedProjection, NormalizedSelect, OrderBy, Query, Select, SubQuery } from "./types.js";
|
|
3
3
|
import { ExpressionToFilterBy, Operator } from "./filter-expression/types.js";
|
|
4
4
|
import { findMatchedFilter } from "./filter-expression/index.js";
|
|
5
5
|
import { operators_d_exports } from "./filter-expression/operators.js";
|
|
@@ -14,4 +14,4 @@ declare const filterExpression: {
|
|
|
14
14
|
convertToExpression: typeof convertToExpression;
|
|
15
15
|
};
|
|
16
16
|
//#endregion
|
|
17
|
-
export { type ContextVariable, type Expression, type ExpressionToFilterBy, type ExpressionVisitor, type ExpressionVisitorWithDefault, type FieldExpression, type FromRootExpression, type FunctionCallExpression, type MultiFieldAccess, type Operator, type OrderBy, type Query, type Select, type SubQuery, context_variables_d_exports as contextVariables, filterExpression, params_placeholders_d_exports as paramsPlaceholders, utils_d_exports as utils, visitors_d_exports as visitors };
|
|
17
|
+
export { type ContextVariable, type Expression, type ExpressionArgument, type ExpressionToFilterBy, type ExpressionVisitor, type ExpressionVisitorWithDefault, type FieldExpression, type FromRootExpression, type FunctionCallExpression, type MultiFieldAccess, type NormalizedProjection, type NormalizedSelect, type Operator, type OrderBy, type Query, type Select, type SubQuery, context_variables_d_exports as contextVariables, filterExpression, params_placeholders_d_exports as paramsPlaceholders, utils_d_exports as utils, visitors_d_exports as visitors };
|
|
@@ -2,41 +2,41 @@ import { Moment, unitOfTime } from "moment";
|
|
|
2
2
|
declare namespace params_placeholders_d_exports {
|
|
3
3
|
export { dateToDateTimeIntervalLookup, dynamicFilterParamPrefix, formulaNowDateTimeParamPlaceholder, formulaTodayDateParamPlaceholder, getFieldIdFromDynamicParam, getRelativeDateValue, getRelativeMomentDate, isDynamicFilterParam, mapDynamicParams, monthAgoDateParamPlaceholder, monthAgoEndDateTimeParamPlaceholder, monthAgoStartDateTimeParamPlaceholder, monthFromNowDateParamPlaceholder, monthFromNowEndDateTimeParamPlaceholder, monthFromNowStartDateTimeParamPlaceholder, paramsPlaceholdersLookup, parseRelativeDatePlaceholder, replacePlaceholdersInParams, toRelativeDatePlaceholder, todayDateParamPlaceholder, todayEndDateTimeParamPlaceholder, todayStartDateTimeParamPlaceholder, tomorrowDateParamPlaceholder, tomorrowEndDateTimeParamPlaceholder, tomorrowStartDateTimeParamPlaceholder, weekAgoDateParamPlaceholder, weekAgoEndDateTimeParamPlaceholder, weekAgoStartDateTimeParamPlaceholder, weekFromNowDateParamPlaceholder, weekFromNowEndDateTimeParamPlaceholder, weekFromNowStartDateTimeParamPlaceholder, whereParamPrefix, yearAgoDateParamPlaceholder, yearAgoEndDateTimeParamPlaceholder, yearAgoStartDateTimeParamPlaceholder, yearFromNowDateParamPlaceholder, yearFromNowEndDateTimeParamPlaceholder, yearFromNowStartDateTimeParamPlaceholder, yesterdayDateParamPlaceholder, yesterdayEndDateTimeParamPlaceholder, yesterdayStartDateTimeParamPlaceholder };
|
|
4
4
|
}
|
|
5
|
-
declare const formulaTodayDateParamPlaceholder = "$formula-today-date-placeholder";
|
|
6
|
-
declare const formulaNowDateTimeParamPlaceholder = "$formula-now-date-time-placeholder";
|
|
7
|
-
declare const todayDateParamPlaceholder = "$today-date";
|
|
8
|
-
declare const tomorrowDateParamPlaceholder = "$tomorrow-date";
|
|
9
|
-
declare const yesterdayDateParamPlaceholder = "$yesterday-date";
|
|
10
|
-
declare const weekAgoDateParamPlaceholder = "$week-ago-date";
|
|
11
|
-
declare const weekFromNowDateParamPlaceholder = "$week-from-now-date";
|
|
12
|
-
declare const monthAgoDateParamPlaceholder = "$month-ago-date";
|
|
13
|
-
declare const monthFromNowDateParamPlaceholder = "$month-from-now-date";
|
|
14
|
-
declare const yearAgoDateParamPlaceholder = "$year-ago-date";
|
|
15
|
-
declare const yearFromNowDateParamPlaceholder = "$year-from-now-date";
|
|
16
|
-
declare const todayStartDateTimeParamPlaceholder = "$today-date-time-start";
|
|
17
|
-
declare const todayEndDateTimeParamPlaceholder = "$today-date-time-end";
|
|
18
|
-
declare const tomorrowStartDateTimeParamPlaceholder = "$tomorrow-date-time-start";
|
|
19
|
-
declare const tomorrowEndDateTimeParamPlaceholder = "$tomorrow-date-time-end";
|
|
20
|
-
declare const yesterdayStartDateTimeParamPlaceholder = "$yesterday-date-time-start";
|
|
21
|
-
declare const yesterdayEndDateTimeParamPlaceholder = "$yesterday-date-time-end";
|
|
22
|
-
declare const weekAgoStartDateTimeParamPlaceholder = "$week-ago-date-time-start";
|
|
23
|
-
declare const weekAgoEndDateTimeParamPlaceholder = "$week-ago-date-time-end";
|
|
24
|
-
declare const weekFromNowStartDateTimeParamPlaceholder = "$week-from-now-date-time-start";
|
|
25
|
-
declare const weekFromNowEndDateTimeParamPlaceholder = "$week-from-now-date-time-end";
|
|
26
|
-
declare const monthAgoStartDateTimeParamPlaceholder = "$month-ago-date-time-start";
|
|
27
|
-
declare const monthAgoEndDateTimeParamPlaceholder = "$month-ago-date-time-end";
|
|
28
|
-
declare const monthFromNowStartDateTimeParamPlaceholder = "$month-from-now-date-time-start";
|
|
29
|
-
declare const monthFromNowEndDateTimeParamPlaceholder = "$month-from-now-date-time-end";
|
|
30
|
-
declare const yearAgoStartDateTimeParamPlaceholder = "$year-ago-date-time-start";
|
|
31
|
-
declare const yearAgoEndDateTimeParamPlaceholder = "$year-ago-date-time-end";
|
|
32
|
-
declare const yearFromNowStartDateTimeParamPlaceholder = "$year-from-now-date-time-start";
|
|
33
|
-
declare const yearFromNowEndDateTimeParamPlaceholder = "$year-from-now-date-time-end";
|
|
34
|
-
declare const paramsPlaceholdersLookup: Record<string, () => string>;
|
|
35
|
-
declare const dynamicFilterParamPrefix = "$dynamic_";
|
|
36
|
-
declare const isDynamicFilterParam: (paramValue: string) => boolean;
|
|
37
|
-
declare const getFieldIdFromDynamicParam: (paramValue: string) => string;
|
|
38
|
-
declare const whereParamPrefix = "$where";
|
|
39
|
-
declare const mapDynamicParams: <T extends Record<string, unknown>>(params: T | null, onDynamicParam: (value: string) => string) => T | null;
|
|
5
|
+
export declare const formulaTodayDateParamPlaceholder = "$formula-today-date-placeholder";
|
|
6
|
+
export declare const formulaNowDateTimeParamPlaceholder = "$formula-now-date-time-placeholder";
|
|
7
|
+
export declare const todayDateParamPlaceholder = "$today-date";
|
|
8
|
+
export declare const tomorrowDateParamPlaceholder = "$tomorrow-date";
|
|
9
|
+
export declare const yesterdayDateParamPlaceholder = "$yesterday-date";
|
|
10
|
+
export declare const weekAgoDateParamPlaceholder = "$week-ago-date";
|
|
11
|
+
export declare const weekFromNowDateParamPlaceholder = "$week-from-now-date";
|
|
12
|
+
export declare const monthAgoDateParamPlaceholder = "$month-ago-date";
|
|
13
|
+
export declare const monthFromNowDateParamPlaceholder = "$month-from-now-date";
|
|
14
|
+
export declare const yearAgoDateParamPlaceholder = "$year-ago-date";
|
|
15
|
+
export declare const yearFromNowDateParamPlaceholder = "$year-from-now-date";
|
|
16
|
+
export declare const todayStartDateTimeParamPlaceholder = "$today-date-time-start";
|
|
17
|
+
export declare const todayEndDateTimeParamPlaceholder = "$today-date-time-end";
|
|
18
|
+
export declare const tomorrowStartDateTimeParamPlaceholder = "$tomorrow-date-time-start";
|
|
19
|
+
export declare const tomorrowEndDateTimeParamPlaceholder = "$tomorrow-date-time-end";
|
|
20
|
+
export declare const yesterdayStartDateTimeParamPlaceholder = "$yesterday-date-time-start";
|
|
21
|
+
export declare const yesterdayEndDateTimeParamPlaceholder = "$yesterday-date-time-end";
|
|
22
|
+
export declare const weekAgoStartDateTimeParamPlaceholder = "$week-ago-date-time-start";
|
|
23
|
+
export declare const weekAgoEndDateTimeParamPlaceholder = "$week-ago-date-time-end";
|
|
24
|
+
export declare const weekFromNowStartDateTimeParamPlaceholder = "$week-from-now-date-time-start";
|
|
25
|
+
export declare const weekFromNowEndDateTimeParamPlaceholder = "$week-from-now-date-time-end";
|
|
26
|
+
export declare const monthAgoStartDateTimeParamPlaceholder = "$month-ago-date-time-start";
|
|
27
|
+
export declare const monthAgoEndDateTimeParamPlaceholder = "$month-ago-date-time-end";
|
|
28
|
+
export declare const monthFromNowStartDateTimeParamPlaceholder = "$month-from-now-date-time-start";
|
|
29
|
+
export declare const monthFromNowEndDateTimeParamPlaceholder = "$month-from-now-date-time-end";
|
|
30
|
+
export declare const yearAgoStartDateTimeParamPlaceholder = "$year-ago-date-time-start";
|
|
31
|
+
export declare const yearAgoEndDateTimeParamPlaceholder = "$year-ago-date-time-end";
|
|
32
|
+
export declare const yearFromNowStartDateTimeParamPlaceholder = "$year-from-now-date-time-start";
|
|
33
|
+
export declare const yearFromNowEndDateTimeParamPlaceholder = "$year-from-now-date-time-end";
|
|
34
|
+
export declare const paramsPlaceholdersLookup: Record<string, () => string>;
|
|
35
|
+
export declare const dynamicFilterParamPrefix = "$dynamic_";
|
|
36
|
+
export declare const isDynamicFilterParam: (paramValue: string) => boolean;
|
|
37
|
+
export declare const getFieldIdFromDynamicParam: (paramValue: string) => string;
|
|
38
|
+
export declare const whereParamPrefix = "$where";
|
|
39
|
+
export declare const mapDynamicParams: <T extends Record<string, unknown>>(params: T | null, onDynamicParam: (value: string) => string) => T | null;
|
|
40
40
|
type RelativeDateInfo = {
|
|
41
41
|
isStartOfInterval?: boolean;
|
|
42
42
|
unitForStart?: unitOfTime.DurationConstructor;
|
|
@@ -45,14 +45,15 @@ type RelativeDateInfo = {
|
|
|
45
45
|
isBeforeNow: boolean;
|
|
46
46
|
isDateTime?: boolean;
|
|
47
47
|
};
|
|
48
|
-
declare const getRelativeMomentDate: ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow }: Omit<RelativeDateInfo, "isDateTime">) => Moment;
|
|
49
|
-
declare const getRelativeDateValue: ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow, isDateTime }: RelativeDateInfo) => string;
|
|
50
|
-
declare const toRelativeDatePlaceholder: ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow, isDateTime }: RelativeDateInfo) => string;
|
|
51
|
-
declare const parseRelativeDatePlaceholder: (placeholder: unknown) => RelativeDateInfo | null;
|
|
52
|
-
declare function replacePlaceholdersInParams<T extends Record<string, unknown
|
|
53
|
-
declare
|
|
48
|
+
export declare const getRelativeMomentDate: ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow }: Omit<RelativeDateInfo, "isDateTime">) => Moment;
|
|
49
|
+
export declare const getRelativeDateValue: ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow, isDateTime }: RelativeDateInfo) => string;
|
|
50
|
+
export declare const toRelativeDatePlaceholder: ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow, isDateTime }: RelativeDateInfo) => string;
|
|
51
|
+
export declare const parseRelativeDatePlaceholder: (placeholder: unknown) => RelativeDateInfo | null;
|
|
52
|
+
export declare function replacePlaceholdersInParams<T extends Record<string, unknown> | null | undefined>(params: T): T;
|
|
53
|
+
export declare function replacePlaceholdersInParams<T extends Record<string, unknown>>(params: T | null | undefined): T | null | undefined;
|
|
54
|
+
export declare const dateToDateTimeIntervalLookup: Record<string, {
|
|
54
55
|
start: string;
|
|
55
56
|
end: string;
|
|
56
57
|
}>;
|
|
57
58
|
//#endregion
|
|
58
|
-
export {
|
|
59
|
+
export { params_placeholders_d_exports };
|
package/lib/select.test-d.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Select } from "./types.js";
|
|
2
2
|
//#region src/select.test-d.d.ts
|
|
3
|
-
declare const nestedProjection: Select;
|
|
4
|
-
declare const invalidProjection: Select;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { invalidProjection, nestedProjection };
|
|
3
|
+
export declare const nestedProjection: Select;
|
|
4
|
+
export declare const invalidProjection: Select;
|
|
5
|
+
//#endregion
|
package/lib/types.d.ts
CHANGED
|
@@ -1,70 +1,42 @@
|
|
|
1
|
-
import { EntityId, PublicId } from "@fibery/schema";
|
|
1
|
+
import { EntityId, Expression, Expression as Expression$1, ExpressionArgument, ExpressionArgument as ExpressionArgument$1, FieldExpression, FieldExpression as FieldExpression$1, FromRootExpression, FromRootExpression as FromRootExpression$1, FunctionCallExpression, FunctionCallExpression as FunctionCallExpression$1, MultiFieldAccess, OrderBy, OrderBy as OrderBy$1, PublicId, Query, QueryLimit, Select, Select as Select$1, SubQuery, SubQuery as SubQuery$1 } from "@fibery/schema";
|
|
2
2
|
//#region src/types.d.ts
|
|
3
|
-
type MultiFieldAccess = [string, string];
|
|
4
|
-
type FieldExpression = Array<string | MultiFieldAccess>;
|
|
5
|
-
type FunctionCallExpression = [string, ...Expression[]];
|
|
6
|
-
type FromRootExpression = ["q/from-root", ...FieldExpression[]];
|
|
7
|
-
/**
|
|
8
|
-
* The full union of all expression forms.
|
|
9
|
-
*
|
|
10
|
-
* Use type guards (isFieldExpression, isFunctionCallExpression, etc.) to narrow.
|
|
11
|
-
*
|
|
12
|
-
* Note: FieldExpression, FunctionCallExpression, FromRootExpression are all subtypes
|
|
13
|
-
* of Expression[] and listed explicitly for readability. SubQuery is a separate type.
|
|
14
|
-
*/
|
|
15
|
-
type Expression = string | Expression[] | FieldExpression | FunctionCallExpression | FromRootExpression;
|
|
16
|
-
type OrderBy = Array<[Expression, string] | [Expression, string, string]>;
|
|
17
|
-
type QueryLimit = number | "q/no-limit";
|
|
18
|
-
type Select = {
|
|
19
|
-
[field: string]: Expression | SubQuery | Select;
|
|
20
|
-
};
|
|
21
3
|
declare const projected: unique symbol;
|
|
22
|
-
type Projection<T extends object = FiberyObject> = Select & {
|
|
4
|
+
export type Projection<T extends object = FiberyObject> = Select$1 & {
|
|
23
5
|
readonly [projected]?: T;
|
|
24
6
|
};
|
|
25
|
-
type
|
|
26
|
-
|
|
27
|
-
"q/select"?: Expression | Select;
|
|
28
|
-
"q/offset"?: number;
|
|
29
|
-
"q/order-by"?: OrderBy;
|
|
30
|
-
"q/limit"?: QueryLimit;
|
|
31
|
-
"q/where"?: Expression;
|
|
7
|
+
export type NormalizedSelect = {
|
|
8
|
+
[field: string]: Expression$1 | number | boolean | null | NormalizedSelect;
|
|
32
9
|
};
|
|
33
|
-
type
|
|
34
|
-
|
|
35
|
-
"q/select"?: Expression | Select;
|
|
36
|
-
"q/offset"?: number;
|
|
37
|
-
"q/order-by"?: OrderBy;
|
|
38
|
-
"q/limit"?: QueryLimit;
|
|
39
|
-
"q/where"?: Expression;
|
|
10
|
+
export type NormalizedProjection<T extends object = FiberyObject> = NormalizedSelect & {
|
|
11
|
+
readonly [projected]?: T;
|
|
40
12
|
};
|
|
41
|
-
type FunctionsMeta = Record<string, {
|
|
13
|
+
export type FunctionsMeta = Record<string, {
|
|
42
14
|
overloads: {
|
|
43
15
|
"arg-types": string[];
|
|
44
16
|
"result-type": string;
|
|
45
17
|
}[];
|
|
46
18
|
}>;
|
|
47
|
-
type ExpressionVisitor = {
|
|
19
|
+
export type ExpressionVisitor = {
|
|
48
20
|
visitVariableExpression?: (expression: string, visitor: ExpressionVisitor) => any;
|
|
49
|
-
visitFunctionCallExpression?: (expression: FunctionCallExpression, visitor: ExpressionVisitor) => any;
|
|
50
|
-
visitFromRootFieldExpression?: (expression: FromRootExpression, visitor: ExpressionVisitor) => any;
|
|
51
|
-
visitFieldExpression?: (expression: FieldExpression, visitor: ExpressionVisitor) => any;
|
|
52
|
-
visitOrderByExpression?: (orderByExpression: OrderBy, visitor?: ExpressionVisitor) => any;
|
|
53
|
-
visitQueryExpression?: (subQueryExpression: SubQuery, visitor: ExpressionVisitor) => any;
|
|
54
|
-
visitExpression?: (expression:
|
|
55
|
-
};
|
|
56
|
-
type ExpressionVisitorWithDefault = Required<ExpressionVisitor>;
|
|
21
|
+
visitFunctionCallExpression?: (expression: FunctionCallExpression$1, visitor: ExpressionVisitor) => any;
|
|
22
|
+
visitFromRootFieldExpression?: (expression: FromRootExpression$1, visitor: ExpressionVisitor) => any;
|
|
23
|
+
visitFieldExpression?: (expression: FieldExpression$1, visitor: ExpressionVisitor) => any;
|
|
24
|
+
visitOrderByExpression?: (orderByExpression: OrderBy$1, visitor?: ExpressionVisitor) => any;
|
|
25
|
+
visitQueryExpression?: (subQueryExpression: SubQuery$1, visitor: ExpressionVisitor) => any;
|
|
26
|
+
visitExpression?: (expression: ExpressionArgument$1 | OrderBy$1) => any;
|
|
27
|
+
};
|
|
28
|
+
export type ExpressionVisitorWithDefault = Required<ExpressionVisitor>;
|
|
57
29
|
type FiberyIdentity = {
|
|
58
30
|
"fibery/id": EntityId;
|
|
59
31
|
};
|
|
60
32
|
type FiberyAutocompletes = {
|
|
61
|
-
"fibery/public-id"?: PublicId;
|
|
33
|
+
"fibery/public-id"?: PublicId | null;
|
|
62
34
|
"fibery/rank"?: number;
|
|
63
35
|
__NOTHING_INTERESTING__TitleField__?: string;
|
|
64
36
|
"icon/icon"?: string | null;
|
|
65
37
|
};
|
|
66
|
-
type FiberyObject = FiberyIdentity & FiberyAutocompletes & {
|
|
38
|
+
export type FiberyObject = FiberyIdentity & FiberyAutocompletes & {
|
|
67
39
|
[field: string]: unknown;
|
|
68
40
|
};
|
|
69
41
|
//#endregion
|
|
70
|
-
export { Expression,
|
|
42
|
+
export type { Expression, ExpressionArgument, FieldExpression, FromRootExpression, FunctionCallExpression, MultiFieldAccess, OrderBy, Query, QueryLimit, Select, SubQuery };
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,77 +1,78 @@
|
|
|
1
|
-
import { Expression, ExpressionVisitor, ExpressionVisitorWithDefault, FieldExpression, FromRootExpression, FunctionCallExpression, MultiFieldAccess, OrderBy, SubQuery } from "./types.js";
|
|
1
|
+
import { Expression as Expression$1, ExpressionArgument as ExpressionArgument$1, ExpressionVisitor, ExpressionVisitorWithDefault, FieldExpression as FieldExpression$1, FromRootExpression as FromRootExpression$1, FunctionCallExpression as FunctionCallExpression$1, MultiFieldAccess, OrderBy as OrderBy$1, SubQuery as SubQuery$1 } from "./types.js";
|
|
2
2
|
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
3
3
|
declare namespace utils_d_exports {
|
|
4
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, resolveFieldObjectByFieldExpression, resolveFieldObjectsByFieldExpression, resolveFieldObjectsByFieldExpressionInIdsTerms, textTypes };
|
|
5
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:
|
|
22
|
-
declare const fromRootKeyword = "q/from-root";
|
|
23
|
-
declare const isFromRootFieldExpression: (expression:
|
|
24
|
-
|
|
25
|
-
declare const
|
|
26
|
-
declare const
|
|
27
|
-
declare const
|
|
28
|
-
declare const
|
|
29
|
-
declare const
|
|
30
|
-
declare const
|
|
31
|
-
declare const
|
|
32
|
-
declare const
|
|
33
|
-
declare const
|
|
34
|
-
declare const
|
|
6
|
+
export declare const assertIsValidExpression: (expression: Expression$1) => void;
|
|
7
|
+
export declare const textTypes: string[];
|
|
8
|
+
export declare const dateTypes: string[];
|
|
9
|
+
export declare const dateRangeTypes: string[];
|
|
10
|
+
export declare const convertableDateTypes: string[];
|
|
11
|
+
export declare const numberTypes: string[];
|
|
12
|
+
export declare const dateRangeFunctions: Set<string>;
|
|
13
|
+
export declare const firstLastFunctions: Set<string>;
|
|
14
|
+
export declare const logicalOperators: Set<string>;
|
|
15
|
+
export declare const relationalOperators: Set<string>;
|
|
16
|
+
export declare const mathOperators: Set<string>;
|
|
17
|
+
export declare const isDateType: (type: string) => type is "fibery/date" | "fibery/date-range";
|
|
18
|
+
export declare const isDateTimeType: (type: string) => type is "fibery/date-time" | "fibery/date-time-range";
|
|
19
|
+
export declare const isSingleDateType: (type: string) => type is "fibery/date" | "fibery/date-time";
|
|
20
|
+
export declare const isRangeType: (type: string) => type is "fibery/date-range" | "fibery/date-time-range";
|
|
21
|
+
export declare const isFunctionCallExpression: (expression: ExpressionArgument$1 | OrderBy$1) => expression is FunctionCallExpression$1;
|
|
22
|
+
export declare const fromRootKeyword = "q/from-root";
|
|
23
|
+
export declare const isFromRootFieldExpression: (expression: ExpressionArgument$1 | OrderBy$1) => expression is FromRootExpression$1;
|
|
24
|
+
type DateRangeFunctionExpression = [string, FieldExpression$1] | [string, FieldExpression$1, ExpressionArgument$1];
|
|
25
|
+
export declare const isDateRangeFunctionExpression: (expression: ExpressionArgument$1) => expression is DateRangeFunctionExpression;
|
|
26
|
+
export declare const isCollectionFunctionExpression: (expression: ExpressionArgument$1) => boolean;
|
|
27
|
+
export declare const isAccessFunctionExpression: (expression: ExpressionArgument$1) => boolean;
|
|
28
|
+
export declare const isBinaryExpression: (expression: ExpressionArgument$1) => boolean;
|
|
29
|
+
export declare const isNaryExpression: (expression: ExpressionArgument$1) => expression is [string, ...ExpressionArgument$1[]];
|
|
30
|
+
export declare const isVariableExpression: (expression: ExpressionArgument$1 | OrderBy$1 | null) => expression is string;
|
|
31
|
+
export declare const isMultiFieldAccess: (expression: ExpressionArgument$1) => expression is MultiFieldAccess;
|
|
32
|
+
export declare const isMultiFieldExpression: (expression: ExpressionArgument$1 | OrderBy$1) => expression is FieldExpression$1;
|
|
33
|
+
export declare const isFieldExpression: (expression: ExpressionArgument$1 | OrderBy$1) => expression is FieldExpression$1;
|
|
34
|
+
export declare const isQueryExpression: (expression: ExpressionArgument$1 | OrderBy$1 | null) => expression is SubQuery$1;
|
|
35
|
+
export declare const getFieldObjectsByFieldExpression: ({ typeObject, expression }: {
|
|
35
36
|
typeObject: TypeObject;
|
|
36
|
-
expression: FieldExpression;
|
|
37
|
+
expression: FieldExpression$1;
|
|
37
38
|
}) => FieldObject[];
|
|
38
|
-
declare const getFieldObjectsByFieldExpressionInIdsTerms: ({ typeObject, expression }: {
|
|
39
|
+
export declare const getFieldObjectsByFieldExpressionInIdsTerms: ({ typeObject, expression }: {
|
|
39
40
|
typeObject: TypeObject;
|
|
40
|
-
expression: FieldExpression;
|
|
41
|
+
expression: FieldExpression$1;
|
|
41
42
|
}) => FieldObject[];
|
|
42
43
|
/** null when any step of the expression no longer resolves */
|
|
43
|
-
declare const resolveFieldObjectsByFieldExpression: ({ typeObject, expression }: {
|
|
44
|
+
export declare const resolveFieldObjectsByFieldExpression: ({ typeObject, expression }: {
|
|
44
45
|
typeObject: TypeObject;
|
|
45
|
-
expression: FieldExpression;
|
|
46
|
+
expression: FieldExpression$1;
|
|
46
47
|
}) => FieldObject[] | null;
|
|
47
48
|
/** null when any step of the expression no longer resolves */
|
|
48
|
-
declare const resolveFieldObjectsByFieldExpressionInIdsTerms: ({ typeObject, expression }: {
|
|
49
|
+
export declare const resolveFieldObjectsByFieldExpressionInIdsTerms: ({ typeObject, expression }: {
|
|
49
50
|
typeObject: TypeObject;
|
|
50
|
-
expression: FieldExpression;
|
|
51
|
+
expression: FieldExpression$1;
|
|
51
52
|
}) => FieldObject[] | null;
|
|
52
|
-
declare const resolveFieldObjectByFieldExpression: (x: {
|
|
53
|
+
export declare const resolveFieldObjectByFieldExpression: (x: {
|
|
53
54
|
typeObject: TypeObject;
|
|
54
|
-
expression: FieldExpression;
|
|
55
|
+
expression: FieldExpression$1;
|
|
55
56
|
}) => FieldObject | null;
|
|
56
|
-
declare const isFieldExpressionValid: ({ typeObject, expression }: {
|
|
57
|
+
export declare const isFieldExpressionValid: ({ typeObject, expression }: {
|
|
57
58
|
typeObject: TypeObject;
|
|
58
|
-
expression: FieldExpression;
|
|
59
|
+
expression: FieldExpression$1;
|
|
59
60
|
}) => boolean;
|
|
60
|
-
declare const isFieldExpressionValidInIdsTerms: ({ typeObject, expression }: {
|
|
61
|
+
export declare const isFieldExpressionValidInIdsTerms: ({ typeObject, expression }: {
|
|
61
62
|
typeObject: TypeObject;
|
|
62
|
-
expression: FieldExpression;
|
|
63
|
+
expression: FieldExpression$1;
|
|
63
64
|
}) => boolean;
|
|
64
|
-
declare const getFieldObjectByFieldExpression: (x: {
|
|
65
|
+
export declare const getFieldObjectByFieldExpression: (x: {
|
|
65
66
|
typeObject: TypeObject;
|
|
66
|
-
expression: FieldExpression;
|
|
67
|
+
expression: FieldExpression$1;
|
|
67
68
|
}) => FieldObject;
|
|
68
|
-
declare const getFieldObjects: (expression: Expression, typeObject: TypeObject) => FieldObject[];
|
|
69
|
+
export declare const getFieldObjects: (expression: Expression$1, typeObject: TypeObject) => FieldObject[];
|
|
69
70
|
/** @deprecated
|
|
70
71
|
* This method checks few expression forms, that we do not generate on frontend anymore(field-access shortcut, direct value as parameter).
|
|
71
72
|
* 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.
|
|
72
73
|
* If you need this method in new places, consider implementing same logic on visitors and use it.
|
|
73
74
|
**/
|
|
74
|
-
declare const extractFieldExpressions: (expression: Expression) => FieldExpression[];
|
|
75
|
-
declare const createExpressionVisitor: (visitor: ExpressionVisitor) => ExpressionVisitorWithDefault;
|
|
75
|
+
export declare const extractFieldExpressions: (expression: Expression$1 | SubQuery$1) => FieldExpression$1[];
|
|
76
|
+
export declare const createExpressionVisitor: (visitor: ExpressionVisitor) => ExpressionVisitorWithDefault;
|
|
76
77
|
//#endregion
|
|
77
|
-
export {
|
|
78
|
+
export { utils_d_exports };
|
package/lib/visitors.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { Expression, ExpressionVisitor, FieldExpression, MultiFieldAccess } from "./types.js";
|
|
1
|
+
import { Expression as Expression$1, ExpressionVisitor, FieldExpression as FieldExpression$1, MultiFieldAccess } from "./types.js";
|
|
2
2
|
import { fieldAccessVisitorTypeAware } from "./field-expression-visitor-type-aware.js";
|
|
3
3
|
import { FieldId, TypeObject } from "@fibery/schema";
|
|
4
4
|
declare namespace visitors_d_exports {
|
|
5
5
|
export { UNKNOWN_EXPRESSION_TYPE, deleteExpressionsWithNotFoundFieldsVisitor, deleteExpressionsWithParamsVisitor, expressionContainsAggregation, fieldAccessVisitorTypeAware, getExpressionType, getReferencedParamNames, replaceIdsWithNamesVisitor, replaceNamesWithIdsVisitor };
|
|
6
6
|
}
|
|
7
7
|
type OnFieldNotFoundInNamesTerms = (params: {
|
|
8
|
-
fieldExpressionInNamesTerms: FieldExpression;
|
|
8
|
+
fieldExpressionInNamesTerms: FieldExpression$1;
|
|
9
9
|
fieldId: FieldId | MultiFieldAccess;
|
|
10
10
|
currentTypeObject: TypeObject | null;
|
|
11
|
-
expression: FieldExpression;
|
|
11
|
+
expression: FieldExpression$1;
|
|
12
12
|
}) => {
|
|
13
13
|
currentTypeObject: TypeObject | null;
|
|
14
|
-
fieldExpressionInNamesTerms: FieldExpression;
|
|
14
|
+
fieldExpressionInNamesTerms: FieldExpression$1;
|
|
15
15
|
};
|
|
16
16
|
type OnFieldNotFoundInIdsTerms = (params: {
|
|
17
|
-
fieldExpressionInIdsTerms: FieldExpression;
|
|
18
|
-
field:
|
|
17
|
+
fieldExpressionInIdsTerms: FieldExpression$1;
|
|
18
|
+
field: FieldExpression$1[number];
|
|
19
19
|
currentTypeObject: TypeObject | null;
|
|
20
|
-
expression: FieldExpression;
|
|
20
|
+
expression: FieldExpression$1;
|
|
21
21
|
}) => {
|
|
22
22
|
currentTypeObject: TypeObject | null;
|
|
23
|
-
fieldExpressionInIdsTerms: FieldExpression;
|
|
23
|
+
fieldExpressionInIdsTerms: FieldExpression$1;
|
|
24
24
|
};
|
|
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;
|
|
25
|
+
export declare const replaceIdsWithNamesVisitor: (typeObject: TypeObject, onFieldNotFound?: OnFieldNotFoundInNamesTerms) => Required<ExpressionVisitor>;
|
|
26
|
+
export declare const replaceNamesWithIdsVisitor: (typeObject: TypeObject, onFieldNotFound?: OnFieldNotFoundInIdsTerms) => Required<ExpressionVisitor>;
|
|
27
|
+
export declare const deleteExpressionsWithNotFoundFieldsVisitor: (typeObject: TypeObject) => Required<ExpressionVisitor>;
|
|
28
|
+
export declare const deleteExpressionsWithParamsVisitor: (paramNames: Set<string>) => Required<ExpressionVisitor>;
|
|
29
|
+
export declare const getReferencedParamNames: (expression: Expression$1) => Set<string>;
|
|
30
|
+
export declare const expressionContainsAggregation: (expression: Expression$1) => boolean;
|
|
31
|
+
export declare const UNKNOWN_EXPRESSION_TYPE = "unknown";
|
|
32
|
+
export declare const getExpressionType: ({ expression, typeObject, functionsMeta, onFieldNotFound, returnRefTypeInsteadOfId }: {
|
|
33
|
+
expression: Expression$1;
|
|
34
34
|
typeObject: TypeObject;
|
|
35
35
|
functionsMeta?: Record<string, {
|
|
36
36
|
overloads: {
|
|
@@ -47,4 +47,4 @@ declare const getExpressionType: ({ expression, typeObject, functionsMeta, onFie
|
|
|
47
47
|
returnRefTypeInsteadOfId?: boolean;
|
|
48
48
|
}) => string | null;
|
|
49
49
|
//#endregion
|
|
50
|
-
export {
|
|
50
|
+
export { fieldAccessVisitorTypeAware, visitors_d_exports };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/expression-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.1",
|
|
4
4
|
"description": "utils for working with fibery api expressions",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"files": [
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"
|
|
28
|
+
"@fibery/helpers": "5.1.0",
|
|
29
|
+
"lodash": "4.18.1",
|
|
29
30
|
"moment": "2.31.0",
|
|
30
|
-
"uuid": "11.1.0"
|
|
31
|
-
"@fibery/helpers": "4.2.1"
|
|
31
|
+
"uuid": "11.1.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@fibery/schema": "13.
|
|
34
|
+
"@fibery/schema": "13.1.1"
|
|
35
35
|
}
|
|
36
36
|
}
|