@fibery/expression-utils 9.7.2 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/lib/_virtual/_rolldown/runtime.js +13 -0
  2. package/lib/index.d.ts +191 -585
  3. package/lib/index.js +15 -50
  4. package/lib/src/context-variables.d.ts +27 -22
  5. package/lib/src/context-variables.js +106 -138
  6. package/lib/src/errors.d.ts +5 -2
  7. package/lib/src/errors.js +14 -14
  8. package/lib/src/field-expression-visitor-type-aware.d.ts +18 -16
  9. package/lib/src/field-expression-visitor-type-aware.js +116 -131
  10. package/lib/src/filter-expression/index.d.ts +12 -9
  11. package/lib/src/filter-expression/index.js +34 -47
  12. package/lib/src/filter-expression/operator-utils.d.ts +14 -11
  13. package/lib/src/filter-expression/operator-utils.js +191 -185
  14. package/lib/src/filter-expression/operators.d.ts +111 -106
  15. package/lib/src/filter-expression/operators.js +1130 -846
  16. package/lib/src/filter-expression/pattern-match-placeholders.d.ts +63 -61
  17. package/lib/src/filter-expression/pattern-match-placeholders.js +107 -138
  18. package/lib/src/filter-expression/pattern-match.d.ts +17 -15
  19. package/lib/src/filter-expression/pattern-match.js +118 -130
  20. package/lib/src/filter-expression/pattern-to-expression.d.ts +13 -11
  21. package/lib/src/filter-expression/pattern-to-expression.js +42 -45
  22. package/lib/src/filter-expression/types.d.ts +29 -26
  23. package/lib/src/filter-expression/types.js +0 -3
  24. package/lib/src/params-placeholders.d.ts +55 -51
  25. package/lib/src/params-placeholders.js +199 -192
  26. package/lib/src/tsfixme.d.ts +4 -1
  27. package/lib/src/tsfixme.js +0 -3
  28. package/lib/src/types.d.ts +47 -45
  29. package/lib/src/types.js +0 -3
  30. package/lib/src/utils.d.ts +53 -48
  31. package/lib/src/utils.js +276 -338
  32. package/lib/src/visitors.d.ts +43 -37
  33. package/lib/src/visitors.js +306 -365
  34. package/lib/test-data/schema-mock.d.ts +68 -751
  35. package/lib/test-data/schema-mock.js +175 -139
  36. package/package.json +17 -10
  37. package/lib/index.js.map +0 -1
  38. package/lib/src/context-variables.js.map +0 -1
  39. package/lib/src/errors.js.map +0 -1
  40. package/lib/src/field-expression-visitor-type-aware.js.map +0 -1
  41. package/lib/src/filter-expression/index.js.map +0 -1
  42. package/lib/src/filter-expression/operator-utils.js.map +0 -1
  43. package/lib/src/filter-expression/operators.js.map +0 -1
  44. package/lib/src/filter-expression/pattern-match-placeholders.js.map +0 -1
  45. package/lib/src/filter-expression/pattern-match.js.map +0 -1
  46. package/lib/src/filter-expression/pattern-to-expression.js.map +0 -1
  47. package/lib/src/filter-expression/types.js.map +0 -1
  48. package/lib/src/params-placeholders.js.map +0 -1
  49. package/lib/src/tsfixme.js.map +0 -1
  50. package/lib/src/types.js.map +0 -1
  51. package/lib/src/utils.js.map +0 -1
  52. package/lib/src/visitors.js.map +0 -1
  53. package/lib/test-data/schema-mock.js.map +0 -1
@@ -1,867 +1,1151 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.operatorBoolIs = exports.operatorCollectionIsNotEmpty = exports.operatorCollectionIsEmpty = exports.operatorCollectionDoesNotContainAnyOf = exports.operatorCollectionDoesNotContainMe = exports.operatorCollectionDoesNotContain = exports.operatorCollectionContainsAnyOf = exports.withoutLastIdAccess = exports.operatorCollectionContainsMe = exports.operatorCollectionContains = exports.operatorLocationIsNotEmpty = exports.operatorLocationIsEmpty = exports.operatorLocationDoesNotContain = exports.operatorLocationContains = exports.operatorTextIsNotEmptyV2 = exports.operatorTextIsNotEmptyV1 = exports.operatorTextIsEmptyV2 = exports.operatorTextIsEmptyV1 = exports.operatorNumberIsNotEmptyV2 = exports.operatorNumberIsNotEmptyV1 = exports.operatorNumberIsEmptyV2 = exports.operatorNumberIsEmptyV1 = exports.operatorCollectionCountLessThanOrEqual = exports.operatorCollectionCountGreaterThanOrEqual = exports.operatorCollectionCountLessThan = exports.operatorCollectionCountGreaterThan = exports.operatorCollectionCountDoesNotEqual = exports.operatorCollectionCountEquals = exports.operatorLessThanOrEqual = exports.operatorGreaterThanOrEqual = exports.operatorLessThan = exports.operatorGreaterThan = exports.operatorNumberDoesNotEqual = exports.operatorNumberEquals = exports.operatorTextEndsWith = exports.operatorTextStartsWith = exports.operatorTextDoesNotContain = exports.operatorTextContains = exports.operatorTextIsNot = exports.operatorTextExactlyIs = exports.operatorTextIs = exports.operatorUserRoleIsAnyOf = exports.operatorReferenceIsNotEmpty = exports.operatorReferenceIsEmpty = exports.operatorReferenceIsNoneOf = exports.operatorReferenceIsNot = exports.operatorReferenceIsAnyOf = exports.operatorReferenceIs = exports.operatorReferenceIsNotMe = exports.operatorReferenceIsMe = void 0;
7
- exports.hiddenValidOperators = exports.operators = exports.operatorsGroups = exports.operatorsGroupsWithoutMe = exports.operatorDateTimeIsOnOrAfter = exports.operatorDateTimeIsOnOrBefore = exports.operatorDateTimeIsAfter = exports.operatorDateTimeIsBefore = exports.operatorDateTimeIsWithin = exports.operatorDateTimeIs = exports.operatorDateIsOnOrAfter = exports.operatorDateIsAfter = exports.operatorDateIsOnOrBefore = exports.operatorDateIsBefore = exports.operatorDateIsWithin = exports.operatorDateIsNotEmptyV2 = exports.operatorDateIsNotEmptyV1 = exports.operatorDateIsEmptyV2 = exports.operatorDateIsEmptyV1 = exports.operatorDateIs = void 0;
8
- const _1 = require("@fibery/helpers/src/_");
9
- /* eslint-disable max-lines */
10
- const findKey_1 = __importDefault(require("lodash/findKey"));
11
- const flatten_1 = __importDefault(require("lodash/flatten"));
12
- const isEqual_1 = __importDefault(require("lodash/isEqual"));
13
- const isString_1 = __importDefault(require("lodash/isString"));
14
- const last_1 = __importDefault(require("lodash/last"));
15
- const uniq_1 = __importDefault(require("lodash/uniq"));
16
- const uuid_1 = require("uuid");
17
- const params_placeholders_1 = require("../params-placeholders");
18
- const operator_utils_1 = require("./operator-utils");
19
- const pattern_match_1 = require("./pattern-match");
20
- const pattern_match_placeholders_1 = require("./pattern-match-placeholders");
21
- const pattern_to_expression_1 = require("./pattern-to-expression");
22
- const referenceIsMePattern = ["=", pattern_match_placeholders_1.referenceExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => x === "$my-id")];
23
- const referenceIsNotMePattern = ["!=", pattern_match_placeholders_1.referenceExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => x === "$my-id")];
24
- const getReferenceMeOperator = ({ id, title, pattern, isNegative, }) => {
25
- return {
26
- type: ":operator-type/unary",
27
- id,
28
- title,
29
- customMatch: (where, params, typeObject) => {
30
- const { matchSuccess, matches } = (0, pattern_match_1.doPatternMatch)(where, params, pattern, typeObject);
31
- if (matchSuccess) {
32
- return {
33
- matchSuccess,
34
- expression: matches[0].value,
35
- };
36
- }
37
- return { matchSuccess: false };
38
- },
39
- customConvertToWhereExpression: (expression, value, getNextParamName) => {
40
- return (0, pattern_to_expression_1.convertToExpression)(pattern, expression, "$my-id", getNextParamName);
41
- },
42
- isNegative,
43
- };
44
- };
45
- exports.operatorReferenceIsMe = getReferenceMeOperator({
46
- id: ":operator/reference-is-me",
47
- title: "is Me",
48
- pattern: referenceIsMePattern,
49
- isNegative: false,
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { doPatternMatch } from "./pattern-match.js";
3
+ import { dateToDateTimeIntervalLookup, isDynamicFilterParam, paramsPlaceholdersLookup, parseRelativeDatePlaceholder, toRelativeDatePlaceholder } from "../params-placeholders.js";
4
+ import { anyDateExpressionPlaceholder, boolFieldPlaceholder, collectionCountExpressionPlaceholder, dateOrDateRangeExpressionPlaceholder, dateTimeOrDateTimeRangeExpressionPlaceholder, getConstantPlaceholder, getParamPlaceholder, locationFieldPlaceholder, numberFieldPlaceholder, referenceCollectionExpressionPlaceholder, referenceCollectionFieldPlaceholder, referenceExpressionPlaceholder, textFieldPlaceholder } from "./pattern-match-placeholders.js";
5
+ import { getCompareOperatorForDateTime, getWithinOperatorCustomConvertFn, getWithinOperatorCustomMatchFn, isDateTime, isNoValue } from "./operator-utils.js";
6
+ import { convertToExpression } from "./pattern-to-expression.js";
7
+ import flatten from "lodash/flatten.js";
8
+ import { validate } from "uuid";
9
+ import { mapValues } from "@fibery/helpers/src/_";
10
+ import isString from "lodash/isString.js";
11
+ import last from "lodash/last.js";
12
+ import findKey from "lodash/findKey.js";
13
+ import isEqual from "lodash/isEqual.js";
14
+ import uniq from "lodash/uniq.js";
15
+ //#region src/filter-expression/operators.ts
16
+ var operators_exports = /* @__PURE__ */ __exportAll({
17
+ hiddenValidOperators: () => hiddenValidOperators,
18
+ operatorBoolIs: () => operatorBoolIs,
19
+ operatorCollectionContains: () => operatorCollectionContains,
20
+ operatorCollectionContainsAnyOf: () => operatorCollectionContainsAnyOf,
21
+ operatorCollectionContainsMe: () => operatorCollectionContainsMe,
22
+ operatorCollectionCountDoesNotEqual: () => operatorCollectionCountDoesNotEqual,
23
+ operatorCollectionCountEquals: () => operatorCollectionCountEquals,
24
+ operatorCollectionCountGreaterThan: () => operatorCollectionCountGreaterThan,
25
+ operatorCollectionCountGreaterThanOrEqual: () => operatorCollectionCountGreaterThanOrEqual,
26
+ operatorCollectionCountLessThan: () => operatorCollectionCountLessThan,
27
+ operatorCollectionCountLessThanOrEqual: () => operatorCollectionCountLessThanOrEqual,
28
+ operatorCollectionDoesNotContain: () => operatorCollectionDoesNotContain,
29
+ operatorCollectionDoesNotContainAnyOf: () => operatorCollectionDoesNotContainAnyOf,
30
+ operatorCollectionDoesNotContainMe: () => operatorCollectionDoesNotContainMe,
31
+ operatorCollectionIsEmpty: () => operatorCollectionIsEmpty,
32
+ operatorCollectionIsNotEmpty: () => operatorCollectionIsNotEmpty,
33
+ operatorDateIs: () => operatorDateIs,
34
+ operatorDateIsAfter: () => operatorDateIsAfter,
35
+ operatorDateIsBefore: () => operatorDateIsBefore,
36
+ operatorDateIsEmptyV1: () => operatorDateIsEmptyV1,
37
+ operatorDateIsEmptyV2: () => operatorDateIsEmptyV2,
38
+ operatorDateIsNotEmptyV1: () => operatorDateIsNotEmptyV1,
39
+ operatorDateIsNotEmptyV2: () => operatorDateIsNotEmptyV2,
40
+ operatorDateIsOnOrAfter: () => operatorDateIsOnOrAfter,
41
+ operatorDateIsOnOrBefore: () => operatorDateIsOnOrBefore,
42
+ operatorDateIsWithin: () => operatorDateIsWithin,
43
+ operatorDateTimeIs: () => operatorDateTimeIs,
44
+ operatorDateTimeIsAfter: () => operatorDateTimeIsAfter,
45
+ operatorDateTimeIsBefore: () => operatorDateTimeIsBefore,
46
+ operatorDateTimeIsOnOrAfter: () => operatorDateTimeIsOnOrAfter,
47
+ operatorDateTimeIsOnOrBefore: () => operatorDateTimeIsOnOrBefore,
48
+ operatorDateTimeIsWithin: () => operatorDateTimeIsWithin,
49
+ operatorGreaterThan: () => operatorGreaterThan,
50
+ operatorGreaterThanOrEqual: () => operatorGreaterThanOrEqual,
51
+ operatorLessThan: () => operatorLessThan,
52
+ operatorLessThanOrEqual: () => operatorLessThanOrEqual,
53
+ operatorLocationContains: () => operatorLocationContains,
54
+ operatorLocationDoesNotContain: () => operatorLocationDoesNotContain,
55
+ operatorLocationIsEmpty: () => operatorLocationIsEmpty,
56
+ operatorLocationIsNotEmpty: () => operatorLocationIsNotEmpty,
57
+ operatorNumberDoesNotEqual: () => operatorNumberDoesNotEqual,
58
+ operatorNumberEquals: () => operatorNumberEquals,
59
+ operatorNumberIsEmptyV1: () => operatorNumberIsEmptyV1,
60
+ operatorNumberIsEmptyV2: () => operatorNumberIsEmptyV2,
61
+ operatorNumberIsNotEmptyV1: () => operatorNumberIsNotEmptyV1,
62
+ operatorNumberIsNotEmptyV2: () => operatorNumberIsNotEmptyV2,
63
+ operatorReferenceIs: () => operatorReferenceIs,
64
+ operatorReferenceIsAnyOf: () => operatorReferenceIsAnyOf,
65
+ operatorReferenceIsEmpty: () => operatorReferenceIsEmpty,
66
+ operatorReferenceIsMe: () => operatorReferenceIsMe,
67
+ operatorReferenceIsNoneOf: () => operatorReferenceIsNoneOf,
68
+ operatorReferenceIsNot: () => operatorReferenceIsNot,
69
+ operatorReferenceIsNotEmpty: () => operatorReferenceIsNotEmpty,
70
+ operatorReferenceIsNotMe: () => operatorReferenceIsNotMe,
71
+ operatorTextContains: () => operatorTextContains,
72
+ operatorTextDoesNotContain: () => operatorTextDoesNotContain,
73
+ operatorTextEndsWith: () => operatorTextEndsWith,
74
+ operatorTextExactlyIs: () => operatorTextExactlyIs,
75
+ operatorTextIs: () => operatorTextIs,
76
+ operatorTextIsEmptyV1: () => operatorTextIsEmptyV1,
77
+ operatorTextIsEmptyV2: () => operatorTextIsEmptyV2,
78
+ operatorTextIsNot: () => operatorTextIsNot,
79
+ operatorTextIsNotEmptyV1: () => operatorTextIsNotEmptyV1,
80
+ operatorTextIsNotEmptyV2: () => operatorTextIsNotEmptyV2,
81
+ operatorTextStartsWith: () => operatorTextStartsWith,
82
+ operatorUserRoleIsAnyOf: () => operatorUserRoleIsAnyOf,
83
+ operators: () => operators,
84
+ operatorsGroups: () => operatorsGroups,
85
+ operatorsGroupsWithoutMe: () => operatorsGroupsWithoutMe,
86
+ withoutLastIdAccess: () => withoutLastIdAccess
50
87
  });
51
- exports.operatorReferenceIsNotMe = getReferenceMeOperator({
52
- id: ":operator/reference-is-not-me",
53
- title: "is not Me",
54
- pattern: referenceIsNotMePattern,
55
- isNegative: true,
88
+ const referenceIsMePattern = [
89
+ "=",
90
+ referenceExpressionPlaceholder,
91
+ getParamPlaceholder((x) => x === "$my-id")
92
+ ];
93
+ const referenceIsNotMePattern = [
94
+ "!=",
95
+ referenceExpressionPlaceholder,
96
+ getParamPlaceholder((x) => x === "$my-id")
97
+ ];
98
+ const getReferenceMeOperator = ({ id, title, pattern, isNegative }) => {
99
+ return {
100
+ type: ":operator-type/unary",
101
+ id,
102
+ title,
103
+ customMatch: (where, params, typeObject) => {
104
+ const { matchSuccess, matches } = doPatternMatch(where, params, pattern, typeObject);
105
+ if (matchSuccess) return {
106
+ matchSuccess,
107
+ expression: matches[0].value
108
+ };
109
+ return { matchSuccess: false };
110
+ },
111
+ customConvertToWhereExpression: (expression, value, getNextParamName) => {
112
+ return convertToExpression(pattern, expression, "$my-id", getNextParamName);
113
+ },
114
+ isNegative
115
+ };
116
+ };
117
+ const operatorReferenceIsMe = getReferenceMeOperator({
118
+ id: ":operator/reference-is-me",
119
+ title: "is Me",
120
+ pattern: referenceIsMePattern,
121
+ isNegative: false
122
+ });
123
+ const operatorReferenceIsNotMe = getReferenceMeOperator({
124
+ id: ":operator/reference-is-not-me",
125
+ title: "is not Me",
126
+ pattern: referenceIsNotMePattern,
127
+ isNegative: true
56
128
  });
57
129
  function isValidReferenceUUID(val) {
58
- // nil UUID should be accepted because "11111111-1111-1111-1111-111111111111" is used as
59
- // non-existing UUID for case when one type has enum type but another type does not
60
- // temporary disable bcz fix opens up another bugs like unable to create entity with pre-set filters and so on
61
- // return isUUID.anyNonNil(val) || val === "11111111-1111-1111-1111-111111111111";
62
- return (0, uuid_1.validate)(val) || ((0, isString_1.default)(val) && (0, params_placeholders_1.isDynamicFilterParam)(val));
130
+ return validate(val) || isString(val) && isDynamicFilterParam(val);
63
131
  }
64
- exports.operatorReferenceIs = {
65
- id: ":operator/reference-is",
66
- title: "is",
67
- pattern: [
68
- "=",
69
- pattern_match_placeholders_1.referenceExpressionPlaceholder,
70
- (0, pattern_match_placeholders_1.getParamPlaceholder)((val) => isValidReferenceUUID(val) || (0, operator_utils_1.isNoValue)(val)),
71
- ],
72
- type: ":operator-type/binary",
73
- isNegative: false,
74
- };
75
- exports.operatorReferenceIsAnyOf = {
76
- id: ":operator/reference-is-any-of",
77
- title: "is any of",
78
- pattern: ["q/in", pattern_match_placeholders_1.referenceExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((val) => val !== null)],
79
- type: ":operator-type/binary",
80
- isNegative: false,
81
- };
82
- exports.operatorReferenceIsNot = {
83
- id: ":operator/reference-is-not",
84
- title: "is not",
85
- pattern: [
86
- "!=",
87
- pattern_match_placeholders_1.referenceExpressionPlaceholder,
88
- (0, pattern_match_placeholders_1.getParamPlaceholder)((val) => isValidReferenceUUID(val) || (0, operator_utils_1.isNoValue)(val)),
89
- ],
90
- type: ":operator-type/binary",
91
- isNegative: true,
92
- };
93
- exports.operatorReferenceIsNoneOf = {
94
- id: ":operator/reference-is-none-of",
95
- title: "is none of",
96
- pattern: ["q/not-in", pattern_match_placeholders_1.referenceExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((val) => val !== null)],
97
- type: ":operator-type/binary",
98
- isNegative: true,
99
- };
100
- exports.operatorReferenceIsEmpty = {
101
- id: ":operator/reference-is-empty",
102
- title: "is empty",
103
- pattern: ["=", pattern_match_placeholders_1.referenceExpressionPlaceholder, (0, pattern_match_placeholders_1.getConstantPlaceholder)(null)],
104
- type: ":operator-type/unary",
105
- isNegative: false,
106
- };
107
- exports.operatorReferenceIsNotEmpty = {
108
- id: ":operator/reference-is-not-empty",
109
- title: "is not empty",
110
- pattern: ["!=", pattern_match_placeholders_1.referenceExpressionPlaceholder, (0, pattern_match_placeholders_1.getConstantPlaceholder)(null)],
111
- type: ":operator-type/unary",
112
- isNegative: true,
113
- };
114
- exports.operatorUserRoleIsAnyOf = {
115
- id: ":operator/user-role-is-any-of",
116
- title: "is any of",
117
- pattern: [
118
- "q/in",
119
- pattern_match_placeholders_1.textFieldPlaceholder,
120
- (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => (Array.isArray(x) && x.every((item) => (0, isString_1.default)(item))) || (0, operator_utils_1.isNoValue)(x)),
121
- ],
122
- type: ":operator-type/binary",
123
- isNegative: false,
124
- };
125
- exports.operatorTextIs = {
126
- id: ":operator/string-equals",
127
- title: "is",
128
- pattern: ["q/equals-ignoring-case?", pattern_match_placeholders_1.textFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
129
- type: ":operator-type/binary",
130
- isNegative: false,
131
- };
132
- exports.operatorTextExactlyIs = {
133
- id: ":operator/string-equals-exact",
134
- title: "=",
135
- pattern: ["=", pattern_match_placeholders_1.textFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
136
- type: ":operator-type/binary",
137
- isNegative: false,
138
- };
139
- exports.operatorTextIsNot = {
140
- id: ":operator/string-not-equals",
141
- title: "is not",
142
- pattern: ["q/not-equals-ignoring-case?", pattern_match_placeholders_1.textFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
143
- type: ":operator-type/binary",
144
- isNegative: true,
145
- };
146
- exports.operatorTextContains = {
147
- id: ":operator/string-contains",
148
- title: "contains",
149
- pattern: ["q/contains", pattern_match_placeholders_1.textFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
150
- type: ":operator-type/binary",
151
- isNegative: false,
152
- };
153
- exports.operatorTextDoesNotContain = {
154
- id: ":operator/string-does-not-contain",
155
- title: "does not contain",
156
- pattern: ["q/not-contains", pattern_match_placeholders_1.textFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
157
- type: ":operator-type/binary",
158
- isNegative: true,
159
- };
160
- exports.operatorTextStartsWith = {
161
- id: ":operator/string-starts-with",
162
- title: "starts with",
163
- pattern: ["q/starts-with-ignoring-case?", pattern_match_placeholders_1.textFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
164
- type: ":operator-type/binary",
165
- isNegative: false,
166
- };
167
- exports.operatorTextEndsWith = {
168
- id: ":operator/string-ends-with",
169
- title: "ends with",
170
- pattern: ["q/ends-with-ignoring-case?", pattern_match_placeholders_1.textFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
171
- type: ":operator-type/binary",
172
- isNegative: false,
173
- };
174
- exports.operatorNumberEquals = {
175
- id: ":operator/equals",
176
- title: "=",
177
- pattern: ["=", pattern_match_placeholders_1.numberFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => x !== null)],
178
- type: ":operator-type/binary",
179
- isNegative: false,
180
- };
181
- exports.operatorNumberDoesNotEqual = {
182
- id: ":operator/does-not-equal",
183
- title: "≠",
184
- pattern: ["!=", pattern_match_placeholders_1.numberFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => x !== null)],
185
- type: ":operator-type/binary",
186
- isNegative: true,
187
- };
188
- exports.operatorGreaterThan = {
189
- id: ":operator/greater-than",
190
- title: ">",
191
- pattern: [">", pattern_match_placeholders_1.numberFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
192
- type: ":operator-type/binary",
193
- isNegative: false,
194
- };
195
- exports.operatorLessThan = {
196
- id: ":operator/less-than",
197
- title: "<",
198
- pattern: ["<", pattern_match_placeholders_1.numberFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
199
- type: ":operator-type/binary",
200
- isNegative: false,
201
- };
202
- exports.operatorGreaterThanOrEqual = {
203
- id: ":operator/greater-than-or-equal",
204
- title: "≥",
205
- pattern: [">=", pattern_match_placeholders_1.numberFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
206
- type: ":operator-type/binary",
207
- isNegative: false,
208
- };
209
- exports.operatorLessThanOrEqual = {
210
- id: ":operator/less-than-or-equal",
211
- title: "≤",
212
- pattern: ["<=", pattern_match_placeholders_1.numberFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
213
- type: ":operator-type/binary",
214
- isNegative: false,
215
- };
216
- exports.operatorCollectionCountEquals = {
217
- id: ":operator/collection-count-equals",
218
- title: "=",
219
- pattern: ["=", pattern_match_placeholders_1.collectionCountExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => x !== null)],
220
- type: ":operator-type/binary",
221
- isNegative: false,
222
- };
223
- exports.operatorCollectionCountDoesNotEqual = {
224
- id: ":operator/collection-count-does-not-equal",
225
- title: "≠",
226
- pattern: ["!=", pattern_match_placeholders_1.collectionCountExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => x !== null)],
227
- type: ":operator-type/binary",
228
- isNegative: true,
229
- };
230
- exports.operatorCollectionCountGreaterThan = {
231
- id: ":operator/collection-count-greater-than",
232
- title: ">",
233
- pattern: [">", pattern_match_placeholders_1.collectionCountExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
234
- type: ":operator-type/binary",
235
- isNegative: false,
236
- };
237
- exports.operatorCollectionCountLessThan = {
238
- id: ":operator/collection-count-less-than",
239
- title: "<",
240
- pattern: ["<", pattern_match_placeholders_1.collectionCountExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
241
- type: ":operator-type/binary",
242
- isNegative: false,
243
- };
244
- exports.operatorCollectionCountGreaterThanOrEqual = {
245
- id: ":operator/collection-count-greater-than-or-equal",
246
- title: "≥",
247
- pattern: [">=", pattern_match_placeholders_1.collectionCountExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
248
- type: ":operator-type/binary",
249
- isNegative: false,
250
- };
251
- exports.operatorCollectionCountLessThanOrEqual = {
252
- id: ":operator/collection-count-less-than-or-equal",
253
- title: "≤",
254
- pattern: ["<=", pattern_match_placeholders_1.collectionCountExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
255
- type: ":operator-type/binary",
256
- isNegative: false,
257
- };
258
- exports.operatorNumberIsEmptyV1 = {
259
- id: ":operator/number-is-empty",
260
- title: "is empty",
261
- pattern: ["=", pattern_match_placeholders_1.numberFieldPlaceholder, (0, pattern_match_placeholders_1.getConstantPlaceholder)(null)],
262
- type: ":operator-type/unary",
263
- isNegative: false,
264
- };
265
- exports.operatorNumberIsEmptyV2 = {
266
- id: ":operator/number-is-empty",
267
- title: "is empty",
268
- pattern: ["=", ["q/null?", pattern_match_placeholders_1.numberFieldPlaceholder], (0, pattern_match_placeholders_1.getConstantPlaceholder)(true)],
269
- type: ":operator-type/unary",
270
- isNegative: false,
271
- };
272
- exports.operatorNumberIsNotEmptyV1 = {
273
- id: ":operator/number-is-not-empty",
274
- title: "is not empty",
275
- pattern: ["!=", pattern_match_placeholders_1.numberFieldPlaceholder, (0, pattern_match_placeholders_1.getConstantPlaceholder)(null)],
276
- type: ":operator-type/unary",
277
- isNegative: true,
278
- };
279
- exports.operatorNumberIsNotEmptyV2 = {
280
- id: ":operator/number-is-not-empty",
281
- title: "is not empty",
282
- pattern: ["=", ["q/null?", pattern_match_placeholders_1.numberFieldPlaceholder], (0, pattern_match_placeholders_1.getConstantPlaceholder)(false)],
283
- type: ":operator-type/unary",
284
- isNegative: true,
285
- };
286
- exports.operatorTextIsEmptyV1 = {
287
- id: ":operator/text-is-empty",
288
- title: "is empty",
289
- pattern: ["=", pattern_match_placeholders_1.textFieldPlaceholder, (0, pattern_match_placeholders_1.getConstantPlaceholder)(null)],
290
- type: ":operator-type/unary",
291
- isNegative: false,
292
- };
293
- exports.operatorTextIsEmptyV2 = {
294
- id: ":operator/text-is-empty",
295
- title: "is empty",
296
- pattern: ["=", ["q/null-or-empty?", pattern_match_placeholders_1.textFieldPlaceholder], (0, pattern_match_placeholders_1.getConstantPlaceholder)(true)],
297
- type: ":operator-type/unary",
298
- isNegative: false,
299
- };
300
- exports.operatorTextIsNotEmptyV1 = {
301
- id: ":operator/text-is-not-empty",
302
- title: "is not empty",
303
- pattern: ["!=", pattern_match_placeholders_1.textFieldPlaceholder, (0, pattern_match_placeholders_1.getConstantPlaceholder)(null)],
304
- type: ":operator-type/unary",
305
- isNegative: true,
306
- };
307
- exports.operatorTextIsNotEmptyV2 = {
308
- id: ":operator/text-is-not-empty",
309
- title: "is not empty",
310
- pattern: ["=", ["q/null-or-empty?", pattern_match_placeholders_1.textFieldPlaceholder], (0, pattern_match_placeholders_1.getConstantPlaceholder)(false)],
311
- type: ":operator-type/unary",
312
- isNegative: true,
313
- };
314
- exports.operatorLocationContains = {
315
- id: ":operator/location-contains",
316
- title: "contains",
317
- pattern: ["q/contains", ["q/address", pattern_match_placeholders_1.locationFieldPlaceholder], (0, pattern_match_placeholders_1.getParamPlaceholder)()],
318
- type: ":operator-type/binary",
319
- isNegative: false,
320
- };
321
- exports.operatorLocationDoesNotContain = {
322
- id: ":operator/location-does-not-contain",
323
- title: "does not contain",
324
- pattern: ["q/not-contains", ["q/address", pattern_match_placeholders_1.locationFieldPlaceholder], (0, pattern_match_placeholders_1.getParamPlaceholder)()],
325
- type: ":operator-type/binary",
326
- isNegative: true,
327
- };
328
- exports.operatorLocationIsEmpty = {
329
- id: ":operator/location-is-empty",
330
- title: "is empty",
331
- pattern: ["=", pattern_match_placeholders_1.locationFieldPlaceholder, (0, pattern_match_placeholders_1.getConstantPlaceholder)(null)],
332
- type: ":operator-type/unary",
333
- isNegative: false,
334
- };
335
- exports.operatorLocationIsNotEmpty = {
336
- id: ":operator/location-is-not-empty",
337
- title: "is not empty",
338
- pattern: ["!=", pattern_match_placeholders_1.locationFieldPlaceholder, (0, pattern_match_placeholders_1.getConstantPlaceholder)(null)],
339
- type: ":operator-type/unary",
340
- isNegative: true,
132
+ const operatorReferenceIs = {
133
+ id: ":operator/reference-is",
134
+ title: "is",
135
+ pattern: [
136
+ "=",
137
+ referenceExpressionPlaceholder,
138
+ getParamPlaceholder((val) => isValidReferenceUUID(val) || isNoValue(val))
139
+ ],
140
+ type: ":operator-type/binary",
141
+ isNegative: false
142
+ };
143
+ const operatorReferenceIsAnyOf = {
144
+ id: ":operator/reference-is-any-of",
145
+ title: "is any of",
146
+ pattern: [
147
+ "q/in",
148
+ referenceExpressionPlaceholder,
149
+ getParamPlaceholder((val) => val !== null)
150
+ ],
151
+ type: ":operator-type/binary",
152
+ isNegative: false
153
+ };
154
+ const operatorReferenceIsNot = {
155
+ id: ":operator/reference-is-not",
156
+ title: "is not",
157
+ pattern: [
158
+ "!=",
159
+ referenceExpressionPlaceholder,
160
+ getParamPlaceholder((val) => isValidReferenceUUID(val) || isNoValue(val))
161
+ ],
162
+ type: ":operator-type/binary",
163
+ isNegative: true
164
+ };
165
+ const operatorReferenceIsNoneOf = {
166
+ id: ":operator/reference-is-none-of",
167
+ title: "is none of",
168
+ pattern: [
169
+ "q/not-in",
170
+ referenceExpressionPlaceholder,
171
+ getParamPlaceholder((val) => val !== null)
172
+ ],
173
+ type: ":operator-type/binary",
174
+ isNegative: true
175
+ };
176
+ const operatorReferenceIsEmpty = {
177
+ id: ":operator/reference-is-empty",
178
+ title: "is empty",
179
+ pattern: [
180
+ "=",
181
+ referenceExpressionPlaceholder,
182
+ getConstantPlaceholder(null)
183
+ ],
184
+ type: ":operator-type/unary",
185
+ isNegative: false
186
+ };
187
+ const operatorReferenceIsNotEmpty = {
188
+ id: ":operator/reference-is-not-empty",
189
+ title: "is not empty",
190
+ pattern: [
191
+ "!=",
192
+ referenceExpressionPlaceholder,
193
+ getConstantPlaceholder(null)
194
+ ],
195
+ type: ":operator-type/unary",
196
+ isNegative: true
197
+ };
198
+ const operatorUserRoleIsAnyOf = {
199
+ id: ":operator/user-role-is-any-of",
200
+ title: "is any of",
201
+ pattern: [
202
+ "q/in",
203
+ textFieldPlaceholder,
204
+ getParamPlaceholder((x) => Array.isArray(x) && x.every((item) => isString(item)) || isNoValue(x))
205
+ ],
206
+ type: ":operator-type/binary",
207
+ isNegative: false
208
+ };
209
+ const operatorTextIs = {
210
+ id: ":operator/string-equals",
211
+ title: "is",
212
+ pattern: [
213
+ "q/equals-ignoring-case?",
214
+ textFieldPlaceholder,
215
+ getParamPlaceholder()
216
+ ],
217
+ type: ":operator-type/binary",
218
+ isNegative: false
219
+ };
220
+ const operatorTextExactlyIs = {
221
+ id: ":operator/string-equals-exact",
222
+ title: "=",
223
+ pattern: [
224
+ "=",
225
+ textFieldPlaceholder,
226
+ getParamPlaceholder()
227
+ ],
228
+ type: ":operator-type/binary",
229
+ isNegative: false
230
+ };
231
+ const operatorTextIsNot = {
232
+ id: ":operator/string-not-equals",
233
+ title: "is not",
234
+ pattern: [
235
+ "q/not-equals-ignoring-case?",
236
+ textFieldPlaceholder,
237
+ getParamPlaceholder()
238
+ ],
239
+ type: ":operator-type/binary",
240
+ isNegative: true
241
+ };
242
+ const operatorTextContains = {
243
+ id: ":operator/string-contains",
244
+ title: "contains",
245
+ pattern: [
246
+ "q/contains",
247
+ textFieldPlaceholder,
248
+ getParamPlaceholder()
249
+ ],
250
+ type: ":operator-type/binary",
251
+ isNegative: false
252
+ };
253
+ const operatorTextDoesNotContain = {
254
+ id: ":operator/string-does-not-contain",
255
+ title: "does not contain",
256
+ pattern: [
257
+ "q/not-contains",
258
+ textFieldPlaceholder,
259
+ getParamPlaceholder()
260
+ ],
261
+ type: ":operator-type/binary",
262
+ isNegative: true
263
+ };
264
+ const operatorTextStartsWith = {
265
+ id: ":operator/string-starts-with",
266
+ title: "starts with",
267
+ pattern: [
268
+ "q/starts-with-ignoring-case?",
269
+ textFieldPlaceholder,
270
+ getParamPlaceholder()
271
+ ],
272
+ type: ":operator-type/binary",
273
+ isNegative: false
274
+ };
275
+ const operatorTextEndsWith = {
276
+ id: ":operator/string-ends-with",
277
+ title: "ends with",
278
+ pattern: [
279
+ "q/ends-with-ignoring-case?",
280
+ textFieldPlaceholder,
281
+ getParamPlaceholder()
282
+ ],
283
+ type: ":operator-type/binary",
284
+ isNegative: false
285
+ };
286
+ const operatorNumberEquals = {
287
+ id: ":operator/equals",
288
+ title: "=",
289
+ pattern: [
290
+ "=",
291
+ numberFieldPlaceholder,
292
+ getParamPlaceholder((x) => x !== null)
293
+ ],
294
+ type: ":operator-type/binary",
295
+ isNegative: false
296
+ };
297
+ const operatorNumberDoesNotEqual = {
298
+ id: ":operator/does-not-equal",
299
+ title: "≠",
300
+ pattern: [
301
+ "!=",
302
+ numberFieldPlaceholder,
303
+ getParamPlaceholder((x) => x !== null)
304
+ ],
305
+ type: ":operator-type/binary",
306
+ isNegative: true
307
+ };
308
+ const operatorGreaterThan = {
309
+ id: ":operator/greater-than",
310
+ title: ">",
311
+ pattern: [
312
+ ">",
313
+ numberFieldPlaceholder,
314
+ getParamPlaceholder()
315
+ ],
316
+ type: ":operator-type/binary",
317
+ isNegative: false
318
+ };
319
+ const operatorLessThan = {
320
+ id: ":operator/less-than",
321
+ title: "<",
322
+ pattern: [
323
+ "<",
324
+ numberFieldPlaceholder,
325
+ getParamPlaceholder()
326
+ ],
327
+ type: ":operator-type/binary",
328
+ isNegative: false
329
+ };
330
+ const operatorGreaterThanOrEqual = {
331
+ id: ":operator/greater-than-or-equal",
332
+ title: "≥",
333
+ pattern: [
334
+ ">=",
335
+ numberFieldPlaceholder,
336
+ getParamPlaceholder()
337
+ ],
338
+ type: ":operator-type/binary",
339
+ isNegative: false
340
+ };
341
+ const operatorLessThanOrEqual = {
342
+ id: ":operator/less-than-or-equal",
343
+ title: "≤",
344
+ pattern: [
345
+ "<=",
346
+ numberFieldPlaceholder,
347
+ getParamPlaceholder()
348
+ ],
349
+ type: ":operator-type/binary",
350
+ isNegative: false
351
+ };
352
+ const operatorCollectionCountEquals = {
353
+ id: ":operator/collection-count-equals",
354
+ title: "=",
355
+ pattern: [
356
+ "=",
357
+ collectionCountExpressionPlaceholder,
358
+ getParamPlaceholder((x) => x !== null)
359
+ ],
360
+ type: ":operator-type/binary",
361
+ isNegative: false
362
+ };
363
+ const operatorCollectionCountDoesNotEqual = {
364
+ id: ":operator/collection-count-does-not-equal",
365
+ title: "≠",
366
+ pattern: [
367
+ "!=",
368
+ collectionCountExpressionPlaceholder,
369
+ getParamPlaceholder((x) => x !== null)
370
+ ],
371
+ type: ":operator-type/binary",
372
+ isNegative: true
373
+ };
374
+ const operatorCollectionCountGreaterThan = {
375
+ id: ":operator/collection-count-greater-than",
376
+ title: ">",
377
+ pattern: [
378
+ ">",
379
+ collectionCountExpressionPlaceholder,
380
+ getParamPlaceholder()
381
+ ],
382
+ type: ":operator-type/binary",
383
+ isNegative: false
384
+ };
385
+ const operatorCollectionCountLessThan = {
386
+ id: ":operator/collection-count-less-than",
387
+ title: "<",
388
+ pattern: [
389
+ "<",
390
+ collectionCountExpressionPlaceholder,
391
+ getParamPlaceholder()
392
+ ],
393
+ type: ":operator-type/binary",
394
+ isNegative: false
395
+ };
396
+ const operatorCollectionCountGreaterThanOrEqual = {
397
+ id: ":operator/collection-count-greater-than-or-equal",
398
+ title: "≥",
399
+ pattern: [
400
+ ">=",
401
+ collectionCountExpressionPlaceholder,
402
+ getParamPlaceholder()
403
+ ],
404
+ type: ":operator-type/binary",
405
+ isNegative: false
406
+ };
407
+ const operatorCollectionCountLessThanOrEqual = {
408
+ id: ":operator/collection-count-less-than-or-equal",
409
+ title: "≤",
410
+ pattern: [
411
+ "<=",
412
+ collectionCountExpressionPlaceholder,
413
+ getParamPlaceholder()
414
+ ],
415
+ type: ":operator-type/binary",
416
+ isNegative: false
417
+ };
418
+ const operatorNumberIsEmptyV1 = {
419
+ id: ":operator/number-is-empty",
420
+ title: "is empty",
421
+ pattern: [
422
+ "=",
423
+ numberFieldPlaceholder,
424
+ getConstantPlaceholder(null)
425
+ ],
426
+ type: ":operator-type/unary",
427
+ isNegative: false
428
+ };
429
+ const operatorNumberIsEmptyV2 = {
430
+ id: ":operator/number-is-empty",
431
+ title: "is empty",
432
+ pattern: [
433
+ "=",
434
+ ["q/null?", numberFieldPlaceholder],
435
+ getConstantPlaceholder(true)
436
+ ],
437
+ type: ":operator-type/unary",
438
+ isNegative: false
439
+ };
440
+ const operatorNumberIsNotEmptyV1 = {
441
+ id: ":operator/number-is-not-empty",
442
+ title: "is not empty",
443
+ pattern: [
444
+ "!=",
445
+ numberFieldPlaceholder,
446
+ getConstantPlaceholder(null)
447
+ ],
448
+ type: ":operator-type/unary",
449
+ isNegative: true
450
+ };
451
+ const operatorNumberIsNotEmptyV2 = {
452
+ id: ":operator/number-is-not-empty",
453
+ title: "is not empty",
454
+ pattern: [
455
+ "=",
456
+ ["q/null?", numberFieldPlaceholder],
457
+ getConstantPlaceholder(false)
458
+ ],
459
+ type: ":operator-type/unary",
460
+ isNegative: true
461
+ };
462
+ const operatorTextIsEmptyV1 = {
463
+ id: ":operator/text-is-empty",
464
+ title: "is empty",
465
+ pattern: [
466
+ "=",
467
+ textFieldPlaceholder,
468
+ getConstantPlaceholder(null)
469
+ ],
470
+ type: ":operator-type/unary",
471
+ isNegative: false
472
+ };
473
+ const operatorTextIsEmptyV2 = {
474
+ id: ":operator/text-is-empty",
475
+ title: "is empty",
476
+ pattern: [
477
+ "=",
478
+ ["q/null-or-empty?", textFieldPlaceholder],
479
+ getConstantPlaceholder(true)
480
+ ],
481
+ type: ":operator-type/unary",
482
+ isNegative: false
483
+ };
484
+ const operatorTextIsNotEmptyV1 = {
485
+ id: ":operator/text-is-not-empty",
486
+ title: "is not empty",
487
+ pattern: [
488
+ "!=",
489
+ textFieldPlaceholder,
490
+ getConstantPlaceholder(null)
491
+ ],
492
+ type: ":operator-type/unary",
493
+ isNegative: true
494
+ };
495
+ const operatorTextIsNotEmptyV2 = {
496
+ id: ":operator/text-is-not-empty",
497
+ title: "is not empty",
498
+ pattern: [
499
+ "=",
500
+ ["q/null-or-empty?", textFieldPlaceholder],
501
+ getConstantPlaceholder(false)
502
+ ],
503
+ type: ":operator-type/unary",
504
+ isNegative: true
505
+ };
506
+ const operatorLocationContains = {
507
+ id: ":operator/location-contains",
508
+ title: "contains",
509
+ pattern: [
510
+ "q/contains",
511
+ ["q/address", locationFieldPlaceholder],
512
+ getParamPlaceholder()
513
+ ],
514
+ type: ":operator-type/binary",
515
+ isNegative: false
516
+ };
517
+ const operatorLocationDoesNotContain = {
518
+ id: ":operator/location-does-not-contain",
519
+ title: "does not contain",
520
+ pattern: [
521
+ "q/not-contains",
522
+ ["q/address", locationFieldPlaceholder],
523
+ getParamPlaceholder()
524
+ ],
525
+ type: ":operator-type/binary",
526
+ isNegative: true
527
+ };
528
+ const operatorLocationIsEmpty = {
529
+ id: ":operator/location-is-empty",
530
+ title: "is empty",
531
+ pattern: [
532
+ "=",
533
+ locationFieldPlaceholder,
534
+ getConstantPlaceholder(null)
535
+ ],
536
+ type: ":operator-type/unary",
537
+ isNegative: false
538
+ };
539
+ const operatorLocationIsNotEmpty = {
540
+ id: ":operator/location-is-not-empty",
541
+ title: "is not empty",
542
+ pattern: [
543
+ "!=",
544
+ locationFieldPlaceholder,
545
+ getConstantPlaceholder(null)
546
+ ],
547
+ type: ":operator-type/unary",
548
+ isNegative: true
341
549
  };
342
550
  const getCollectionContainsPattern = (paramMatchFn) => {
343
- return [
344
- ">",
345
- {
346
- "q/from": pattern_match_placeholders_1.referenceCollectionFieldPlaceholder,
347
- "q/select": ["q/count", ["fibery/id"]],
348
- "q/where": ["=", ["fibery/id"], (0, pattern_match_placeholders_1.getParamPlaceholder)(paramMatchFn)],
349
- "q/limit": "q/no-limit",
350
- },
351
- (0, pattern_match_placeholders_1.getConstantPlaceholder)(0),
352
- ];
551
+ return [
552
+ ">",
553
+ {
554
+ "q/from": referenceCollectionFieldPlaceholder,
555
+ "q/select": ["q/count", ["fibery/id"]],
556
+ "q/where": [
557
+ "=",
558
+ ["fibery/id"],
559
+ getParamPlaceholder(paramMatchFn)
560
+ ],
561
+ "q/limit": "q/no-limit"
562
+ },
563
+ getConstantPlaceholder(0)
564
+ ];
353
565
  };
354
566
  const getCollectionContainsAnyOfPattern = (comparisonOperator) => [
355
- comparisonOperator,
356
- {
357
- "q/from": pattern_match_placeholders_1.referenceCollectionFieldPlaceholder,
358
- "q/select": ["q/count", ["fibery/id"]],
359
- "q/where": [
360
- "q/in",
361
- ["fibery/id"],
362
- (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => (Array.isArray(x) && x.every((item) => isValidReferenceUUID(item))) || (0, operator_utils_1.isNoValue)(x)),
363
- ],
364
- "q/limit": "q/no-limit",
365
- },
366
- (0, pattern_match_placeholders_1.getConstantPlaceholder)(0),
567
+ comparisonOperator,
568
+ {
569
+ "q/from": referenceCollectionFieldPlaceholder,
570
+ "q/select": ["q/count", ["fibery/id"]],
571
+ "q/where": [
572
+ "q/in",
573
+ ["fibery/id"],
574
+ getParamPlaceholder((x) => Array.isArray(x) && x.every((item) => isValidReferenceUUID(item)) || isNoValue(x))
575
+ ],
576
+ "q/limit": "q/no-limit"
577
+ },
578
+ getConstantPlaceholder(0)
367
579
  ];
368
580
  const collectionContainsAnyOfPattern = getCollectionContainsAnyOfPattern(">");
369
581
  const collectionDoesNotContainAnyOfPattern = getCollectionContainsAnyOfPattern("=");
370
- const collectionContainsPattern = getCollectionContainsPattern((x) => isValidReferenceUUID(x) || (0, operator_utils_1.isNoValue)(x));
582
+ const collectionContainsPattern = getCollectionContainsPattern((x) => isValidReferenceUUID(x) || isNoValue(x));
371
583
  const collectionContainsMePattern = getCollectionContainsPattern((x) => x === "$my-id");
372
584
  const getCollectionDoesNotContainPattern = (paramMatchFn) => [
373
- "=",
374
- {
375
- "q/from": pattern_match_placeholders_1.referenceCollectionFieldPlaceholder,
376
- "q/select": ["q/count", ["fibery/id"]],
377
- "q/where": ["=", ["fibery/id"], (0, pattern_match_placeholders_1.getParamPlaceholder)(paramMatchFn)],
378
- "q/limit": "q/no-limit",
379
- },
380
- (0, pattern_match_placeholders_1.getConstantPlaceholder)(0),
585
+ "=",
586
+ {
587
+ "q/from": referenceCollectionFieldPlaceholder,
588
+ "q/select": ["q/count", ["fibery/id"]],
589
+ "q/where": [
590
+ "=",
591
+ ["fibery/id"],
592
+ getParamPlaceholder(paramMatchFn)
593
+ ],
594
+ "q/limit": "q/no-limit"
595
+ },
596
+ getConstantPlaceholder(0)
381
597
  ];
382
- const collectionDoesNotContainPattern = getCollectionDoesNotContainPattern((x) => isValidReferenceUUID(x) || (0, operator_utils_1.isNoValue)(x));
598
+ const collectionDoesNotContainPattern = getCollectionDoesNotContainPattern((x) => isValidReferenceUUID(x) || isNoValue(x));
383
599
  const collectionDoesNotContainMePattern = getCollectionDoesNotContainPattern((x) => x === "$my-id");
384
- exports.operatorCollectionContains = {
385
- id: ":operator/collection-contains",
386
- title: "contains",
387
- customMatch: (where, params, typeObject) => {
388
- const { matchSuccess, matches } = (0, pattern_match_1.doPatternMatch)(where, params, collectionContainsPattern, typeObject);
389
- if (matchSuccess) {
390
- return {
391
- matchSuccess,
392
- expression: [...matches[0].value, "fibery/id"],
393
- value: matches[1].value,
394
- };
395
- }
396
- return { matchSuccess: false };
397
- },
398
- customConvertToWhereExpression: (expression, value, getNextParamName) => {
399
- return (0, pattern_to_expression_1.convertToExpression)(collectionContainsPattern, (0, exports.withoutLastIdAccess)(expression), value, getNextParamName);
400
- },
401
- type: ":operator-type/binary",
402
- isNegative: false,
403
- };
404
- const getOperatorCollectionMe = ({ id, title, pattern, isNegative, }) => ({
405
- id,
406
- title,
407
- customMatch: (where, params, typeObject) => {
408
- const { matchSuccess, matches } = (0, pattern_match_1.doPatternMatch)(where, params, pattern, typeObject);
409
- if (matchSuccess) {
410
- return {
411
- matchSuccess,
412
- expression: [...matches[0].value, "fibery/id"],
413
- };
414
- }
415
- return { matchSuccess: false };
416
- },
417
- customConvertToWhereExpression: (expression, value, getNextParamName) => {
418
- return (0, pattern_to_expression_1.convertToExpression)(pattern, (0, exports.withoutLastIdAccess)(expression), "$my-id", getNextParamName);
419
- },
420
- type: ":operator-type/unary",
421
- isNegative,
600
+ const operatorCollectionContains = {
601
+ id: ":operator/collection-contains",
602
+ title: "contains",
603
+ customMatch: (where, params, typeObject) => {
604
+ const { matchSuccess, matches } = doPatternMatch(where, params, collectionContainsPattern, typeObject);
605
+ if (matchSuccess) return {
606
+ matchSuccess,
607
+ expression: [...matches[0].value, "fibery/id"],
608
+ value: matches[1].value
609
+ };
610
+ return { matchSuccess: false };
611
+ },
612
+ customConvertToWhereExpression: (expression, value, getNextParamName) => {
613
+ return convertToExpression(collectionContainsPattern, withoutLastIdAccess(expression), value, getNextParamName);
614
+ },
615
+ type: ":operator-type/binary",
616
+ isNegative: false
617
+ };
618
+ const getOperatorCollectionMe = ({ id, title, pattern, isNegative }) => ({
619
+ id,
620
+ title,
621
+ customMatch: (where, params, typeObject) => {
622
+ const { matchSuccess, matches } = doPatternMatch(where, params, pattern, typeObject);
623
+ if (matchSuccess) return {
624
+ matchSuccess,
625
+ expression: [...matches[0].value, "fibery/id"]
626
+ };
627
+ return { matchSuccess: false };
628
+ },
629
+ customConvertToWhereExpression: (expression, value, getNextParamName) => {
630
+ return convertToExpression(pattern, withoutLastIdAccess(expression), "$my-id", getNextParamName);
631
+ },
632
+ type: ":operator-type/unary",
633
+ isNegative
422
634
  });
423
- exports.operatorCollectionContainsMe = getOperatorCollectionMe({
424
- id: ":operator/collection-contains-me",
425
- title: "contains Me",
426
- pattern: collectionContainsMePattern,
427
- isNegative: false,
635
+ const operatorCollectionContainsMe = getOperatorCollectionMe({
636
+ id: ":operator/collection-contains-me",
637
+ title: "contains Me",
638
+ pattern: collectionContainsMePattern,
639
+ isNegative: false
428
640
  });
429
641
  const withoutLastIdAccess = (expression) => {
430
- const arr = expression;
431
- if ((0, last_1.default)(arr) !== "fibery/id") {
432
- throw new Error("not supported");
433
- }
434
- return arr.slice(0, -1);
435
- };
436
- exports.withoutLastIdAccess = withoutLastIdAccess;
437
- exports.operatorCollectionContainsAnyOf = {
438
- id: ":operator/collection-contains-any-of",
439
- title: "contains any of",
440
- customMatch: (where, params, typeObject) => {
441
- const { matchSuccess, matches } = (0, pattern_match_1.doPatternMatch)(where, params, collectionContainsAnyOfPattern, typeObject);
442
- if (matchSuccess) {
443
- return {
444
- matchSuccess,
445
- expression: [...matches[0].value, "fibery/id"],
446
- value: matches[1].value,
447
- };
448
- }
449
- return { matchSuccess: false };
450
- },
451
- customConvertToWhereExpression: (expression, value, getNextParamName) => {
452
- return (0, pattern_to_expression_1.convertToExpression)(collectionContainsAnyOfPattern, (0, exports.withoutLastIdAccess)(expression), value, getNextParamName);
453
- },
454
- type: ":operator-type/binary",
455
- isNegative: false,
456
- };
457
- exports.operatorCollectionDoesNotContain = {
458
- id: ":operator/collection-does-not-contain",
459
- title: "does not contain",
460
- customMatch: (where, params, typeObject) => {
461
- const { matchSuccess, matches } = (0, pattern_match_1.doPatternMatch)(where, params, collectionDoesNotContainPattern, typeObject);
462
- if (matchSuccess) {
463
- return {
464
- matchSuccess,
465
- expression: [...matches[0].value, "fibery/id"],
466
- value: matches[1].value,
467
- };
468
- }
469
- return { matchSuccess: false };
470
- },
471
- customConvertToWhereExpression: (expression, value, getNextParamName) => {
472
- return (0, pattern_to_expression_1.convertToExpression)(collectionDoesNotContainPattern, (0, exports.withoutLastIdAccess)(expression), value, getNextParamName);
473
- },
474
- type: ":operator-type/binary",
475
- isNegative: true,
476
- };
477
- exports.operatorCollectionDoesNotContainMe = getOperatorCollectionMe({
478
- id: ":operator/collection-does-not-contain-me",
479
- title: "does not contain Me",
480
- pattern: collectionDoesNotContainMePattern,
481
- isNegative: true,
642
+ const arr = expression;
643
+ if (last(arr) !== "fibery/id") throw new Error("not supported");
644
+ return arr.slice(0, -1);
645
+ };
646
+ const operatorCollectionContainsAnyOf = {
647
+ id: ":operator/collection-contains-any-of",
648
+ title: "contains any of",
649
+ customMatch: (where, params, typeObject) => {
650
+ const { matchSuccess, matches } = doPatternMatch(where, params, collectionContainsAnyOfPattern, typeObject);
651
+ if (matchSuccess) return {
652
+ matchSuccess,
653
+ expression: [...matches[0].value, "fibery/id"],
654
+ value: matches[1].value
655
+ };
656
+ return { matchSuccess: false };
657
+ },
658
+ customConvertToWhereExpression: (expression, value, getNextParamName) => {
659
+ return convertToExpression(collectionContainsAnyOfPattern, withoutLastIdAccess(expression), value, getNextParamName);
660
+ },
661
+ type: ":operator-type/binary",
662
+ isNegative: false
663
+ };
664
+ const operatorCollectionDoesNotContain = {
665
+ id: ":operator/collection-does-not-contain",
666
+ title: "does not contain",
667
+ customMatch: (where, params, typeObject) => {
668
+ const { matchSuccess, matches } = doPatternMatch(where, params, collectionDoesNotContainPattern, typeObject);
669
+ if (matchSuccess) return {
670
+ matchSuccess,
671
+ expression: [...matches[0].value, "fibery/id"],
672
+ value: matches[1].value
673
+ };
674
+ return { matchSuccess: false };
675
+ },
676
+ customConvertToWhereExpression: (expression, value, getNextParamName) => {
677
+ return convertToExpression(collectionDoesNotContainPattern, withoutLastIdAccess(expression), value, getNextParamName);
678
+ },
679
+ type: ":operator-type/binary",
680
+ isNegative: true
681
+ };
682
+ const operatorCollectionDoesNotContainMe = getOperatorCollectionMe({
683
+ id: ":operator/collection-does-not-contain-me",
684
+ title: "does not contain Me",
685
+ pattern: collectionDoesNotContainMePattern,
686
+ isNegative: true
482
687
  });
483
- exports.operatorCollectionDoesNotContainAnyOf = {
484
- id: ":operator/collection-does-not-contain-any-of",
485
- title: "contains none of",
486
- customMatch: (where, params, typeObject) => {
487
- const { matchSuccess, matches } = (0, pattern_match_1.doPatternMatch)(where, params, collectionDoesNotContainAnyOfPattern, typeObject);
488
- if (matchSuccess) {
489
- return {
490
- matchSuccess,
491
- expression: [...matches[0].value, "fibery/id"],
492
- value: matches[1].value,
493
- };
494
- }
495
- return { matchSuccess: false };
496
- },
497
- customConvertToWhereExpression: (expression, value, getNextParamName) => {
498
- return (0, pattern_to_expression_1.convertToExpression)(collectionDoesNotContainAnyOfPattern, (0, exports.withoutLastIdAccess)(expression), value, getNextParamName);
499
- },
500
- type: ":operator-type/binary",
501
- isNegative: true,
502
- };
503
- exports.operatorCollectionIsEmpty = {
504
- id: ":operator/is-collection-empty",
505
- title: "is empty",
506
- pattern: ["=", ["q/count", pattern_match_placeholders_1.referenceCollectionExpressionPlaceholder], (0, pattern_match_placeholders_1.getConstantPlaceholder)(0)],
507
- type: ":operator-type/unary",
508
- isNegative: false,
509
- };
510
- exports.operatorCollectionIsNotEmpty = {
511
- id: ":operator/is-collection-not-empty",
512
- title: "is not empty",
513
- pattern: [">", ["q/count", pattern_match_placeholders_1.referenceCollectionExpressionPlaceholder], (0, pattern_match_placeholders_1.getConstantPlaceholder)(0)],
514
- type: ":operator-type/unary",
515
- isNegative: true,
516
- };
517
- exports.operatorBoolIs = {
518
- id: ":operator/bool-is",
519
- title: "is",
520
- customMatch: (where, params, typeObject) => {
521
- {
522
- const { matchSuccess, matches } = (0, pattern_match_1.doPatternMatch)(where, params, ["=", pattern_match_placeholders_1.boolFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => x === true || x === false)], typeObject);
523
- if (matchSuccess) {
524
- return {
525
- matchSuccess,
526
- expression: matches[0].value,
527
- value: matches[1].value,
528
- };
529
- }
530
- }
531
- {
532
- // This is old expression version, just for backward compatibility.
533
- const { matchSuccess, matches } = (0, pattern_match_1.doPatternMatch)(where, params, [
534
- "or",
535
- ["=", pattern_match_placeholders_1.boolFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => x === false)],
536
- ["=", pattern_match_placeholders_1.boolFieldPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => x === null)],
537
- ], typeObject);
538
- if (matchSuccess) {
539
- return {
540
- matchSuccess,
541
- expression: matches[0].value,
542
- value: false,
543
- };
544
- }
545
- return { matchSuccess: false };
546
- }
547
- },
548
- customConvertToWhereExpression: (expression, value, getNextParamName) => {
549
- const paramName = getNextParamName();
550
- return {
551
- expression: ["=", expression, paramName],
552
- params: { [paramName]: value || false },
553
- };
554
- },
555
- type: ":operator-type/binary",
556
- isNegative: false,
557
- };
558
- exports.operatorDateIs = {
559
- id: ":operator/date-is",
560
- title: "is",
561
- pattern: ["=", pattern_match_placeholders_1.dateOrDateRangeExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => x !== null)],
562
- type: ":operator-type/binary",
563
- isNegative: false,
564
- };
565
- exports.operatorDateIsEmptyV1 = {
566
- id: ":operator/date-is-empty",
567
- title: "is empty",
568
- pattern: ["=", pattern_match_placeholders_1.anyDateExpressionPlaceholder, (0, pattern_match_placeholders_1.getConstantPlaceholder)(null)],
569
- type: ":operator-type/unary",
570
- isNegative: false,
571
- };
572
- exports.operatorDateIsEmptyV2 = {
573
- id: ":operator/date-is-empty",
574
- title: "is empty",
575
- pattern: ["=", ["q/null?", pattern_match_placeholders_1.anyDateExpressionPlaceholder], (0, pattern_match_placeholders_1.getConstantPlaceholder)(true)],
576
- type: ":operator-type/unary",
577
- isNegative: false,
578
- };
579
- exports.operatorDateIsNotEmptyV1 = {
580
- id: ":operator/date-is-not-empty",
581
- title: "is not empty",
582
- pattern: ["!=", pattern_match_placeholders_1.anyDateExpressionPlaceholder, (0, pattern_match_placeholders_1.getConstantPlaceholder)(null)],
583
- type: ":operator-type/unary",
584
- isNegative: true,
585
- };
586
- exports.operatorDateIsNotEmptyV2 = {
587
- id: ":operator/date-is-not-empty",
588
- title: "is not empty",
589
- pattern: ["=", ["q/null?", pattern_match_placeholders_1.anyDateExpressionPlaceholder], (0, pattern_match_placeholders_1.getConstantPlaceholder)(false)],
590
- type: ":operator-type/unary",
591
- isNegative: true,
592
- };
593
- exports.operatorDateIsWithin = {
594
- id: ":operator/date-is-within",
595
- title: "is within",
596
- customMatch: (0, operator_utils_1.getWithinOperatorCustomMatchFn)(pattern_match_placeholders_1.dateOrDateRangeExpressionPlaceholder, false),
597
- customConvertToWhereExpression: (0, operator_utils_1.getWithinOperatorCustomConvertFn)(false),
598
- type: ":operator-type/binary",
599
- isNegative: false,
600
- };
601
- exports.operatorDateIsBefore = {
602
- id: ":operator/date-is-before",
603
- title: "is earlier than",
604
- pattern: ["<", pattern_match_placeholders_1.dateOrDateRangeExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
605
- type: ":operator-type/binary",
606
- isNegative: false,
607
- };
608
- exports.operatorDateIsOnOrBefore = {
609
- id: ":operator/date-is-on-or-before",
610
- title: "is on or earlier than",
611
- pattern: ["<=", pattern_match_placeholders_1.dateOrDateRangeExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
612
- type: ":operator-type/binary",
613
- isNegative: false,
614
- };
615
- exports.operatorDateIsAfter = {
616
- id: ":operator/date-is-after",
617
- title: "is later than",
618
- pattern: [">", pattern_match_placeholders_1.dateOrDateRangeExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
619
- type: ":operator-type/binary",
620
- isNegative: false,
621
- };
622
- exports.operatorDateIsOnOrAfter = {
623
- id: ":operator/date-is-on-or-after",
624
- title: "is on or later than",
625
- pattern: [">=", pattern_match_placeholders_1.dateOrDateRangeExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
626
- type: ":operator-type/binary",
627
- isNegative: false,
628
- };
629
- exports.operatorDateTimeIs = {
630
- id: ":operator/date-time-is",
631
- title: "is",
632
- customMatch: (where, params, typeObject) => {
633
- {
634
- const { matchSuccess, matches: [firstFieldMatch, firstParamMatch, secondFieldMatch, secondParamMatch], } = (0, pattern_match_1.doPatternMatch)(where, params, [
635
- "and",
636
- [">=", pattern_match_placeholders_1.dateTimeOrDateTimeRangeExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
637
- ["<=", pattern_match_placeholders_1.dateTimeOrDateTimeRangeExpressionPlaceholder, (0, pattern_match_placeholders_1.getParamPlaceholder)()],
638
- ], typeObject);
639
- if (matchSuccess && (0, isEqual_1.default)(firstFieldMatch.value, secondFieldMatch.value)) {
640
- const firstParamValue = firstParamMatch.value;
641
- const secondParamValue = secondParamMatch.value;
642
- if (params_placeholders_1.paramsPlaceholdersLookup[firstParamValue] && params_placeholders_1.paramsPlaceholdersLookup[secondParamValue]) {
643
- const value = (0, findKey_1.default)(params_placeholders_1.dateToDateTimeIntervalLookup, (val) => val.start === firstParamValue && val.end === secondParamValue);
644
- return {
645
- matchSuccess,
646
- expression: firstFieldMatch.value,
647
- value,
648
- };
649
- }
650
- const firstParamRelativeDateInfo = (0, params_placeholders_1.parseRelativeDatePlaceholder)(firstParamValue);
651
- const secondParamRelativeDateInfo = (0, params_placeholders_1.parseRelativeDatePlaceholder)(secondParamValue);
652
- if (firstParamRelativeDateInfo && secondParamRelativeDateInfo) {
653
- const value = (0, params_placeholders_1.toRelativeDatePlaceholder)({
654
- ...firstParamRelativeDateInfo,
655
- isStartOfInterval: undefined,
656
- });
657
- return {
658
- matchSuccess,
659
- expression: firstFieldMatch.value,
660
- value,
661
- };
662
- }
663
- }
664
- }
665
- {
666
- const { matchSuccess, matches: [fieldMatch, paramMatch], } = (0, pattern_match_1.doPatternMatch)(where, params, [
667
- "=",
668
- pattern_match_placeholders_1.dateTimeOrDateTimeRangeExpressionPlaceholder,
669
- (0, pattern_match_placeholders_1.getParamPlaceholder)((x) => ((0, isString_1.default)(x) && (0, operator_utils_1.isDateTime)(x)) || (0, operator_utils_1.isNoValue)(x)),
670
- ], typeObject);
671
- if (matchSuccess) {
672
- return {
673
- matchSuccess,
674
- expression: fieldMatch.value,
675
- value: paramMatch.value,
676
- };
677
- }
678
- }
679
- return { matchSuccess: false };
680
- },
681
- customConvertToWhereExpression: (expression, value, getNextParamName) => {
682
- const dateTimePlaceholders = params_placeholders_1.dateToDateTimeIntervalLookup[value];
683
- let relativeDateInfo = null;
684
- if (dateTimePlaceholders) {
685
- const { start, end } = dateTimePlaceholders;
686
- return {
687
- expression: ["and", [">=", expression, start], ["<=", expression, end]],
688
- params: { [start]: start, [end]: end },
689
- };
690
- }
691
- else if ((relativeDateInfo = (0, params_placeholders_1.parseRelativeDatePlaceholder)(value))) {
692
- const startRelativePlaceholder = (0, params_placeholders_1.toRelativeDatePlaceholder)({
693
- ...relativeDateInfo,
694
- isStartOfInterval: true,
695
- unitForStart: "day",
696
- });
697
- const endRelativePlaceholder = (0, params_placeholders_1.toRelativeDatePlaceholder)({
698
- ...relativeDateInfo,
699
- isStartOfInterval: false,
700
- unitForStart: "day",
701
- });
702
- return {
703
- expression: ["and", [">=", expression, startRelativePlaceholder], ["<=", expression, endRelativePlaceholder]],
704
- params: {
705
- [startRelativePlaceholder]: startRelativePlaceholder,
706
- [endRelativePlaceholder]: endRelativePlaceholder,
707
- },
708
- };
709
- }
710
- else {
711
- const dateParamName = getNextParamName();
712
- return {
713
- expression: ["=", expression, dateParamName],
714
- params: { [dateParamName]: value },
715
- };
716
- }
717
- },
718
- type: ":operator-type/binary",
719
- isNegative: false,
720
- };
721
- exports.operatorDateTimeIsWithin = {
722
- id: ":operator/date-time-is-within",
723
- title: "is within",
724
- customMatch: (0, operator_utils_1.getWithinOperatorCustomMatchFn)(pattern_match_placeholders_1.dateTimeOrDateTimeRangeExpressionPlaceholder, true),
725
- customConvertToWhereExpression: (0, operator_utils_1.getWithinOperatorCustomConvertFn)(true),
726
- type: ":operator-type/binary",
727
- isNegative: false,
728
- };
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);
733
- exports.operatorsGroupsWithoutMe = {
734
- ":filter-type/comment-reference-collection": [exports.operatorCollectionIsEmpty, exports.operatorCollectionIsNotEmpty],
735
- ":filter-type/file-reference": [exports.operatorReferenceIsEmpty, exports.operatorReferenceIsNotEmpty],
736
- ":filter-type/file-reference-collection": [exports.operatorCollectionIsEmpty, exports.operatorCollectionIsNotEmpty],
737
- ":filter-type/reference": [
738
- exports.operatorReferenceIsAnyOf,
739
- exports.operatorReferenceIsNoneOf,
740
- exports.operatorReferenceIs,
741
- exports.operatorReferenceIsNot,
742
- exports.operatorReferenceIsEmpty,
743
- exports.operatorReferenceIsNotEmpty,
744
- ],
745
- ":filter-type/user-reference": [
746
- exports.operatorReferenceIsAnyOf,
747
- exports.operatorReferenceIsNoneOf,
748
- exports.operatorReferenceIs,
749
- exports.operatorReferenceIsNot,
750
- exports.operatorReferenceIsEmpty,
751
- exports.operatorReferenceIsNotEmpty,
752
- ],
753
- ":filter-type/single-select": [
754
- exports.operatorReferenceIsAnyOf,
755
- exports.operatorReferenceIsNoneOf,
756
- exports.operatorReferenceIs,
757
- exports.operatorReferenceIsNot,
758
- exports.operatorReferenceIsEmpty,
759
- exports.operatorReferenceIsNotEmpty,
760
- ],
761
- ":filter-type/multi-select": [
762
- exports.operatorCollectionContainsAnyOf,
763
- exports.operatorCollectionDoesNotContainAnyOf,
764
- exports.operatorCollectionContains,
765
- exports.operatorCollectionDoesNotContain,
766
- exports.operatorCollectionIsEmpty,
767
- exports.operatorCollectionIsNotEmpty,
768
- ],
769
- ":filter-type/reference-collection": [
770
- exports.operatorCollectionContainsAnyOf,
771
- exports.operatorCollectionDoesNotContainAnyOf,
772
- exports.operatorCollectionContains,
773
- exports.operatorCollectionDoesNotContain,
774
- exports.operatorCollectionIsEmpty,
775
- exports.operatorCollectionIsNotEmpty,
776
- ],
777
- ":filter-type/user-reference-collection": [
778
- exports.operatorCollectionContainsAnyOf,
779
- exports.operatorCollectionDoesNotContainAnyOf,
780
- exports.operatorCollectionContains,
781
- exports.operatorCollectionDoesNotContain,
782
- exports.operatorCollectionIsEmpty,
783
- exports.operatorCollectionIsNotEmpty,
784
- ],
785
- ":filter-type/text": [
786
- exports.operatorTextContains,
787
- exports.operatorTextDoesNotContain,
788
- exports.operatorTextIs,
789
- exports.operatorTextIsNot,
790
- exports.operatorTextStartsWith,
791
- exports.operatorTextEndsWith,
792
- exports.operatorTextIsEmptyV2,
793
- exports.operatorTextIsNotEmptyV2,
794
- ],
795
- ":filter-type/number": [
796
- exports.operatorNumberEquals,
797
- exports.operatorNumberDoesNotEqual,
798
- exports.operatorGreaterThan,
799
- exports.operatorLessThan,
800
- exports.operatorGreaterThanOrEqual,
801
- exports.operatorLessThanOrEqual,
802
- exports.operatorNumberIsEmptyV2,
803
- exports.operatorNumberIsNotEmptyV2,
804
- ],
805
- ":filter-type/bool": [exports.operatorBoolIs],
806
- ":filter-type/date": [
807
- exports.operatorDateIs,
808
- exports.operatorDateIsWithin,
809
- exports.operatorDateIsBefore,
810
- exports.operatorDateIsAfter,
811
- exports.operatorDateIsOnOrBefore,
812
- exports.operatorDateIsOnOrAfter,
813
- exports.operatorDateIsEmptyV2,
814
- exports.operatorDateIsNotEmptyV2,
815
- ],
816
- ":filter-type/date-time": [
817
- exports.operatorDateTimeIs,
818
- exports.operatorDateTimeIsWithin,
819
- exports.operatorDateTimeIsBefore,
820
- exports.operatorDateTimeIsAfter,
821
- exports.operatorDateTimeIsOnOrBefore,
822
- exports.operatorDateTimeIsOnOrAfter,
823
- exports.operatorDateIsEmptyV2,
824
- exports.operatorDateIsNotEmptyV2,
825
- ],
826
- ":filter-type/location": [
827
- exports.operatorLocationContains,
828
- exports.operatorLocationDoesNotContain,
829
- exports.operatorLocationIsEmpty,
830
- exports.operatorLocationIsNotEmpty,
831
- ],
832
- ":filter-type/user-role": [exports.operatorUserRoleIsAnyOf],
833
- ":filter-type/collection-count": [
834
- exports.operatorCollectionCountEquals,
835
- exports.operatorCollectionCountDoesNotEqual,
836
- exports.operatorCollectionCountGreaterThan,
837
- exports.operatorCollectionCountLessThan,
838
- exports.operatorCollectionCountGreaterThanOrEqual,
839
- exports.operatorCollectionCountLessThanOrEqual,
840
- ],
841
- };
842
- exports.operatorsGroups = (0, _1.mapValues)(exports.operatorsGroupsWithoutMe, (value, key) => {
843
- if (key === ":filter-type/user-reference") {
844
- return [exports.operatorReferenceIsMe, exports.operatorReferenceIsNotMe].concat(value);
845
- }
846
- else if (key === ":filter-type/user-reference-collection") {
847
- return [exports.operatorCollectionContainsMe, exports.operatorCollectionDoesNotContainMe].concat(value);
848
- }
849
- else {
850
- return value;
851
- }
688
+ const operatorCollectionDoesNotContainAnyOf = {
689
+ id: ":operator/collection-does-not-contain-any-of",
690
+ title: "contains none of",
691
+ customMatch: (where, params, typeObject) => {
692
+ const { matchSuccess, matches } = doPatternMatch(where, params, collectionDoesNotContainAnyOfPattern, typeObject);
693
+ if (matchSuccess) return {
694
+ matchSuccess,
695
+ expression: [...matches[0].value, "fibery/id"],
696
+ value: matches[1].value
697
+ };
698
+ return { matchSuccess: false };
699
+ },
700
+ customConvertToWhereExpression: (expression, value, getNextParamName) => {
701
+ return convertToExpression(collectionDoesNotContainAnyOfPattern, withoutLastIdAccess(expression), value, getNextParamName);
702
+ },
703
+ type: ":operator-type/binary",
704
+ isNegative: true
705
+ };
706
+ const operatorCollectionIsEmpty = {
707
+ id: ":operator/is-collection-empty",
708
+ title: "is empty",
709
+ pattern: [
710
+ "=",
711
+ ["q/count", referenceCollectionExpressionPlaceholder],
712
+ getConstantPlaceholder(0)
713
+ ],
714
+ type: ":operator-type/unary",
715
+ isNegative: false
716
+ };
717
+ const operatorCollectionIsNotEmpty = {
718
+ id: ":operator/is-collection-not-empty",
719
+ title: "is not empty",
720
+ pattern: [
721
+ ">",
722
+ ["q/count", referenceCollectionExpressionPlaceholder],
723
+ getConstantPlaceholder(0)
724
+ ],
725
+ type: ":operator-type/unary",
726
+ isNegative: true
727
+ };
728
+ const operatorBoolIs = {
729
+ id: ":operator/bool-is",
730
+ title: "is",
731
+ customMatch: (where, params, typeObject) => {
732
+ {
733
+ const { matchSuccess, matches } = doPatternMatch(where, params, [
734
+ "=",
735
+ boolFieldPlaceholder,
736
+ getParamPlaceholder((x) => x === true || x === false)
737
+ ], typeObject);
738
+ if (matchSuccess) return {
739
+ matchSuccess,
740
+ expression: matches[0].value,
741
+ value: matches[1].value
742
+ };
743
+ }
744
+ {
745
+ const { matchSuccess, matches } = doPatternMatch(where, params, [
746
+ "or",
747
+ [
748
+ "=",
749
+ boolFieldPlaceholder,
750
+ getParamPlaceholder((x) => x === false)
751
+ ],
752
+ [
753
+ "=",
754
+ boolFieldPlaceholder,
755
+ getParamPlaceholder((x) => x === null)
756
+ ]
757
+ ], typeObject);
758
+ if (matchSuccess) return {
759
+ matchSuccess,
760
+ expression: matches[0].value,
761
+ value: false
762
+ };
763
+ return { matchSuccess: false };
764
+ }
765
+ },
766
+ customConvertToWhereExpression: (expression, value, getNextParamName) => {
767
+ const paramName = getNextParamName();
768
+ return {
769
+ expression: [
770
+ "=",
771
+ expression,
772
+ paramName
773
+ ],
774
+ params: { [paramName]: value || false }
775
+ };
776
+ },
777
+ type: ":operator-type/binary",
778
+ isNegative: false
779
+ };
780
+ const operatorDateIs = {
781
+ id: ":operator/date-is",
782
+ title: "is",
783
+ pattern: [
784
+ "=",
785
+ dateOrDateRangeExpressionPlaceholder,
786
+ getParamPlaceholder((x) => x !== null)
787
+ ],
788
+ type: ":operator-type/binary",
789
+ isNegative: false
790
+ };
791
+ const operatorDateIsEmptyV1 = {
792
+ id: ":operator/date-is-empty",
793
+ title: "is empty",
794
+ pattern: [
795
+ "=",
796
+ anyDateExpressionPlaceholder,
797
+ getConstantPlaceholder(null)
798
+ ],
799
+ type: ":operator-type/unary",
800
+ isNegative: false
801
+ };
802
+ const operatorDateIsEmptyV2 = {
803
+ id: ":operator/date-is-empty",
804
+ title: "is empty",
805
+ pattern: [
806
+ "=",
807
+ ["q/null?", anyDateExpressionPlaceholder],
808
+ getConstantPlaceholder(true)
809
+ ],
810
+ type: ":operator-type/unary",
811
+ isNegative: false
812
+ };
813
+ const operatorDateIsNotEmptyV1 = {
814
+ id: ":operator/date-is-not-empty",
815
+ title: "is not empty",
816
+ pattern: [
817
+ "!=",
818
+ anyDateExpressionPlaceholder,
819
+ getConstantPlaceholder(null)
820
+ ],
821
+ type: ":operator-type/unary",
822
+ isNegative: true
823
+ };
824
+ const operatorDateIsNotEmptyV2 = {
825
+ id: ":operator/date-is-not-empty",
826
+ title: "is not empty",
827
+ pattern: [
828
+ "=",
829
+ ["q/null?", anyDateExpressionPlaceholder],
830
+ getConstantPlaceholder(false)
831
+ ],
832
+ type: ":operator-type/unary",
833
+ isNegative: true
834
+ };
835
+ const operatorDateIsWithin = {
836
+ id: ":operator/date-is-within",
837
+ title: "is within",
838
+ customMatch: getWithinOperatorCustomMatchFn(dateOrDateRangeExpressionPlaceholder, false),
839
+ customConvertToWhereExpression: getWithinOperatorCustomConvertFn(false),
840
+ type: ":operator-type/binary",
841
+ isNegative: false
842
+ };
843
+ const operatorDateIsBefore = {
844
+ id: ":operator/date-is-before",
845
+ title: "is earlier than",
846
+ pattern: [
847
+ "<",
848
+ dateOrDateRangeExpressionPlaceholder,
849
+ getParamPlaceholder()
850
+ ],
851
+ type: ":operator-type/binary",
852
+ isNegative: false
853
+ };
854
+ const operatorDateIsOnOrBefore = {
855
+ id: ":operator/date-is-on-or-before",
856
+ title: "is on or earlier than",
857
+ pattern: [
858
+ "<=",
859
+ dateOrDateRangeExpressionPlaceholder,
860
+ getParamPlaceholder()
861
+ ],
862
+ type: ":operator-type/binary",
863
+ isNegative: false
864
+ };
865
+ const operatorDateIsAfter = {
866
+ id: ":operator/date-is-after",
867
+ title: "is later than",
868
+ pattern: [
869
+ ">",
870
+ dateOrDateRangeExpressionPlaceholder,
871
+ getParamPlaceholder()
872
+ ],
873
+ type: ":operator-type/binary",
874
+ isNegative: false
875
+ };
876
+ const operatorDateIsOnOrAfter = {
877
+ id: ":operator/date-is-on-or-after",
878
+ title: "is on or later than",
879
+ pattern: [
880
+ ">=",
881
+ dateOrDateRangeExpressionPlaceholder,
882
+ getParamPlaceholder()
883
+ ],
884
+ type: ":operator-type/binary",
885
+ isNegative: false
886
+ };
887
+ const operatorDateTimeIs = {
888
+ id: ":operator/date-time-is",
889
+ title: "is",
890
+ customMatch: (where, params, typeObject) => {
891
+ {
892
+ const { matchSuccess, matches: [firstFieldMatch, firstParamMatch, secondFieldMatch, secondParamMatch] } = doPatternMatch(where, params, [
893
+ "and",
894
+ [
895
+ ">=",
896
+ dateTimeOrDateTimeRangeExpressionPlaceholder,
897
+ getParamPlaceholder()
898
+ ],
899
+ [
900
+ "<=",
901
+ dateTimeOrDateTimeRangeExpressionPlaceholder,
902
+ getParamPlaceholder()
903
+ ]
904
+ ], typeObject);
905
+ if (matchSuccess && isEqual(firstFieldMatch.value, secondFieldMatch.value)) {
906
+ const firstParamValue = firstParamMatch.value;
907
+ const secondParamValue = secondParamMatch.value;
908
+ if (paramsPlaceholdersLookup[firstParamValue] && paramsPlaceholdersLookup[secondParamValue]) {
909
+ const value = findKey(dateToDateTimeIntervalLookup, (val) => val.start === firstParamValue && val.end === secondParamValue);
910
+ return {
911
+ matchSuccess,
912
+ expression: firstFieldMatch.value,
913
+ value
914
+ };
915
+ }
916
+ const firstParamRelativeDateInfo = parseRelativeDatePlaceholder(firstParamValue);
917
+ const secondParamRelativeDateInfo = parseRelativeDatePlaceholder(secondParamValue);
918
+ if (firstParamRelativeDateInfo && secondParamRelativeDateInfo) {
919
+ const value = toRelativeDatePlaceholder({
920
+ ...firstParamRelativeDateInfo,
921
+ isStartOfInterval: void 0
922
+ });
923
+ return {
924
+ matchSuccess,
925
+ expression: firstFieldMatch.value,
926
+ value
927
+ };
928
+ }
929
+ }
930
+ }
931
+ {
932
+ const { matchSuccess, matches: [fieldMatch, paramMatch] } = doPatternMatch(where, params, [
933
+ "=",
934
+ dateTimeOrDateTimeRangeExpressionPlaceholder,
935
+ getParamPlaceholder((x) => isString(x) && isDateTime(x) || isNoValue(x))
936
+ ], typeObject);
937
+ if (matchSuccess) return {
938
+ matchSuccess,
939
+ expression: fieldMatch.value,
940
+ value: paramMatch.value
941
+ };
942
+ }
943
+ return { matchSuccess: false };
944
+ },
945
+ customConvertToWhereExpression: (expression, value, getNextParamName) => {
946
+ const dateTimePlaceholders = dateToDateTimeIntervalLookup[value];
947
+ let relativeDateInfo = null;
948
+ if (dateTimePlaceholders) {
949
+ const { start, end } = dateTimePlaceholders;
950
+ return {
951
+ expression: [
952
+ "and",
953
+ [
954
+ ">=",
955
+ expression,
956
+ start
957
+ ],
958
+ [
959
+ "<=",
960
+ expression,
961
+ end
962
+ ]
963
+ ],
964
+ params: {
965
+ [start]: start,
966
+ [end]: end
967
+ }
968
+ };
969
+ } else if (relativeDateInfo = parseRelativeDatePlaceholder(value)) {
970
+ const startRelativePlaceholder = toRelativeDatePlaceholder({
971
+ ...relativeDateInfo,
972
+ isStartOfInterval: true,
973
+ unitForStart: "day"
974
+ });
975
+ const endRelativePlaceholder = toRelativeDatePlaceholder({
976
+ ...relativeDateInfo,
977
+ isStartOfInterval: false,
978
+ unitForStart: "day"
979
+ });
980
+ return {
981
+ expression: [
982
+ "and",
983
+ [
984
+ ">=",
985
+ expression,
986
+ startRelativePlaceholder
987
+ ],
988
+ [
989
+ "<=",
990
+ expression,
991
+ endRelativePlaceholder
992
+ ]
993
+ ],
994
+ params: {
995
+ [startRelativePlaceholder]: startRelativePlaceholder,
996
+ [endRelativePlaceholder]: endRelativePlaceholder
997
+ }
998
+ };
999
+ } else {
1000
+ const dateParamName = getNextParamName();
1001
+ return {
1002
+ expression: [
1003
+ "=",
1004
+ expression,
1005
+ dateParamName
1006
+ ],
1007
+ params: { [dateParamName]: value }
1008
+ };
1009
+ }
1010
+ },
1011
+ type: ":operator-type/binary",
1012
+ isNegative: false
1013
+ };
1014
+ const operatorDateTimeIsWithin = {
1015
+ id: ":operator/date-time-is-within",
1016
+ title: "is within",
1017
+ customMatch: getWithinOperatorCustomMatchFn(dateTimeOrDateTimeRangeExpressionPlaceholder, true),
1018
+ customConvertToWhereExpression: getWithinOperatorCustomConvertFn(true),
1019
+ type: ":operator-type/binary",
1020
+ isNegative: false
1021
+ };
1022
+ const operatorDateTimeIsBefore = getCompareOperatorForDateTime(":operator/date-time-is-before", "is earlier than", "<", true, false);
1023
+ const operatorDateTimeIsAfter = getCompareOperatorForDateTime(":operator/date-time-is-after", "is later than", ">", false, false);
1024
+ const operatorDateTimeIsOnOrBefore = getCompareOperatorForDateTime(":operator/date-time-is-on-or-before", "is on or earlier than", "<=", false, false);
1025
+ const operatorDateTimeIsOnOrAfter = getCompareOperatorForDateTime(":operator/date-time-is-on-or-after", "is on or later than", ">=", true, false);
1026
+ const operatorsGroupsWithoutMe = {
1027
+ ":filter-type/comment-reference-collection": [operatorCollectionIsEmpty, operatorCollectionIsNotEmpty],
1028
+ ":filter-type/file-reference": [operatorReferenceIsEmpty, operatorReferenceIsNotEmpty],
1029
+ ":filter-type/file-reference-collection": [operatorCollectionIsEmpty, operatorCollectionIsNotEmpty],
1030
+ ":filter-type/reference": [
1031
+ operatorReferenceIsAnyOf,
1032
+ operatorReferenceIsNoneOf,
1033
+ operatorReferenceIs,
1034
+ operatorReferenceIsNot,
1035
+ operatorReferenceIsEmpty,
1036
+ operatorReferenceIsNotEmpty
1037
+ ],
1038
+ ":filter-type/user-reference": [
1039
+ operatorReferenceIsAnyOf,
1040
+ operatorReferenceIsNoneOf,
1041
+ operatorReferenceIs,
1042
+ operatorReferenceIsNot,
1043
+ operatorReferenceIsEmpty,
1044
+ operatorReferenceIsNotEmpty
1045
+ ],
1046
+ ":filter-type/single-select": [
1047
+ operatorReferenceIsAnyOf,
1048
+ operatorReferenceIsNoneOf,
1049
+ operatorReferenceIs,
1050
+ operatorReferenceIsNot,
1051
+ operatorReferenceIsEmpty,
1052
+ operatorReferenceIsNotEmpty
1053
+ ],
1054
+ ":filter-type/multi-select": [
1055
+ operatorCollectionContainsAnyOf,
1056
+ operatorCollectionDoesNotContainAnyOf,
1057
+ operatorCollectionContains,
1058
+ operatorCollectionDoesNotContain,
1059
+ operatorCollectionIsEmpty,
1060
+ operatorCollectionIsNotEmpty
1061
+ ],
1062
+ ":filter-type/reference-collection": [
1063
+ operatorCollectionContainsAnyOf,
1064
+ operatorCollectionDoesNotContainAnyOf,
1065
+ operatorCollectionContains,
1066
+ operatorCollectionDoesNotContain,
1067
+ operatorCollectionIsEmpty,
1068
+ operatorCollectionIsNotEmpty
1069
+ ],
1070
+ ":filter-type/user-reference-collection": [
1071
+ operatorCollectionContainsAnyOf,
1072
+ operatorCollectionDoesNotContainAnyOf,
1073
+ operatorCollectionContains,
1074
+ operatorCollectionDoesNotContain,
1075
+ operatorCollectionIsEmpty,
1076
+ operatorCollectionIsNotEmpty
1077
+ ],
1078
+ ":filter-type/text": [
1079
+ operatorTextContains,
1080
+ operatorTextDoesNotContain,
1081
+ operatorTextIs,
1082
+ operatorTextIsNot,
1083
+ operatorTextStartsWith,
1084
+ operatorTextEndsWith,
1085
+ operatorTextIsEmptyV2,
1086
+ operatorTextIsNotEmptyV2
1087
+ ],
1088
+ ":filter-type/number": [
1089
+ operatorNumberEquals,
1090
+ operatorNumberDoesNotEqual,
1091
+ operatorGreaterThan,
1092
+ operatorLessThan,
1093
+ operatorGreaterThanOrEqual,
1094
+ operatorLessThanOrEqual,
1095
+ operatorNumberIsEmptyV2,
1096
+ operatorNumberIsNotEmptyV2
1097
+ ],
1098
+ ":filter-type/bool": [operatorBoolIs],
1099
+ ":filter-type/date": [
1100
+ operatorDateIs,
1101
+ operatorDateIsWithin,
1102
+ operatorDateIsBefore,
1103
+ operatorDateIsAfter,
1104
+ operatorDateIsOnOrBefore,
1105
+ operatorDateIsOnOrAfter,
1106
+ operatorDateIsEmptyV2,
1107
+ operatorDateIsNotEmptyV2
1108
+ ],
1109
+ ":filter-type/date-time": [
1110
+ operatorDateTimeIs,
1111
+ operatorDateTimeIsWithin,
1112
+ operatorDateTimeIsBefore,
1113
+ operatorDateTimeIsAfter,
1114
+ operatorDateTimeIsOnOrBefore,
1115
+ operatorDateTimeIsOnOrAfter,
1116
+ operatorDateIsEmptyV2,
1117
+ operatorDateIsNotEmptyV2
1118
+ ],
1119
+ ":filter-type/location": [
1120
+ operatorLocationContains,
1121
+ operatorLocationDoesNotContain,
1122
+ operatorLocationIsEmpty,
1123
+ operatorLocationIsNotEmpty
1124
+ ],
1125
+ ":filter-type/user-role": [operatorUserRoleIsAnyOf],
1126
+ ":filter-type/collection-count": [
1127
+ operatorCollectionCountEquals,
1128
+ operatorCollectionCountDoesNotEqual,
1129
+ operatorCollectionCountGreaterThan,
1130
+ operatorCollectionCountLessThan,
1131
+ operatorCollectionCountGreaterThanOrEqual,
1132
+ operatorCollectionCountLessThanOrEqual
1133
+ ]
1134
+ };
1135
+ const operatorsGroups = mapValues(operatorsGroupsWithoutMe, (value, key) => {
1136
+ if (key === ":filter-type/user-reference") return [operatorReferenceIsMe, operatorReferenceIsNotMe].concat(value);
1137
+ else if (key === ":filter-type/user-reference-collection") return [operatorCollectionContainsMe, operatorCollectionDoesNotContainMe].concat(value);
1138
+ else return value;
852
1139
  });
853
- exports.operators = (0, uniq_1.default)((0, flatten_1.default)(Object.values(exports.operatorsGroups))).concat([
854
- // these operators are used only for backward compatibility. You can't select them on UI.
855
- // https://the.fibery.io/SoftDev/User~Story/Empty-operator-in-Filters-on-view-should-work-the-same-way-as-IsEmpty-in-formulas-1972
856
- exports.operatorTextIsEmptyV1,
857
- exports.operatorTextIsNotEmptyV1,
858
- exports.operatorDateIsEmptyV1,
859
- exports.operatorDateIsNotEmptyV1,
860
- exports.operatorNumberIsEmptyV1,
861
- exports.operatorNumberIsNotEmptyV1,
862
- // needed for unique value deduplication view
863
- // https://the.fibery.io/favorites/Product_Management/feature/6495
864
- exports.operatorTextExactlyIs,
1140
+ const operators = uniq(flatten(Object.values(operatorsGroups))).concat([
1141
+ operatorTextIsEmptyV1,
1142
+ operatorTextIsNotEmptyV1,
1143
+ operatorDateIsEmptyV1,
1144
+ operatorDateIsNotEmptyV1,
1145
+ operatorNumberIsEmptyV1,
1146
+ operatorNumberIsNotEmptyV1,
1147
+ operatorTextExactlyIs
865
1148
  ]);
866
- exports.hiddenValidOperators = [exports.operatorTextExactlyIs];
867
- //# sourceMappingURL=operators.js.map
1149
+ const hiddenValidOperators = [operatorTextExactlyIs];
1150
+ //#endregion
1151
+ 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, operators_exports, withoutLastIdAccess };