@malloydata/malloy-filter 0.0.268-dev250421234442 → 0.0.268-dev250422184455

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.
@@ -1,10 +1,10 @@
1
1
  interface FilterOperator<T extends string> {
2
2
  operator: T;
3
3
  }
4
- interface Negateable {
4
+ interface Negatable {
5
5
  not?: boolean;
6
6
  }
7
- export interface Null extends FilterOperator<'null'>, Negateable {
7
+ export interface Null extends FilterOperator<'null'>, Negatable {
8
8
  }
9
9
  export type ChainOp = 'and' | 'or' | ',';
10
10
  export declare function isChainOp(s: string): s is ChainOp;
@@ -15,33 +15,33 @@ type BooleanChainOp = 'and' | 'or';
15
15
  export interface BooleanChain<T> extends FilterOperator<BooleanChainOp> {
16
16
  members: T[];
17
17
  }
18
- interface ClauseGroup<T> extends FilterOperator<'()'>, Negateable {
18
+ interface ClauseGroup<T> extends FilterOperator<'()'>, Negatable {
19
19
  expr: T;
20
20
  }
21
21
  export type StringConditionOperator = 'starts' | 'ends' | 'contains' | '=';
22
22
  export declare function isStringCondition(sc: StringFilter): sc is StringCondition;
23
- export interface StringCondition extends FilterOperator<StringConditionOperator>, Negateable {
23
+ export interface StringCondition extends FilterOperator<StringConditionOperator>, Negatable {
24
24
  values: string[];
25
25
  }
26
- export interface StringMatch extends FilterOperator<'~'>, Negateable {
26
+ export interface StringMatch extends FilterOperator<'~'>, Negatable {
27
27
  escaped_values: string[];
28
28
  }
29
- export interface StringEmpty extends FilterOperator<'empty'>, Negateable {
29
+ export interface StringEmpty extends FilterOperator<'empty'>, Negatable {
30
30
  }
31
31
  export type StringFilter = StringCondition | StringMatch | Null | StringEmpty | ClauseChain<StringFilter> | ClauseGroup<StringFilter>;
32
32
  export declare function isStringFilter(sc: Object): sc is StringFilter;
33
33
  export type BooleanOperator = 'true' | 'false' | 'false_or_null';
34
- export interface BooleanCondition extends Negateable {
34
+ export interface BooleanCondition extends Negatable {
35
35
  operator: BooleanOperator;
36
36
  }
37
37
  export type BooleanFilter = BooleanCondition | Null;
38
38
  export declare function isBooleanFilter(bc: Object): bc is BooleanFilter;
39
39
  export type NumberOperator = '<=' | '>=' | '!=' | '=' | '>' | '<';
40
- export interface NumberCondition extends FilterOperator<NumberOperator>, Negateable {
40
+ export interface NumberCondition extends FilterOperator<NumberOperator>, Negatable {
41
41
  values: string[];
42
42
  }
43
43
  export type NumberRangeOperator = '<=' | '>=' | '>' | '<';
44
- export interface NumberRange extends FilterOperator<'range'>, Negateable {
44
+ export interface NumberRange extends FilterOperator<'range'>, Negatable {
45
45
  startOperator: NumberRangeOperator;
46
46
  startValue: string;
47
47
  endOperator: NumberRangeOperator;
@@ -80,24 +80,24 @@ export interface UnitMoment {
80
80
  units: TemporalUnit;
81
81
  }
82
82
  export type Moment = UnitMoment | NowMoment | AgoMoment | FromNowMoment | TemporalLiteral | WhichdayMoment | WeekdayMoment;
83
- export interface Before extends FilterOperator<'before'>, Negateable {
83
+ export interface Before extends FilterOperator<'before'>, Negatable {
84
84
  before: Moment;
85
85
  }
86
- export interface After extends FilterOperator<'after'>, Negateable {
86
+ export interface After extends FilterOperator<'after'>, Negatable {
87
87
  after: Moment;
88
88
  }
89
- export interface To extends FilterOperator<'to'>, Negateable {
89
+ export interface To extends FilterOperator<'to'>, Negatable {
90
90
  fromMoment: Moment;
91
91
  toMoment: Moment;
92
92
  }
93
- export interface For extends FilterOperator<'for'>, Negateable, Duration {
93
+ export interface For extends FilterOperator<'for'>, Negatable, Duration {
94
94
  begin: Moment;
95
95
  }
96
- export interface in_last extends FilterOperator<'in_last'>, Negateable, Duration {
96
+ export interface in_last extends FilterOperator<'in_last'>, Negatable, Duration {
97
97
  }
98
- export interface JustUnits extends FilterOperator<'last' | 'next'>, Negateable, Duration {
98
+ export interface JustUnits extends FilterOperator<'last' | 'next'>, Negatable, Duration {
99
99
  }
100
- export interface InMoment extends FilterOperator<'in'>, Negateable {
100
+ export interface InMoment extends FilterOperator<'in'>, Negatable {
101
101
  in: Moment;
102
102
  }
103
103
  export type TemporalFilter = Null | Before | After | To | For | JustUnits | in_last | InMoment | BooleanChain<TemporalFilter> | ClauseGroup<TemporalFilter>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy-filter",
3
- "version": "0.0.268-dev250421234442",
3
+ "version": "0.0.268-dev250422184455",
4
4
  "license": "MIT",
5
5
  "description": "Parsers for the Malloy filtering sub-languages",
6
6
  "main": "dist/index.js",
@@ -9,11 +9,11 @@ interface FilterOperator<T extends string> {
9
9
  operator: T;
10
10
  }
11
11
 
12
- interface Negateable {
12
+ interface Negatable {
13
13
  not?: boolean;
14
14
  }
15
15
 
16
- export interface Null extends FilterOperator<'null'>, Negateable {}
16
+ export interface Null extends FilterOperator<'null'>, Negatable {}
17
17
 
18
18
  export type ChainOp = 'and' | 'or' | ',';
19
19
  export function isChainOp(s: string): s is ChainOp {
@@ -29,7 +29,7 @@ export interface BooleanChain<T> extends FilterOperator<BooleanChainOp> {
29
29
  members: T[];
30
30
  }
31
31
 
32
- interface ClauseGroup<T> extends FilterOperator<'()'>, Negateable {
32
+ interface ClauseGroup<T> extends FilterOperator<'()'>, Negatable {
33
33
  expr: T;
34
34
  }
35
35
 
@@ -40,15 +40,15 @@ export function isStringCondition(sc: StringFilter): sc is StringCondition {
40
40
 
41
41
  export interface StringCondition
42
42
  extends FilterOperator<StringConditionOperator>,
43
- Negateable {
43
+ Negatable {
44
44
  values: string[];
45
45
  }
46
46
 
47
- export interface StringMatch extends FilterOperator<'~'>, Negateable {
47
+ export interface StringMatch extends FilterOperator<'~'>, Negatable {
48
48
  escaped_values: string[];
49
49
  }
50
50
 
51
- export interface StringEmpty extends FilterOperator<'empty'>, Negateable {}
51
+ export interface StringEmpty extends FilterOperator<'empty'>, Negatable {}
52
52
 
53
53
  export type StringFilter =
54
54
  | StringCondition
@@ -80,7 +80,7 @@ export function isStringFilter(sc: Object): sc is StringFilter {
80
80
 
81
81
  export type BooleanOperator = 'true' | 'false' | 'false_or_null';
82
82
 
83
- export interface BooleanCondition extends Negateable {
83
+ export interface BooleanCondition extends Negatable {
84
84
  operator: BooleanOperator;
85
85
  }
86
86
 
@@ -98,13 +98,13 @@ export type NumberOperator = '<=' | '>=' | '!=' | '=' | '>' | '<';
98
98
 
99
99
  export interface NumberCondition
100
100
  extends FilterOperator<NumberOperator>,
101
- Negateable {
101
+ Negatable {
102
102
  values: string[];
103
103
  }
104
104
 
105
105
  export type NumberRangeOperator = '<=' | '>=' | '>' | '<';
106
106
 
107
- export interface NumberRange extends FilterOperator<'range'>, Negateable {
107
+ export interface NumberRange extends FilterOperator<'range'>, Negatable {
108
108
  startOperator: NumberRangeOperator;
109
109
  startValue: string;
110
110
  endOperator: NumberRangeOperator;
@@ -201,36 +201,36 @@ export type Moment =
201
201
  | WhichdayMoment
202
202
  | WeekdayMoment;
203
203
 
204
- export interface Before extends FilterOperator<'before'>, Negateable {
204
+ export interface Before extends FilterOperator<'before'>, Negatable {
205
205
  before: Moment;
206
206
  }
207
207
 
208
- export interface After extends FilterOperator<'after'>, Negateable {
208
+ export interface After extends FilterOperator<'after'>, Negatable {
209
209
  after: Moment;
210
210
  }
211
211
 
212
- export interface To extends FilterOperator<'to'>, Negateable {
212
+ export interface To extends FilterOperator<'to'>, Negatable {
213
213
  fromMoment: Moment;
214
214
  toMoment: Moment;
215
215
  }
216
216
 
217
- export interface For extends FilterOperator<'for'>, Negateable, Duration {
217
+ export interface For extends FilterOperator<'for'>, Negatable, Duration {
218
218
  begin: Moment;
219
219
  }
220
220
 
221
221
  // N units starting in the past, including this one
222
222
  export interface in_last
223
223
  extends FilterOperator<'in_last'>,
224
- Negateable,
224
+ Negatable,
225
225
  Duration {}
226
226
 
227
227
  // Nunits starting in the past, not including this one
228
228
  export interface JustUnits
229
229
  extends FilterOperator<'last' | 'next'>,
230
- Negateable,
230
+ Negatable,
231
231
  Duration {}
232
232
 
233
- export interface InMoment extends FilterOperator<'in'>, Negateable {
233
+ export interface InMoment extends FilterOperator<'in'>, Negatable {
234
234
  in: Moment;
235
235
  }
236
236