@vizzly/semantic-layer-public 0.0.219 → 0.0.221
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.
|
@@ -71,54 +71,67 @@ exports.timeDimensionsConstants = {
|
|
|
71
71
|
month: {
|
|
72
72
|
publicName: 'Monthly',
|
|
73
73
|
dateFormat: 'MMMM YYYY',
|
|
74
|
+
dataTypeOutput: 'date_time',
|
|
74
75
|
},
|
|
75
76
|
year: {
|
|
76
77
|
publicName: 'Yearly',
|
|
77
78
|
dateFormat: 'YYYY',
|
|
79
|
+
dataTypeOutput: 'date_time',
|
|
78
80
|
},
|
|
79
81
|
quarter: {
|
|
80
82
|
publicName: 'Per quarter',
|
|
81
83
|
dateFormat: 'quarter',
|
|
84
|
+
dataTypeOutput: 'date_time',
|
|
82
85
|
},
|
|
83
86
|
week: {
|
|
84
87
|
publicName: 'Weekly',
|
|
85
88
|
dateFormat: 'week',
|
|
89
|
+
dataTypeOutput: 'date_time',
|
|
86
90
|
},
|
|
87
91
|
day: {
|
|
88
92
|
publicName: 'Daily',
|
|
89
93
|
dateFormat: 'DD-MM-YYYY',
|
|
94
|
+
dataTypeOutput: 'date_time',
|
|
90
95
|
},
|
|
91
96
|
hourOfDayOnly: {
|
|
92
97
|
publicName: 'Hour of day',
|
|
93
98
|
dateFormat: 'hour_of_day',
|
|
99
|
+
dataTypeOutput: 'date_time',
|
|
94
100
|
},
|
|
95
101
|
weekOfYearOnly: {
|
|
96
102
|
publicName: 'Week of year',
|
|
97
103
|
dateFormat: 'week_of_year',
|
|
104
|
+
dataTypeOutput: 'number',
|
|
98
105
|
},
|
|
99
106
|
dayOfWeekOnly: {
|
|
100
107
|
publicName: 'Day of week',
|
|
101
108
|
dateFormat: 'day_of_week_iso',
|
|
109
|
+
dataTypeOutput: 'number',
|
|
102
110
|
},
|
|
103
111
|
monthOfYearOnly: {
|
|
104
112
|
publicName: 'Month of year',
|
|
105
113
|
dateFormat: 'month_of_year',
|
|
114
|
+
dataTypeOutput: 'number',
|
|
106
115
|
},
|
|
107
116
|
dayOfMonthOnly: {
|
|
108
117
|
publicName: 'Day of month',
|
|
109
118
|
dateFormat: 'day_of_month',
|
|
119
|
+
dataTypeOutput: 'number',
|
|
110
120
|
},
|
|
111
121
|
second: {
|
|
112
122
|
publicName: 'Per second',
|
|
113
123
|
dateFormat: 'hh:mm:ss',
|
|
124
|
+
dataTypeOutput: 'date_time',
|
|
114
125
|
},
|
|
115
126
|
hour: {
|
|
116
127
|
publicName: 'Hourly',
|
|
117
128
|
dateFormat: 'hh:mm',
|
|
129
|
+
dataTypeOutput: 'date_time',
|
|
118
130
|
},
|
|
119
131
|
minute: {
|
|
120
132
|
publicName: 'Per minute',
|
|
121
133
|
dateFormat: 'hh:mm',
|
|
134
|
+
dataTypeOutput: 'date_time',
|
|
122
135
|
},
|
|
123
136
|
};
|
|
124
137
|
exports.supportedAggregatesConstants = {
|
|
@@ -24,10 +24,11 @@ export type SupportedTransformationFunctions = {
|
|
|
24
24
|
};
|
|
25
25
|
export type SupportedTimeTruncFunction = {
|
|
26
26
|
publicName: string;
|
|
27
|
+
dataTypeOutput: 'number' | 'boolean' | 'string' | 'date_time' | 'string[]';
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* @deprecated
|
|
30
|
+
* formatting function to use is determined
|
|
31
|
+
* by the frontend from function -> formatter id
|
|
31
32
|
* */
|
|
32
33
|
dateFormat: DateTimeFormat | (string & {});
|
|
33
34
|
};
|
|
@@ -12,21 +12,6 @@ const constants_2 = require("../QueryEngineConfig/constants");
|
|
|
12
12
|
const DataSetNotLinkedToConnection_1 = require("../errors/DataSetNotLinkedToConnection");
|
|
13
13
|
const REDACT_KEYS_FROM_ERROR_MESSAGE = ['unencryptedCredentials', 'encryptedCredentials'];
|
|
14
14
|
const SUPPORTED_SECURE_FILTER_OPS = Object.keys(constants_2.supportedOperatorsConstants);
|
|
15
|
-
const SUPPORTED_ALLOWED_GRANULARITIES = [
|
|
16
|
-
'second',
|
|
17
|
-
'minute',
|
|
18
|
-
'hour',
|
|
19
|
-
'day',
|
|
20
|
-
'week',
|
|
21
|
-
'month',
|
|
22
|
-
'quarter',
|
|
23
|
-
'year',
|
|
24
|
-
'dayOfMonthOnly',
|
|
25
|
-
'dayOfWeekOnly',
|
|
26
|
-
'weekOfYearOnly',
|
|
27
|
-
'hourOfDayOnly',
|
|
28
|
-
'monthOfYearOnly',
|
|
29
|
-
];
|
|
30
15
|
const SUPPORTED_JOINS = ['rightJoin', 'leftJoin', 'innerJoin', 'outerJoin', 'leftOuterJoin', 'rightOuterJoin'];
|
|
31
16
|
exports.ALLOWED_ID_REGEX = /^[a-zA-Z0-9_+:\/=\-\s]*$/;
|
|
32
17
|
exports.ID_REGEX_ERROR_MESSAGE = 'IDs must only use alpha numeric characters and _';
|
|
@@ -59,7 +44,7 @@ const _fieldSchema = (client) => {
|
|
|
59
44
|
canBeMeasure: joi_1.default.boolean().optional().description('Can this field be used in aggregations?'),
|
|
60
45
|
canBeUsedInSort: joi_1.default.boolean().optional().description('__vizzly_hide_from_docs'),
|
|
61
46
|
allowedGranularities: joi_1.default.array()
|
|
62
|
-
.items(joi_1.default.string().valid(...
|
|
47
|
+
.items(joi_1.default.string().valid(...Object.keys((0, getQueryEngineConfig_1.getQueryEngineConfig)(client).supportedTimeTruncFunctions)))
|
|
63
48
|
.optional(),
|
|
64
49
|
allowedOperators: joi_1.default.alternatives()
|
|
65
50
|
.conditional('..dataType', {
|