@platforma-sdk/model 1.45.26 → 1.45.35

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.
@@ -107,6 +107,16 @@ export function convertFilterUiToExpressionImpl(value: FilterSpec): ExpressionIm
107
107
  return rank(col(value.column), false).over([]).le(lit(value.n));
108
108
  }
109
109
 
110
+ if (
111
+ value.type === 'patternMatchesRegularExpression'
112
+ || value.type === 'patternFuzzyContainSubsequence'
113
+ || value.type === 'inSet'
114
+ || value.type === 'notInSet'
115
+ || value.type === 'notEqual'
116
+ ) {
117
+ throw new Error('Not implemented filter type: ' + value.type);
118
+ }
119
+
110
120
  if (value.type === undefined) {
111
121
  throw new Error('Filter type is undefined, this should not happen');
112
122
  }
@@ -14,32 +14,38 @@ export type FilterSpecNode<Leaf, CommonNode = {}, CommonLeaf = {}> =
14
14
  | CommonNode & { type: 'or'; filters: FilterSpecNode<Leaf, CommonNode, CommonLeaf>[] }
15
15
  | CommonNode & { type: 'and'; filters: FilterSpecNode<Leaf, CommonNode, CommonLeaf>[] };
16
16
 
17
- export type FilterSpecLeaf =
17
+ export type FilterSpecLeaf<T = SUniversalPColumnId> =
18
18
  | { type: undefined }
19
- | { type: 'isNA'; column: SUniversalPColumnId }
20
- | { type: 'isNotNA'; column: SUniversalPColumnId }
21
-
22
- | { type: 'patternEquals'; column: SUniversalPColumnId; value: string }
23
- | { type: 'patternNotEquals'; column: SUniversalPColumnId; value: string }
24
- | { type: 'patternContainSubsequence'; column: SUniversalPColumnId; value: string }
25
- | { type: 'patternNotContainSubsequence'; column: SUniversalPColumnId; value: string }
26
-
27
- | { type: 'topN'; column: SUniversalPColumnId; n: number }
28
- | { type: 'bottomN'; column: SUniversalPColumnId; n: number }
29
-
30
- | { type: 'equal'; column: SUniversalPColumnId; x: number }
31
- | { type: 'lessThan'; column: SUniversalPColumnId; x: number }
32
- | { type: 'greaterThan'; column: SUniversalPColumnId; x: number }
33
- | { type: 'lessThanOrEqual'; column: SUniversalPColumnId; x: number }
34
- | { type: 'greaterThanOrEqual'; column: SUniversalPColumnId; x: number }
35
-
36
- | { type: 'equalToColumn'; column: SUniversalPColumnId; rhs: SUniversalPColumnId }
37
- | { type: 'lessThanColumn'; column: SUniversalPColumnId; rhs: SUniversalPColumnId; minDiff?: number }
38
- | { type: 'greaterThanColumn'; column: SUniversalPColumnId; rhs: SUniversalPColumnId; minDiff?: number }
39
- | { type: 'lessThanColumnOrEqual'; column: SUniversalPColumnId; rhs: SUniversalPColumnId; minDiff?: number }
40
- | { type: 'greaterThanColumnOrEqual'; column: SUniversalPColumnId; rhs: SUniversalPColumnId; minDiff?: number };
41
-
42
- export type FilterSpec<Leaf extends FilterSpecLeaf = FilterSpecLeaf, CommonNode = {}, CommonLeaf = CommonNode> =
19
+ | { type: 'isNA'; column: T }
20
+ | { type: 'isNotNA'; column: T }
21
+
22
+ | { type: 'patternEquals'; column: T; value: string }
23
+ | { type: 'patternNotEquals'; column: T; value: string }
24
+ | { type: 'patternContainSubsequence'; column: T; value: string }
25
+ | { type: 'patternNotContainSubsequence'; column: T; value: string }
26
+ | { type: 'patternMatchesRegularExpression'; column: T; value: string }
27
+ | { type: 'patternFuzzyContainSubsequence'; column: T; value: string; maxEdits?: number; substitutionsOnly?: boolean; wildcard?: string }
28
+
29
+ | { type: 'inSet'; column: T; value: string[] }
30
+ | { type: 'notInSet'; column: T; value: string[] }
31
+
32
+ | { type: 'topN'; column: T; n: number }
33
+ | { type: 'bottomN'; column: T; n: number }
34
+
35
+ | { type: 'equal'; column: T; x: number }
36
+ | { type: 'notEqual'; column: T; x: number }
37
+ | { type: 'lessThan'; column: T; x: number }
38
+ | { type: 'greaterThan'; column: T; x: number }
39
+ | { type: 'lessThanOrEqual'; column: T; x: number }
40
+ | { type: 'greaterThanOrEqual'; column: T; x: number }
41
+
42
+ | { type: 'equalToColumn'; column: T; rhs: T }
43
+ | { type: 'lessThanColumn'; column: T; rhs: T; minDiff?: number }
44
+ | { type: 'greaterThanColumn'; column: T; rhs: T; minDiff?: number }
45
+ | { type: 'lessThanColumnOrEqual'; column: T; rhs: T; minDiff?: number }
46
+ | { type: 'greaterThanColumnOrEqual'; column: T; rhs: T; minDiff?: number };
47
+
48
+ export type FilterSpec<Leaf extends FilterSpecLeaf<unknown> = FilterSpecLeaf<SUniversalPColumnId>, CommonNode = {}, CommonLeaf = CommonNode> =
43
49
  FilterSpecNode<Leaf, CommonNode, CommonLeaf>;
44
50
 
45
51
  export type FilterSpecType = Exclude<FilterSpec, { type: undefined }>['type'];