@malloydata/malloy-interfaces 0.0.262 → 0.0.263-dev250414184158
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/to_malloy.js +2 -0
- package/dist/types.d.ts +42 -3
- package/dist/types.js +34 -1
- package/package.json +1 -1
- package/thrift/malloy.thrift +23 -1
package/dist/to_malloy.js
CHANGED
|
@@ -54,6 +54,8 @@ function escapeString(str) {
|
|
|
54
54
|
function literalToFragments(literal) {
|
|
55
55
|
var _a, _b;
|
|
56
56
|
switch (literal.kind) {
|
|
57
|
+
case 'filter_expression_literal':
|
|
58
|
+
return [quoteFilter(literal.filter_expression_value)];
|
|
57
59
|
case 'boolean_literal':
|
|
58
60
|
return [literal.boolean_value.toString()];
|
|
59
61
|
case 'string_literal': {
|
package/dist/types.d.ts
CHANGED
|
@@ -220,6 +220,10 @@ export type Filter = FilterWithFilterString;
|
|
|
220
220
|
export type FilterWithFilterString = {
|
|
221
221
|
kind: 'filter_string';
|
|
222
222
|
} & FilterStringApplication;
|
|
223
|
+
export type FilterExpressionLiteral = {
|
|
224
|
+
filter_expression_value: string;
|
|
225
|
+
};
|
|
226
|
+
export type FilterExpressionType = {};
|
|
223
227
|
export type FilterOperation = {
|
|
224
228
|
filter: Filter;
|
|
225
229
|
};
|
|
@@ -248,8 +252,8 @@ export type JoinInfo = {
|
|
|
248
252
|
export type Limit = {
|
|
249
253
|
limit: number;
|
|
250
254
|
};
|
|
251
|
-
export type LiteralValueType = 'string_literal' | 'number_literal' | 'date_literal' | 'timestamp_literal' | 'boolean_literal' | 'null_literal';
|
|
252
|
-
export type LiteralValue = LiteralValueWithStringLiteral | LiteralValueWithNumberLiteral | LiteralValueWithDateLiteral | LiteralValueWithTimestampLiteral | LiteralValueWithBooleanLiteral | LiteralValueWithNullLiteral;
|
|
255
|
+
export type LiteralValueType = 'string_literal' | 'number_literal' | 'date_literal' | 'timestamp_literal' | 'boolean_literal' | 'null_literal' | 'filter_expression_literal';
|
|
256
|
+
export type LiteralValue = LiteralValueWithStringLiteral | LiteralValueWithNumberLiteral | LiteralValueWithDateLiteral | LiteralValueWithTimestampLiteral | LiteralValueWithBooleanLiteral | LiteralValueWithNullLiteral | LiteralValueWithFilterExpressionLiteral;
|
|
253
257
|
export type LiteralValueWithStringLiteral = {
|
|
254
258
|
kind: 'string_literal';
|
|
255
259
|
} & StringLiteral;
|
|
@@ -268,6 +272,9 @@ export type LiteralValueWithBooleanLiteral = {
|
|
|
268
272
|
export type LiteralValueWithNullLiteral = {
|
|
269
273
|
kind: 'null_literal';
|
|
270
274
|
} & NullLiteral;
|
|
275
|
+
export type LiteralValueWithFilterExpressionLiteral = {
|
|
276
|
+
kind: 'filter_expression_literal';
|
|
277
|
+
} & FilterExpressionLiteral;
|
|
271
278
|
export type Location = {
|
|
272
279
|
url: string;
|
|
273
280
|
range: Range;
|
|
@@ -320,9 +327,41 @@ export type OrderBy = {
|
|
|
320
327
|
export type OrderByDirection = 'asc' | 'desc';
|
|
321
328
|
export type ParameterInfo = {
|
|
322
329
|
name: string;
|
|
323
|
-
type:
|
|
330
|
+
type: ParameterType;
|
|
324
331
|
default_value?: LiteralValue;
|
|
325
332
|
};
|
|
333
|
+
export type ParameterTypeType = 'string_type' | 'boolean_type' | 'number_type' | 'json_type' | 'sql_native_type' | 'date_type' | 'timestamp_type' | 'array_type' | 'record_type' | 'filter_expression_type';
|
|
334
|
+
export type ParameterType = ParameterTypeWithStringType | ParameterTypeWithBooleanType | ParameterTypeWithNumberType | ParameterTypeWithJSONType | ParameterTypeWithSQLNativeType | ParameterTypeWithDateType | ParameterTypeWithTimestampType | ParameterTypeWithArrayType | ParameterTypeWithRecordType | ParameterTypeWithFilterExpressionType;
|
|
335
|
+
export type ParameterTypeWithStringType = {
|
|
336
|
+
kind: 'string_type';
|
|
337
|
+
} & StringType;
|
|
338
|
+
export type ParameterTypeWithBooleanType = {
|
|
339
|
+
kind: 'boolean_type';
|
|
340
|
+
} & BooleanType;
|
|
341
|
+
export type ParameterTypeWithNumberType = {
|
|
342
|
+
kind: 'number_type';
|
|
343
|
+
} & NumberType;
|
|
344
|
+
export type ParameterTypeWithJSONType = {
|
|
345
|
+
kind: 'json_type';
|
|
346
|
+
} & JSONType;
|
|
347
|
+
export type ParameterTypeWithSQLNativeType = {
|
|
348
|
+
kind: 'sql_native_type';
|
|
349
|
+
} & SQLNativeType;
|
|
350
|
+
export type ParameterTypeWithDateType = {
|
|
351
|
+
kind: 'date_type';
|
|
352
|
+
} & DateType;
|
|
353
|
+
export type ParameterTypeWithTimestampType = {
|
|
354
|
+
kind: 'timestamp_type';
|
|
355
|
+
} & TimestampType;
|
|
356
|
+
export type ParameterTypeWithArrayType = {
|
|
357
|
+
kind: 'array_type';
|
|
358
|
+
} & ArrayType;
|
|
359
|
+
export type ParameterTypeWithRecordType = {
|
|
360
|
+
kind: 'record_type';
|
|
361
|
+
} & RecordType;
|
|
362
|
+
export type ParameterTypeWithFilterExpressionType = {
|
|
363
|
+
kind: 'filter_expression_type';
|
|
364
|
+
} & FilterExpressionType;
|
|
326
365
|
export type ParameterValue = {
|
|
327
366
|
name: string;
|
|
328
367
|
value: LiteralValue;
|
package/dist/types.js
CHANGED
|
@@ -511,6 +511,22 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
511
511
|
'filter_string': 'FilterStringApplication',
|
|
512
512
|
},
|
|
513
513
|
},
|
|
514
|
+
'FilterExpressionLiteral': {
|
|
515
|
+
'type': 'struct',
|
|
516
|
+
'name': 'FilterExpressionLiteral',
|
|
517
|
+
'fields': {
|
|
518
|
+
'filter_expression_value': {
|
|
519
|
+
'type': 'string',
|
|
520
|
+
'optional': false,
|
|
521
|
+
'array': false,
|
|
522
|
+
},
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
'FilterExpressionType': {
|
|
526
|
+
'type': 'struct',
|
|
527
|
+
'name': 'FilterExpressionType',
|
|
528
|
+
'fields': {},
|
|
529
|
+
},
|
|
514
530
|
'FilterOperation': {
|
|
515
531
|
'type': 'struct',
|
|
516
532
|
'name': 'FilterOperation',
|
|
@@ -633,6 +649,7 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
633
649
|
'timestamp_literal': 'TimestampLiteral',
|
|
634
650
|
'boolean_literal': 'BooleanLiteral',
|
|
635
651
|
'null_literal': 'NullLiteral',
|
|
652
|
+
'filter_expression_literal': 'FilterExpressionLiteral',
|
|
636
653
|
},
|
|
637
654
|
},
|
|
638
655
|
'Location': {
|
|
@@ -838,7 +855,7 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
838
855
|
'array': false,
|
|
839
856
|
},
|
|
840
857
|
'type': {
|
|
841
|
-
'type': '
|
|
858
|
+
'type': 'ParameterType',
|
|
842
859
|
'optional': false,
|
|
843
860
|
'array': false,
|
|
844
861
|
},
|
|
@@ -849,6 +866,22 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
849
866
|
},
|
|
850
867
|
},
|
|
851
868
|
},
|
|
869
|
+
'ParameterType': {
|
|
870
|
+
'type': 'union',
|
|
871
|
+
'name': 'ParameterType',
|
|
872
|
+
'options': {
|
|
873
|
+
'string_type': 'StringType',
|
|
874
|
+
'boolean_type': 'BooleanType',
|
|
875
|
+
'number_type': 'NumberType',
|
|
876
|
+
'json_type': 'JSONType',
|
|
877
|
+
'sql_native_type': 'SQLNativeType',
|
|
878
|
+
'date_type': 'DateType',
|
|
879
|
+
'timestamp_type': 'TimestampType',
|
|
880
|
+
'array_type': 'ArrayType',
|
|
881
|
+
'record_type': 'RecordType',
|
|
882
|
+
'filter_expression_type': 'FilterExpressionType',
|
|
883
|
+
},
|
|
884
|
+
},
|
|
852
885
|
'ParameterValue': {
|
|
853
886
|
'type': 'struct',
|
|
854
887
|
'name': 'ParameterValue',
|
package/package.json
CHANGED
package/thrift/malloy.thrift
CHANGED
|
@@ -25,7 +25,7 @@ struct SourceInfo {
|
|
|
25
25
|
|
|
26
26
|
struct ParameterInfo {
|
|
27
27
|
1: required string name,
|
|
28
|
-
2: required
|
|
28
|
+
2: required ParameterType type,
|
|
29
29
|
3: optional LiteralValue default_value,
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -176,6 +176,10 @@ struct RecordType {
|
|
|
176
176
|
1: required list<DimensionInfo> fields
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
+
struct FilterExpressionType {
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
179
183
|
union AtomicType {
|
|
180
184
|
1: required StringType string_type,
|
|
181
185
|
2: required BooleanType boolean_type,
|
|
@@ -188,6 +192,19 @@ union AtomicType {
|
|
|
188
192
|
10: required RecordType record_type,
|
|
189
193
|
}
|
|
190
194
|
|
|
195
|
+
union ParameterType {
|
|
196
|
+
1: required StringType string_type,
|
|
197
|
+
2: required BooleanType boolean_type,
|
|
198
|
+
3: required NumberType number_type,
|
|
199
|
+
4: required JSONType json_type,
|
|
200
|
+
5: required SQLNativeType sql_native_type,
|
|
201
|
+
6: required DateType date_type,
|
|
202
|
+
7: required TimestampType timestamp_type,
|
|
203
|
+
9: required ArrayType array_type,
|
|
204
|
+
10: required RecordType record_type,
|
|
205
|
+
11: required FilterExpressionType filter_expression_type,
|
|
206
|
+
}
|
|
207
|
+
|
|
191
208
|
struct SQLNativeType {
|
|
192
209
|
1: optional string sql_type,
|
|
193
210
|
}
|
|
@@ -373,6 +390,7 @@ union LiteralValue {
|
|
|
373
390
|
4: required TimestampLiteral timestamp_literal,
|
|
374
391
|
5: required BooleanLiteral boolean_literal,
|
|
375
392
|
6: required NullLiteral null_literal,
|
|
393
|
+
7: required FilterExpressionLiteral filter_expression_literal,
|
|
376
394
|
}
|
|
377
395
|
|
|
378
396
|
struct StringLiteral {
|
|
@@ -400,6 +418,10 @@ struct TimestampLiteral {
|
|
|
400
418
|
struct NullLiteral {
|
|
401
419
|
}
|
|
402
420
|
|
|
421
|
+
struct FilterExpressionLiteral {
|
|
422
|
+
1: required string filter_expression_value,
|
|
423
|
+
}
|
|
424
|
+
|
|
403
425
|
union Expression {
|
|
404
426
|
1: required Reference field_reference,
|
|
405
427
|
2: required TimeTruncationFieldReference time_truncation,
|