@fibery/expression-utils 9.6.4 → 9.7.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/index.d.ts +568 -4
- package/lib/jest.config.cjs +35 -0
- package/lib/jest.config.cjs.map +1 -0
- package/lib/jest.config.d.cts +3 -0
- package/lib/src/errors.d.ts +1 -2
- package/lib/src/errors.js.map +1 -1
- package/lib/src/fieldExpressionVisitorTypeAware.d.ts +23 -5
- package/lib/src/fieldExpressionVisitorTypeAware.js +1 -1
- package/lib/src/fieldExpressionVisitorTypeAware.js.map +1 -1
- package/lib/src/filter-expression/index.d.ts +1 -2
- package/lib/src/filter-expression/index.js.map +1 -1
- package/lib/src/filter-expression/operator-utils.d.ts +1 -1
- package/lib/src/filter-expression/operator-utils.js +4 -3
- package/lib/src/filter-expression/operator-utils.js.map +1 -1
- package/lib/src/filter-expression/operators.js +69 -6
- package/lib/src/filter-expression/operators.js.map +1 -1
- package/lib/src/filter-expression/pattern-match.d.ts +1 -1
- package/lib/src/filter-expression/pattern-match.js.map +1 -1
- package/lib/src/filter-expression/patternMatchPlaceholders.d.ts +80 -64
- package/lib/src/filter-expression/patternMatchPlaceholders.js.map +1 -1
- package/lib/src/filter-expression/patternToExpression.d.ts +14 -3
- package/lib/src/filter-expression/patternToExpression.js +5 -4
- package/lib/src/filter-expression/patternToExpression.js.map +1 -1
- package/lib/src/filter-expression/types.d.ts +4 -2
- package/lib/src/params-placeholders.d.ts +2 -3
- package/lib/src/params-placeholders.js +14 -12
- package/lib/src/params-placeholders.js.map +1 -1
- package/lib/src/types.d.ts +8 -10
- package/lib/src/utils.d.ts +8 -0
- package/lib/src/utils.js +52 -3
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visitors.d.ts +4 -4
- package/lib/src/visitors.js +5 -5
- package/lib/src/visitors.js.map +1 -1
- package/lib/testData/schemaMock.d.ts +472 -218
- package/lib/testData/schemaMock.js.map +1 -1
- package/package.json +13 -54
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldExpressionVisitorTypeAware.js","sourceRoot":"","sources":["../../src/fieldExpressionVisitorTypeAware.
|
|
1
|
+
{"version":3,"file":"fieldExpressionVisitorTypeAware.js","sourceRoot":"","sources":["../../src/fieldExpressionVisitorTypeAware.ts"],"names":[],"mappings":";;;;;;AACA,yEAAiD;AACjD,iEAAyC;AAEzC,mCAAoE;AAWpE,MAAM,oBAAoB,GAAG,CAAC,EAC5B,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,iBAAiB,EAC7B,OAAO,EACP,eAAe,GAMhB,EAAE,EAAE,CACH,eAAe,CAAC,MAAM,CACpB,CAAC,EAAC,UAAU,EAAE,UAAU,EAAwD,EAAE,WAAwB,EAAE,EAAE;IAC5G,IAAI,UAAU,IAAI,IAAA,0BAAkB,EAAC,WAAW,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChH,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,WAAW,GAAG,UAAU,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QAChE,MAAM,cAAc,GAAG,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAC9D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,EAAE,KAAK,MAAM,CACxC,EAAE,gBAAgB,CAAC;QACpB,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,cAAc,GAAG,eAAe,CAAC;gBACrC,iBAAiB,EAAE,UAAU;gBAC7B,UAAU,EAAE,eAAe;gBAC3B,WAAW;aACZ,CAAC,CAAC;YACH,OAAO,cAAc;gBACnB,CAAC,CAAC,EAAC,UAAU,EAAE,cAAc,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC,GAAG,UAAU,EAAE,cAAc,CAAC,W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e;iBAChB,CAAC,CAAC;gBACH,OAAO;oBACL,GAAG,kBAAkB;oBACrB,GAAG;wBACD,QAAQ,EAAE,eAAe,CAAC,UAAU;wBACpC,UAAU,EAAE,IAAA,uBAAa,EAAC,gBAAgB,CAAC;4BACzC,CAAC,CAAC,IAAA,mBAAS,EAAC,gBAA8C,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;4BAC1G,CAAC,CAAC,eAAe,CAAC,eAAe,CAAC,gBAA8B,CAAC;qBACpE;oBACD,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAC,SAAS,EAAE,eAAe,CAAC,eAAe,CAAC,eAAe,CAAC,EAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBAC3F,GAAG,CAAC,iBAAiB;wBACnB,CAAC,CAAC;4BACE,YAAY,EAAE,eAAe,CAAC,sBAAsB,CAAC,iBAAiB,CAAC;yBACxE;wBACH,CAAC,CAAC,IAAI,CAAC;iBACV,CAAC;YACJ,CAAC;YACD,OAAO,kBAAkB,CAAC;QAC5B,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEK,MAAM,2BAA2B,GAAG,CAAC,EAC1C,UAAU,EACV,OAAO,GAAG,cAAc,EACxB,eAAe,GAAG,sBAAsB,GAKzC,EAAE,EAAE;IACH,OAAO,mCAAmC,CAAC,EAAC,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAC,CAAC,CAAC;AACjH,CAAC,CAAC;AAVW,QAAA,2BAA2B,+BAUtC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Expression } from "../types";
|
|
2
2
|
import { Operator } from "./types";
|
|
3
3
|
import { Schema } from "@fibery/schema";
|
|
4
|
-
|
|
5
|
-
export declare const findMatchedFilter: (filterExpression: Expression, params: $TSFixMe, operators: Array<Operator>, schema: Schema | null, type: string) => {
|
|
4
|
+
export declare const findMatchedFilter: (filterExpression: Expression, params: Record<string, unknown>, operators: Array<Operator>, schema: Schema | null, type: string) => {
|
|
6
5
|
operator: Operator;
|
|
7
6
|
value: any;
|
|
8
7
|
expression: Expression;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/filter-expression/index.ts"],"names":[],"mappings":";;;AAGA,mDAA+C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/filter-expression/index.ts"],"names":[],"mappings":";;;AAGA,mDAA+C;AAC/C,+BAAkC;AAClC,sCAA8C;AAEvC,MAAM,iBAAiB,GAAG,CAC/B,gBAA4B,EAC5B,MAA+B,EAC/B,SAA0B,EAC1B,MAAqB,EACrB,IAAY,EACZ,EAAE;IACF,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,IAAI,CAAC,EAAE,CAAC;QAC9D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAElD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;YACzB,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC,gBAAgB,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;YAC/E,IAAI,WAAW,CAAC,YAAY,EAAE,CAAC;gBAC7B,OAAO;oBACL,QAAQ;oBACR,KAAK,EAAE,WAAW,CAAC,KAAK;oBACxB,UAAU,EAAE,WAAW,CAAC,UAAU;oBAClC,IAAI;oBACJ,EAAE,EAAE,IAAA,SAAM,GAAE;iBACb,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,EAAC,YAAY,EAAE,OAAO,EAAC,GAAG,IAAA,8BAAc,EAAC,gBAAgB,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACvG,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,8BAA8B,CAAC,CAAC;gBAC3F,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,mCAAmC,CAAC,CAAC;gBACrG,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC5B,MAAM,IAAI,4BAAmB,CAAC,kDAAkD,CAAC,CAAC;gBACpF,CAAC;gBACD,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACjC,MAAM,IAAI,4BAAmB,CAAC,uDAAuD,CAAC,CAAC;gBACzF,CAAC;gBAED,OAAO;oBACL,QAAQ;oBACR,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK;oBAC/C,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAAK;oBACtC,IAAI;oBACJ,EAAE,EAAE,IAAA,SAAM,GAAE;iBACb,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAhDW,QAAA,iBAAiB,qBAgD5B"}
|
|
@@ -4,7 +4,7 @@ import { Expression } from "../types";
|
|
|
4
4
|
export declare const isDateTime: (dateString: string) => boolean;
|
|
5
5
|
export declare const NO_VALUE: undefined;
|
|
6
6
|
export declare const isNoValue: (value: unknown) => boolean;
|
|
7
|
-
export declare const getCompareOperatorForDateTime: (id: string, title: string, operator: string, compareByStartInterval: boolean) => Operator;
|
|
7
|
+
export declare const getCompareOperatorForDateTime: (id: string, title: string, operator: string, compareByStartInterval: boolean, isNegative: boolean) => Operator;
|
|
8
8
|
export declare const getWithinOperatorCustomConvertFn: (leftPartExcluded: boolean) => (expression: Expression, value: {
|
|
9
9
|
withinRangeStart: unknown;
|
|
10
10
|
withinRangeEnd: unknown;
|
|
@@ -26,7 +26,7 @@ const isNoValue = (value) => {
|
|
|
26
26
|
return value === exports.NO_VALUE;
|
|
27
27
|
};
|
|
28
28
|
exports.isNoValue = isNoValue;
|
|
29
|
-
const getCompareOperatorForDateTime = (id, title, operator, compareByStartInterval) => ({
|
|
29
|
+
const getCompareOperatorForDateTime = (id, title, operator, compareByStartInterval, isNegative) => ({
|
|
30
30
|
id,
|
|
31
31
|
title,
|
|
32
32
|
customMatch: (where, params, typeObject) => {
|
|
@@ -34,7 +34,7 @@ const getCompareOperatorForDateTime = (id, title, operator, compareByStartInterv
|
|
|
34
34
|
operator,
|
|
35
35
|
patternMatchPlaceholders_1.dateTimeOrDateTimeRangeExpressionPlaceholder,
|
|
36
36
|
(0, patternMatchPlaceholders_1.getParamPlaceholder)((x) => {
|
|
37
|
-
return (Boolean(params_placeholders_1.paramsPlaceholdersLookup[x]) ||
|
|
37
|
+
return (((0, isString_1.default)(x) && Boolean(params_placeholders_1.paramsPlaceholdersLookup[x])) ||
|
|
38
38
|
((0, isString_1.default)(x) && (0, exports.isDateTime)(x)) ||
|
|
39
39
|
Boolean((0, params_placeholders_1.parseRelativeDatePlaceholder)(x)) ||
|
|
40
40
|
(0, exports.isNoValue)(x));
|
|
@@ -100,12 +100,13 @@ const getCompareOperatorForDateTime = (id, title, operator, compareByStartInterv
|
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
type: ":operator-type/binary",
|
|
103
|
+
isNegative,
|
|
103
104
|
});
|
|
104
105
|
exports.getCompareOperatorForDateTime = getCompareOperatorForDateTime;
|
|
105
106
|
const getWithinRangeParam = ({ withinRangeValue, getNextParamName, }) => {
|
|
106
107
|
// check that it's a relative date.
|
|
107
108
|
const withinRangeDateInfo = (0, params_placeholders_1.parseRelativeDatePlaceholder)(withinRangeValue);
|
|
108
|
-
if (
|
|
109
|
+
if (withinRangeDateInfo) {
|
|
109
110
|
return { key: withinRangeValue, value: withinRangeValue };
|
|
110
111
|
}
|
|
111
112
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator-utils.js","sourceRoot":"","sources":["../../../src/filter-expression/operator-utils.ts"],"names":[],"mappings":";;;;;;AAAA,6DAAqC;AACrC,6DAAqC;AACrC,+DAAuC;AACvC,gEAmBgC;AAChC,mDAA+C;AAC/C,yEAA6G;AAM7G,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AACrD,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,oEAAoE;AACpE,0FAA0F;AAC1F,8EAA8E;AAC9E,sDAAsD;AAC/C,MAAM,UAAU,GAAG,CAAC,UAAkB,EAAW,EAAE,CACxD,UAAU,CAAC,MAAM,KAAK,iBAAiB,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,KAAK,aAAa,CAAC,MAAM,CAAC;AADlF,QAAA,UAAU,cACwE;AAElF,QAAA,QAAQ,GAAG,SAAS,CAAC;AAE3B,MAAM,SAAS,GAAG,CAAC,KAAc,EAAE,EAAE;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,kBAAkB,IAAI,KAAK,IAAI,gBAAgB,IAAI,KAAK,EAAE,CAAC;QAC5G,OAAO,KAAK,CAAC,gBAAgB,KAAK,gBAAQ,IAAI,KAAK,CAAC,cAAc,KAAK,gBAAQ,CAAC;IAClF,CAAC;IACD,OAAO,KAAK,KAAK,gBAAQ,CAAC;AAC5B,CAAC,CAAC;AALW,QAAA,SAAS,aAKpB;AAEK,MAAM,6BAA6B,GAAG,CAC3C,EAAU,EACV,KAAa,EACb,QAAgB,EAChB,sBAA+B,
|
|
1
|
+
{"version":3,"file":"operator-utils.js","sourceRoot":"","sources":["../../../src/filter-expression/operator-utils.ts"],"names":[],"mappings":";;;;;;AAAA,6DAAqC;AACrC,6DAAqC;AACrC,+DAAuC;AACvC,g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AAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;aACjE,EACD,KAAK,EACL,MAAM,EACN,UAAU,CACX,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC,CAAC;AA/BW,QAAA,8BAA8B,kCA+BzC"}
|
|
@@ -21,7 +21,7 @@ const patternMatchPlaceholders_1 = require("./patternMatchPlaceholders");
|
|
|
21
21
|
const patternToExpression_1 = require("./patternToExpression");
|
|
22
22
|
const referenceIsMePattern = ["=", patternMatchPlaceholders_1.referenceExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)((x) => x === "$my-id")];
|
|
23
23
|
const referenceIsNotMePattern = ["!=", patternMatchPlaceholders_1.referenceExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)((x) => x === "$my-id")];
|
|
24
|
-
const getReferenceMeOperator = ({ id, title, pattern }) => {
|
|
24
|
+
const getReferenceMeOperator = ({ id, title, pattern, isNegative, }) => {
|
|
25
25
|
return {
|
|
26
26
|
type: ":operator-type/unary",
|
|
27
27
|
id,
|
|
@@ -39,17 +39,20 @@ const getReferenceMeOperator = ({ id, title, pattern }) => {
|
|
|
39
39
|
customConvertToWhereExpression: (expression, value, getNextParamName) => {
|
|
40
40
|
return (0, patternToExpression_1.convertToExpression)(pattern, expression, "$my-id", getNextParamName);
|
|
41
41
|
},
|
|
42
|
+
isNegative,
|
|
42
43
|
};
|
|
43
44
|
};
|
|
44
45
|
exports.operatorReferenceIsMe = getReferenceMeOperator({
|
|
45
46
|
id: ":operator/reference-is-me",
|
|
46
47
|
title: "is Me",
|
|
47
48
|
pattern: referenceIsMePattern,
|
|
49
|
+
isNegative: false,
|
|
48
50
|
});
|
|
49
51
|
exports.operatorReferenceIsNotMe = getReferenceMeOperator({
|
|
50
52
|
id: ":operator/reference-is-not-me",
|
|
51
53
|
title: "is not Me",
|
|
52
54
|
pattern: referenceIsNotMePattern,
|
|
55
|
+
isNegative: true,
|
|
53
56
|
});
|
|
54
57
|
function isValidReferenceUUID(val) {
|
|
55
58
|
// nil UUID should be accepted because "11111111-1111-1111-1111-111111111111" is used as
|
|
@@ -67,12 +70,14 @@ exports.operatorReferenceIs = {
|
|
|
67
70
|
(0, patternMatchPlaceholders_1.getParamPlaceholder)((val) => isValidReferenceUUID(val) || (0, operator_utils_1.isNoValue)(val)),
|
|
68
71
|
],
|
|
69
72
|
type: ":operator-type/binary",
|
|
73
|
+
isNegative: false,
|
|
70
74
|
};
|
|
71
75
|
exports.operatorReferenceIsAnyOf = {
|
|
72
76
|
id: ":operator/reference-is-any-of",
|
|
73
77
|
title: "is any of",
|
|
74
78
|
pattern: ["q/in", patternMatchPlaceholders_1.referenceExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)((val) => val !== null)],
|
|
75
79
|
type: ":operator-type/binary",
|
|
80
|
+
isNegative: false,
|
|
76
81
|
};
|
|
77
82
|
exports.operatorReferenceIsNot = {
|
|
78
83
|
id: ":operator/reference-is-not",
|
|
@@ -83,24 +88,28 @@ exports.operatorReferenceIsNot = {
|
|
|
83
88
|
(0, patternMatchPlaceholders_1.getParamPlaceholder)((val) => isValidReferenceUUID(val) || (0, operator_utils_1.isNoValue)(val)),
|
|
84
89
|
],
|
|
85
90
|
type: ":operator-type/binary",
|
|
91
|
+
isNegative: true,
|
|
86
92
|
};
|
|
87
93
|
exports.operatorReferenceIsNoneOf = {
|
|
88
94
|
id: ":operator/reference-is-none-of",
|
|
89
95
|
title: "is none of",
|
|
90
96
|
pattern: ["q/not-in", patternMatchPlaceholders_1.referenceExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)((val) => val !== null)],
|
|
91
97
|
type: ":operator-type/binary",
|
|
98
|
+
isNegative: true,
|
|
92
99
|
};
|
|
93
100
|
exports.operatorReferenceIsEmpty = {
|
|
94
101
|
id: ":operator/reference-is-empty",
|
|
95
102
|
title: "is empty",
|
|
96
103
|
pattern: ["=", patternMatchPlaceholders_1.referenceExpressionPlaceholder, (0, patternMatchPlaceholders_1.getConstantPlaceholder)(null)],
|
|
97
104
|
type: ":operator-type/unary",
|
|
105
|
+
isNegative: false,
|
|
98
106
|
};
|
|
99
107
|
exports.operatorReferenceIsNotEmpty = {
|
|
100
108
|
id: ":operator/reference-is-not-empty",
|
|
101
109
|
title: "is not empty",
|
|
102
110
|
pattern: ["!=", patternMatchPlaceholders_1.referenceExpressionPlaceholder, (0, patternMatchPlaceholders_1.getConstantPlaceholder)(null)],
|
|
103
111
|
type: ":operator-type/unary",
|
|
112
|
+
isNegative: true,
|
|
104
113
|
};
|
|
105
114
|
exports.operatorUserRoleIsAnyOf = {
|
|
106
115
|
id: ":operator/user-role-is-any-of",
|
|
@@ -111,192 +120,224 @@ exports.operatorUserRoleIsAnyOf = {
|
|
|
111
120
|
(0, patternMatchPlaceholders_1.getParamPlaceholder)((x) => (Array.isArray(x) && x.every((item) => (0, isString_1.default)(item))) || (0, operator_utils_1.isNoValue)(x)),
|
|
112
121
|
],
|
|
113
122
|
type: ":operator-type/binary",
|
|
123
|
+
isNegative: false,
|
|
114
124
|
};
|
|
115
125
|
exports.operatorTextIs = {
|
|
116
126
|
id: ":operator/string-equals",
|
|
117
127
|
title: "is",
|
|
118
128
|
pattern: ["q/equals-ignoring-case?", patternMatchPlaceholders_1.textFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
119
129
|
type: ":operator-type/binary",
|
|
130
|
+
isNegative: false,
|
|
120
131
|
};
|
|
121
132
|
exports.operatorTextExactlyIs = {
|
|
122
133
|
id: ":operator/string-equals-exact",
|
|
123
134
|
title: "=",
|
|
124
135
|
pattern: ["=", patternMatchPlaceholders_1.textFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
125
136
|
type: ":operator-type/binary",
|
|
137
|
+
isNegative: false,
|
|
126
138
|
};
|
|
127
139
|
exports.operatorTextIsNot = {
|
|
128
140
|
id: ":operator/string-not-equals",
|
|
129
141
|
title: "is not",
|
|
130
142
|
pattern: ["q/not-equals-ignoring-case?", patternMatchPlaceholders_1.textFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
131
143
|
type: ":operator-type/binary",
|
|
144
|
+
isNegative: true,
|
|
132
145
|
};
|
|
133
146
|
exports.operatorTextContains = {
|
|
134
147
|
id: ":operator/string-contains",
|
|
135
148
|
title: "contains",
|
|
136
149
|
pattern: ["q/contains", patternMatchPlaceholders_1.textFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
137
150
|
type: ":operator-type/binary",
|
|
151
|
+
isNegative: false,
|
|
138
152
|
};
|
|
139
153
|
exports.operatorTextDoesNotContain = {
|
|
140
154
|
id: ":operator/string-does-not-contain",
|
|
141
155
|
title: "does not contain",
|
|
142
156
|
pattern: ["q/not-contains", patternMatchPlaceholders_1.textFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
143
157
|
type: ":operator-type/binary",
|
|
158
|
+
isNegative: true,
|
|
144
159
|
};
|
|
145
160
|
exports.operatorTextStartsWith = {
|
|
146
161
|
id: ":operator/string-starts-with",
|
|
147
162
|
title: "starts with",
|
|
148
163
|
pattern: ["q/starts-with-ignoring-case?", patternMatchPlaceholders_1.textFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
149
164
|
type: ":operator-type/binary",
|
|
165
|
+
isNegative: false,
|
|
150
166
|
};
|
|
151
167
|
exports.operatorTextEndsWith = {
|
|
152
168
|
id: ":operator/string-ends-with",
|
|
153
169
|
title: "ends with",
|
|
154
170
|
pattern: ["q/ends-with-ignoring-case?", patternMatchPlaceholders_1.textFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
155
171
|
type: ":operator-type/binary",
|
|
172
|
+
isNegative: false,
|
|
156
173
|
};
|
|
157
174
|
exports.operatorNumberEquals = {
|
|
158
175
|
id: ":operator/equals",
|
|
159
176
|
title: "=",
|
|
160
177
|
pattern: ["=", patternMatchPlaceholders_1.numberFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)((x) => x !== null)],
|
|
161
178
|
type: ":operator-type/binary",
|
|
179
|
+
isNegative: false,
|
|
162
180
|
};
|
|
163
181
|
exports.operatorNumberDoesNotEqual = {
|
|
164
182
|
id: ":operator/does-not-equal",
|
|
165
183
|
title: "≠",
|
|
166
184
|
pattern: ["!=", patternMatchPlaceholders_1.numberFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)((x) => x !== null)],
|
|
167
185
|
type: ":operator-type/binary",
|
|
186
|
+
isNegative: true,
|
|
168
187
|
};
|
|
169
188
|
exports.operatorGreaterThan = {
|
|
170
189
|
id: ":operator/greater-than",
|
|
171
190
|
title: ">",
|
|
172
191
|
pattern: [">", patternMatchPlaceholders_1.numberFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
173
192
|
type: ":operator-type/binary",
|
|
193
|
+
isNegative: false,
|
|
174
194
|
};
|
|
175
195
|
exports.operatorLessThan = {
|
|
176
196
|
id: ":operator/less-than",
|
|
177
197
|
title: "<",
|
|
178
198
|
pattern: ["<", patternMatchPlaceholders_1.numberFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
179
199
|
type: ":operator-type/binary",
|
|
200
|
+
isNegative: false,
|
|
180
201
|
};
|
|
181
202
|
exports.operatorGreaterThanOrEqual = {
|
|
182
203
|
id: ":operator/greater-than-or-equal",
|
|
183
204
|
title: "≥",
|
|
184
205
|
pattern: [">=", patternMatchPlaceholders_1.numberFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
185
206
|
type: ":operator-type/binary",
|
|
207
|
+
isNegative: false,
|
|
186
208
|
};
|
|
187
209
|
exports.operatorLessThanOrEqual = {
|
|
188
210
|
id: ":operator/less-than-or-equal",
|
|
189
211
|
title: "≤",
|
|
190
212
|
pattern: ["<=", patternMatchPlaceholders_1.numberFieldPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
191
213
|
type: ":operator-type/binary",
|
|
214
|
+
isNegative: false,
|
|
192
215
|
};
|
|
193
216
|
exports.operatorCollectionCountEquals = {
|
|
194
217
|
id: ":operator/collection-count-equals",
|
|
195
218
|
title: "=",
|
|
196
219
|
pattern: ["=", patternMatchPlaceholders_1.collectionCountExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)((x) => x !== null)],
|
|
197
220
|
type: ":operator-type/binary",
|
|
221
|
+
isNegative: false,
|
|
198
222
|
};
|
|
199
223
|
exports.operatorCollectionCountDoesNotEqual = {
|
|
200
224
|
id: ":operator/collection-count-does-not-equal",
|
|
201
225
|
title: "≠",
|
|
202
226
|
pattern: ["!=", patternMatchPlaceholders_1.collectionCountExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)((x) => x !== null)],
|
|
203
227
|
type: ":operator-type/binary",
|
|
228
|
+
isNegative: true,
|
|
204
229
|
};
|
|
205
230
|
exports.operatorCollectionCountGreaterThan = {
|
|
206
231
|
id: ":operator/collection-count-greater-than",
|
|
207
232
|
title: ">",
|
|
208
233
|
pattern: [">", patternMatchPlaceholders_1.collectionCountExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
209
234
|
type: ":operator-type/binary",
|
|
235
|
+
isNegative: false,
|
|
210
236
|
};
|
|
211
237
|
exports.operatorCollectionCountLessThan = {
|
|
212
238
|
id: ":operator/collection-count-less-than",
|
|
213
239
|
title: "<",
|
|
214
240
|
pattern: ["<", patternMatchPlaceholders_1.collectionCountExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
215
241
|
type: ":operator-type/binary",
|
|
242
|
+
isNegative: false,
|
|
216
243
|
};
|
|
217
244
|
exports.operatorCollectionCountGreaterThanOrEqual = {
|
|
218
245
|
id: ":operator/collection-count-greater-than-or-equal",
|
|
219
246
|
title: "≥",
|
|
220
247
|
pattern: [">=", patternMatchPlaceholders_1.collectionCountExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
221
248
|
type: ":operator-type/binary",
|
|
249
|
+
isNegative: false,
|
|
222
250
|
};
|
|
223
251
|
exports.operatorCollectionCountLessThanOrEqual = {
|
|
224
252
|
id: ":operator/collection-count-less-than-or-equal",
|
|
225
253
|
title: "≤",
|
|
226
254
|
pattern: ["<=", patternMatchPlaceholders_1.collectionCountExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
227
255
|
type: ":operator-type/binary",
|
|
256
|
+
isNegative: false,
|
|
228
257
|
};
|
|
229
258
|
exports.operatorNumberIsEmptyV1 = {
|
|
230
259
|
id: ":operator/number-is-empty",
|
|
231
260
|
title: "is empty",
|
|
232
261
|
pattern: ["=", patternMatchPlaceholders_1.numberFieldPlaceholder, (0, patternMatchPlaceholders_1.getConstantPlaceholder)(null)],
|
|
233
262
|
type: ":operator-type/unary",
|
|
263
|
+
isNegative: false,
|
|
234
264
|
};
|
|
235
265
|
exports.operatorNumberIsEmptyV2 = {
|
|
236
266
|
id: ":operator/number-is-empty",
|
|
237
267
|
title: "is empty",
|
|
238
268
|
pattern: ["=", ["q/null?", patternMatchPlaceholders_1.numberFieldPlaceholder], (0, patternMatchPlaceholders_1.getConstantPlaceholder)(true)],
|
|
239
269
|
type: ":operator-type/unary",
|
|
270
|
+
isNegative: false,
|
|
240
271
|
};
|
|
241
272
|
exports.operatorNumberIsNotEmptyV1 = {
|
|
242
273
|
id: ":operator/number-is-not-empty",
|
|
243
274
|
title: "is not empty",
|
|
244
275
|
pattern: ["!=", patternMatchPlaceholders_1.numberFieldPlaceholder, (0, patternMatchPlaceholders_1.getConstantPlaceholder)(null)],
|
|
245
276
|
type: ":operator-type/unary",
|
|
277
|
+
isNegative: true,
|
|
246
278
|
};
|
|
247
279
|
exports.operatorNumberIsNotEmptyV2 = {
|
|
248
280
|
id: ":operator/number-is-not-empty",
|
|
249
281
|
title: "is not empty",
|
|
250
282
|
pattern: ["=", ["q/null?", patternMatchPlaceholders_1.numberFieldPlaceholder], (0, patternMatchPlaceholders_1.getConstantPlaceholder)(false)],
|
|
251
283
|
type: ":operator-type/unary",
|
|
284
|
+
isNegative: true,
|
|
252
285
|
};
|
|
253
286
|
exports.operatorTextIsEmptyV1 = {
|
|
254
287
|
id: ":operator/text-is-empty",
|
|
255
288
|
title: "is empty",
|
|
256
289
|
pattern: ["=", patternMatchPlaceholders_1.textFieldPlaceholder, (0, patternMatchPlaceholders_1.getConstantPlaceholder)(null)],
|
|
257
290
|
type: ":operator-type/unary",
|
|
291
|
+
isNegative: false,
|
|
258
292
|
};
|
|
259
293
|
exports.operatorTextIsEmptyV2 = {
|
|
260
294
|
id: ":operator/text-is-empty",
|
|
261
295
|
title: "is empty",
|
|
262
296
|
pattern: ["=", ["q/null-or-empty?", patternMatchPlaceholders_1.textFieldPlaceholder], (0, patternMatchPlaceholders_1.getConstantPlaceholder)(true)],
|
|
263
297
|
type: ":operator-type/unary",
|
|
298
|
+
isNegative: false,
|
|
264
299
|
};
|
|
265
300
|
exports.operatorTextIsNotEmptyV1 = {
|
|
266
301
|
id: ":operator/text-is-not-empty",
|
|
267
302
|
title: "is not empty",
|
|
268
303
|
pattern: ["!=", patternMatchPlaceholders_1.textFieldPlaceholder, (0, patternMatchPlaceholders_1.getConstantPlaceholder)(null)],
|
|
269
304
|
type: ":operator-type/unary",
|
|
305
|
+
isNegative: true,
|
|
270
306
|
};
|
|
271
307
|
exports.operatorTextIsNotEmptyV2 = {
|
|
272
308
|
id: ":operator/text-is-not-empty",
|
|
273
309
|
title: "is not empty",
|
|
274
310
|
pattern: ["=", ["q/null-or-empty?", patternMatchPlaceholders_1.textFieldPlaceholder], (0, patternMatchPlaceholders_1.getConstantPlaceholder)(false)],
|
|
275
311
|
type: ":operator-type/unary",
|
|
312
|
+
isNegative: true,
|
|
276
313
|
};
|
|
277
314
|
exports.operatorLocationContains = {
|
|
278
315
|
id: ":operator/location-contains",
|
|
279
316
|
title: "contains",
|
|
280
317
|
pattern: ["q/contains", ["q/address", patternMatchPlaceholders_1.locationFieldPlaceholder], (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
281
318
|
type: ":operator-type/binary",
|
|
319
|
+
isNegative: false,
|
|
282
320
|
};
|
|
283
321
|
exports.operatorLocationDoesNotContain = {
|
|
284
322
|
id: ":operator/location-does-not-contain",
|
|
285
323
|
title: "does not contain",
|
|
286
324
|
pattern: ["q/not-contains", ["q/address", patternMatchPlaceholders_1.locationFieldPlaceholder], (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
287
325
|
type: ":operator-type/binary",
|
|
326
|
+
isNegative: true,
|
|
288
327
|
};
|
|
289
328
|
exports.operatorLocationIsEmpty = {
|
|
290
329
|
id: ":operator/location-is-empty",
|
|
291
330
|
title: "is empty",
|
|
292
331
|
pattern: ["=", patternMatchPlaceholders_1.locationFieldPlaceholder, (0, patternMatchPlaceholders_1.getConstantPlaceholder)(null)],
|
|
293
332
|
type: ":operator-type/unary",
|
|
333
|
+
isNegative: false,
|
|
294
334
|
};
|
|
295
335
|
exports.operatorLocationIsNotEmpty = {
|
|
296
336
|
id: ":operator/location-is-not-empty",
|
|
297
337
|
title: "is not empty",
|
|
298
338
|
pattern: ["!=", patternMatchPlaceholders_1.locationFieldPlaceholder, (0, patternMatchPlaceholders_1.getConstantPlaceholder)(null)],
|
|
299
339
|
type: ":operator-type/unary",
|
|
340
|
+
isNegative: true,
|
|
300
341
|
};
|
|
301
342
|
const getCollectionContainsPattern = (paramMatchFn) => {
|
|
302
343
|
return [
|
|
@@ -358,8 +399,9 @@ exports.operatorCollectionContains = {
|
|
|
358
399
|
return (0, patternToExpression_1.convertToExpression)(collectionContainsPattern, (0, exports.withoutLastIdAccess)(expression), value, getNextParamName);
|
|
359
400
|
},
|
|
360
401
|
type: ":operator-type/binary",
|
|
402
|
+
isNegative: false,
|
|
361
403
|
};
|
|
362
|
-
const getOperatorCollectionMe = ({ id, title, pattern }) => ({
|
|
404
|
+
const getOperatorCollectionMe = ({ id, title, pattern, isNegative, }) => ({
|
|
363
405
|
id,
|
|
364
406
|
title,
|
|
365
407
|
customMatch: (where, params, typeObject) => {
|
|
@@ -376,11 +418,13 @@ const getOperatorCollectionMe = ({ id, title, pattern }) => ({
|
|
|
376
418
|
return (0, patternToExpression_1.convertToExpression)(pattern, (0, exports.withoutLastIdAccess)(expression), "$my-id", getNextParamName);
|
|
377
419
|
},
|
|
378
420
|
type: ":operator-type/unary",
|
|
421
|
+
isNegative,
|
|
379
422
|
});
|
|
380
423
|
exports.operatorCollectionContainsMe = getOperatorCollectionMe({
|
|
381
424
|
id: ":operator/collection-contains-me",
|
|
382
425
|
title: "contains Me",
|
|
383
426
|
pattern: collectionContainsMePattern,
|
|
427
|
+
isNegative: false,
|
|
384
428
|
});
|
|
385
429
|
const withoutLastIdAccess = (expression) => {
|
|
386
430
|
const arr = expression;
|
|
@@ -408,6 +452,7 @@ exports.operatorCollectionContainsAnyOf = {
|
|
|
408
452
|
return (0, patternToExpression_1.convertToExpression)(collectionContainsAnyOfPattern, (0, exports.withoutLastIdAccess)(expression), value, getNextParamName);
|
|
409
453
|
},
|
|
410
454
|
type: ":operator-type/binary",
|
|
455
|
+
isNegative: false,
|
|
411
456
|
};
|
|
412
457
|
exports.operatorCollectionDoesNotContain = {
|
|
413
458
|
id: ":operator/collection-does-not-contain",
|
|
@@ -427,11 +472,13 @@ exports.operatorCollectionDoesNotContain = {
|
|
|
427
472
|
return (0, patternToExpression_1.convertToExpression)(collectionDoesNotContainPattern, (0, exports.withoutLastIdAccess)(expression), value, getNextParamName);
|
|
428
473
|
},
|
|
429
474
|
type: ":operator-type/binary",
|
|
475
|
+
isNegative: true,
|
|
430
476
|
};
|
|
431
477
|
exports.operatorCollectionDoesNotContainMe = getOperatorCollectionMe({
|
|
432
478
|
id: ":operator/collection-does-not-contain-me",
|
|
433
479
|
title: "does not contain Me",
|
|
434
480
|
pattern: collectionDoesNotContainMePattern,
|
|
481
|
+
isNegative: true,
|
|
435
482
|
});
|
|
436
483
|
exports.operatorCollectionDoesNotContainAnyOf = {
|
|
437
484
|
id: ":operator/collection-does-not-contain-any-of",
|
|
@@ -451,18 +498,21 @@ exports.operatorCollectionDoesNotContainAnyOf = {
|
|
|
451
498
|
return (0, patternToExpression_1.convertToExpression)(collectionDoesNotContainAnyOfPattern, (0, exports.withoutLastIdAccess)(expression), value, getNextParamName);
|
|
452
499
|
},
|
|
453
500
|
type: ":operator-type/binary",
|
|
501
|
+
isNegative: true,
|
|
454
502
|
};
|
|
455
503
|
exports.operatorCollectionIsEmpty = {
|
|
456
504
|
id: ":operator/is-collection-empty",
|
|
457
505
|
title: "is empty",
|
|
458
506
|
pattern: ["=", ["q/count", patternMatchPlaceholders_1.referenceCollectionExpressionPlaceholder], (0, patternMatchPlaceholders_1.getConstantPlaceholder)(0)],
|
|
459
507
|
type: ":operator-type/unary",
|
|
508
|
+
isNegative: false,
|
|
460
509
|
};
|
|
461
510
|
exports.operatorCollectionIsNotEmpty = {
|
|
462
511
|
id: ":operator/is-collection-not-empty",
|
|
463
512
|
title: "is not empty",
|
|
464
513
|
pattern: [">", ["q/count", patternMatchPlaceholders_1.referenceCollectionExpressionPlaceholder], (0, patternMatchPlaceholders_1.getConstantPlaceholder)(0)],
|
|
465
514
|
type: ":operator-type/unary",
|
|
515
|
+
isNegative: true,
|
|
466
516
|
};
|
|
467
517
|
exports.operatorBoolIs = {
|
|
468
518
|
id: ":operator/bool-is",
|
|
@@ -503,36 +553,42 @@ exports.operatorBoolIs = {
|
|
|
503
553
|
};
|
|
504
554
|
},
|
|
505
555
|
type: ":operator-type/binary",
|
|
556
|
+
isNegative: false,
|
|
506
557
|
};
|
|
507
558
|
exports.operatorDateIs = {
|
|
508
559
|
id: ":operator/date-is",
|
|
509
560
|
title: "is",
|
|
510
561
|
pattern: ["=", patternMatchPlaceholders_1.dateOrDateRangeExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)((x) => x !== null)],
|
|
511
562
|
type: ":operator-type/binary",
|
|
563
|
+
isNegative: false,
|
|
512
564
|
};
|
|
513
565
|
exports.operatorDateIsEmptyV1 = {
|
|
514
566
|
id: ":operator/date-is-empty",
|
|
515
567
|
title: "is empty",
|
|
516
568
|
pattern: ["=", patternMatchPlaceholders_1.anyDateExpressionPlaceholder, (0, patternMatchPlaceholders_1.getConstantPlaceholder)(null)],
|
|
517
569
|
type: ":operator-type/unary",
|
|
570
|
+
isNegative: false,
|
|
518
571
|
};
|
|
519
572
|
exports.operatorDateIsEmptyV2 = {
|
|
520
573
|
id: ":operator/date-is-empty",
|
|
521
574
|
title: "is empty",
|
|
522
575
|
pattern: ["=", ["q/null?", patternMatchPlaceholders_1.anyDateExpressionPlaceholder], (0, patternMatchPlaceholders_1.getConstantPlaceholder)(true)],
|
|
523
576
|
type: ":operator-type/unary",
|
|
577
|
+
isNegative: false,
|
|
524
578
|
};
|
|
525
579
|
exports.operatorDateIsNotEmptyV1 = {
|
|
526
580
|
id: ":operator/date-is-not-empty",
|
|
527
581
|
title: "is not empty",
|
|
528
582
|
pattern: ["!=", patternMatchPlaceholders_1.anyDateExpressionPlaceholder, (0, patternMatchPlaceholders_1.getConstantPlaceholder)(null)],
|
|
529
583
|
type: ":operator-type/unary",
|
|
584
|
+
isNegative: true,
|
|
530
585
|
};
|
|
531
586
|
exports.operatorDateIsNotEmptyV2 = {
|
|
532
587
|
id: ":operator/date-is-not-empty",
|
|
533
588
|
title: "is not empty",
|
|
534
589
|
pattern: ["=", ["q/null?", patternMatchPlaceholders_1.anyDateExpressionPlaceholder], (0, patternMatchPlaceholders_1.getConstantPlaceholder)(false)],
|
|
535
590
|
type: ":operator-type/unary",
|
|
591
|
+
isNegative: true,
|
|
536
592
|
};
|
|
537
593
|
exports.operatorDateIsWithin = {
|
|
538
594
|
id: ":operator/date-is-within",
|
|
@@ -540,30 +596,35 @@ exports.operatorDateIsWithin = {
|
|
|
540
596
|
customMatch: (0, operator_utils_1.getWithinOperatorCustomMatchFn)(patternMatchPlaceholders_1.dateOrDateRangeExpressionPlaceholder, false),
|
|
541
597
|
customConvertToWhereExpression: (0, operator_utils_1.getWithinOperatorCustomConvertFn)(false),
|
|
542
598
|
type: ":operator-type/binary",
|
|
599
|
+
isNegative: false,
|
|
543
600
|
};
|
|
544
601
|
exports.operatorDateIsBefore = {
|
|
545
602
|
id: ":operator/date-is-before",
|
|
546
603
|
title: "is earlier than",
|
|
547
604
|
pattern: ["<", patternMatchPlaceholders_1.dateOrDateRangeExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
548
605
|
type: ":operator-type/binary",
|
|
606
|
+
isNegative: false,
|
|
549
607
|
};
|
|
550
608
|
exports.operatorDateIsOnOrBefore = {
|
|
551
609
|
id: ":operator/date-is-on-or-before",
|
|
552
610
|
title: "is on or earlier than",
|
|
553
611
|
pattern: ["<=", patternMatchPlaceholders_1.dateOrDateRangeExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
554
612
|
type: ":operator-type/binary",
|
|
613
|
+
isNegative: false,
|
|
555
614
|
};
|
|
556
615
|
exports.operatorDateIsAfter = {
|
|
557
616
|
id: ":operator/date-is-after",
|
|
558
617
|
title: "is later than",
|
|
559
618
|
pattern: [">", patternMatchPlaceholders_1.dateOrDateRangeExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
560
619
|
type: ":operator-type/binary",
|
|
620
|
+
isNegative: false,
|
|
561
621
|
};
|
|
562
622
|
exports.operatorDateIsOnOrAfter = {
|
|
563
623
|
id: ":operator/date-is-on-or-after",
|
|
564
624
|
title: "is on or later than",
|
|
565
625
|
pattern: [">=", patternMatchPlaceholders_1.dateOrDateRangeExpressionPlaceholder, (0, patternMatchPlaceholders_1.getParamPlaceholder)()],
|
|
566
626
|
type: ":operator-type/binary",
|
|
627
|
+
isNegative: false,
|
|
567
628
|
};
|
|
568
629
|
exports.operatorDateTimeIs = {
|
|
569
630
|
id: ":operator/date-time-is",
|
|
@@ -655,6 +716,7 @@ exports.operatorDateTimeIs = {
|
|
|
655
716
|
}
|
|
656
717
|
},
|
|
657
718
|
type: ":operator-type/binary",
|
|
719
|
+
isNegative: false,
|
|
658
720
|
};
|
|
659
721
|
exports.operatorDateTimeIsWithin = {
|
|
660
722
|
id: ":operator/date-time-is-within",
|
|
@@ -662,11 +724,12 @@ exports.operatorDateTimeIsWithin = {
|
|
|
662
724
|
customMatch: (0, operator_utils_1.getWithinOperatorCustomMatchFn)(patternMatchPlaceholders_1.dateTimeOrDateTimeRangeExpressionPlaceholder, true),
|
|
663
725
|
customConvertToWhereExpression: (0, operator_utils_1.getWithinOperatorCustomConvertFn)(true),
|
|
664
726
|
type: ":operator-type/binary",
|
|
727
|
+
isNegative: false,
|
|
665
728
|
};
|
|
666
|
-
exports.operatorDateTimeIsBefore = (0, operator_utils_1.getCompareOperatorForDateTime)(":operator/date-time-is-before", "is earlier than", "<", true);
|
|
667
|
-
exports.operatorDateTimeIsAfter = (0, operator_utils_1.getCompareOperatorForDateTime)(":operator/date-time-is-after", "is later than", ">", false);
|
|
668
|
-
exports.operatorDateTimeIsOnOrBefore = (0, operator_utils_1.getCompareOperatorForDateTime)(":operator/date-time-is-on-or-before", "is on or earlier than", "<=", false);
|
|
669
|
-
exports.operatorDateTimeIsOnOrAfter = (0, operator_utils_1.getCompareOperatorForDateTime)(":operator/date-time-is-on-or-after", "is on or later than", ">=", true);
|
|
729
|
+
exports.operatorDateTimeIsBefore = (0, operator_utils_1.getCompareOperatorForDateTime)(":operator/date-time-is-before", "is earlier than", "<", true, false);
|
|
730
|
+
exports.operatorDateTimeIsAfter = (0, operator_utils_1.getCompareOperatorForDateTime)(":operator/date-time-is-after", "is later than", ">", false, false);
|
|
731
|
+
exports.operatorDateTimeIsOnOrBefore = (0, operator_utils_1.getCompareOperatorForDateTime)(":operator/date-time-is-on-or-before", "is on or earlier than", "<=", false, false);
|
|
732
|
+
exports.operatorDateTimeIsOnOrAfter = (0, operator_utils_1.getCompareOperatorForDateTime)(":operator/date-time-is-on-or-after", "is on or later than", ">=", true, false);
|
|
670
733
|
exports.operatorsGroupsWithoutMe = {
|
|
671
734
|
":filter-type/comment-reference-collection": [exports.operatorCollectionIsEmpty, exports.operatorCollectionIsNotEmpty],
|
|
672
735
|
":filter-type/file-reference": [exports.operatorReferenceIsEmpty, exports.operatorReferenceIsNotEmpty],
|