@infomaximum/widget-sdk 6.0.0-wefi344-2 → 7.0.0-2
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/CHANGELOG.md +1376 -0
- package/README.md +4 -1
- package/dist/index.d.ts +10111 -1681
- package/dist/index.esm.js +1451 -481
- package/dist/index.js +1533 -481
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -3,6 +3,40 @@
|
|
|
3
3
|
var localization$1 = require('@infomaximum/localization');
|
|
4
4
|
var baseFilter = require('@infomaximum/base-filter');
|
|
5
5
|
|
|
6
|
+
/** Массив версий в строгом порядке, по которому последовательно выполняется миграция */
|
|
7
|
+
var apiVersions = [
|
|
8
|
+
"1",
|
|
9
|
+
"2",
|
|
10
|
+
"3",
|
|
11
|
+
"4",
|
|
12
|
+
"5",
|
|
13
|
+
"6",
|
|
14
|
+
"7", // Версии от 7 и старше пока не удаляем [BI-15416]
|
|
15
|
+
"8",
|
|
16
|
+
"9",
|
|
17
|
+
"10",
|
|
18
|
+
"10.1",
|
|
19
|
+
"10.2",
|
|
20
|
+
"10.3", // 241223
|
|
21
|
+
"11",
|
|
22
|
+
"12",
|
|
23
|
+
"13", // 2503
|
|
24
|
+
"13.1", // 250314
|
|
25
|
+
"14",
|
|
26
|
+
"15", // Для версии системы 2505
|
|
27
|
+
"15.1", // Для версии системы 250609
|
|
28
|
+
"15.2", // Для версии системы 250614
|
|
29
|
+
"16", // Для версии системы 2507
|
|
30
|
+
"16.1", // Для версии системы 250703
|
|
31
|
+
"16.2", // Для версии системы 250709
|
|
32
|
+
"17", // 2508
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Актуальная версия settings, с которой работает система.
|
|
36
|
+
* Используется единая версия для settings виджетов и показателей.
|
|
37
|
+
*/
|
|
38
|
+
var apiVersion = apiVersions.at(-1);
|
|
39
|
+
|
|
6
40
|
exports.EWidgetActionInputMethod = void 0;
|
|
7
41
|
(function (EWidgetActionInputMethod) {
|
|
8
42
|
EWidgetActionInputMethod["COLUMN"] = "COLUMN";
|
|
@@ -23,6 +57,7 @@ exports.EActionTypes = void 0;
|
|
|
23
57
|
EActionTypes["UPDATE_VARIABLE"] = "UPDATE_VARIABLE";
|
|
24
58
|
EActionTypes["EXECUTE_SCRIPT"] = "EXECUTE_SCRIPT";
|
|
25
59
|
EActionTypes["OPEN_VIEW"] = "OPEN_VIEW";
|
|
60
|
+
EActionTypes["DRILL_DOWN"] = "DRILL_DOWN";
|
|
26
61
|
})(exports.EActionTypes || (exports.EActionTypes = {}));
|
|
27
62
|
exports.EViewMode = void 0;
|
|
28
63
|
(function (EViewMode) {
|
|
@@ -65,6 +100,46 @@ exports.EActionButtonsTypes = void 0;
|
|
|
65
100
|
EActionButtonsTypes["SECONDARY"] = "primary-outlined";
|
|
66
101
|
})(exports.EActionButtonsTypes || (exports.EActionButtonsTypes = {}));
|
|
67
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Глобальный счетчик для генерации ID.
|
|
105
|
+
*
|
|
106
|
+
* @todo
|
|
107
|
+
* В будущем можно заменить единый счетчик на изолированные счетчики в разных контекстах.
|
|
108
|
+
*/
|
|
109
|
+
var id = 1;
|
|
110
|
+
var AutoIdentifiedArrayItemSchema = function (z) {
|
|
111
|
+
return z.object({
|
|
112
|
+
/**
|
|
113
|
+
* Идентификатор, добавляемый системой "на лету" для удобства разработки, не сохраняется на сервер.
|
|
114
|
+
* Гарантируется уникальность id в пределах settings виджета.
|
|
115
|
+
*/
|
|
116
|
+
id: z
|
|
117
|
+
.number()
|
|
118
|
+
.default(-1)
|
|
119
|
+
.transform(function (currentId) { return (currentId === -1 ? id++ : currentId); }),
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
var BaseWidgetSettingsSchema = function (z) {
|
|
123
|
+
return z.object({
|
|
124
|
+
title: z.string().default(""),
|
|
125
|
+
titleSize: themed(z.number().default(14), function (theme) { return theme.widgets.titleSize; }),
|
|
126
|
+
titleColor: themed(ColorSchema(z), function (theme) { return theme.widgets.titleColor; }),
|
|
127
|
+
titleWeight: themed(z.enum(exports.EFontWeight).default(exports.EFontWeight.NORMAL), function (theme) { return theme.widgets.titleWeight; }),
|
|
128
|
+
stateName: z.string().nullable().default(null),
|
|
129
|
+
showMarkdown: z.boolean().default(false),
|
|
130
|
+
markdownMeasures: z.array(MarkdownMeasureSchema(z)).default([]),
|
|
131
|
+
markdownText: z.string().default(""),
|
|
132
|
+
markdownTextSize: z.number().default(14),
|
|
133
|
+
filters: z.array(SettingsFilterSchema(z)).default([]),
|
|
134
|
+
filterMode: z.enum(exports.EWidgetFilterMode).default(exports.EWidgetFilterMode.DEFAULT),
|
|
135
|
+
ignoreFilters: z.boolean().default(false),
|
|
136
|
+
sorting: z.array(WidgetSortingIndicatorSchema(z)).default([]),
|
|
137
|
+
actionButtons: z.array(ActionButtonSchema(z)).default([]),
|
|
138
|
+
paddings: themed(z.union([z.number(), z.string()]).default(8), function (theme) { return theme.widgets.paddings; }),
|
|
139
|
+
viewTheme: z.boolean().default(false),
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
|
|
68
143
|
exports.ESimpleDataType = void 0;
|
|
69
144
|
(function (ESimpleDataType) {
|
|
70
145
|
ESimpleDataType["OTHER"] = "OTHER";
|
|
@@ -77,247 +152,6 @@ exports.ESimpleDataType = void 0;
|
|
|
77
152
|
ESimpleDataType["BOOLEAN"] = "BOOLEAN";
|
|
78
153
|
})(exports.ESimpleDataType || (exports.ESimpleDataType = {}));
|
|
79
154
|
|
|
80
|
-
var prepareValuesForSql = function (simpleType, values) {
|
|
81
|
-
return simpleType === exports.ESimpleDataType.INTEGER ||
|
|
82
|
-
simpleType === exports.ESimpleDataType.FLOAT ||
|
|
83
|
-
simpleType === exports.ESimpleDataType.BOOLEAN
|
|
84
|
-
? values
|
|
85
|
-
: values.map(function (value) {
|
|
86
|
-
return value === null ? null : "'".concat(escapeSingularQuotes$1(escapeReverseSlash(value)), "'");
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
var escapeReverseSlash = function (formula) {
|
|
90
|
-
return formula.replaceAll(/\\/gm, "\\\\");
|
|
91
|
-
};
|
|
92
|
-
var escapeSingularQuotes$1 = function (formula) {
|
|
93
|
-
return formula.replaceAll("'", "\\'");
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
/******************************************************************************
|
|
97
|
-
Copyright (c) Microsoft Corporation.
|
|
98
|
-
|
|
99
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
100
|
-
purpose with or without fee is hereby granted.
|
|
101
|
-
|
|
102
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
103
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
104
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
105
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
106
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
107
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
108
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
109
|
-
***************************************************************************** */
|
|
110
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
var __assign = function() {
|
|
114
|
-
__assign = Object.assign || function __assign(t) {
|
|
115
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
116
|
-
s = arguments[i];
|
|
117
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
118
|
-
}
|
|
119
|
-
return t;
|
|
120
|
-
};
|
|
121
|
-
return __assign.apply(this, arguments);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
function __rest(s, e) {
|
|
125
|
-
var t = {};
|
|
126
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
127
|
-
t[p] = s[p];
|
|
128
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
129
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
130
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
131
|
-
t[p[i]] = s[p[i]];
|
|
132
|
-
}
|
|
133
|
-
return t;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function __makeTemplateObject(cooked, raw) {
|
|
137
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
138
|
-
return cooked;
|
|
139
|
-
}
|
|
140
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
141
|
-
var e = new Error(message);
|
|
142
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
exports.ECalculatorFilterMethods = void 0;
|
|
146
|
-
(function (ECalculatorFilterMethods) {
|
|
147
|
-
ECalculatorFilterMethods["EQUAL_TO"] = "EQUAL_TO";
|
|
148
|
-
ECalculatorFilterMethods["NOT_EQUAL_TO"] = "NOT_EQUAL_TO";
|
|
149
|
-
ECalculatorFilterMethods["GREATER_THAN"] = "GREATER_THAN";
|
|
150
|
-
ECalculatorFilterMethods["LESS_THAN"] = "LESS_THAN";
|
|
151
|
-
ECalculatorFilterMethods["GREATER_THAN_OR_EQUAL_TO"] = "GREATER_THAN_OR_EQUAL_TO";
|
|
152
|
-
ECalculatorFilterMethods["LESS_THAN_OR_EQUAL_TO"] = "LESS_THAN_OR_EQUAL_TO";
|
|
153
|
-
ECalculatorFilterMethods["STARTS_WITH"] = "STARTS_WITH";
|
|
154
|
-
ECalculatorFilterMethods["ENDS_WITH"] = "ENDS_WITH";
|
|
155
|
-
ECalculatorFilterMethods["CONTAINS"] = "CONTAINS";
|
|
156
|
-
ECalculatorFilterMethods["NOT_CONTAINS"] = "NOT_CONTAINS";
|
|
157
|
-
ECalculatorFilterMethods["IN_RANGE"] = "IN_RANGE";
|
|
158
|
-
ECalculatorFilterMethods["NOT_IN_RANGE"] = "NOT_IN_RANGE";
|
|
159
|
-
ECalculatorFilterMethods["INCLUDE"] = "INCLUDE";
|
|
160
|
-
ECalculatorFilterMethods["EXCLUDE"] = "EXCLUDE";
|
|
161
|
-
ECalculatorFilterMethods["NONEMPTY"] = "NONEMPTY";
|
|
162
|
-
ECalculatorFilterMethods["EMPTY"] = "EMPTY";
|
|
163
|
-
})(exports.ECalculatorFilterMethods || (exports.ECalculatorFilterMethods = {}));
|
|
164
|
-
|
|
165
|
-
var formulaFilterMethods = __assign(__assign({}, exports.ECalculatorFilterMethods), { LAST_TIME: "LAST_TIME" });
|
|
166
|
-
exports.EProcessFilterNames = void 0;
|
|
167
|
-
(function (EProcessFilterNames) {
|
|
168
|
-
/** Наличие события */
|
|
169
|
-
EProcessFilterNames["presenceOfEvent"] = "presenceOfEvent";
|
|
170
|
-
/** Количество повторов события */
|
|
171
|
-
EProcessFilterNames["repetitionOfEvent"] = "repetitionOfEvent";
|
|
172
|
-
/** Наличие перехода */
|
|
173
|
-
EProcessFilterNames["presenceOfTransition"] = "presenceOfTransition";
|
|
174
|
-
/** Длительность перехода */
|
|
175
|
-
EProcessFilterNames["durationOfTransition"] = "durationOfTransition";
|
|
176
|
-
})(exports.EProcessFilterNames || (exports.EProcessFilterNames = {}));
|
|
177
|
-
exports.EFormulaFilterFieldKeys = void 0;
|
|
178
|
-
(function (EFormulaFilterFieldKeys) {
|
|
179
|
-
EFormulaFilterFieldKeys["date"] = "date";
|
|
180
|
-
EFormulaFilterFieldKeys["dateRange"] = "dateRange";
|
|
181
|
-
EFormulaFilterFieldKeys["numberRange"] = "numberRange";
|
|
182
|
-
EFormulaFilterFieldKeys["string"] = "string";
|
|
183
|
-
EFormulaFilterFieldKeys["lastTimeValue"] = "lastTimeValue";
|
|
184
|
-
EFormulaFilterFieldKeys["lastTimeUnit"] = "lastTimeUnit";
|
|
185
|
-
EFormulaFilterFieldKeys["durationUnit"] = "durationUnit";
|
|
186
|
-
})(exports.EFormulaFilterFieldKeys || (exports.EFormulaFilterFieldKeys = {}));
|
|
187
|
-
var isFormulaFilterValue = function (value) {
|
|
188
|
-
return "filteringMethod" in value;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
var compact = function (items) { return ((items === null || items === void 0 ? void 0 : items.filter(Boolean)) || []); };
|
|
192
|
-
var compactMap = function (items, f) {
|
|
193
|
-
return compact(items === null || items === void 0 ? void 0 : items.map(f));
|
|
194
|
-
};
|
|
195
|
-
var isNil = function (value) {
|
|
196
|
-
return value === null || value === undefined;
|
|
197
|
-
};
|
|
198
|
-
function memoize(fn) {
|
|
199
|
-
var cache = new Map();
|
|
200
|
-
return function (arg) {
|
|
201
|
-
if (cache.has(arg)) {
|
|
202
|
-
return cache.get(arg);
|
|
203
|
-
}
|
|
204
|
-
var result = fn(arg);
|
|
205
|
-
cache.set(arg, result);
|
|
206
|
-
return result;
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
exports.EClickHouseBaseTypes = void 0;
|
|
211
|
-
(function (EClickHouseBaseTypes) {
|
|
212
|
-
// DATE
|
|
213
|
-
EClickHouseBaseTypes["Date"] = "Date";
|
|
214
|
-
EClickHouseBaseTypes["Date32"] = "Date32";
|
|
215
|
-
// DATETIME
|
|
216
|
-
EClickHouseBaseTypes["DateTime"] = "DateTime";
|
|
217
|
-
EClickHouseBaseTypes["DateTime32"] = "DateTime32";
|
|
218
|
-
// DATETIME64
|
|
219
|
-
EClickHouseBaseTypes["DateTime64"] = "DateTime64";
|
|
220
|
-
// STRING
|
|
221
|
-
EClickHouseBaseTypes["FixedString"] = "FixedString";
|
|
222
|
-
EClickHouseBaseTypes["String"] = "String";
|
|
223
|
-
// FLOAT
|
|
224
|
-
EClickHouseBaseTypes["Decimal"] = "Decimal";
|
|
225
|
-
EClickHouseBaseTypes["Decimal32"] = "Decimal32";
|
|
226
|
-
EClickHouseBaseTypes["Decimal64"] = "Decimal64";
|
|
227
|
-
EClickHouseBaseTypes["Decimal128"] = "Decimal128";
|
|
228
|
-
EClickHouseBaseTypes["Decimal256"] = "Decimal256";
|
|
229
|
-
EClickHouseBaseTypes["Float32"] = "Float32";
|
|
230
|
-
EClickHouseBaseTypes["Float64"] = "Float64";
|
|
231
|
-
// INTEGER
|
|
232
|
-
EClickHouseBaseTypes["Int8"] = "Int8";
|
|
233
|
-
EClickHouseBaseTypes["Int16"] = "Int16";
|
|
234
|
-
EClickHouseBaseTypes["Int32"] = "Int32";
|
|
235
|
-
EClickHouseBaseTypes["Int64"] = "Int64";
|
|
236
|
-
EClickHouseBaseTypes["Int128"] = "Int128";
|
|
237
|
-
EClickHouseBaseTypes["Int256"] = "Int256";
|
|
238
|
-
EClickHouseBaseTypes["UInt8"] = "UInt8";
|
|
239
|
-
EClickHouseBaseTypes["UInt16"] = "UInt16";
|
|
240
|
-
EClickHouseBaseTypes["UInt32"] = "UInt32";
|
|
241
|
-
EClickHouseBaseTypes["UInt64"] = "UInt64";
|
|
242
|
-
EClickHouseBaseTypes["UInt128"] = "UInt128";
|
|
243
|
-
EClickHouseBaseTypes["UInt256"] = "UInt256";
|
|
244
|
-
// BOOLEAN
|
|
245
|
-
EClickHouseBaseTypes["Bool"] = "Bool";
|
|
246
|
-
})(exports.EClickHouseBaseTypes || (exports.EClickHouseBaseTypes = {}));
|
|
247
|
-
var stringTypes = ["String", "FixedString"];
|
|
248
|
-
var parseClickHouseType = memoize(function (type) {
|
|
249
|
-
if (isNil(type)) {
|
|
250
|
-
return {
|
|
251
|
-
simpleBaseType: exports.ESimpleDataType.OTHER,
|
|
252
|
-
dbBaseDataType: undefined,
|
|
253
|
-
containers: [],
|
|
254
|
-
simpleType: exports.ESimpleDataType.OTHER,
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
var _a = extractInnerType(type), containers = _a.containers, dbBaseDataType = _a.dbBaseDataType;
|
|
258
|
-
if (!dbBaseDataType) {
|
|
259
|
-
throw new Error("Invalid ClickHouse type: ".concat(type));
|
|
260
|
-
}
|
|
261
|
-
return {
|
|
262
|
-
dbBaseDataType: dbBaseDataType,
|
|
263
|
-
simpleBaseType: simplifyBaseType(dbBaseDataType),
|
|
264
|
-
containers: containers,
|
|
265
|
-
get simpleType() {
|
|
266
|
-
return containers.includes("Array") ? exports.ESimpleDataType.OTHER : this.simpleBaseType;
|
|
267
|
-
},
|
|
268
|
-
};
|
|
269
|
-
});
|
|
270
|
-
/** 'A(B(C))' -> ['A', 'B', 'C'] */
|
|
271
|
-
var splitByBrackets = function (input) { return input.split(/[\(\)]/).filter(Boolean); };
|
|
272
|
-
/**
|
|
273
|
-
* Отделить внутренний тип от оберток.
|
|
274
|
-
* Не поддерживаются обертки Tuple и LowCardinality.
|
|
275
|
-
*/
|
|
276
|
-
var extractInnerType = function (type) {
|
|
277
|
-
var tokens = splitByBrackets(type);
|
|
278
|
-
// Удаление параметров типа.
|
|
279
|
-
if (tokens.length > 0 && isTypeParameters(tokens.at(-1))) {
|
|
280
|
-
tokens.pop();
|
|
281
|
-
}
|
|
282
|
-
var dbBaseDataType = tokens.pop();
|
|
283
|
-
return { containers: tokens, dbBaseDataType: dbBaseDataType };
|
|
284
|
-
};
|
|
285
|
-
var simplifyBaseType = function (dbBaseType) {
|
|
286
|
-
var isSourceTypeStartsWith = function (prefix) { return dbBaseType.startsWith(prefix); };
|
|
287
|
-
if (isSourceTypeStartsWith("Int") || isSourceTypeStartsWith("UInt")) {
|
|
288
|
-
return exports.ESimpleDataType.INTEGER;
|
|
289
|
-
}
|
|
290
|
-
if (isSourceTypeStartsWith("Decimal") || isSourceTypeStartsWith("Float")) {
|
|
291
|
-
return exports.ESimpleDataType.FLOAT;
|
|
292
|
-
}
|
|
293
|
-
if (stringTypes.some(isSourceTypeStartsWith)) {
|
|
294
|
-
return exports.ESimpleDataType.STRING;
|
|
295
|
-
}
|
|
296
|
-
if (isSourceTypeStartsWith("DateTime64")) {
|
|
297
|
-
return exports.ESimpleDataType.DATETIME64;
|
|
298
|
-
}
|
|
299
|
-
if (isSourceTypeStartsWith("DateTime")) {
|
|
300
|
-
return exports.ESimpleDataType.DATETIME;
|
|
301
|
-
}
|
|
302
|
-
if (isSourceTypeStartsWith("Date")) {
|
|
303
|
-
return exports.ESimpleDataType.DATE;
|
|
304
|
-
}
|
|
305
|
-
if (isSourceTypeStartsWith("Bool")) {
|
|
306
|
-
return exports.ESimpleDataType.BOOLEAN;
|
|
307
|
-
}
|
|
308
|
-
return exports.ESimpleDataType.OTHER;
|
|
309
|
-
};
|
|
310
|
-
/**
|
|
311
|
-
* - `3` -> true
|
|
312
|
-
* - `3, 'Europe/Moscow'` -> true
|
|
313
|
-
* - `3, Europe/Moscow` -> false
|
|
314
|
-
*
|
|
315
|
-
* Пример типа с параметрами: `DateTime64(3, 'Europe/Moscow')`
|
|
316
|
-
*/
|
|
317
|
-
var isTypeParameters = function (stringifiedParameters) {
|
|
318
|
-
return stringifiedParameters.split(", ").some(function (p) { return !Number.isNaN(Number(p)) || p.startsWith("'"); });
|
|
319
|
-
};
|
|
320
|
-
|
|
321
155
|
exports.EFormatTypes = void 0;
|
|
322
156
|
(function (EFormatTypes) {
|
|
323
157
|
/** Дата */
|
|
@@ -611,7 +445,1052 @@ var formattingConfig = {
|
|
|
611
445
|
},
|
|
612
446
|
};
|
|
613
447
|
|
|
614
|
-
|
|
448
|
+
/******************************************************************************
|
|
449
|
+
Copyright (c) Microsoft Corporation.
|
|
450
|
+
|
|
451
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
452
|
+
purpose with or without fee is hereby granted.
|
|
453
|
+
|
|
454
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
455
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
456
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
457
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
458
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
459
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
460
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
461
|
+
***************************************************************************** */
|
|
462
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
var __assign = function() {
|
|
466
|
+
__assign = Object.assign || function __assign(t) {
|
|
467
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
468
|
+
s = arguments[i];
|
|
469
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
470
|
+
}
|
|
471
|
+
return t;
|
|
472
|
+
};
|
|
473
|
+
return __assign.apply(this, arguments);
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
function __rest(s, e) {
|
|
477
|
+
var t = {};
|
|
478
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
479
|
+
t[p] = s[p];
|
|
480
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
481
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
482
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
483
|
+
t[p[i]] = s[p[i]];
|
|
484
|
+
}
|
|
485
|
+
return t;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function __values(o) {
|
|
489
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
490
|
+
if (m) return m.call(o);
|
|
491
|
+
if (o && typeof o.length === "number") return {
|
|
492
|
+
next: function () {
|
|
493
|
+
if (o && i >= o.length) o = void 0;
|
|
494
|
+
return { value: o && o[i++], done: !o };
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function __read(o, n) {
|
|
501
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
502
|
+
if (!m) return o;
|
|
503
|
+
var i = m.call(o), r, ar = [], e;
|
|
504
|
+
try {
|
|
505
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
506
|
+
}
|
|
507
|
+
catch (error) { e = { error: error }; }
|
|
508
|
+
finally {
|
|
509
|
+
try {
|
|
510
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
511
|
+
}
|
|
512
|
+
finally { if (e) throw e.error; }
|
|
513
|
+
}
|
|
514
|
+
return ar;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function __makeTemplateObject(cooked, raw) {
|
|
518
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
519
|
+
return cooked;
|
|
520
|
+
}
|
|
521
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
522
|
+
var e = new Error(message);
|
|
523
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
exports.EWidgetIndicatorType = void 0;
|
|
527
|
+
(function (EWidgetIndicatorType) {
|
|
528
|
+
EWidgetIndicatorType["MEASURE"] = "MEASURE";
|
|
529
|
+
EWidgetIndicatorType["EVENT_INDICATOR"] = "EVENT_INDICATOR";
|
|
530
|
+
EWidgetIndicatorType["TRANSITION_INDICATOR"] = "TRANSITION_INDICATOR";
|
|
531
|
+
EWidgetIndicatorType["DIMENSION"] = "DIMENSION";
|
|
532
|
+
EWidgetIndicatorType["SORTING"] = "SORTING";
|
|
533
|
+
})(exports.EWidgetIndicatorType || (exports.EWidgetIndicatorType = {}));
|
|
534
|
+
exports.EOuterAggregation = void 0;
|
|
535
|
+
(function (EOuterAggregation) {
|
|
536
|
+
EOuterAggregation["avg"] = "avg";
|
|
537
|
+
EOuterAggregation["median"] = "median";
|
|
538
|
+
EOuterAggregation["count"] = "count";
|
|
539
|
+
EOuterAggregation["countDistinct"] = "countDistinct";
|
|
540
|
+
EOuterAggregation["min"] = "min";
|
|
541
|
+
EOuterAggregation["max"] = "max";
|
|
542
|
+
EOuterAggregation["sum"] = "sum";
|
|
543
|
+
EOuterAggregation["top"] = "top";
|
|
544
|
+
})(exports.EOuterAggregation || (exports.EOuterAggregation = {}));
|
|
545
|
+
/** Режимы значения показателя (на основе чего генерируется формула) */
|
|
546
|
+
exports.EWidgetIndicatorValueModes = void 0;
|
|
547
|
+
(function (EWidgetIndicatorValueModes) {
|
|
548
|
+
/** Готовая формула (как правило, введенная пользователем через редактор формул) */
|
|
549
|
+
EWidgetIndicatorValueModes["FORMULA"] = "FORMULA";
|
|
550
|
+
/** Шаблон формулы, предоставляемый системой */
|
|
551
|
+
EWidgetIndicatorValueModes["TEMPLATE"] = "TEMPLATE";
|
|
552
|
+
EWidgetIndicatorValueModes["AGGREGATION"] = "AGGREGATION";
|
|
553
|
+
EWidgetIndicatorValueModes["DURATION"] = "DURATION";
|
|
554
|
+
EWidgetIndicatorValueModes["CONVERSION"] = "CONVERSION";
|
|
555
|
+
EWidgetIndicatorValueModes["START_TIME"] = "START_TIME";
|
|
556
|
+
EWidgetIndicatorValueModes["END_TIME"] = "END_TIME";
|
|
557
|
+
})(exports.EWidgetIndicatorValueModes || (exports.EWidgetIndicatorValueModes = {}));
|
|
558
|
+
/** Режимы сортировки (на что ссылается сортировка) */
|
|
559
|
+
exports.ESortingValueModes = void 0;
|
|
560
|
+
(function (ESortingValueModes) {
|
|
561
|
+
/** Сортировка по формуле */
|
|
562
|
+
ESortingValueModes["FORMULA"] = "FORMULA";
|
|
563
|
+
/** Сортировка по показателю(разрезу или мере) виджета */
|
|
564
|
+
ESortingValueModes["IN_WIDGET"] = "IN_WIDGET";
|
|
565
|
+
})(exports.ESortingValueModes || (exports.ESortingValueModes = {}));
|
|
566
|
+
exports.EFormatOrFormattingMode = void 0;
|
|
567
|
+
(function (EFormatOrFormattingMode) {
|
|
568
|
+
EFormatOrFormattingMode["BASE"] = "BASE";
|
|
569
|
+
EFormatOrFormattingMode["TEMPLATE"] = "TEMPLATE";
|
|
570
|
+
})(exports.EFormatOrFormattingMode || (exports.EFormatOrFormattingMode = {}));
|
|
571
|
+
function inheritDisplayConditionFromHierarchy(dimension, hierarchy) {
|
|
572
|
+
return __assign(__assign({}, dimension), { displayCondition: hierarchy.displayCondition });
|
|
573
|
+
}
|
|
574
|
+
/** Тип показателя */
|
|
575
|
+
exports.EIndicatorType = void 0;
|
|
576
|
+
(function (EIndicatorType) {
|
|
577
|
+
/** Показатели процесса */
|
|
578
|
+
EIndicatorType["PROCESS_MEASURE"] = "PROCESS_MEASURE";
|
|
579
|
+
/** Вводимое значение */
|
|
580
|
+
EIndicatorType["STATIC"] = "STATIC";
|
|
581
|
+
/** Статический список */
|
|
582
|
+
EIndicatorType["STATIC_LIST"] = "STATIC_LIST";
|
|
583
|
+
/** Динамический список */
|
|
584
|
+
EIndicatorType["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
585
|
+
/** Список колонок */
|
|
586
|
+
EIndicatorType["COLUMN_LIST"] = "COLUMN_LIST";
|
|
587
|
+
/** Разрез */
|
|
588
|
+
EIndicatorType["DIMENSION"] = "DIMENSION";
|
|
589
|
+
/** Мера */
|
|
590
|
+
EIndicatorType["MEASURE"] = "MEASURE";
|
|
591
|
+
/** Иерархия */
|
|
592
|
+
EIndicatorType["DYNAMIC_DIMENSION"] = "DYNAMIC_DIMENSION";
|
|
593
|
+
/** Пользовательская сортировка */
|
|
594
|
+
EIndicatorType["USER_SORTING"] = "USER_SORTING";
|
|
595
|
+
})(exports.EIndicatorType || (exports.EIndicatorType = {}));
|
|
596
|
+
/** Обобщенные типы значений переменных */
|
|
597
|
+
exports.ESimpleInputType = void 0;
|
|
598
|
+
(function (ESimpleInputType) {
|
|
599
|
+
/** Число (точность Float64) */
|
|
600
|
+
ESimpleInputType["NUMBER"] = "FLOAT";
|
|
601
|
+
/** Целое число (точность Int64) */
|
|
602
|
+
ESimpleInputType["INTEGER_NUMBER"] = "INTEGER";
|
|
603
|
+
/** Текст */
|
|
604
|
+
ESimpleInputType["TEXT"] = "STRING";
|
|
605
|
+
/** Дата (точность Date) */
|
|
606
|
+
ESimpleInputType["DATE"] = "DATE";
|
|
607
|
+
/** Дата и время (точность DateTime64) */
|
|
608
|
+
ESimpleInputType["DATE_AND_TIME"] = "DATETIME";
|
|
609
|
+
/** Логический тип */
|
|
610
|
+
ESimpleInputType["BOOLEAN"] = "BOOLEAN";
|
|
611
|
+
})(exports.ESimpleInputType || (exports.ESimpleInputType = {}));
|
|
612
|
+
function isDimensionsHierarchy(indicator) {
|
|
613
|
+
return "hierarchyDimensions" in indicator;
|
|
614
|
+
}
|
|
615
|
+
exports.OuterAggregation = void 0;
|
|
616
|
+
(function (OuterAggregation) {
|
|
617
|
+
OuterAggregation["avg"] = "avgIf";
|
|
618
|
+
OuterAggregation["median"] = "medianIf";
|
|
619
|
+
OuterAggregation["count"] = "countIf";
|
|
620
|
+
OuterAggregation["countDistinct"] = "countIfDistinct";
|
|
621
|
+
OuterAggregation["min"] = "minIf";
|
|
622
|
+
OuterAggregation["max"] = "maxIf";
|
|
623
|
+
OuterAggregation["sum"] = "sumIf";
|
|
624
|
+
})(exports.OuterAggregation || (exports.OuterAggregation = {}));
|
|
625
|
+
exports.EDurationTemplateName = void 0;
|
|
626
|
+
(function (EDurationTemplateName) {
|
|
627
|
+
EDurationTemplateName["avg"] = "avg";
|
|
628
|
+
EDurationTemplateName["median"] = "median";
|
|
629
|
+
})(exports.EDurationTemplateName || (exports.EDurationTemplateName = {}));
|
|
630
|
+
exports.EEventAppearances = void 0;
|
|
631
|
+
(function (EEventAppearances) {
|
|
632
|
+
EEventAppearances["FIRST"] = "FIRST";
|
|
633
|
+
EEventAppearances["LAST"] = "LAST";
|
|
634
|
+
})(exports.EEventAppearances || (exports.EEventAppearances = {}));
|
|
635
|
+
|
|
636
|
+
// Типы, используемые в значениях элементов управления.
|
|
637
|
+
exports.EWidgetFilterMode = void 0;
|
|
638
|
+
(function (EWidgetFilterMode) {
|
|
639
|
+
EWidgetFilterMode["DEFAULT"] = "DEFAULT";
|
|
640
|
+
EWidgetFilterMode["SINGLE"] = "SINGLE";
|
|
641
|
+
EWidgetFilterMode["DISABLED"] = "DISABLED";
|
|
642
|
+
})(exports.EWidgetFilterMode || (exports.EWidgetFilterMode = {}));
|
|
643
|
+
exports.EMarkdownDisplayMode = void 0;
|
|
644
|
+
(function (EMarkdownDisplayMode) {
|
|
645
|
+
EMarkdownDisplayMode["NONE"] = "NONE";
|
|
646
|
+
EMarkdownDisplayMode["INDICATOR"] = "INDICATOR";
|
|
647
|
+
})(exports.EMarkdownDisplayMode || (exports.EMarkdownDisplayMode = {}));
|
|
648
|
+
exports.EDisplayConditionMode = void 0;
|
|
649
|
+
(function (EDisplayConditionMode) {
|
|
650
|
+
EDisplayConditionMode["DISABLED"] = "DISABLED";
|
|
651
|
+
EDisplayConditionMode["FORMULA"] = "FORMULA";
|
|
652
|
+
EDisplayConditionMode["VARIABLE"] = "VARIABLE";
|
|
653
|
+
})(exports.EDisplayConditionMode || (exports.EDisplayConditionMode = {}));
|
|
654
|
+
exports.EFontWeight = void 0;
|
|
655
|
+
(function (EFontWeight) {
|
|
656
|
+
EFontWeight["NORMAL"] = "NORMAL";
|
|
657
|
+
EFontWeight["BOLD"] = "BOLD";
|
|
658
|
+
})(exports.EFontWeight || (exports.EFontWeight = {}));
|
|
659
|
+
exports.EHeightMode = void 0;
|
|
660
|
+
(function (EHeightMode) {
|
|
661
|
+
EHeightMode["FIXED"] = "FIXED";
|
|
662
|
+
EHeightMode["PERCENT"] = "PERCENT";
|
|
663
|
+
})(exports.EHeightMode || (exports.EHeightMode = {}));
|
|
664
|
+
|
|
665
|
+
var SortDirectionSchema = function (z) {
|
|
666
|
+
return z.union([z.literal(exports.ESortDirection.ascend), z.literal(exports.ESortDirection.descend)]);
|
|
667
|
+
};
|
|
668
|
+
var SortOrderSchema = function (z) {
|
|
669
|
+
return z.object({
|
|
670
|
+
/** Формула сортировки */
|
|
671
|
+
formula: FormulaSchema(z),
|
|
672
|
+
/** Тип данных формулы */
|
|
673
|
+
dbDataType: z.string().optional(),
|
|
674
|
+
/** Направление сортировки */
|
|
675
|
+
direction: SortDirectionSchema(z),
|
|
676
|
+
/** Условие применения сортировки */
|
|
677
|
+
displayCondition: FormulaSchema(z).optional(),
|
|
678
|
+
});
|
|
679
|
+
};
|
|
680
|
+
var WidgetSortingValueSchema = function (z) {
|
|
681
|
+
return z.discriminatedUnion("mode", [
|
|
682
|
+
z.object({
|
|
683
|
+
mode: z.literal(exports.ESortingValueModes.FORMULA),
|
|
684
|
+
formula: FormulaSchema(z),
|
|
685
|
+
dbDataType: z.string().optional(),
|
|
686
|
+
}),
|
|
687
|
+
z.object({
|
|
688
|
+
mode: z.literal(exports.ESortingValueModes.IN_WIDGET),
|
|
689
|
+
group: z.string(),
|
|
690
|
+
index: z.number(),
|
|
691
|
+
}),
|
|
692
|
+
]);
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
/** Ключи мета-данных внутри схем настроек */
|
|
696
|
+
exports.ESettingsSchemaMetaKey = void 0;
|
|
697
|
+
(function (ESettingsSchemaMetaKey) {
|
|
698
|
+
/** Привязка значения из темы к настройке */
|
|
699
|
+
ESettingsSchemaMetaKey["themeValue"] = "themeValue";
|
|
700
|
+
/** Тип сущности */
|
|
701
|
+
ESettingsSchemaMetaKey["entity"] = "entity";
|
|
702
|
+
})(exports.ESettingsSchemaMetaKey || (exports.ESettingsSchemaMetaKey = {}));
|
|
703
|
+
|
|
704
|
+
var _a$6;
|
|
705
|
+
var RangeSchema = function (z) {
|
|
706
|
+
return z.object({
|
|
707
|
+
unit: z.string().optional(),
|
|
708
|
+
min: z.number().optional(),
|
|
709
|
+
max: z.number().optional(),
|
|
710
|
+
});
|
|
711
|
+
};
|
|
712
|
+
var DisplayConditionSchema = function (z) {
|
|
713
|
+
return z
|
|
714
|
+
.discriminatedUnion("mode", [
|
|
715
|
+
z.object({
|
|
716
|
+
mode: z.literal(exports.EDisplayConditionMode.DISABLED),
|
|
717
|
+
}),
|
|
718
|
+
z.object({
|
|
719
|
+
mode: z.literal(exports.EDisplayConditionMode.FORMULA),
|
|
720
|
+
formula: FormulaSchema(z),
|
|
721
|
+
}),
|
|
722
|
+
z.object({
|
|
723
|
+
mode: z.literal(exports.EDisplayConditionMode.VARIABLE),
|
|
724
|
+
variableName: NameNullableSchema(z),
|
|
725
|
+
variableValue: z.string().nullable().default(null),
|
|
726
|
+
}),
|
|
727
|
+
])
|
|
728
|
+
.default({ mode: exports.EDisplayConditionMode.DISABLED });
|
|
729
|
+
};
|
|
730
|
+
/** Схема ключа сущности (с возможностью находиться в неинициализированном состоянии) */
|
|
731
|
+
var KeyNullableSchema = function (z) { return z.string().nullable().default(null); };
|
|
732
|
+
/** Схема имени сущности (с возможностью находиться в неинициализированном состоянии) */
|
|
733
|
+
var NameNullableSchema = function (z) { return z.string().nullable().default(null); };
|
|
734
|
+
/**
|
|
735
|
+
* Перечисление системных типов сущностей в схеме настроек виджетов.
|
|
736
|
+
* @note при расширении лучше положить на более общий уровень.
|
|
737
|
+
*/
|
|
738
|
+
var EEntity;
|
|
739
|
+
(function (EEntity) {
|
|
740
|
+
EEntity["formula"] = "formula";
|
|
741
|
+
})(EEntity || (EEntity = {}));
|
|
742
|
+
var formulaMeta = Object.freeze((_a$6 = {}, _a$6[exports.ESettingsSchemaMetaKey.entity] = EEntity.formula, _a$6));
|
|
743
|
+
/** Схема формулы */
|
|
744
|
+
var FormulaSchema = function (z) { return z.string().default("").meta(formulaMeta); };
|
|
745
|
+
/**
|
|
746
|
+
* Схема формулы, которая не может быть пустой строкой, но может быть в
|
|
747
|
+
* неинициализированном состоянии null (вместо пустой строки)
|
|
748
|
+
*
|
|
749
|
+
* @note для обратной совместимости без необходимости писать миграции
|
|
750
|
+
*/
|
|
751
|
+
var FormulaNullableSchema = function (z) {
|
|
752
|
+
return z.string().nullable().default(null).meta(formulaMeta);
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
var WidgetIndicatorSchema = function (z) {
|
|
756
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
757
|
+
name: z.string(),
|
|
758
|
+
});
|
|
759
|
+
};
|
|
760
|
+
var FormatSchema = function (z) {
|
|
761
|
+
return z
|
|
762
|
+
.object({
|
|
763
|
+
mode: z.enum(exports.EFormatOrFormattingMode),
|
|
764
|
+
value: z.enum(exports.EFormatTypes).optional(),
|
|
765
|
+
})
|
|
766
|
+
.default({ mode: exports.EFormatOrFormattingMode.BASE, value: exports.EFormatTypes.STRING });
|
|
767
|
+
};
|
|
768
|
+
var FormattingSchema = function (z) {
|
|
769
|
+
return z
|
|
770
|
+
.discriminatedUnion("mode", [
|
|
771
|
+
z.object({
|
|
772
|
+
mode: z.literal(exports.EFormatOrFormattingMode.BASE),
|
|
773
|
+
value: z.enum(exports.EFormattingPresets).default(exports.EFormattingPresets.AUTO),
|
|
774
|
+
}),
|
|
775
|
+
z.object({
|
|
776
|
+
mode: z.literal(exports.EFormatOrFormattingMode.TEMPLATE),
|
|
777
|
+
value: z.string().default(""),
|
|
778
|
+
}),
|
|
779
|
+
])
|
|
780
|
+
.default({ mode: exports.EFormatOrFormattingMode.BASE, value: exports.EFormattingPresets.AUTO });
|
|
781
|
+
};
|
|
782
|
+
var WidgetColumnIndicatorSchema = function (z) {
|
|
783
|
+
return WidgetIndicatorSchema(z).extend({
|
|
784
|
+
dbDataType: z.string().optional(),
|
|
785
|
+
format: FormatSchema(z).optional(),
|
|
786
|
+
formatting: FormattingSchema(z).optional(),
|
|
787
|
+
displayCondition: DisplayConditionSchema(z),
|
|
788
|
+
onClick: z.array(ActionsOnClickSchema(z)).optional(),
|
|
789
|
+
});
|
|
790
|
+
};
|
|
791
|
+
var WidgetIndicatorFormulaValueSchema = function (z) {
|
|
792
|
+
return z.object({
|
|
793
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.FORMULA),
|
|
794
|
+
formula: FormulaSchema(z).optional(),
|
|
795
|
+
});
|
|
796
|
+
};
|
|
797
|
+
var WidgetIndicatorTemplateValueSchema = function (z) {
|
|
798
|
+
return z.object({
|
|
799
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.TEMPLATE),
|
|
800
|
+
/** Имя шаблонной формулы, использующей колонку таблицы */
|
|
801
|
+
templateName: z.string().optional(),
|
|
802
|
+
/** Имя таблицы */
|
|
803
|
+
tableName: z.string().optional(),
|
|
804
|
+
/** Имя колонки */
|
|
805
|
+
columnName: z.string().optional(),
|
|
806
|
+
});
|
|
807
|
+
};
|
|
808
|
+
var ColumnIndicatorValueSchema = function (z) {
|
|
809
|
+
return z.union([MeasureValueSchema(z), DimensionValueSchema(z)]);
|
|
810
|
+
};
|
|
811
|
+
var MeasureValueSchema = function (z) {
|
|
812
|
+
return z.discriminatedUnion("mode", [
|
|
813
|
+
WidgetIndicatorFormulaValueSchema(z),
|
|
814
|
+
WidgetIndicatorTemplateValueSchema(z).extend({
|
|
815
|
+
innerTemplateName: z.enum(exports.EMeasureInnerTemplateNames).optional(),
|
|
816
|
+
}),
|
|
817
|
+
]);
|
|
818
|
+
};
|
|
819
|
+
var DimensionValueSchema = function (z) {
|
|
820
|
+
return z.discriminatedUnion("mode", [
|
|
821
|
+
WidgetIndicatorFormulaValueSchema(z),
|
|
822
|
+
WidgetIndicatorTemplateValueSchema(z).extend({
|
|
823
|
+
innerTemplateName: z.never().optional(),
|
|
824
|
+
}),
|
|
825
|
+
]);
|
|
826
|
+
};
|
|
827
|
+
var WidgetIndicatorAggregationValueSchema = function (z) {
|
|
828
|
+
return z.object({
|
|
829
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.AGGREGATION),
|
|
830
|
+
templateName: z.string(),
|
|
831
|
+
processKey: KeyNullableSchema(z),
|
|
832
|
+
eventName: NameNullableSchema(z),
|
|
833
|
+
eventNameFormula: FormulaNullableSchema(z),
|
|
834
|
+
anyEvent: z.literal(true).optional(),
|
|
835
|
+
caseCaseIdFormula: FormulaNullableSchema(z),
|
|
836
|
+
filters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
837
|
+
tableName: z.string().optional(),
|
|
838
|
+
columnName: z.string().optional(),
|
|
839
|
+
eventTimeFormula: FormulaNullableSchema(z).optional(),
|
|
840
|
+
});
|
|
841
|
+
};
|
|
842
|
+
var WidgetMeasureAggregationValueSchema = function (z) {
|
|
843
|
+
return WidgetIndicatorAggregationValueSchema(z).extend({ outerAggregation: z.enum(exports.EOuterAggregation) });
|
|
844
|
+
};
|
|
845
|
+
var WidgetIndicatorTimeValueSchema = function (z) {
|
|
846
|
+
return z.object({
|
|
847
|
+
templateName: z.string(),
|
|
848
|
+
mode: z.union([
|
|
849
|
+
z.literal(exports.EWidgetIndicatorValueModes.START_TIME),
|
|
850
|
+
z.literal(exports.EWidgetIndicatorValueModes.END_TIME),
|
|
851
|
+
]),
|
|
852
|
+
processKey: KeyNullableSchema(z),
|
|
853
|
+
eventName: NameNullableSchema(z),
|
|
854
|
+
eventTimeFormula: FormulaNullableSchema(z),
|
|
855
|
+
caseCaseIdFormula: FormulaNullableSchema(z),
|
|
856
|
+
eventNameFormula: FormulaNullableSchema(z),
|
|
857
|
+
filters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
858
|
+
});
|
|
859
|
+
};
|
|
860
|
+
var WidgetDimensionSchema = function (z) {
|
|
861
|
+
return WidgetColumnIndicatorSchema(z).extend({
|
|
862
|
+
value: z
|
|
863
|
+
.discriminatedUnion("mode", [
|
|
864
|
+
DimensionValueSchema(z),
|
|
865
|
+
WidgetIndicatorAggregationValueSchema(z).extend({
|
|
866
|
+
innerTemplateName: z.string().optional(),
|
|
867
|
+
}),
|
|
868
|
+
WidgetIndicatorTimeValueSchema(z),
|
|
869
|
+
])
|
|
870
|
+
.optional(),
|
|
871
|
+
hideEmptyValues: z.boolean().default(false),
|
|
872
|
+
});
|
|
873
|
+
};
|
|
874
|
+
var WidgetDimensionInHierarchySchema = function (z) {
|
|
875
|
+
return WidgetDimensionSchema(z).omit({ displayCondition: true });
|
|
876
|
+
};
|
|
877
|
+
var WidgetDimensionHierarchySchema = function (z, dimensionSchema) {
|
|
878
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
879
|
+
name: z.string(),
|
|
880
|
+
// Для иерархии является дискриминатором, для него нельзя задавать дефолтное значение.
|
|
881
|
+
hierarchyDimensions: z.array(dimensionSchema),
|
|
882
|
+
displayCondition: DisplayConditionSchema(z),
|
|
883
|
+
});
|
|
884
|
+
};
|
|
885
|
+
var WidgetIndicatorConversionValueSchema = function (z) {
|
|
886
|
+
return z.object({
|
|
887
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.CONVERSION),
|
|
888
|
+
startEventNameFormula: FormulaNullableSchema(z),
|
|
889
|
+
startEventProcessKey: KeyNullableSchema(z),
|
|
890
|
+
startEventName: NameNullableSchema(z),
|
|
891
|
+
startEventFilters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
892
|
+
startEventTimeFormula: FormulaNullableSchema(z),
|
|
893
|
+
endEventNameFormula: FormulaNullableSchema(z),
|
|
894
|
+
endEventProcessKey: KeyNullableSchema(z),
|
|
895
|
+
endEventName: NameNullableSchema(z),
|
|
896
|
+
endEventFilters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
897
|
+
endCaseCaseIdFormula: FormulaNullableSchema(z),
|
|
898
|
+
endEventTimeFormula: FormulaNullableSchema(z),
|
|
899
|
+
});
|
|
900
|
+
};
|
|
901
|
+
var WidgetIndicatorDurationValueSchema = function (z) {
|
|
902
|
+
return WidgetIndicatorConversionValueSchema(z).extend({
|
|
903
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.DURATION),
|
|
904
|
+
templateName: z.string(),
|
|
905
|
+
startEventAppearances: z.enum(exports.EEventAppearances),
|
|
906
|
+
endEventAppearances: z.enum(exports.EEventAppearances),
|
|
907
|
+
});
|
|
908
|
+
};
|
|
909
|
+
var WidgetMeasureSchema = function (z) {
|
|
910
|
+
return WidgetColumnIndicatorSchema(z).extend({
|
|
911
|
+
value: z
|
|
912
|
+
.discriminatedUnion("mode", [
|
|
913
|
+
MeasureValueSchema(z),
|
|
914
|
+
WidgetMeasureAggregationValueSchema(z),
|
|
915
|
+
WidgetIndicatorConversionValueSchema(z),
|
|
916
|
+
WidgetIndicatorDurationValueSchema(z),
|
|
917
|
+
])
|
|
918
|
+
.optional(),
|
|
919
|
+
});
|
|
920
|
+
};
|
|
921
|
+
var MarkdownMeasureSchema = function (z) {
|
|
922
|
+
return WidgetMeasureSchema(z).extend({
|
|
923
|
+
displaySign: z.enum(exports.EMarkdownDisplayMode).default(exports.EMarkdownDisplayMode.NONE),
|
|
924
|
+
});
|
|
925
|
+
};
|
|
926
|
+
var WidgetSortingIndicatorSchema = function (z) {
|
|
927
|
+
return WidgetIndicatorSchema(z).extend({
|
|
928
|
+
direction: SortDirectionSchema(z),
|
|
929
|
+
value: WidgetSortingValueSchema(z),
|
|
930
|
+
});
|
|
931
|
+
};
|
|
932
|
+
var ProcessIndicatorValueSchema = function (z) {
|
|
933
|
+
return z.discriminatedUnion("mode", [
|
|
934
|
+
z.object({
|
|
935
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.FORMULA),
|
|
936
|
+
formula: FormulaSchema(z),
|
|
937
|
+
}),
|
|
938
|
+
z.object({
|
|
939
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.TEMPLATE),
|
|
940
|
+
/** Имя шаблонной формулы, использующей колонку таблицы */
|
|
941
|
+
templateName: z.string(),
|
|
942
|
+
}),
|
|
943
|
+
]);
|
|
944
|
+
};
|
|
945
|
+
var ProcessIndicatorSchema = function (z) {
|
|
946
|
+
return WidgetIndicatorSchema(z).extend({
|
|
947
|
+
value: ProcessIndicatorValueSchema(z).optional(),
|
|
948
|
+
dbDataType: z.string().optional(),
|
|
949
|
+
format: FormatSchema(z).optional(),
|
|
950
|
+
formatting: FormattingSchema(z).optional(),
|
|
951
|
+
displayCondition: DisplayConditionSchema(z),
|
|
952
|
+
});
|
|
953
|
+
};
|
|
954
|
+
|
|
955
|
+
var FormulaFilterValueSchema = function (z) {
|
|
956
|
+
var _a;
|
|
957
|
+
return z.object({
|
|
958
|
+
name: z.string().nullish(),
|
|
959
|
+
formula: z.string(),
|
|
960
|
+
sliceIndex: z.number().optional(),
|
|
961
|
+
dbDataType: z.string(),
|
|
962
|
+
format: z.enum(exports.EFormatTypes),
|
|
963
|
+
filteringMethod: z.enum(Object.values(formulaFilterMethods)),
|
|
964
|
+
checkedValues: z.array(z.string().nullable()).optional(),
|
|
965
|
+
formValues: z
|
|
966
|
+
.object((_a = {},
|
|
967
|
+
_a[exports.EFormulaFilterFieldKeys.date] = z.string().nullable(),
|
|
968
|
+
_a[exports.EFormulaFilterFieldKeys.dateRange] = z.tuple([z.string(), z.string()]),
|
|
969
|
+
_a[exports.EFormulaFilterFieldKeys.numberRange] = z.tuple([
|
|
970
|
+
z.number().optional(),
|
|
971
|
+
z.number().optional(),
|
|
972
|
+
]),
|
|
973
|
+
_a[exports.EFormulaFilterFieldKeys.string] = z.string(),
|
|
974
|
+
// todo: отказаться от использования z.string(), оставить только z.number() [BI-15912]
|
|
975
|
+
_a[exports.EFormulaFilterFieldKeys.lastTimeValue] = z.number().or(z.string()),
|
|
976
|
+
_a[exports.EFormulaFilterFieldKeys.lastTimeUnit] = z.enum(exports.ELastTimeUnit),
|
|
977
|
+
_a[exports.EFormulaFilterFieldKeys.durationUnit] = z.enum(exports.EDurationUnit),
|
|
978
|
+
_a))
|
|
979
|
+
.partial()
|
|
980
|
+
.optional(),
|
|
981
|
+
});
|
|
982
|
+
};
|
|
983
|
+
var ExtendedFormulaFilterValueSchema = function (z) {
|
|
984
|
+
return z.union([FormulaFilterValueSchema(z), z.object({ formula: z.string() })]);
|
|
985
|
+
};
|
|
986
|
+
var DimensionProcessFilterSchema = function (z) {
|
|
987
|
+
return z.object({
|
|
988
|
+
value: z.union([
|
|
989
|
+
WidgetIndicatorAggregationValueSchema(z).extend({
|
|
990
|
+
outerAggregation: z.enum(exports.EOuterAggregation),
|
|
991
|
+
}),
|
|
992
|
+
WidgetIndicatorAggregationValueSchema(z).extend({
|
|
993
|
+
innerTemplateName: z.string().optional(),
|
|
994
|
+
}),
|
|
995
|
+
WidgetIndicatorTimeValueSchema(z),
|
|
996
|
+
z.object({
|
|
997
|
+
mode: z.literal(exports.EWidgetIndicatorValueModes.FORMULA),
|
|
998
|
+
formula: z.string().optional(),
|
|
999
|
+
}),
|
|
1000
|
+
]),
|
|
1001
|
+
dbDataType: z.string(),
|
|
1002
|
+
condition: z.object({
|
|
1003
|
+
filteringMethod: z.enum(Object.values(formulaFilterMethods)),
|
|
1004
|
+
timeUnit: z.enum(exports.EDimensionProcessFilterTimeUnit).optional(),
|
|
1005
|
+
values: z.array(z.string().nullable()),
|
|
1006
|
+
}),
|
|
1007
|
+
});
|
|
1008
|
+
};
|
|
1009
|
+
var SettingsFilterSchema = function (z) {
|
|
1010
|
+
return z.union([ExtendedFormulaFilterValueSchema(z), DimensionProcessFilterSchema(z)]);
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1013
|
+
var ActionOnClickParameterCommonSchema = function (z) {
|
|
1014
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
1015
|
+
name: z.string(),
|
|
1016
|
+
});
|
|
1017
|
+
};
|
|
1018
|
+
var ParameterFromColumnSchema = function (z) {
|
|
1019
|
+
return z.object({
|
|
1020
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.COLUMN),
|
|
1021
|
+
tableName: z.string().nullable().default(null),
|
|
1022
|
+
columnName: z.string().nullable().default(null),
|
|
1023
|
+
dbDataType: z.string().optional(),
|
|
1024
|
+
});
|
|
1025
|
+
};
|
|
1026
|
+
var ParameterFromVariableSchema = function (z) {
|
|
1027
|
+
return z.object({
|
|
1028
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.VARIABLE),
|
|
1029
|
+
sourceVariable: z.string().nullable().default(null),
|
|
1030
|
+
});
|
|
1031
|
+
};
|
|
1032
|
+
var ParameterFromFormulaSchema = function (z) {
|
|
1033
|
+
return z.object({
|
|
1034
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.FORMULA),
|
|
1035
|
+
formula: FormulaSchema(z),
|
|
1036
|
+
considerFilters: z.boolean().default(false),
|
|
1037
|
+
dbDataType: z.string().optional(),
|
|
1038
|
+
});
|
|
1039
|
+
};
|
|
1040
|
+
var ParameterFromEventSchema = function (z) {
|
|
1041
|
+
return z.object({
|
|
1042
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.EVENT),
|
|
1043
|
+
});
|
|
1044
|
+
};
|
|
1045
|
+
var ParameterFromStartEventSchema = function (z) {
|
|
1046
|
+
return z.object({
|
|
1047
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.START_EVENT),
|
|
1048
|
+
});
|
|
1049
|
+
};
|
|
1050
|
+
var ParameterFromEndEventSchema = function (z) {
|
|
1051
|
+
return z.object({
|
|
1052
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.FINISH_EVENT),
|
|
1053
|
+
});
|
|
1054
|
+
};
|
|
1055
|
+
var ParameterFromAggregationSchema = function (z) {
|
|
1056
|
+
return z.object({
|
|
1057
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.AGGREGATION),
|
|
1058
|
+
formula: FormulaSchema(z),
|
|
1059
|
+
considerFilters: z.boolean().default(false),
|
|
1060
|
+
dbDataType: z.string().optional(),
|
|
1061
|
+
});
|
|
1062
|
+
};
|
|
1063
|
+
var ParameterFromManualInputSchema = function (z) {
|
|
1064
|
+
return z.object({
|
|
1065
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.MANUALLY),
|
|
1066
|
+
description: z.string().default(""),
|
|
1067
|
+
defaultValue: FormulaSchema(z),
|
|
1068
|
+
dbDataType: z.string().optional(),
|
|
1069
|
+
filterByRows: z.boolean().default(false),
|
|
1070
|
+
validation: FormulaSchema(z),
|
|
1071
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1072
|
+
});
|
|
1073
|
+
};
|
|
1074
|
+
var ParameterFromStaticListSchema = function (z) {
|
|
1075
|
+
return z.object({
|
|
1076
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.STATIC_LIST),
|
|
1077
|
+
options: z.string().default(""),
|
|
1078
|
+
defaultValue: z
|
|
1079
|
+
.union([z.string(), z.array(z.string())])
|
|
1080
|
+
.nullable()
|
|
1081
|
+
.default(null),
|
|
1082
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1083
|
+
});
|
|
1084
|
+
};
|
|
1085
|
+
var ParameterFromDynamicListSchema = function (z) {
|
|
1086
|
+
return z.object({
|
|
1087
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.DYNAMIC_LIST),
|
|
1088
|
+
options: FormulaSchema(z),
|
|
1089
|
+
defaultValue: FormulaSchema(z),
|
|
1090
|
+
dbDataType: z.string().optional(),
|
|
1091
|
+
displayOptions: FormulaSchema(z),
|
|
1092
|
+
filters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
1093
|
+
filterByRows: z.boolean().default(false),
|
|
1094
|
+
considerFilters: z.boolean().default(false),
|
|
1095
|
+
insertAnyValues: z.boolean().default(false),
|
|
1096
|
+
validation: FormulaSchema(z),
|
|
1097
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1098
|
+
});
|
|
1099
|
+
};
|
|
1100
|
+
var ParameterFromDataModelSchema = function (z) {
|
|
1101
|
+
return z.object({
|
|
1102
|
+
inputMethod: z.literal(exports.EWidgetActionInputMethod.DATA_MODEL),
|
|
1103
|
+
option: z.enum(exports.EDataModelOption).default(exports.EDataModelOption.TABLE_LIST),
|
|
1104
|
+
/**
|
|
1105
|
+
* Используется только при COLUMN_LIST. Не делаем union по option, чтобы сохранить
|
|
1106
|
+
* одновременно default для option и работоспособность внешнего discriminated union.
|
|
1107
|
+
*/
|
|
1108
|
+
parent: NameNullableSchema(z),
|
|
1109
|
+
});
|
|
1110
|
+
};
|
|
1111
|
+
var ActionOnClickParameterSchema = function (z) {
|
|
1112
|
+
return z.intersection(ActionOnClickParameterCommonSchema(z), z.discriminatedUnion("inputMethod", [
|
|
1113
|
+
ParameterFromColumnSchema(z),
|
|
1114
|
+
ParameterFromVariableSchema(z),
|
|
1115
|
+
ParameterFromFormulaSchema(z),
|
|
1116
|
+
ParameterFromEventSchema(z),
|
|
1117
|
+
ParameterFromStartEventSchema(z),
|
|
1118
|
+
ParameterFromEndEventSchema(z),
|
|
1119
|
+
ParameterFromAggregationSchema(z),
|
|
1120
|
+
ParameterFromManualInputSchema(z),
|
|
1121
|
+
ParameterFromStaticListSchema(z),
|
|
1122
|
+
ParameterFromDynamicListSchema(z),
|
|
1123
|
+
ParameterFromDataModelSchema(z),
|
|
1124
|
+
]));
|
|
1125
|
+
};
|
|
1126
|
+
var ActionCommonSchema = function (z) {
|
|
1127
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
1128
|
+
name: z.string(),
|
|
1129
|
+
});
|
|
1130
|
+
};
|
|
1131
|
+
var ActionDrillDownSchema = function (z) {
|
|
1132
|
+
return ActionCommonSchema(z).extend({ type: z.literal(exports.EActionTypes.DRILL_DOWN) });
|
|
1133
|
+
};
|
|
1134
|
+
var ActionGoToURLSchema = function (z) {
|
|
1135
|
+
return ActionCommonSchema(z).extend({
|
|
1136
|
+
type: z.literal(exports.EActionTypes.OPEN_URL),
|
|
1137
|
+
url: z.string(),
|
|
1138
|
+
newWindow: z.boolean().default(true),
|
|
1139
|
+
});
|
|
1140
|
+
};
|
|
1141
|
+
var ActivateConditionSchema = function (z) {
|
|
1142
|
+
return z
|
|
1143
|
+
.discriminatedUnion("mode", [
|
|
1144
|
+
z.object({
|
|
1145
|
+
mode: z.literal(exports.EActivateConditionMode.FORMULA),
|
|
1146
|
+
formula: FormulaSchema(z),
|
|
1147
|
+
}),
|
|
1148
|
+
z.object({
|
|
1149
|
+
mode: z.literal(exports.EActivateConditionMode.VARIABLE),
|
|
1150
|
+
variableName: z.string().nullable().default(null),
|
|
1151
|
+
variableValue: z.string().nullable().default(null),
|
|
1152
|
+
}),
|
|
1153
|
+
])
|
|
1154
|
+
.default({ mode: exports.EActivateConditionMode.FORMULA, formula: "" });
|
|
1155
|
+
};
|
|
1156
|
+
var ActionRunScriptSchema = function (z) {
|
|
1157
|
+
return ActionCommonSchema(z).extend({
|
|
1158
|
+
type: z.literal(exports.EActionTypes.EXECUTE_SCRIPT),
|
|
1159
|
+
parameters: z.array(ActionOnClickParameterSchema(z)).default([]),
|
|
1160
|
+
scriptKey: z.string(),
|
|
1161
|
+
autoUpdate: z.enum(exports.EAutoUpdateMode).default(exports.EAutoUpdateMode.THIS_WIDGET),
|
|
1162
|
+
hideInactiveButton: z.boolean().default(false),
|
|
1163
|
+
activateCondition: ActivateConditionSchema(z),
|
|
1164
|
+
hint: z.string().default(""),
|
|
1165
|
+
});
|
|
1166
|
+
};
|
|
1167
|
+
var ActionUpdateVariableSchema = function (z) {
|
|
1168
|
+
return ActionCommonSchema(z).extend({
|
|
1169
|
+
type: z.literal(exports.EActionTypes.UPDATE_VARIABLE),
|
|
1170
|
+
variables: z.array(ActionOnClickParameterSchema(z)).default([]),
|
|
1171
|
+
});
|
|
1172
|
+
};
|
|
1173
|
+
var ActionOpenInSchema = function (z) {
|
|
1174
|
+
return z.discriminatedUnion("openIn", [
|
|
1175
|
+
z.object({
|
|
1176
|
+
openIn: z.literal(exports.EViewOpenIn.DRAWER_WINDOW),
|
|
1177
|
+
alignment: z.enum(exports.EDrawerPlacement).default(exports.EDrawerPlacement.RIGHT),
|
|
1178
|
+
inheritFilter: z.boolean().default(true),
|
|
1179
|
+
}),
|
|
1180
|
+
z.object({
|
|
1181
|
+
openIn: z.literal(exports.EViewOpenIn.PLACEHOLDER),
|
|
1182
|
+
placeholderName: z.string(),
|
|
1183
|
+
}),
|
|
1184
|
+
z.object({
|
|
1185
|
+
openIn: z.literal(exports.EViewOpenIn.MODAL_WINDOW),
|
|
1186
|
+
positionByClick: z.boolean().default(false),
|
|
1187
|
+
inheritFilter: z.boolean().default(true),
|
|
1188
|
+
}),
|
|
1189
|
+
z.object({
|
|
1190
|
+
openIn: z.literal(exports.EViewOpenIn.WINDOW),
|
|
1191
|
+
newWindow: z.boolean().default(true),
|
|
1192
|
+
inheritFilter: z.boolean().default(true),
|
|
1193
|
+
}),
|
|
1194
|
+
]);
|
|
1195
|
+
};
|
|
1196
|
+
var ActionOpenViewCommonSchema = function (z) {
|
|
1197
|
+
return ActionCommonSchema(z).extend({ type: z.literal(exports.EActionTypes.OPEN_VIEW) });
|
|
1198
|
+
};
|
|
1199
|
+
var ActionOpenViewSchema = function (z) {
|
|
1200
|
+
return z.intersection(z.discriminatedUnion("mode", [
|
|
1201
|
+
ActionOpenViewCommonSchema(z).extend({
|
|
1202
|
+
mode: z.literal(exports.EViewMode.GENERATED_BY_SCRIPT),
|
|
1203
|
+
scriptKey: z.string(),
|
|
1204
|
+
parameters: z.array(ActionOnClickParameterSchema(z)).default([]),
|
|
1205
|
+
displayName: z.string().default(""),
|
|
1206
|
+
}),
|
|
1207
|
+
ActionOpenViewCommonSchema(z).extend({
|
|
1208
|
+
mode: z.literal(exports.EViewMode.EXISTED_VIEW),
|
|
1209
|
+
viewKey: z.string(),
|
|
1210
|
+
parameters: z.array(ActionOnClickParameterSchema(z)).default([]),
|
|
1211
|
+
}),
|
|
1212
|
+
ActionOpenViewCommonSchema(z).extend({
|
|
1213
|
+
mode: z.literal(exports.EViewMode.EMPTY),
|
|
1214
|
+
placeholderName: z.string(),
|
|
1215
|
+
openIn: z.literal(exports.EViewOpenIn.PLACEHOLDER),
|
|
1216
|
+
}),
|
|
1217
|
+
]), ActionOpenInSchema(z));
|
|
1218
|
+
};
|
|
1219
|
+
var ActionsOnClickSchema = function (z) {
|
|
1220
|
+
return z.union([
|
|
1221
|
+
ActionGoToURLSchema(z),
|
|
1222
|
+
ActionRunScriptSchema(z),
|
|
1223
|
+
ActionUpdateVariableSchema(z),
|
|
1224
|
+
ActionOpenViewSchema(z),
|
|
1225
|
+
ActionDrillDownSchema(z),
|
|
1226
|
+
]);
|
|
1227
|
+
};
|
|
1228
|
+
var WidgetActionParameterCommonSchema = function (z) {
|
|
1229
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
1230
|
+
name: z.string(),
|
|
1231
|
+
displayName: z.string().default(""),
|
|
1232
|
+
isHidden: z.boolean().default(false),
|
|
1233
|
+
});
|
|
1234
|
+
};
|
|
1235
|
+
var WidgetActionParameterSchema = function (z) {
|
|
1236
|
+
return z.intersection(WidgetActionParameterCommonSchema(z), z.discriminatedUnion("inputMethod", [
|
|
1237
|
+
ParameterFromColumnSchema(z),
|
|
1238
|
+
ParameterFromVariableSchema(z),
|
|
1239
|
+
ParameterFromFormulaSchema(z),
|
|
1240
|
+
ParameterFromManualInputSchema(z),
|
|
1241
|
+
ParameterFromStaticListSchema(z),
|
|
1242
|
+
ParameterFromDynamicListSchema(z),
|
|
1243
|
+
ParameterFromAggregationSchema(z),
|
|
1244
|
+
ParameterFromDataModelSchema(z),
|
|
1245
|
+
]));
|
|
1246
|
+
};
|
|
1247
|
+
var WidgetActionSchema = function (z) {
|
|
1248
|
+
return ActionCommonSchema(z).extend({
|
|
1249
|
+
parameters: z.array(WidgetActionParameterSchema(z)).default([]),
|
|
1250
|
+
type: z.literal(exports.EActionTypes.EXECUTE_SCRIPT),
|
|
1251
|
+
scriptKey: z.string(),
|
|
1252
|
+
autoUpdate: z.enum(exports.EAutoUpdateMode).default(exports.EAutoUpdateMode.THIS_WIDGET),
|
|
1253
|
+
description: z.string().default(""),
|
|
1254
|
+
hideInactiveButton: z.boolean().default(false),
|
|
1255
|
+
hint: z.string().default(""),
|
|
1256
|
+
activateCondition: ActivateConditionSchema(z),
|
|
1257
|
+
});
|
|
1258
|
+
};
|
|
1259
|
+
var ViewActionParameterSchema = function (z) {
|
|
1260
|
+
return z.intersection(AutoIdentifiedArrayItemSchema(z).extend({ name: z.string() }), z.discriminatedUnion("inputMethod", [
|
|
1261
|
+
ParameterFromAggregationSchema(z),
|
|
1262
|
+
ParameterFromVariableSchema(z),
|
|
1263
|
+
]));
|
|
1264
|
+
};
|
|
1265
|
+
var ViewActionSchema = function (z) {
|
|
1266
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
1267
|
+
name: z.string(),
|
|
1268
|
+
buttonType: z.enum(exports.EActionButtonsTypes).default(exports.EActionButtonsTypes.BASE),
|
|
1269
|
+
type: z.literal(exports.EActionTypes.EXECUTE_SCRIPT).default(exports.EActionTypes.EXECUTE_SCRIPT),
|
|
1270
|
+
parameters: z.array(ViewActionParameterSchema(z)).default([]),
|
|
1271
|
+
scriptKey: KeyNullableSchema(z),
|
|
1272
|
+
autoUpdate: z
|
|
1273
|
+
.union([z.literal(exports.EAutoUpdateMode.NONE), z.literal(exports.EAutoUpdateMode.ALL_VIEWS)])
|
|
1274
|
+
.default(exports.EAutoUpdateMode.NONE),
|
|
1275
|
+
});
|
|
1276
|
+
};
|
|
1277
|
+
var ActionSchema = function (z) {
|
|
1278
|
+
return z.union([ActionsOnClickSchema(z), WidgetActionSchema(z), ViewActionSchema(z)]);
|
|
1279
|
+
};
|
|
1280
|
+
var ActionButtonSchema = function (z) {
|
|
1281
|
+
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
1282
|
+
name: z.string(),
|
|
1283
|
+
onClick: z.array(WidgetActionSchema(z)).default([]),
|
|
1284
|
+
buttonType: z.enum(exports.EActionButtonsTypes).default(exports.EActionButtonsTypes.BASE),
|
|
1285
|
+
backgroundColor: ColorSchema(z),
|
|
1286
|
+
borderColor: ColorSchema(z),
|
|
1287
|
+
color: ColorSchema(z),
|
|
1288
|
+
hint: z.string().default(""),
|
|
1289
|
+
});
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1292
|
+
var prepareValuesForSql = function (simpleType, values) {
|
|
1293
|
+
return simpleType === exports.ESimpleDataType.INTEGER ||
|
|
1294
|
+
simpleType === exports.ESimpleDataType.FLOAT ||
|
|
1295
|
+
simpleType === exports.ESimpleDataType.BOOLEAN
|
|
1296
|
+
? values
|
|
1297
|
+
: values.map(function (value) {
|
|
1298
|
+
return value === null ? null : "'".concat(escapeSingularQuotes$1(escapeReverseSlash(value)), "'");
|
|
1299
|
+
});
|
|
1300
|
+
};
|
|
1301
|
+
var escapeReverseSlash = function (formula) {
|
|
1302
|
+
return formula.replaceAll(/\\/gm, "\\\\");
|
|
1303
|
+
};
|
|
1304
|
+
var escapeSingularQuotes$1 = function (formula) {
|
|
1305
|
+
return formula.replaceAll("'", "\\'");
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
exports.ECalculatorFilterMethods = void 0;
|
|
1309
|
+
(function (ECalculatorFilterMethods) {
|
|
1310
|
+
ECalculatorFilterMethods["EQUAL_TO"] = "EQUAL_TO";
|
|
1311
|
+
ECalculatorFilterMethods["NOT_EQUAL_TO"] = "NOT_EQUAL_TO";
|
|
1312
|
+
ECalculatorFilterMethods["GREATER_THAN"] = "GREATER_THAN";
|
|
1313
|
+
ECalculatorFilterMethods["LESS_THAN"] = "LESS_THAN";
|
|
1314
|
+
ECalculatorFilterMethods["GREATER_THAN_OR_EQUAL_TO"] = "GREATER_THAN_OR_EQUAL_TO";
|
|
1315
|
+
ECalculatorFilterMethods["LESS_THAN_OR_EQUAL_TO"] = "LESS_THAN_OR_EQUAL_TO";
|
|
1316
|
+
ECalculatorFilterMethods["STARTS_WITH"] = "STARTS_WITH";
|
|
1317
|
+
ECalculatorFilterMethods["ENDS_WITH"] = "ENDS_WITH";
|
|
1318
|
+
ECalculatorFilterMethods["CONTAINS"] = "CONTAINS";
|
|
1319
|
+
ECalculatorFilterMethods["NOT_CONTAINS"] = "NOT_CONTAINS";
|
|
1320
|
+
ECalculatorFilterMethods["IN_RANGE"] = "IN_RANGE";
|
|
1321
|
+
ECalculatorFilterMethods["NOT_IN_RANGE"] = "NOT_IN_RANGE";
|
|
1322
|
+
ECalculatorFilterMethods["INCLUDE"] = "INCLUDE";
|
|
1323
|
+
ECalculatorFilterMethods["EXCLUDE"] = "EXCLUDE";
|
|
1324
|
+
ECalculatorFilterMethods["NONEMPTY"] = "NONEMPTY";
|
|
1325
|
+
ECalculatorFilterMethods["EMPTY"] = "EMPTY";
|
|
1326
|
+
})(exports.ECalculatorFilterMethods || (exports.ECalculatorFilterMethods = {}));
|
|
1327
|
+
|
|
1328
|
+
var formulaFilterMethods = __assign(__assign({}, exports.ECalculatorFilterMethods), { LAST_TIME: "LAST_TIME" });
|
|
1329
|
+
exports.EProcessFilterNames = void 0;
|
|
1330
|
+
(function (EProcessFilterNames) {
|
|
1331
|
+
/** Наличие события */
|
|
1332
|
+
EProcessFilterNames["presenceOfEvent"] = "presenceOfEvent";
|
|
1333
|
+
/** Количество повторов события */
|
|
1334
|
+
EProcessFilterNames["repetitionOfEvent"] = "repetitionOfEvent";
|
|
1335
|
+
/** Наличие перехода */
|
|
1336
|
+
EProcessFilterNames["presenceOfTransition"] = "presenceOfTransition";
|
|
1337
|
+
/** Длительность перехода */
|
|
1338
|
+
EProcessFilterNames["durationOfTransition"] = "durationOfTransition";
|
|
1339
|
+
})(exports.EProcessFilterNames || (exports.EProcessFilterNames = {}));
|
|
1340
|
+
exports.EFormulaFilterFieldKeys = void 0;
|
|
1341
|
+
(function (EFormulaFilterFieldKeys) {
|
|
1342
|
+
EFormulaFilterFieldKeys["date"] = "date";
|
|
1343
|
+
EFormulaFilterFieldKeys["dateRange"] = "dateRange";
|
|
1344
|
+
EFormulaFilterFieldKeys["numberRange"] = "numberRange";
|
|
1345
|
+
EFormulaFilterFieldKeys["string"] = "string";
|
|
1346
|
+
EFormulaFilterFieldKeys["lastTimeValue"] = "lastTimeValue";
|
|
1347
|
+
EFormulaFilterFieldKeys["lastTimeUnit"] = "lastTimeUnit";
|
|
1348
|
+
EFormulaFilterFieldKeys["durationUnit"] = "durationUnit";
|
|
1349
|
+
})(exports.EFormulaFilterFieldKeys || (exports.EFormulaFilterFieldKeys = {}));
|
|
1350
|
+
exports.EDimensionProcessFilterTimeUnit = void 0;
|
|
1351
|
+
(function (EDimensionProcessFilterTimeUnit) {
|
|
1352
|
+
EDimensionProcessFilterTimeUnit["YEARS"] = "YEARS";
|
|
1353
|
+
EDimensionProcessFilterTimeUnit["MONTHS"] = "MONTHS";
|
|
1354
|
+
EDimensionProcessFilterTimeUnit["HOURS"] = "HOURS";
|
|
1355
|
+
EDimensionProcessFilterTimeUnit["DAYS"] = "DAYS";
|
|
1356
|
+
EDimensionProcessFilterTimeUnit["MINUTES"] = "MINUTES";
|
|
1357
|
+
})(exports.EDimensionProcessFilterTimeUnit || (exports.EDimensionProcessFilterTimeUnit = {}));
|
|
1358
|
+
var isFormulaFilterValue = function (value) {
|
|
1359
|
+
return "filteringMethod" in value;
|
|
1360
|
+
};
|
|
1361
|
+
var isDimensionProcessFilter = function (filter) { return "value" in filter && "condition" in filter; };
|
|
1362
|
+
|
|
1363
|
+
var compact = function (items) { return ((items === null || items === void 0 ? void 0 : items.filter(Boolean)) || []); };
|
|
1364
|
+
var compactMap = function (items, f) {
|
|
1365
|
+
return compact(items === null || items === void 0 ? void 0 : items.map(f));
|
|
1366
|
+
};
|
|
1367
|
+
var isNil = function (value) {
|
|
1368
|
+
return value === null || value === undefined;
|
|
1369
|
+
};
|
|
1370
|
+
function memoize(fn) {
|
|
1371
|
+
var cache = new Map();
|
|
1372
|
+
return function (arg) {
|
|
1373
|
+
if (cache.has(arg)) {
|
|
1374
|
+
return cache.get(arg);
|
|
1375
|
+
}
|
|
1376
|
+
var result = fn(arg);
|
|
1377
|
+
cache.set(arg, result);
|
|
1378
|
+
return result;
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
exports.EClickHouseBaseTypes = void 0;
|
|
1383
|
+
(function (EClickHouseBaseTypes) {
|
|
1384
|
+
// DATE
|
|
1385
|
+
EClickHouseBaseTypes["Date"] = "Date";
|
|
1386
|
+
EClickHouseBaseTypes["Date32"] = "Date32";
|
|
1387
|
+
// DATETIME
|
|
1388
|
+
EClickHouseBaseTypes["DateTime"] = "DateTime";
|
|
1389
|
+
EClickHouseBaseTypes["DateTime32"] = "DateTime32";
|
|
1390
|
+
// DATETIME64
|
|
1391
|
+
EClickHouseBaseTypes["DateTime64"] = "DateTime64";
|
|
1392
|
+
// STRING
|
|
1393
|
+
EClickHouseBaseTypes["FixedString"] = "FixedString";
|
|
1394
|
+
EClickHouseBaseTypes["String"] = "String";
|
|
1395
|
+
// FLOAT
|
|
1396
|
+
EClickHouseBaseTypes["Decimal"] = "Decimal";
|
|
1397
|
+
EClickHouseBaseTypes["Decimal32"] = "Decimal32";
|
|
1398
|
+
EClickHouseBaseTypes["Decimal64"] = "Decimal64";
|
|
1399
|
+
EClickHouseBaseTypes["Decimal128"] = "Decimal128";
|
|
1400
|
+
EClickHouseBaseTypes["Decimal256"] = "Decimal256";
|
|
1401
|
+
EClickHouseBaseTypes["Float32"] = "Float32";
|
|
1402
|
+
EClickHouseBaseTypes["Float64"] = "Float64";
|
|
1403
|
+
// INTEGER
|
|
1404
|
+
EClickHouseBaseTypes["Int8"] = "Int8";
|
|
1405
|
+
EClickHouseBaseTypes["Int16"] = "Int16";
|
|
1406
|
+
EClickHouseBaseTypes["Int32"] = "Int32";
|
|
1407
|
+
EClickHouseBaseTypes["Int64"] = "Int64";
|
|
1408
|
+
EClickHouseBaseTypes["Int128"] = "Int128";
|
|
1409
|
+
EClickHouseBaseTypes["Int256"] = "Int256";
|
|
1410
|
+
EClickHouseBaseTypes["UInt8"] = "UInt8";
|
|
1411
|
+
EClickHouseBaseTypes["UInt16"] = "UInt16";
|
|
1412
|
+
EClickHouseBaseTypes["UInt32"] = "UInt32";
|
|
1413
|
+
EClickHouseBaseTypes["UInt64"] = "UInt64";
|
|
1414
|
+
EClickHouseBaseTypes["UInt128"] = "UInt128";
|
|
1415
|
+
EClickHouseBaseTypes["UInt256"] = "UInt256";
|
|
1416
|
+
// BOOLEAN
|
|
1417
|
+
EClickHouseBaseTypes["Bool"] = "Bool";
|
|
1418
|
+
})(exports.EClickHouseBaseTypes || (exports.EClickHouseBaseTypes = {}));
|
|
1419
|
+
var stringTypes = ["String", "FixedString"];
|
|
1420
|
+
var parseClickHouseType = memoize(function (type) {
|
|
1421
|
+
if (isNil(type)) {
|
|
1422
|
+
return {
|
|
1423
|
+
simpleBaseType: exports.ESimpleDataType.OTHER,
|
|
1424
|
+
dbBaseDataType: undefined,
|
|
1425
|
+
containers: [],
|
|
1426
|
+
simpleType: exports.ESimpleDataType.OTHER,
|
|
1427
|
+
};
|
|
1428
|
+
}
|
|
1429
|
+
var _a = extractInnerType(type), containers = _a.containers, dbBaseDataType = _a.dbBaseDataType;
|
|
1430
|
+
if (!dbBaseDataType) {
|
|
1431
|
+
throw new Error("Invalid ClickHouse type: ".concat(type));
|
|
1432
|
+
}
|
|
1433
|
+
return {
|
|
1434
|
+
dbBaseDataType: dbBaseDataType,
|
|
1435
|
+
simpleBaseType: simplifyBaseType(dbBaseDataType),
|
|
1436
|
+
containers: containers,
|
|
1437
|
+
get simpleType() {
|
|
1438
|
+
return containers.includes("Array") ? exports.ESimpleDataType.OTHER : this.simpleBaseType;
|
|
1439
|
+
},
|
|
1440
|
+
};
|
|
1441
|
+
});
|
|
1442
|
+
/** 'A(B(C))' -> ['A', 'B', 'C'] */
|
|
1443
|
+
var splitByBrackets = function (input) { return input.split(/[\(\)]/).filter(Boolean); };
|
|
1444
|
+
/**
|
|
1445
|
+
* Отделить внутренний тип от оберток.
|
|
1446
|
+
* Не поддерживаются обертки Tuple и LowCardinality.
|
|
1447
|
+
*/
|
|
1448
|
+
var extractInnerType = function (type) {
|
|
1449
|
+
var tokens = splitByBrackets(type);
|
|
1450
|
+
// Удаление параметров типа.
|
|
1451
|
+
if (tokens.length > 0 && isTypeParameters(tokens.at(-1))) {
|
|
1452
|
+
tokens.pop();
|
|
1453
|
+
}
|
|
1454
|
+
var dbBaseDataType = tokens.pop();
|
|
1455
|
+
return { containers: tokens, dbBaseDataType: dbBaseDataType };
|
|
1456
|
+
};
|
|
1457
|
+
var simplifyBaseType = function (dbBaseType) {
|
|
1458
|
+
var isSourceTypeStartsWith = function (prefix) { return dbBaseType.startsWith(prefix); };
|
|
1459
|
+
if (isSourceTypeStartsWith("Int") || isSourceTypeStartsWith("UInt")) {
|
|
1460
|
+
return exports.ESimpleDataType.INTEGER;
|
|
1461
|
+
}
|
|
1462
|
+
if (isSourceTypeStartsWith("Decimal") || isSourceTypeStartsWith("Float")) {
|
|
1463
|
+
return exports.ESimpleDataType.FLOAT;
|
|
1464
|
+
}
|
|
1465
|
+
if (stringTypes.some(isSourceTypeStartsWith)) {
|
|
1466
|
+
return exports.ESimpleDataType.STRING;
|
|
1467
|
+
}
|
|
1468
|
+
if (isSourceTypeStartsWith("DateTime64")) {
|
|
1469
|
+
return exports.ESimpleDataType.DATETIME64;
|
|
1470
|
+
}
|
|
1471
|
+
if (isSourceTypeStartsWith("DateTime")) {
|
|
1472
|
+
return exports.ESimpleDataType.DATETIME;
|
|
1473
|
+
}
|
|
1474
|
+
if (isSourceTypeStartsWith("Date")) {
|
|
1475
|
+
return exports.ESimpleDataType.DATE;
|
|
1476
|
+
}
|
|
1477
|
+
if (isSourceTypeStartsWith("Bool")) {
|
|
1478
|
+
return exports.ESimpleDataType.BOOLEAN;
|
|
1479
|
+
}
|
|
1480
|
+
return exports.ESimpleDataType.OTHER;
|
|
1481
|
+
};
|
|
1482
|
+
/**
|
|
1483
|
+
* - `3` -> true
|
|
1484
|
+
* - `3, 'Europe/Moscow'` -> true
|
|
1485
|
+
* - `3, Europe/Moscow` -> false
|
|
1486
|
+
*
|
|
1487
|
+
* Пример типа с параметрами: `DateTime64(3, 'Europe/Moscow')`
|
|
1488
|
+
*/
|
|
1489
|
+
var isTypeParameters = function (stringifiedParameters) {
|
|
1490
|
+
return stringifiedParameters.split(", ").some(function (p) { return !Number.isNaN(Number(p)) || p.startsWith("'"); });
|
|
1491
|
+
};
|
|
1492
|
+
|
|
1493
|
+
var _a$5;
|
|
615
1494
|
exports.EDimensionTemplateNames = void 0;
|
|
616
1495
|
(function (EDimensionTemplateNames) {
|
|
617
1496
|
EDimensionTemplateNames["dateTime"] = "dateTime";
|
|
@@ -627,136 +1506,29 @@ exports.EDimensionTemplateNames = void 0;
|
|
|
627
1506
|
EDimensionTemplateNames["hour"] = "hour";
|
|
628
1507
|
})(exports.EDimensionTemplateNames || (exports.EDimensionTemplateNames = {}));
|
|
629
1508
|
/** Стандартные шаблоны разреза */
|
|
630
|
-
var dimensionTemplateFormulas = (_a$
|
|
631
|
-
_a$
|
|
632
|
-
_a$
|
|
633
|
-
_a$
|
|
634
|
-
_a$
|
|
635
|
-
_a$
|
|
636
|
-
_a$
|
|
637
|
-
_a$
|
|
638
|
-
_a$
|
|
639
|
-
_a$
|
|
640
|
-
_a$
|
|
641
|
-
_a$
|
|
642
|
-
_a$
|
|
643
|
-
|
|
644
|
-
exports.EWidgetIndicatorType = void 0;
|
|
645
|
-
(function (EWidgetIndicatorType) {
|
|
646
|
-
EWidgetIndicatorType["MEASURE"] = "MEASURE";
|
|
647
|
-
EWidgetIndicatorType["EVENT_INDICATOR"] = "EVENT_INDICATOR";
|
|
648
|
-
EWidgetIndicatorType["TRANSITION_INDICATOR"] = "TRANSITION_INDICATOR";
|
|
649
|
-
EWidgetIndicatorType["DIMENSION"] = "DIMENSION";
|
|
650
|
-
EWidgetIndicatorType["SORTING"] = "SORTING";
|
|
651
|
-
})(exports.EWidgetIndicatorType || (exports.EWidgetIndicatorType = {}));
|
|
652
|
-
exports.EOuterAggregation = void 0;
|
|
653
|
-
(function (EOuterAggregation) {
|
|
654
|
-
EOuterAggregation["avg"] = "avg";
|
|
655
|
-
EOuterAggregation["median"] = "median";
|
|
656
|
-
EOuterAggregation["count"] = "count";
|
|
657
|
-
EOuterAggregation["countDistinct"] = "countDistinct";
|
|
658
|
-
EOuterAggregation["min"] = "min";
|
|
659
|
-
EOuterAggregation["max"] = "max";
|
|
660
|
-
EOuterAggregation["sum"] = "sum";
|
|
661
|
-
EOuterAggregation["top"] = "top";
|
|
662
|
-
})(exports.EOuterAggregation || (exports.EOuterAggregation = {}));
|
|
663
|
-
/** Режимы значения показателя (на основе чего генерируется формула) */
|
|
664
|
-
exports.EWidgetIndicatorValueModes = void 0;
|
|
665
|
-
(function (EWidgetIndicatorValueModes) {
|
|
666
|
-
/** Готовая формула (как правило, введенная пользователем через редактор формул) */
|
|
667
|
-
EWidgetIndicatorValueModes["FORMULA"] = "FORMULA";
|
|
668
|
-
/** Шаблон формулы, предоставляемый системой */
|
|
669
|
-
EWidgetIndicatorValueModes["TEMPLATE"] = "TEMPLATE";
|
|
670
|
-
EWidgetIndicatorValueModes["AGGREGATION"] = "AGGREGATION";
|
|
671
|
-
EWidgetIndicatorValueModes["DURATION"] = "DURATION";
|
|
672
|
-
EWidgetIndicatorValueModes["CONVERSION"] = "CONVERSION";
|
|
673
|
-
EWidgetIndicatorValueModes["START_TIME"] = "START_TIME";
|
|
674
|
-
EWidgetIndicatorValueModes["END_TIME"] = "END_TIME";
|
|
675
|
-
})(exports.EWidgetIndicatorValueModes || (exports.EWidgetIndicatorValueModes = {}));
|
|
676
|
-
/** Режимы сортировки (на что ссылается сортировка) */
|
|
677
|
-
exports.ESortingValueModes = void 0;
|
|
678
|
-
(function (ESortingValueModes) {
|
|
679
|
-
/** Сортировка по формуле */
|
|
680
|
-
ESortingValueModes["FORMULA"] = "FORMULA";
|
|
681
|
-
/** Сортировка по показателю(разрезу или мере) виджета */
|
|
682
|
-
ESortingValueModes["IN_WIDGET"] = "IN_WIDGET";
|
|
683
|
-
})(exports.ESortingValueModes || (exports.ESortingValueModes = {}));
|
|
684
|
-
exports.EFormatOrFormattingMode = void 0;
|
|
685
|
-
(function (EFormatOrFormattingMode) {
|
|
686
|
-
EFormatOrFormattingMode["BASE"] = "BASE";
|
|
687
|
-
EFormatOrFormattingMode["TEMPLATE"] = "TEMPLATE";
|
|
688
|
-
})(exports.EFormatOrFormattingMode || (exports.EFormatOrFormattingMode = {}));
|
|
689
|
-
/** Тип показателя */
|
|
690
|
-
exports.EIndicatorType = void 0;
|
|
691
|
-
(function (EIndicatorType) {
|
|
692
|
-
/** Показатели процесса */
|
|
693
|
-
EIndicatorType["PROCESS_MEASURE"] = "PROCESS_MEASURE";
|
|
694
|
-
/** Вводимое значение */
|
|
695
|
-
EIndicatorType["STATIC"] = "STATIC";
|
|
696
|
-
/** Статический список */
|
|
697
|
-
EIndicatorType["STATIC_LIST"] = "STATIC_LIST";
|
|
698
|
-
/** Динамический список */
|
|
699
|
-
EIndicatorType["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
700
|
-
/** Список колонок */
|
|
701
|
-
EIndicatorType["COLUMN_LIST"] = "COLUMN_LIST";
|
|
702
|
-
/** Разрез */
|
|
703
|
-
EIndicatorType["DIMENSION"] = "DIMENSION";
|
|
704
|
-
/** Мера */
|
|
705
|
-
EIndicatorType["MEASURE"] = "MEASURE";
|
|
706
|
-
/** Иерархия */
|
|
707
|
-
EIndicatorType["DYNAMIC_DIMENSION"] = "DYNAMIC_DIMENSION";
|
|
708
|
-
/** Пользовательская сортировка */
|
|
709
|
-
EIndicatorType["USER_SORTING"] = "USER_SORTING";
|
|
710
|
-
})(exports.EIndicatorType || (exports.EIndicatorType = {}));
|
|
711
|
-
/** Обобщенные типы значений переменных */
|
|
712
|
-
exports.ESimpleInputType = void 0;
|
|
713
|
-
(function (ESimpleInputType) {
|
|
714
|
-
/** Число (точность Float64) */
|
|
715
|
-
ESimpleInputType["NUMBER"] = "FLOAT";
|
|
716
|
-
/** Целое число (точность Int64) */
|
|
717
|
-
ESimpleInputType["INTEGER_NUMBER"] = "INTEGER";
|
|
718
|
-
/** Текст */
|
|
719
|
-
ESimpleInputType["TEXT"] = "STRING";
|
|
720
|
-
/** Дата (точность Date) */
|
|
721
|
-
ESimpleInputType["DATE"] = "DATE";
|
|
722
|
-
/** Дата и время (точность DateTime64) */
|
|
723
|
-
ESimpleInputType["DATE_AND_TIME"] = "DATETIME";
|
|
724
|
-
/** Логический тип */
|
|
725
|
-
ESimpleInputType["BOOLEAN"] = "BOOLEAN";
|
|
726
|
-
})(exports.ESimpleInputType || (exports.ESimpleInputType = {}));
|
|
727
|
-
function isDimensionsHierarchy(indicator) {
|
|
728
|
-
return "hierarchyDimensions" in indicator;
|
|
729
|
-
}
|
|
730
|
-
exports.OuterAggregation = void 0;
|
|
731
|
-
(function (OuterAggregation) {
|
|
732
|
-
OuterAggregation["avg"] = "avgIf";
|
|
733
|
-
OuterAggregation["median"] = "medianIf";
|
|
734
|
-
OuterAggregation["count"] = "countIf";
|
|
735
|
-
OuterAggregation["countDistinct"] = "countIfDistinct";
|
|
736
|
-
OuterAggregation["min"] = "minIf";
|
|
737
|
-
OuterAggregation["max"] = "maxIf";
|
|
738
|
-
OuterAggregation["sum"] = "sumIf";
|
|
739
|
-
})(exports.OuterAggregation || (exports.OuterAggregation = {}));
|
|
740
|
-
exports.EDurationTemplateName = void 0;
|
|
741
|
-
(function (EDurationTemplateName) {
|
|
742
|
-
EDurationTemplateName["avg"] = "avg";
|
|
743
|
-
EDurationTemplateName["median"] = "median";
|
|
744
|
-
})(exports.EDurationTemplateName || (exports.EDurationTemplateName = {}));
|
|
745
|
-
exports.EEventAppearances = void 0;
|
|
746
|
-
(function (EEventAppearances) {
|
|
747
|
-
EEventAppearances["FIRST"] = "FIRST";
|
|
748
|
-
EEventAppearances["LAST"] = "LAST";
|
|
749
|
-
})(exports.EEventAppearances || (exports.EEventAppearances = {}));
|
|
1509
|
+
var dimensionTemplateFormulas = (_a$5 = {},
|
|
1510
|
+
_a$5[exports.EDimensionTemplateNames.dateTime] = "toDateTime({columnFormula})",
|
|
1511
|
+
_a$5[exports.EDimensionTemplateNames.date] = "toDate({columnFormula})",
|
|
1512
|
+
_a$5[exports.EDimensionTemplateNames.year] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toYear({columnFormula}))",
|
|
1513
|
+
_a$5[exports.EDimensionTemplateNames.yearAndQuarter] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toYear({columnFormula}) * 10 + toQuarter({columnFormula}))",
|
|
1514
|
+
_a$5[exports.EDimensionTemplateNames.quarter] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toQuarter({columnFormula}))",
|
|
1515
|
+
_a$5[exports.EDimensionTemplateNames.yearAndMonth] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toYYYYMM({columnFormula}))",
|
|
1516
|
+
_a$5[exports.EDimensionTemplateNames.month] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toMonth({columnFormula}))",
|
|
1517
|
+
_a$5[exports.EDimensionTemplateNames.dayOfMonth] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toDayOfMonth({columnFormula}))",
|
|
1518
|
+
_a$5[exports.EDimensionTemplateNames.week] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toWeek({columnFormula}))",
|
|
1519
|
+
_a$5[exports.EDimensionTemplateNames.dayOfWeek] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toDayOfWeek({columnFormula}))",
|
|
1520
|
+
_a$5[exports.EDimensionTemplateNames.hour] = "if(defaultValueOfArgumentType({columnFormula}) = {columnFormula}, 0, toHour({columnFormula}))",
|
|
1521
|
+
_a$5);
|
|
750
1522
|
|
|
751
1523
|
function createAggregationTemplate$1(functionName, options) {
|
|
752
|
-
return "process(".concat(functionName, "(").concat((options === null || options === void 0 ? void 0 : options.distinct) ? "distinct " : "", "{columnFormula}, {eventNameFormula} =
|
|
1524
|
+
return "process(".concat(functionName, "(").concat((options === null || options === void 0 ? void 0 : options.distinct) ? "distinct " : "", "{columnFormula}, {eventNameFormula} ={eventName}{filters}), {caseCaseIdFormula})");
|
|
753
1525
|
}
|
|
754
1526
|
|
|
755
|
-
var countReworksTemplate = "process(if(countIf({eventNameFormula} =
|
|
756
|
-
var countExecutionsTemplate = "process(countIf({eventNameFormula} in
|
|
757
|
-
var lastValueTemplate = "process(argMaxIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} =
|
|
758
|
-
var firstValueTemplate = "process(argMinIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} =
|
|
759
|
-
var topTemplate = "process(topKIf(1)({columnFormula}, {eventNameFormula} =
|
|
1527
|
+
var countReworksTemplate = "process(if(countIf({eventNameFormula} = {eventName}{filters}) > 0, countIf({eventNameFormula} = {eventName}{filters}) - 1, 0), {caseCaseIdFormula})";
|
|
1528
|
+
var countExecutionsTemplate = "process(countIf({eventNameFormula} in {eventName}{filters}), {caseCaseIdFormula})";
|
|
1529
|
+
var lastValueTemplate = "process(argMaxIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} = {eventName}{filters}), {caseCaseIdFormula})";
|
|
1530
|
+
var firstValueTemplate = "process(argMinIf({columnFormula}, {eventTimeFormula}, {eventNameFormula} = {eventName}{filters}), {caseCaseIdFormula})";
|
|
1531
|
+
var topTemplate = "process(topKIf(1)({columnFormula}, {eventNameFormula} = {eventName}{filters})[1], {caseCaseIdFormula})";
|
|
760
1532
|
var avgTemplate = createAggregationTemplate$1("avgIf");
|
|
761
1533
|
var medianTemplate = createAggregationTemplate$1("medianIf");
|
|
762
1534
|
var countTemplate = createAggregationTemplate$1("countIf");
|
|
@@ -765,8 +1537,51 @@ var minTemplate = createAggregationTemplate$1("minIf");
|
|
|
765
1537
|
var maxTemplate = createAggregationTemplate$1("maxIf");
|
|
766
1538
|
var sumTemplate = createAggregationTemplate$1("sumIf");
|
|
767
1539
|
|
|
768
|
-
function
|
|
769
|
-
return
|
|
1540
|
+
function hasPossibleSingleLineComment(str) {
|
|
1541
|
+
return str.indexOf("--") >= 0;
|
|
1542
|
+
}
|
|
1543
|
+
function sanitizeSingleLineComment(formula, wrapInBrackets) {
|
|
1544
|
+
if (!hasPossibleSingleLineComment(formula)) {
|
|
1545
|
+
return formula;
|
|
1546
|
+
}
|
|
1547
|
+
var lines = formula.split("\n");
|
|
1548
|
+
var lastLine = lines[lines.length - 1];
|
|
1549
|
+
// Кейс, когда хотим избежать повторного добавления переноса строки:
|
|
1550
|
+
// уже есть переносы и после последнего переноса нет комментария
|
|
1551
|
+
if (lines.length > 1 && lastLine && !hasPossibleSingleLineComment(lastLine)) {
|
|
1552
|
+
return formula;
|
|
1553
|
+
}
|
|
1554
|
+
return wrapInBrackets ? "(".concat(formula, "\n)") : "".concat(formula, "\n");
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
/** Функция для безопасного заполнения SQL шаблонов с защитой от однострочных SQL комментариев в подставляемых значениях. */
|
|
1558
|
+
function fillTemplateSql(templateString, params) {
|
|
1559
|
+
var e_1, _a;
|
|
1560
|
+
var newParams = {};
|
|
1561
|
+
if (templateString.indexOf("'{") >= 0) {
|
|
1562
|
+
throw new Error("\u041D\u0435\u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 \u0448\u0430\u0431\u043B\u043E\u043D: \u043F\u043B\u0435\u0439\u0441\u0445\u043E\u043B\u0434\u0435\u0440\u044B \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u044B \u0437\u0430\u043A\u043B\u044E\u0447\u0430\u0442\u044C\u0441\u044F \u0432 \u043E\u0434\u0438\u043D\u0430\u0440\u043D\u044B\u0435 \u043A\u0430\u0432\u044B\u0447\u043A\u0438.\n \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 {placeholder} \u0432\u043C\u0435\u0441\u0442\u043E '{placeholder}'.\n \u041A\u0430\u0432\u044B\u0447\u043A\u0438 \u0434\u043E\u043B\u0436\u043D\u044B \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u0442\u044C\u0441\u044F \u0434\u043B\u044F \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0445 \u043F\u043E\u043B\u0435\u0439 \u043F\u0440\u0438 \u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0438 \u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.");
|
|
1563
|
+
}
|
|
1564
|
+
try {
|
|
1565
|
+
for (var _b = __values(Object.entries(params)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1566
|
+
var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
|
|
1567
|
+
if (String(value).indexOf("--") >= 0) {
|
|
1568
|
+
newParams[key] = "".concat(value, "\n");
|
|
1569
|
+
continue;
|
|
1570
|
+
}
|
|
1571
|
+
newParams[key] = sanitizeSingleLineComment(String(value));
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1575
|
+
finally {
|
|
1576
|
+
try {
|
|
1577
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1578
|
+
}
|
|
1579
|
+
finally { if (e_1) throw e_1.error; }
|
|
1580
|
+
}
|
|
1581
|
+
return templateString.replace(/\{(.*?)\}/g, function (_, key) {
|
|
1582
|
+
var _a;
|
|
1583
|
+
return (_a = newParams[key]) !== null && _a !== void 0 ? _a : "";
|
|
1584
|
+
});
|
|
770
1585
|
}
|
|
771
1586
|
|
|
772
1587
|
/** Создать функцию экранирования переданных `specialChars` внутри `str` */
|
|
@@ -840,7 +1655,7 @@ var escapeSingularQuotes = function (formula) {
|
|
|
840
1655
|
};
|
|
841
1656
|
|
|
842
1657
|
var prepareFormulaForSql = function (formula, simpleType) {
|
|
843
|
-
formula =
|
|
1658
|
+
formula = sanitizeSingleLineComment(formula, true);
|
|
844
1659
|
return simpleType === exports.ESimpleDataType.OTHER ? "toString(".concat(formula, ")") : formula;
|
|
845
1660
|
};
|
|
846
1661
|
var clearSingleLineComments = function (formula) {
|
|
@@ -922,7 +1737,7 @@ var convertFiltersToFormula = function (filters) {
|
|
|
922
1737
|
return filters.length > 0 ? " AND ".concat(convertToFormulasChain(filters)) : "";
|
|
923
1738
|
};
|
|
924
1739
|
|
|
925
|
-
var _a$
|
|
1740
|
+
var _a$4;
|
|
926
1741
|
exports.EDimensionAggregationTemplateName = void 0;
|
|
927
1742
|
(function (EDimensionAggregationTemplateName) {
|
|
928
1743
|
EDimensionAggregationTemplateName["avg"] = "avg";
|
|
@@ -939,20 +1754,20 @@ exports.EDimensionAggregationTemplateName = void 0;
|
|
|
939
1754
|
EDimensionAggregationTemplateName["countReworks"] = "countReworks";
|
|
940
1755
|
})(exports.EDimensionAggregationTemplateName || (exports.EDimensionAggregationTemplateName = {}));
|
|
941
1756
|
/** Шаблоны процессных метрик разреза с режимом AGGREGATION */
|
|
942
|
-
var dimensionAggregationTemplates = (_a$
|
|
943
|
-
_a$
|
|
944
|
-
_a$
|
|
945
|
-
_a$
|
|
946
|
-
_a$
|
|
947
|
-
_a$
|
|
948
|
-
_a$
|
|
949
|
-
_a$
|
|
950
|
-
_a$
|
|
951
|
-
_a$
|
|
952
|
-
_a$
|
|
953
|
-
_a$
|
|
954
|
-
_a$
|
|
955
|
-
_a$
|
|
1757
|
+
var dimensionAggregationTemplates = (_a$4 = {},
|
|
1758
|
+
_a$4[exports.EDimensionAggregationTemplateName.avg] = avgTemplate,
|
|
1759
|
+
_a$4[exports.EDimensionAggregationTemplateName.median] = medianTemplate,
|
|
1760
|
+
_a$4[exports.EDimensionAggregationTemplateName.count] = countTemplate,
|
|
1761
|
+
_a$4[exports.EDimensionAggregationTemplateName.countDistinct] = countDistinctTemplate,
|
|
1762
|
+
_a$4[exports.EDimensionAggregationTemplateName.min] = minTemplate,
|
|
1763
|
+
_a$4[exports.EDimensionAggregationTemplateName.max] = maxTemplate,
|
|
1764
|
+
_a$4[exports.EDimensionAggregationTemplateName.sum] = sumTemplate,
|
|
1765
|
+
_a$4[exports.EDimensionAggregationTemplateName.top] = topTemplate,
|
|
1766
|
+
_a$4[exports.EDimensionAggregationTemplateName.firstValue] = firstValueTemplate,
|
|
1767
|
+
_a$4[exports.EDimensionAggregationTemplateName.lastValue] = lastValueTemplate,
|
|
1768
|
+
_a$4[exports.EDimensionAggregationTemplateName.countExecutions] = countExecutionsTemplate,
|
|
1769
|
+
_a$4[exports.EDimensionAggregationTemplateName.countReworks] = countReworksTemplate,
|
|
1770
|
+
_a$4);
|
|
956
1771
|
/** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
|
|
957
1772
|
var prepareDimensionAggregationParams = function (value) {
|
|
958
1773
|
if (!value.eventName ||
|
|
@@ -965,8 +1780,7 @@ var prepareDimensionAggregationParams = function (value) {
|
|
|
965
1780
|
var commonParams = {
|
|
966
1781
|
eventNameFormula: value.eventNameFormula,
|
|
967
1782
|
caseCaseIdFormula: value.caseCaseIdFormula,
|
|
968
|
-
eventName: value.eventName,
|
|
969
|
-
objectFilters: "1",
|
|
1783
|
+
eventName: "'".concat(escapeSingularQuotes(value.eventName), "'"),
|
|
970
1784
|
filters: convertFiltersToFormula(value.filters),
|
|
971
1785
|
eventTimeFormula: "",
|
|
972
1786
|
columnFormula: "",
|
|
@@ -995,13 +1809,13 @@ var timeTemplates = (function () {
|
|
|
995
1809
|
var generateTemplates = function (innerTemplate) {
|
|
996
1810
|
var templates = {};
|
|
997
1811
|
for (var key in dimensionTemplateFormulas) {
|
|
998
|
-
templates[key] =
|
|
1812
|
+
templates[key] = fillTemplateSql(dimensionTemplateFormulas[key], { columnFormula: innerTemplate });
|
|
999
1813
|
}
|
|
1000
1814
|
return templates;
|
|
1001
1815
|
};
|
|
1002
1816
|
return _a = {},
|
|
1003
|
-
_a[exports.EWidgetIndicatorValueModes.START_TIME] = generateTemplates("process(minIf({eventTimeFormula}, {eventNameFormula} =
|
|
1004
|
-
_a[exports.EWidgetIndicatorValueModes.END_TIME] = generateTemplates("process(maxIf({eventTimeFormula}, {eventNameFormula} =
|
|
1817
|
+
_a[exports.EWidgetIndicatorValueModes.START_TIME] = generateTemplates("process(minIf({eventTimeFormula}, {eventNameFormula} = {eventName}{filters}), {caseCaseIdFormula})"),
|
|
1818
|
+
_a[exports.EWidgetIndicatorValueModes.END_TIME] = generateTemplates("process(maxIf({eventTimeFormula}, {eventNameFormula} = {eventName}{filters}), {caseCaseIdFormula})"),
|
|
1005
1819
|
_a;
|
|
1006
1820
|
})();
|
|
1007
1821
|
/** На основе значения режимов START_TIME/END_TIME подготовить параметры для подстановки в шаблонную формулу */
|
|
@@ -1019,12 +1833,12 @@ var prepareTimeParams = function (value) {
|
|
|
1019
1833
|
eventNameFormula: value.eventNameFormula,
|
|
1020
1834
|
caseCaseIdFormula: value.caseCaseIdFormula,
|
|
1021
1835
|
filters: convertFiltersToFormula(value.filters),
|
|
1022
|
-
eventName: value.eventName,
|
|
1836
|
+
eventName: "'".concat(escapeSingularQuotes(value.eventName), "'"),
|
|
1023
1837
|
};
|
|
1024
1838
|
};
|
|
1025
1839
|
|
|
1026
1840
|
function getDimensionFormula(_a) {
|
|
1027
|
-
var _b;
|
|
1841
|
+
var _b, _c;
|
|
1028
1842
|
var value = _a.value;
|
|
1029
1843
|
if (!value) {
|
|
1030
1844
|
return "";
|
|
@@ -1038,10 +1852,13 @@ function getDimensionFormula(_a) {
|
|
|
1038
1852
|
if (!templateFormula || !tableName || !columnName) {
|
|
1039
1853
|
return "";
|
|
1040
1854
|
}
|
|
1041
|
-
return
|
|
1855
|
+
return fillTemplateSql(templateFormula, {
|
|
1042
1856
|
columnFormula: generateColumnFormula(tableName, columnName),
|
|
1043
1857
|
});
|
|
1044
1858
|
}
|
|
1859
|
+
return (_c = getProcessDimensionValueFormula(value)) !== null && _c !== void 0 ? _c : "";
|
|
1860
|
+
}
|
|
1861
|
+
function getProcessDimensionValueFormula(value) {
|
|
1045
1862
|
if (value.mode === exports.EWidgetIndicatorValueModes.AGGREGATION) {
|
|
1046
1863
|
var preparedParams = prepareDimensionAggregationParams(value);
|
|
1047
1864
|
if (!preparedParams) {
|
|
@@ -1051,10 +1868,10 @@ function getDimensionFormula(_a) {
|
|
|
1051
1868
|
? dimensionTemplateFormulas[value.innerTemplateName]
|
|
1052
1869
|
: null;
|
|
1053
1870
|
var columnFormula = innerTemplate
|
|
1054
|
-
?
|
|
1871
|
+
? fillTemplateSql(innerTemplate, { columnFormula: preparedParams.columnFormula })
|
|
1055
1872
|
: preparedParams.columnFormula;
|
|
1056
1873
|
var dimensionAggregationTemplate = dimensionAggregationTemplates[value.templateName];
|
|
1057
|
-
return
|
|
1874
|
+
return fillTemplateSql(dimensionAggregationTemplate, __assign(__assign({}, preparedParams), { columnFormula: columnFormula }));
|
|
1058
1875
|
}
|
|
1059
1876
|
if (value.mode === exports.EWidgetIndicatorValueModes.START_TIME ||
|
|
1060
1877
|
value.mode === exports.EWidgetIndicatorValueModes.END_TIME) {
|
|
@@ -1063,9 +1880,8 @@ function getDimensionFormula(_a) {
|
|
|
1063
1880
|
return "";
|
|
1064
1881
|
}
|
|
1065
1882
|
var templateFormula = timeTemplates[value.mode][value.templateName];
|
|
1066
|
-
return
|
|
1883
|
+
return fillTemplateSql(templateFormula, preparedParams);
|
|
1067
1884
|
}
|
|
1068
|
-
return "";
|
|
1069
1885
|
}
|
|
1070
1886
|
|
|
1071
1887
|
exports.EMeasureAggregationTemplateName = void 0;
|
|
@@ -1097,8 +1913,7 @@ var prepareMeasureAggregationParams = function (value) {
|
|
|
1097
1913
|
outerAggregation: value.outerAggregation,
|
|
1098
1914
|
eventNameFormula: value.eventNameFormula,
|
|
1099
1915
|
caseCaseIdFormula: value.caseCaseIdFormula,
|
|
1100
|
-
eventName: value.eventName,
|
|
1101
|
-
objectFilters: "1",
|
|
1916
|
+
eventName: value.eventName ? "'".concat(escapeSingularQuotes(value.eventName), "'") : "",
|
|
1102
1917
|
filters: convertFiltersToFormula(value.filters),
|
|
1103
1918
|
eventTimeFormula: "",
|
|
1104
1919
|
columnFormula: "",
|
|
@@ -1119,7 +1934,7 @@ var prepareMeasureAggregationParams = function (value) {
|
|
|
1119
1934
|
return columnParams;
|
|
1120
1935
|
};
|
|
1121
1936
|
|
|
1122
|
-
var _a$
|
|
1937
|
+
var _a$3, _b;
|
|
1123
1938
|
exports.EMeasureTemplateNames = void 0;
|
|
1124
1939
|
(function (EMeasureTemplateNames) {
|
|
1125
1940
|
EMeasureTemplateNames["avg"] = "avg";
|
|
@@ -1130,19 +1945,28 @@ exports.EMeasureTemplateNames = void 0;
|
|
|
1130
1945
|
EMeasureTemplateNames["max"] = "max";
|
|
1131
1946
|
EMeasureTemplateNames["sum"] = "sum";
|
|
1132
1947
|
})(exports.EMeasureTemplateNames || (exports.EMeasureTemplateNames = {}));
|
|
1948
|
+
exports.EMeasureInnerTemplateNames = void 0;
|
|
1949
|
+
(function (EMeasureInnerTemplateNames) {
|
|
1950
|
+
EMeasureInnerTemplateNames["begin"] = "begin";
|
|
1951
|
+
EMeasureInnerTemplateNames["end"] = "end";
|
|
1952
|
+
})(exports.EMeasureInnerTemplateNames || (exports.EMeasureInnerTemplateNames = {}));
|
|
1133
1953
|
/** Стандартные шаблоны меры */
|
|
1134
|
-
var measureTemplateFormulas = (_a$
|
|
1135
|
-
_a$
|
|
1136
|
-
_a$
|
|
1137
|
-
_a$
|
|
1138
|
-
_a$
|
|
1139
|
-
_a$
|
|
1140
|
-
_a$
|
|
1141
|
-
_a$
|
|
1142
|
-
_a$
|
|
1954
|
+
var measureTemplateFormulas = (_a$3 = {},
|
|
1955
|
+
_a$3[exports.EMeasureTemplateNames.avg] = "avg({columnFormula})",
|
|
1956
|
+
_a$3[exports.EMeasureTemplateNames.count] = "count({columnFormula})",
|
|
1957
|
+
_a$3[exports.EMeasureTemplateNames.countDistinct] = "count(distinct {columnFormula})",
|
|
1958
|
+
_a$3[exports.EMeasureTemplateNames.median] = "medianExact({columnFormula})",
|
|
1959
|
+
_a$3[exports.EMeasureTemplateNames.min] = "min({columnFormula})",
|
|
1960
|
+
_a$3[exports.EMeasureTemplateNames.max] = "max({columnFormula})",
|
|
1961
|
+
_a$3[exports.EMeasureTemplateNames.sum] = "sum({columnFormula})",
|
|
1962
|
+
_a$3);
|
|
1963
|
+
var measureInnerTemplateFormulas = (_b = {},
|
|
1964
|
+
_b[exports.EMeasureInnerTemplateNames.begin] = "begin({columnFormula})",
|
|
1965
|
+
_b[exports.EMeasureInnerTemplateNames.end] = "end({columnFormula})",
|
|
1966
|
+
_b);
|
|
1143
1967
|
|
|
1144
1968
|
/** Шаблон процессной метрики меры с режимом CONVERSION */
|
|
1145
|
-
var conversionTemplate = "countIf(\n process(\n minIf(\n {startEventTimeFormula}, \n {startEventNameFormula} =
|
|
1969
|
+
var conversionTemplate = "countIf(\n process(\n minIf(\n {startEventTimeFormula}, \n {startEventNameFormula} = {startEventName}{startEventFilters}\n ), \n {endCaseCaseIdFormula}\n ) < \n process(\n maxIf(\n {endEventTimeFormula}, \n {endEventNameFormula} = {endEventName}{endEventFilters}\n ), \n {endCaseCaseIdFormula}\n ) \n and \n process(\n countIf(\n {startEventNameFormula} = {startEventName}{startEventFilters}\n ) != 0, \n {endCaseCaseIdFormula}\n ) != 0\n) / countIf(\n process(\n countIf(\n {startEventNameFormula} = {startEventName}{startEventFilters}\n ) != 0, \n {endCaseCaseIdFormula}\n ) != 0\n)";
|
|
1146
1970
|
/** На основе значения режима CONVERSION подготовить параметры для подстановки в шаблонную формулу */
|
|
1147
1971
|
var prepareConversionParams = function (value) {
|
|
1148
1972
|
if (!value.startEventName ||
|
|
@@ -1157,15 +1981,14 @@ var prepareConversionParams = function (value) {
|
|
|
1157
1981
|
return null;
|
|
1158
1982
|
}
|
|
1159
1983
|
return {
|
|
1160
|
-
objectFilters: "1",
|
|
1161
1984
|
startEventTimeFormula: value.startEventTimeFormula,
|
|
1162
1985
|
startEventNameFormula: value.startEventNameFormula,
|
|
1163
1986
|
startEventFilters: convertFiltersToFormula(value.startEventFilters),
|
|
1164
|
-
startEventName: value.startEventName,
|
|
1987
|
+
startEventName: "'".concat(escapeSingularQuotes(value.startEventName), "'"),
|
|
1165
1988
|
endEventTimeFormula: value.endEventTimeFormula,
|
|
1166
1989
|
endCaseCaseIdFormula: value.endCaseCaseIdFormula,
|
|
1167
1990
|
endEventNameFormula: value.endEventNameFormula,
|
|
1168
|
-
endEventName: value.endEventName,
|
|
1991
|
+
endEventName: "'".concat(escapeSingularQuotes(value.endEventName), "'"),
|
|
1169
1992
|
endEventFilters: convertFiltersToFormula(value.endEventFilters),
|
|
1170
1993
|
};
|
|
1171
1994
|
};
|
|
@@ -1173,7 +1996,7 @@ var prepareConversionParams = function (value) {
|
|
|
1173
1996
|
/** Шаблоны процессных метрик меры с режимом DURATION */
|
|
1174
1997
|
var durationTemplates = (function () {
|
|
1175
1998
|
var _a;
|
|
1176
|
-
var innerTemplate = "\n timeDiff(\n process(\n {startEventAggregationName}(\n {startEventTimeFormula}, \n {startEventNameFormula} =
|
|
1999
|
+
var innerTemplate = "\n timeDiff(\n process(\n {startEventAggregationName}(\n {startEventTimeFormula}, \n {startEventNameFormula} = {startEventName}{startEventFilters}\n ), \n {endCaseCaseIdFormula}\n ), \n process(\n {endEventAggregationName}(\n {endEventTimeFormula}, \n {endEventNameFormula} = {endEventName}{endEventFilters}\n ), \n {endCaseCaseIdFormula}\n )\n ), \n process(\n {startEventAggregationName}(\n {startEventTimeFormula}, \n {startEventNameFormula} = {startEventName}{startEventFilters}\n ), \n {endCaseCaseIdFormula}\n ) < \n process(\n {endEventAggregationName}(\n {endEventTimeFormula}, \n {endEventNameFormula} = {endEventName}{endEventFilters}\n ), \n {endCaseCaseIdFormula}\n ) \n and \n process(\n countIf(\n {startEventNameFormula} = {startEventName}{startEventFilters}\n ) != 0, \n {endCaseCaseIdFormula}\n ) != 0\n ";
|
|
1177
2000
|
return _a = {},
|
|
1178
2001
|
_a[exports.EDurationTemplateName.avg] = "avgIf(".concat(innerTemplate, ")"),
|
|
1179
2002
|
_a[exports.EDurationTemplateName.median] = "medianIf(".concat(innerTemplate, ")"),
|
|
@@ -1196,32 +2019,31 @@ var prepareDurationParams = function (value) {
|
|
|
1196
2019
|
return appearance === exports.EEventAppearances.FIRST ? "minIf" : "maxIf";
|
|
1197
2020
|
};
|
|
1198
2021
|
return {
|
|
1199
|
-
objectFilters: "1",
|
|
1200
2022
|
startEventTimeFormula: value.startEventTimeFormula,
|
|
1201
2023
|
startEventNameFormula: value.startEventNameFormula,
|
|
1202
2024
|
startEventFilters: convertFiltersToFormula(value.startEventFilters),
|
|
1203
|
-
startEventName: value.startEventName,
|
|
2025
|
+
startEventName: "'".concat(escapeSingularQuotes(value.startEventName), "'"),
|
|
1204
2026
|
startEventAggregationName: getAggregationNameByAppearances(value.startEventAppearances),
|
|
1205
2027
|
endEventTimeFormula: value.endEventTimeFormula,
|
|
1206
2028
|
endCaseCaseIdFormula: value.endCaseCaseIdFormula,
|
|
1207
2029
|
endEventNameFormula: value.endEventNameFormula,
|
|
1208
|
-
endEventName: value.endEventName,
|
|
2030
|
+
endEventName: "'".concat(escapeSingularQuotes(value.endEventName), "'"),
|
|
1209
2031
|
endEventFilters: convertFiltersToFormula(value.endEventFilters),
|
|
1210
2032
|
endEventAggregationName: getAggregationNameByAppearances(value.endEventAppearances),
|
|
1211
2033
|
};
|
|
1212
2034
|
};
|
|
1213
2035
|
|
|
1214
2036
|
function createAnyEventTemplate(aggregatePart) {
|
|
1215
|
-
return "{outerAggregation}
|
|
2037
|
+
return "{outerAggregation}(process(".concat(aggregatePart, ", {caseCaseIdFormula}))");
|
|
1216
2038
|
}
|
|
1217
2039
|
function createSpecificEventTemplate(fn, additionalFn) {
|
|
1218
|
-
return "{outerAggregation}
|
|
2040
|
+
return "{outerAggregation}(process(".concat(fn, "(").concat(additionalFn ? "".concat(additionalFn, " ") : "", "{columnFormula}, {eventNameFormula} = {eventName}{filters}), {caseCaseIdFormula}))");
|
|
1219
2041
|
}
|
|
1220
2042
|
function createTopLikeTemplate(template) {
|
|
1221
2043
|
return function (outerAggregation) {
|
|
1222
2044
|
return outerAggregation === exports.EOuterAggregation.top
|
|
1223
|
-
? "{outerAggregation}
|
|
1224
|
-
: "{outerAggregation}
|
|
2045
|
+
? "{outerAggregation}K(1)(".concat(template, ")[1]")
|
|
2046
|
+
: "{outerAggregation}(".concat(template, ")");
|
|
1225
2047
|
};
|
|
1226
2048
|
}
|
|
1227
2049
|
function createAggregationTemplate(templateName, _a) {
|
|
@@ -1268,9 +2090,9 @@ function createAggregationTemplate(templateName, _a) {
|
|
|
1268
2090
|
? createAnyEventTemplate("argMax({columnFormula}, {eventTimeFormula})")
|
|
1269
2091
|
: createTopLikeTemplate(lastValueTemplate)(outerAggregation);
|
|
1270
2092
|
case exports.EMeasureAggregationTemplateName.countExecutions:
|
|
1271
|
-
return "{outerAggregation}
|
|
2093
|
+
return "{outerAggregation}(".concat(countExecutionsTemplate, ")");
|
|
1272
2094
|
case exports.EMeasureAggregationTemplateName.countReworks:
|
|
1273
|
-
return "{outerAggregation}
|
|
2095
|
+
return "{outerAggregation}(".concat(countReworksTemplate, ")");
|
|
1274
2096
|
}
|
|
1275
2097
|
}
|
|
1276
2098
|
|
|
@@ -1284,19 +2106,24 @@ function getMeasureFormula(_a) {
|
|
|
1284
2106
|
return (_b = value.formula) !== null && _b !== void 0 ? _b : "";
|
|
1285
2107
|
}
|
|
1286
2108
|
if (value.mode === exports.EWidgetIndicatorValueModes.TEMPLATE) {
|
|
1287
|
-
var templateName = value.templateName, tableName = value.tableName, columnName = value.columnName;
|
|
2109
|
+
var templateName = value.templateName, tableName = value.tableName, columnName = value.columnName, innerTemplateName = value.innerTemplateName;
|
|
1288
2110
|
var templateFormula = measureTemplateFormulas[templateName];
|
|
1289
2111
|
if (!templateFormula || !tableName || !columnName) {
|
|
1290
2112
|
return "";
|
|
1291
2113
|
}
|
|
1292
|
-
|
|
1293
|
-
|
|
2114
|
+
var columnFormula = innerTemplateName
|
|
2115
|
+
? fillTemplateSql(measureInnerTemplateFormulas[innerTemplateName], {
|
|
2116
|
+
columnFormula: generateColumnFormula(tableName, columnName),
|
|
2117
|
+
})
|
|
2118
|
+
: generateColumnFormula(tableName, columnName);
|
|
2119
|
+
return fillTemplateSql(templateFormula, {
|
|
2120
|
+
columnFormula: columnFormula,
|
|
1294
2121
|
});
|
|
1295
2122
|
}
|
|
1296
2123
|
if (value.mode === exports.EWidgetIndicatorValueModes.AGGREGATION) {
|
|
1297
2124
|
var preparedParams = prepareMeasureAggregationParams(value);
|
|
1298
2125
|
return preparedParams
|
|
1299
|
-
?
|
|
2126
|
+
? fillTemplateSql(createAggregationTemplate(value.templateName, {
|
|
1300
2127
|
outerAggregation: preparedParams.outerAggregation,
|
|
1301
2128
|
anyEvent: value.anyEvent,
|
|
1302
2129
|
}), preparedParams)
|
|
@@ -1307,28 +2134,28 @@ function getMeasureFormula(_a) {
|
|
|
1307
2134
|
if (!preparedParams) {
|
|
1308
2135
|
return "";
|
|
1309
2136
|
}
|
|
1310
|
-
return
|
|
2137
|
+
return fillTemplateSql(conversionTemplate, preparedParams);
|
|
1311
2138
|
}
|
|
1312
2139
|
if (value.mode === exports.EWidgetIndicatorValueModes.DURATION) {
|
|
1313
2140
|
var preparedParams = prepareDurationParams(value);
|
|
1314
2141
|
if (!preparedParams) {
|
|
1315
2142
|
return "";
|
|
1316
2143
|
}
|
|
1317
|
-
return
|
|
2144
|
+
return fillTemplateSql(durationTemplates[value.templateName], preparedParams);
|
|
1318
2145
|
}
|
|
1319
2146
|
return "";
|
|
1320
2147
|
}
|
|
1321
2148
|
|
|
1322
|
-
var _a$
|
|
2149
|
+
var _a$2;
|
|
1323
2150
|
exports.EEventMeasureTemplateNames = void 0;
|
|
1324
2151
|
(function (EEventMeasureTemplateNames) {
|
|
1325
2152
|
EEventMeasureTemplateNames["eventsCount"] = "eventsCount";
|
|
1326
2153
|
EEventMeasureTemplateNames["reworksCount"] = "reworksCount";
|
|
1327
2154
|
})(exports.EEventMeasureTemplateNames || (exports.EEventMeasureTemplateNames = {}));
|
|
1328
|
-
var eventMeasureTemplateFormulas = (_a$
|
|
1329
|
-
_a$
|
|
1330
|
-
_a$
|
|
1331
|
-
_a$
|
|
2155
|
+
var eventMeasureTemplateFormulas = (_a$2 = {},
|
|
2156
|
+
_a$2[exports.EEventMeasureTemplateNames.eventsCount] = "count()",
|
|
2157
|
+
_a$2[exports.EEventMeasureTemplateNames.reworksCount] = "count() - uniqExact({caseCaseIdFormula})",
|
|
2158
|
+
_a$2);
|
|
1332
2159
|
|
|
1333
2160
|
function getEventMeasureFormula(_a, process) {
|
|
1334
2161
|
var value = _a.value;
|
|
@@ -1340,21 +2167,21 @@ function getEventMeasureFormula(_a, process) {
|
|
|
1340
2167
|
}
|
|
1341
2168
|
if (value.mode === exports.EWidgetIndicatorValueModes.TEMPLATE) {
|
|
1342
2169
|
var templateFormula = eventMeasureTemplateFormulas[value.templateName];
|
|
1343
|
-
return templateFormula &&
|
|
2170
|
+
return templateFormula && fillTemplateSql(templateFormula, process);
|
|
1344
2171
|
}
|
|
1345
2172
|
return "";
|
|
1346
2173
|
}
|
|
1347
2174
|
|
|
1348
|
-
var _a;
|
|
2175
|
+
var _a$1;
|
|
1349
2176
|
exports.ETransitionMeasureTemplateNames = void 0;
|
|
1350
2177
|
(function (ETransitionMeasureTemplateNames) {
|
|
1351
2178
|
ETransitionMeasureTemplateNames["transitionsCount"] = "transitionsCount";
|
|
1352
2179
|
ETransitionMeasureTemplateNames["medianTime"] = "medianTime";
|
|
1353
2180
|
})(exports.ETransitionMeasureTemplateNames || (exports.ETransitionMeasureTemplateNames = {}));
|
|
1354
|
-
var transitionMeasureTemplateFormulas = (_a = {},
|
|
1355
|
-
_a[exports.ETransitionMeasureTemplateNames.transitionsCount] = "count()",
|
|
1356
|
-
_a[exports.ETransitionMeasureTemplateNames.medianTime] = "medianExact(date_diff(second, begin({eventTimeFormula}), end({eventTimeFormula})))",
|
|
1357
|
-
_a);
|
|
2181
|
+
var transitionMeasureTemplateFormulas = (_a$1 = {},
|
|
2182
|
+
_a$1[exports.ETransitionMeasureTemplateNames.transitionsCount] = "count()",
|
|
2183
|
+
_a$1[exports.ETransitionMeasureTemplateNames.medianTime] = "medianExact(date_diff(second, begin({eventTimeFormula}), end({eventTimeFormula})))",
|
|
2184
|
+
_a$1);
|
|
1358
2185
|
|
|
1359
2186
|
function getTransitionMeasureFormula(_a, process) {
|
|
1360
2187
|
var value = _a.value;
|
|
@@ -1366,35 +2193,11 @@ function getTransitionMeasureFormula(_a, process) {
|
|
|
1366
2193
|
}
|
|
1367
2194
|
if (value.mode === exports.EWidgetIndicatorValueModes.TEMPLATE) {
|
|
1368
2195
|
var templateFormula = transitionMeasureTemplateFormulas[value.templateName];
|
|
1369
|
-
return templateFormula &&
|
|
2196
|
+
return templateFormula && fillTemplateSql(templateFormula, process);
|
|
1370
2197
|
}
|
|
1371
2198
|
return "";
|
|
1372
2199
|
}
|
|
1373
2200
|
|
|
1374
|
-
// Типы, используемые в значениях элементов управления.
|
|
1375
|
-
exports.EWidgetFilterMode = void 0;
|
|
1376
|
-
(function (EWidgetFilterMode) {
|
|
1377
|
-
EWidgetFilterMode["DEFAULT"] = "DEFAULT";
|
|
1378
|
-
EWidgetFilterMode["SINGLE"] = "SINGLE";
|
|
1379
|
-
EWidgetFilterMode["DISABLED"] = "DISABLED";
|
|
1380
|
-
})(exports.EWidgetFilterMode || (exports.EWidgetFilterMode = {}));
|
|
1381
|
-
exports.EMarkdownDisplayMode = void 0;
|
|
1382
|
-
(function (EMarkdownDisplayMode) {
|
|
1383
|
-
EMarkdownDisplayMode["NONE"] = "NONE";
|
|
1384
|
-
EMarkdownDisplayMode["INDICATOR"] = "INDICATOR";
|
|
1385
|
-
})(exports.EMarkdownDisplayMode || (exports.EMarkdownDisplayMode = {}));
|
|
1386
|
-
exports.EDisplayConditionMode = void 0;
|
|
1387
|
-
(function (EDisplayConditionMode) {
|
|
1388
|
-
EDisplayConditionMode["DISABLED"] = "DISABLED";
|
|
1389
|
-
EDisplayConditionMode["FORMULA"] = "FORMULA";
|
|
1390
|
-
EDisplayConditionMode["VARIABLE"] = "VARIABLE";
|
|
1391
|
-
})(exports.EDisplayConditionMode || (exports.EDisplayConditionMode = {}));
|
|
1392
|
-
exports.EFontWeight = void 0;
|
|
1393
|
-
(function (EFontWeight) {
|
|
1394
|
-
EFontWeight["NORMAL"] = "NORMAL";
|
|
1395
|
-
EFontWeight["BOLD"] = "BOLD";
|
|
1396
|
-
})(exports.EFontWeight || (exports.EFontWeight = {}));
|
|
1397
|
-
|
|
1398
2201
|
function checkDisplayCondition(displayCondition, variables) {
|
|
1399
2202
|
var _a;
|
|
1400
2203
|
if ((displayCondition === null || displayCondition === void 0 ? void 0 : displayCondition.mode) === exports.EDisplayConditionMode.VARIABLE) {
|
|
@@ -1528,7 +2331,7 @@ var getFormulaFilterValues = function (filterValue) {
|
|
|
1528
2331
|
if (filteringMethod === formulaFilterMethods.LAST_TIME) {
|
|
1529
2332
|
var showTime = format === exports.EFormatTypes.DATETIME;
|
|
1530
2333
|
return compact([
|
|
1531
|
-
convertDateToClickHouse(subtractDurationFromDate(new Date(), lastTimeValue !== null && lastTimeValue !== void 0 ? lastTimeValue : 0, lastTimeUnit), showTime),
|
|
2334
|
+
convertDateToClickHouse(subtractDurationFromDate(new Date(), Number(lastTimeValue !== null && lastTimeValue !== void 0 ? lastTimeValue : 0), lastTimeUnit), showTime),
|
|
1532
2335
|
convertDateToClickHouse(new Date(), showTime),
|
|
1533
2336
|
]);
|
|
1534
2337
|
}
|
|
@@ -1550,7 +2353,9 @@ var getFormulaFilterValues = function (filterValue) {
|
|
|
1550
2353
|
}
|
|
1551
2354
|
return [];
|
|
1552
2355
|
};
|
|
1553
|
-
var applyIndexToArrayFormula = function (formula, index) {
|
|
2356
|
+
var applyIndexToArrayFormula = function (formula, index) {
|
|
2357
|
+
return "(".concat(formula, ")[").concat(index, "]");
|
|
2358
|
+
};
|
|
1554
2359
|
var mapFormulaFilterToCalculatorInput = function (filterValue) {
|
|
1555
2360
|
if (!filterValue) {
|
|
1556
2361
|
return null;
|
|
@@ -1558,7 +2363,7 @@ var mapFormulaFilterToCalculatorInput = function (filterValue) {
|
|
|
1558
2363
|
if (!isFormulaFilterValue(filterValue)) {
|
|
1559
2364
|
return {
|
|
1560
2365
|
dbDataType: exports.EClickHouseBaseTypes.Bool,
|
|
1561
|
-
formula:
|
|
2366
|
+
formula: fillTemplateSql(displayConditionTemplate, {
|
|
1562
2367
|
formula: prepareFormulaForSql(filterValue.formula),
|
|
1563
2368
|
}),
|
|
1564
2369
|
values: ["true"],
|
|
@@ -1593,6 +2398,46 @@ var mapFormulaFiltersToInputs = function (filters) {
|
|
|
1593
2398
|
return compactMap(filters, mapFormulaFilterToCalculatorInput);
|
|
1594
2399
|
};
|
|
1595
2400
|
|
|
2401
|
+
var _a;
|
|
2402
|
+
var intervalByUnit = (_a = {},
|
|
2403
|
+
_a[exports.EDimensionProcessFilterTimeUnit.YEARS] = "year",
|
|
2404
|
+
_a[exports.EDimensionProcessFilterTimeUnit.MONTHS] = "month",
|
|
2405
|
+
_a[exports.EDimensionProcessFilterTimeUnit.DAYS] = "day",
|
|
2406
|
+
_a[exports.EDimensionProcessFilterTimeUnit.HOURS] = "hour",
|
|
2407
|
+
_a[exports.EDimensionProcessFilterTimeUnit.MINUTES] = "minute",
|
|
2408
|
+
_a);
|
|
2409
|
+
function mapDimensionProcessFilterToCalculatorInput(filter) {
|
|
2410
|
+
var formula = filter.value.mode === exports.EWidgetIndicatorValueModes.FORMULA
|
|
2411
|
+
? filter.value.formula
|
|
2412
|
+
: getProcessDimensionValueFormula(filter.value);
|
|
2413
|
+
if (formula === undefined) {
|
|
2414
|
+
throw new Error("Formula generation error");
|
|
2415
|
+
}
|
|
2416
|
+
var _a = filter.condition, timeUnit = _a.timeUnit, filteringMethod = _a.filteringMethod, values = _a.values;
|
|
2417
|
+
if (filteringMethod === "LAST_TIME") {
|
|
2418
|
+
if (!timeUnit) {
|
|
2419
|
+
throw new Error("Missing time unit");
|
|
2420
|
+
}
|
|
2421
|
+
return {
|
|
2422
|
+
dbDataType: exports.EClickHouseBaseTypes.Bool,
|
|
2423
|
+
formula: "date_diff('".concat(intervalByUnit[timeUnit], "', ").concat(formula, ", now())"),
|
|
2424
|
+
values: values,
|
|
2425
|
+
filteringMethod: formulaFilterMethods.LESS_THAN_OR_EQUAL_TO,
|
|
2426
|
+
};
|
|
2427
|
+
}
|
|
2428
|
+
return { formula: formula, filteringMethod: filteringMethod, values: values, dbDataType: filter.dbDataType };
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
var mapSettingsFilterToCalculatorInput = function (filter) {
|
|
2432
|
+
if (isDimensionProcessFilter(filter)) {
|
|
2433
|
+
return mapDimensionProcessFilterToCalculatorInput(filter);
|
|
2434
|
+
}
|
|
2435
|
+
return mapFormulaFilterToCalculatorInput(filter);
|
|
2436
|
+
};
|
|
2437
|
+
var mapSettingsFiltersToInputs = function (filters) {
|
|
2438
|
+
return compactMap(filters, mapSettingsFilterToCalculatorInput);
|
|
2439
|
+
};
|
|
2440
|
+
|
|
1596
2441
|
function mapMeasureToInput(measure, variables, addFormulas) {
|
|
1597
2442
|
if (addFormulas === void 0) { addFormulas = function () { return new Map(); }; }
|
|
1598
2443
|
var mainFormula = getMeasureFormula(measure);
|
|
@@ -1698,8 +2543,8 @@ exports.ESortDirection = void 0;
|
|
|
1698
2543
|
* Если к разрезу иерархии применяется INCLUDE-фильтр с одним значением - выбираем следующий за ним разрез
|
|
1699
2544
|
* Если к разрезу иерархии применяется INCLUDE-фильтр с несколькими значениями - выбираем данный разрез
|
|
1700
2545
|
*/
|
|
1701
|
-
function selectDimensionFromHierarchy(
|
|
1702
|
-
var hierarchyDimensions =
|
|
2546
|
+
function selectDimensionFromHierarchy(hierarchy, filters) {
|
|
2547
|
+
var hierarchyDimensions = hierarchy.hierarchyDimensions; hierarchy.displayCondition;
|
|
1703
2548
|
var _loop_1 = function (i) {
|
|
1704
2549
|
var dimension = hierarchyDimensions[i];
|
|
1705
2550
|
// todo: widgets - возможно, стоит использовать Map фильтров для быстрого поиска
|
|
@@ -1712,14 +2557,18 @@ function selectDimensionFromHierarchy(_a, filters) {
|
|
|
1712
2557
|
return "continue";
|
|
1713
2558
|
}
|
|
1714
2559
|
var selectionIndex = matchedFilter.values.length > 1 ? i : Math.min(i + 1, hierarchyDimensions.length - 1);
|
|
1715
|
-
|
|
2560
|
+
var dimensionFromHierarchy_1 = hierarchyDimensions[selectionIndex];
|
|
2561
|
+
return { value: (dimensionFromHierarchy_1 &&
|
|
2562
|
+
inheritDisplayConditionFromHierarchy(dimensionFromHierarchy_1, hierarchy)) };
|
|
1716
2563
|
};
|
|
1717
2564
|
for (var i = hierarchyDimensions.length - 1; i >= 0; i--) {
|
|
1718
2565
|
var state_1 = _loop_1(i);
|
|
1719
2566
|
if (typeof state_1 === "object")
|
|
1720
2567
|
return state_1.value;
|
|
1721
2568
|
}
|
|
1722
|
-
|
|
2569
|
+
var dimensionFromHierarchy = hierarchyDimensions[0];
|
|
2570
|
+
return (dimensionFromHierarchy &&
|
|
2571
|
+
inheritDisplayConditionFromHierarchy(dimensionFromHierarchy, hierarchy));
|
|
1723
2572
|
}
|
|
1724
2573
|
|
|
1725
2574
|
var getDefaultSortOrders = function (_a) {
|
|
@@ -1735,7 +2584,8 @@ var getDefaultSortOrders = function (_a) {
|
|
|
1735
2584
|
/** Если есть временной разрез, то авто-сортировка по первому такому разрезу (по возрастанию) */
|
|
1736
2585
|
var timeDimension = dimensions.find(function (dimension) {
|
|
1737
2586
|
var _a;
|
|
1738
|
-
return ((_a = dimension.format) === null || _a === void 0 ? void 0 : _a.
|
|
2587
|
+
return ((_a = dimension.format) === null || _a === void 0 ? void 0 : _a.mode) === exports.EFormatOrFormattingMode.BASE &&
|
|
2588
|
+
dimension.format.value !== undefined &&
|
|
1739
2589
|
[
|
|
1740
2590
|
exports.EFormatTypes.DATE,
|
|
1741
2591
|
exports.EFormatTypes.MONTH,
|
|
@@ -1794,9 +2644,9 @@ function mapSortingToInputs(_a) {
|
|
|
1794
2644
|
return;
|
|
1795
2645
|
}
|
|
1796
2646
|
if (getIndicatorType(value.group, indicator) === exports.EWidgetIndicatorType.DIMENSION) {
|
|
1797
|
-
var activeDimensions = isDimensionsHierarchy(indicator)
|
|
2647
|
+
var activeDimensions = (isDimensionsHierarchy(indicator)
|
|
1798
2648
|
? selectDimensionFromHierarchy(indicator, filters)
|
|
1799
|
-
: indicator;
|
|
2649
|
+
: indicator);
|
|
1800
2650
|
var formula = activeDimensions && getDimensionFormula(activeDimensions);
|
|
1801
2651
|
if (!formula || !checkDisplayCondition(indicator.displayCondition, variables)) {
|
|
1802
2652
|
return;
|
|
@@ -1810,10 +2660,11 @@ function mapSortingToInputs(_a) {
|
|
|
1810
2660
|
: undefined,
|
|
1811
2661
|
};
|
|
1812
2662
|
}
|
|
2663
|
+
var measure = indicator;
|
|
1813
2664
|
return {
|
|
1814
|
-
formula: getMeasureFormula(
|
|
2665
|
+
formula: getMeasureFormula(measure),
|
|
1815
2666
|
direction: direction,
|
|
1816
|
-
dbDataType:
|
|
2667
|
+
dbDataType: measure.dbDataType,
|
|
1817
2668
|
};
|
|
1818
2669
|
});
|
|
1819
2670
|
return sortOrder;
|
|
@@ -1827,8 +2678,7 @@ function prepareSortOrders(_a) {
|
|
|
1827
2678
|
var replaceHierarchiesWithDimensions = function (dimensions, filters) {
|
|
1828
2679
|
return compactMap(dimensions, function (indicator) {
|
|
1829
2680
|
if (isDimensionsHierarchy(indicator)) {
|
|
1830
|
-
|
|
1831
|
-
return (selectedDimension && replaceDisplayCondition(selectedDimension, indicator.displayCondition));
|
|
2681
|
+
return selectDimensionFromHierarchy(indicator, filters);
|
|
1832
2682
|
}
|
|
1833
2683
|
return indicator;
|
|
1834
2684
|
});
|
|
@@ -1899,6 +2749,12 @@ exports.EUnitMode = void 0;
|
|
|
1899
2749
|
EUnitMode["PIXEL"] = "PIXEL";
|
|
1900
2750
|
EUnitMode["PERCENT"] = "PERCENT";
|
|
1901
2751
|
})(exports.EUnitMode || (exports.EUnitMode = {}));
|
|
2752
|
+
var defaultActionsConfig = {
|
|
2753
|
+
OPEN_URL: { availability: true },
|
|
2754
|
+
UPDATE_VARIABLE: { availability: true },
|
|
2755
|
+
EXECUTE_SCRIPT: { availability: true },
|
|
2756
|
+
OPEN_VIEW: { availability: true },
|
|
2757
|
+
};
|
|
1902
2758
|
|
|
1903
2759
|
exports.ESelectOptionTypes = void 0;
|
|
1904
2760
|
(function (ESelectOptionTypes) {
|
|
@@ -2087,6 +2943,120 @@ var getColorByIndex = function (index) {
|
|
|
2087
2943
|
return color;
|
|
2088
2944
|
};
|
|
2089
2945
|
|
|
2946
|
+
var WidgetPresetSettingsSchema = function (z) {
|
|
2947
|
+
return BaseWidgetSettingsSchema(z)
|
|
2948
|
+
.pick({
|
|
2949
|
+
filterMode: true,
|
|
2950
|
+
ignoreFilters: true,
|
|
2951
|
+
stateName: true,
|
|
2952
|
+
titleColor: true,
|
|
2953
|
+
titleSize: true,
|
|
2954
|
+
titleWeight: true,
|
|
2955
|
+
paddings: true,
|
|
2956
|
+
})
|
|
2957
|
+
.extend({
|
|
2958
|
+
textSize: z.number().default(12),
|
|
2959
|
+
});
|
|
2960
|
+
};
|
|
2961
|
+
|
|
2962
|
+
/**
|
|
2963
|
+
* Привязывает мета-информацию о теме к Zod-схеме
|
|
2964
|
+
*
|
|
2965
|
+
* @template Value - Тип значения схемы
|
|
2966
|
+
* @template Theme - Тип темы (по умолчанию ITheme)
|
|
2967
|
+
*
|
|
2968
|
+
* @param scheme - Zod схема для привязки
|
|
2969
|
+
* @param selectThemeValue - Функция, возвращающая значение из темы
|
|
2970
|
+
*
|
|
2971
|
+
* @returns Zod схему с мета-информацией о теме
|
|
2972
|
+
*
|
|
2973
|
+
* @example
|
|
2974
|
+
* // Базовое использование
|
|
2975
|
+
* textSize: themed(
|
|
2976
|
+
* z.number().default(12),
|
|
2977
|
+
* (theme) => theme.textSize
|
|
2978
|
+
* )
|
|
2979
|
+
*/
|
|
2980
|
+
var themed = function (scheme, selectThemeValue) {
|
|
2981
|
+
var _a;
|
|
2982
|
+
return scheme.meta((_a = {}, _a[exports.ESettingsSchemaMetaKey.themeValue] = selectThemeValue, _a));
|
|
2983
|
+
};
|
|
2984
|
+
|
|
2985
|
+
var ColorBaseSchema = function (z) {
|
|
2986
|
+
return z.object({
|
|
2987
|
+
mode: z.literal(exports.EColorMode.BASE),
|
|
2988
|
+
value: z.string(),
|
|
2989
|
+
});
|
|
2990
|
+
};
|
|
2991
|
+
var ColorRuleSchema = function (z) {
|
|
2992
|
+
return z.object({
|
|
2993
|
+
mode: z.literal(exports.EColorMode.RULE),
|
|
2994
|
+
formula: FormulaSchema(z),
|
|
2995
|
+
});
|
|
2996
|
+
};
|
|
2997
|
+
var ColorAutoSchema = function (z) {
|
|
2998
|
+
return z.object({
|
|
2999
|
+
mode: z.literal(exports.EColorMode.AUTO),
|
|
3000
|
+
});
|
|
3001
|
+
};
|
|
3002
|
+
var ColorDisabledSchema = function (z) {
|
|
3003
|
+
return z.object({
|
|
3004
|
+
mode: z.literal(exports.EColorMode.DISABLED),
|
|
3005
|
+
});
|
|
3006
|
+
};
|
|
3007
|
+
var ColorGradientSchema = function (z) {
|
|
3008
|
+
return z.object({
|
|
3009
|
+
mode: z.literal(exports.EColorMode.GRADIENT),
|
|
3010
|
+
startValue: z.string(),
|
|
3011
|
+
endValue: z.string(),
|
|
3012
|
+
classCount: z.number().min(3).max(10).nullish(),
|
|
3013
|
+
});
|
|
3014
|
+
};
|
|
3015
|
+
var ColorFormulaSchema = function (z) {
|
|
3016
|
+
return z.object({
|
|
3017
|
+
mode: z.literal(exports.EColorMode.FORMULA),
|
|
3018
|
+
formula: FormulaSchema(z),
|
|
3019
|
+
});
|
|
3020
|
+
};
|
|
3021
|
+
var ColorValuesSchema = function (z) {
|
|
3022
|
+
return z.object({
|
|
3023
|
+
mode: z.literal(exports.EColorMode.VALUES),
|
|
3024
|
+
items: z
|
|
3025
|
+
.array(z.object({ value: z.string(), color: z.union([ColorBaseSchema(z), ColorRuleSchema(z)]) }))
|
|
3026
|
+
.default([]),
|
|
3027
|
+
});
|
|
3028
|
+
};
|
|
3029
|
+
var ColorByDimensionSchema = function (z) {
|
|
3030
|
+
return z.object({
|
|
3031
|
+
mode: z.literal(exports.EColorMode.BY_DIMENSION),
|
|
3032
|
+
/** Имя разреза из области видимости правила отображения */
|
|
3033
|
+
dimensionName: z.string(),
|
|
3034
|
+
items: z
|
|
3035
|
+
.array(z.object({ value: z.string(), color: z.union([ColorBaseSchema(z), ColorRuleSchema(z)]) }))
|
|
3036
|
+
.default([]),
|
|
3037
|
+
});
|
|
3038
|
+
};
|
|
3039
|
+
var ColoredValueSchema = function (z) {
|
|
3040
|
+
return z.object({
|
|
3041
|
+
value: z.string(),
|
|
3042
|
+
color: z.union([ColorBaseSchema(z), ColorRuleSchema(z)]),
|
|
3043
|
+
});
|
|
3044
|
+
};
|
|
3045
|
+
var ColorSchema = function (z) {
|
|
3046
|
+
return z
|
|
3047
|
+
.discriminatedUnion("mode", [
|
|
3048
|
+
ColorAutoSchema(z),
|
|
3049
|
+
ColorDisabledSchema(z),
|
|
3050
|
+
ColorBaseSchema(z),
|
|
3051
|
+
ColorRuleSchema(z),
|
|
3052
|
+
ColorGradientSchema(z),
|
|
3053
|
+
ColorFormulaSchema(z),
|
|
3054
|
+
ColorValuesSchema(z),
|
|
3055
|
+
ColorByDimensionSchema(z),
|
|
3056
|
+
])
|
|
3057
|
+
.default({ mode: exports.EColorMode.AUTO });
|
|
3058
|
+
};
|
|
3059
|
+
|
|
2090
3060
|
Object.defineProperty(exports, "ELanguages", {
|
|
2091
3061
|
enumerable: true,
|
|
2092
3062
|
get: function () { return localization$1.ELanguages; }
|
|
@@ -2095,6 +3065,81 @@ Object.defineProperty(exports, "EFilteringMethodValues", {
|
|
|
2095
3065
|
enumerable: true,
|
|
2096
3066
|
get: function () { return baseFilter.EFilteringMethodValues; }
|
|
2097
3067
|
});
|
|
3068
|
+
exports.ActionButtonSchema = ActionButtonSchema;
|
|
3069
|
+
exports.ActionDrillDownSchema = ActionDrillDownSchema;
|
|
3070
|
+
exports.ActionGoToURLSchema = ActionGoToURLSchema;
|
|
3071
|
+
exports.ActionOnClickParameterSchema = ActionOnClickParameterSchema;
|
|
3072
|
+
exports.ActionOpenInSchema = ActionOpenInSchema;
|
|
3073
|
+
exports.ActionOpenViewSchema = ActionOpenViewSchema;
|
|
3074
|
+
exports.ActionRunScriptSchema = ActionRunScriptSchema;
|
|
3075
|
+
exports.ActionSchema = ActionSchema;
|
|
3076
|
+
exports.ActionUpdateVariableSchema = ActionUpdateVariableSchema;
|
|
3077
|
+
exports.ActionsOnClickSchema = ActionsOnClickSchema;
|
|
3078
|
+
exports.AutoIdentifiedArrayItemSchema = AutoIdentifiedArrayItemSchema;
|
|
3079
|
+
exports.BaseWidgetSettingsSchema = BaseWidgetSettingsSchema;
|
|
3080
|
+
exports.ColorAutoSchema = ColorAutoSchema;
|
|
3081
|
+
exports.ColorBaseSchema = ColorBaseSchema;
|
|
3082
|
+
exports.ColorByDimensionSchema = ColorByDimensionSchema;
|
|
3083
|
+
exports.ColorDisabledSchema = ColorDisabledSchema;
|
|
3084
|
+
exports.ColorFormulaSchema = ColorFormulaSchema;
|
|
3085
|
+
exports.ColorGradientSchema = ColorGradientSchema;
|
|
3086
|
+
exports.ColorRuleSchema = ColorRuleSchema;
|
|
3087
|
+
exports.ColorSchema = ColorSchema;
|
|
3088
|
+
exports.ColorValuesSchema = ColorValuesSchema;
|
|
3089
|
+
exports.ColoredValueSchema = ColoredValueSchema;
|
|
3090
|
+
exports.ColumnIndicatorValueSchema = ColumnIndicatorValueSchema;
|
|
3091
|
+
exports.DimensionProcessFilterSchema = DimensionProcessFilterSchema;
|
|
3092
|
+
exports.DimensionValueSchema = DimensionValueSchema;
|
|
3093
|
+
exports.DisplayConditionSchema = DisplayConditionSchema;
|
|
3094
|
+
exports.ExtendedFormulaFilterValueSchema = ExtendedFormulaFilterValueSchema;
|
|
3095
|
+
exports.FormatSchema = FormatSchema;
|
|
3096
|
+
exports.FormattingSchema = FormattingSchema;
|
|
3097
|
+
exports.FormulaFilterValueSchema = FormulaFilterValueSchema;
|
|
3098
|
+
exports.FormulaNullableSchema = FormulaNullableSchema;
|
|
3099
|
+
exports.FormulaSchema = FormulaSchema;
|
|
3100
|
+
exports.KeyNullableSchema = KeyNullableSchema;
|
|
3101
|
+
exports.MarkdownMeasureSchema = MarkdownMeasureSchema;
|
|
3102
|
+
exports.MeasureValueSchema = MeasureValueSchema;
|
|
3103
|
+
exports.NameNullableSchema = NameNullableSchema;
|
|
3104
|
+
exports.ParameterFromAggregationSchema = ParameterFromAggregationSchema;
|
|
3105
|
+
exports.ParameterFromColumnSchema = ParameterFromColumnSchema;
|
|
3106
|
+
exports.ParameterFromDataModelSchema = ParameterFromDataModelSchema;
|
|
3107
|
+
exports.ParameterFromDynamicListSchema = ParameterFromDynamicListSchema;
|
|
3108
|
+
exports.ParameterFromEndEventSchema = ParameterFromEndEventSchema;
|
|
3109
|
+
exports.ParameterFromEventSchema = ParameterFromEventSchema;
|
|
3110
|
+
exports.ParameterFromFormulaSchema = ParameterFromFormulaSchema;
|
|
3111
|
+
exports.ParameterFromManualInputSchema = ParameterFromManualInputSchema;
|
|
3112
|
+
exports.ParameterFromStartEventSchema = ParameterFromStartEventSchema;
|
|
3113
|
+
exports.ParameterFromStaticListSchema = ParameterFromStaticListSchema;
|
|
3114
|
+
exports.ParameterFromVariableSchema = ParameterFromVariableSchema;
|
|
3115
|
+
exports.ProcessIndicatorSchema = ProcessIndicatorSchema;
|
|
3116
|
+
exports.ProcessIndicatorValueSchema = ProcessIndicatorValueSchema;
|
|
3117
|
+
exports.RangeSchema = RangeSchema;
|
|
3118
|
+
exports.SettingsFilterSchema = SettingsFilterSchema;
|
|
3119
|
+
exports.SortDirectionSchema = SortDirectionSchema;
|
|
3120
|
+
exports.SortOrderSchema = SortOrderSchema;
|
|
3121
|
+
exports.ViewActionParameterSchema = ViewActionParameterSchema;
|
|
3122
|
+
exports.ViewActionSchema = ViewActionSchema;
|
|
3123
|
+
exports.WidgetActionParameterSchema = WidgetActionParameterSchema;
|
|
3124
|
+
exports.WidgetActionSchema = WidgetActionSchema;
|
|
3125
|
+
exports.WidgetColumnIndicatorSchema = WidgetColumnIndicatorSchema;
|
|
3126
|
+
exports.WidgetDimensionHierarchySchema = WidgetDimensionHierarchySchema;
|
|
3127
|
+
exports.WidgetDimensionInHierarchySchema = WidgetDimensionInHierarchySchema;
|
|
3128
|
+
exports.WidgetDimensionSchema = WidgetDimensionSchema;
|
|
3129
|
+
exports.WidgetIndicatorAggregationValueSchema = WidgetIndicatorAggregationValueSchema;
|
|
3130
|
+
exports.WidgetIndicatorConversionValueSchema = WidgetIndicatorConversionValueSchema;
|
|
3131
|
+
exports.WidgetIndicatorDurationValueSchema = WidgetIndicatorDurationValueSchema;
|
|
3132
|
+
exports.WidgetIndicatorFormulaValueSchema = WidgetIndicatorFormulaValueSchema;
|
|
3133
|
+
exports.WidgetIndicatorSchema = WidgetIndicatorSchema;
|
|
3134
|
+
exports.WidgetIndicatorTemplateValueSchema = WidgetIndicatorTemplateValueSchema;
|
|
3135
|
+
exports.WidgetIndicatorTimeValueSchema = WidgetIndicatorTimeValueSchema;
|
|
3136
|
+
exports.WidgetMeasureAggregationValueSchema = WidgetMeasureAggregationValueSchema;
|
|
3137
|
+
exports.WidgetMeasureSchema = WidgetMeasureSchema;
|
|
3138
|
+
exports.WidgetPresetSettingsSchema = WidgetPresetSettingsSchema;
|
|
3139
|
+
exports.WidgetSortingIndicatorSchema = WidgetSortingIndicatorSchema;
|
|
3140
|
+
exports.WidgetSortingValueSchema = WidgetSortingValueSchema;
|
|
3141
|
+
exports.apiVersion = apiVersion;
|
|
3142
|
+
exports.apiVersions = apiVersions;
|
|
2098
3143
|
exports.applyIndexToArrayFormula = applyIndexToArrayFormula;
|
|
2099
3144
|
exports.bindContentWithIndicator = bindContentWithIndicator;
|
|
2100
3145
|
exports.bindContentsWithIndicators = bindContentsWithIndicators;
|
|
@@ -2110,6 +3155,7 @@ exports.createEscaper = createEscaper;
|
|
|
2110
3155
|
exports.createMeasureAggregationTemplate = createAggregationTemplate;
|
|
2111
3156
|
exports.curlyBracketsContentPattern = curlyBracketsContentPattern;
|
|
2112
3157
|
exports.dashboardLinkRegExp = dashboardLinkRegExp;
|
|
3158
|
+
exports.defaultActionsConfig = defaultActionsConfig;
|
|
2113
3159
|
exports.dimensionAggregationTemplates = dimensionAggregationTemplates;
|
|
2114
3160
|
exports.dimensionTemplateFormulas = dimensionTemplateFormulas;
|
|
2115
3161
|
exports.displayConditionTemplate = displayConditionTemplate;
|
|
@@ -2118,7 +3164,7 @@ exports.durationTemplates = durationTemplates;
|
|
|
2118
3164
|
exports.escapeCurlyBracketLinkName = escapeCurlyBracketLinkName;
|
|
2119
3165
|
exports.escapeDoubleQuoteLinkName = escapeDoubleQuoteLinkName;
|
|
2120
3166
|
exports.eventMeasureTemplateFormulas = eventMeasureTemplateFormulas;
|
|
2121
|
-
exports.
|
|
3167
|
+
exports.fillTemplateSql = fillTemplateSql;
|
|
2122
3168
|
exports.formattingConfig = formattingConfig;
|
|
2123
3169
|
exports.formulaFilterMethods = formulaFilterMethods;
|
|
2124
3170
|
exports.generateColumnFormula = generateColumnFormula;
|
|
@@ -2129,8 +3175,11 @@ exports.getDisplayConditionFormula = getDisplayConditionFormula;
|
|
|
2129
3175
|
exports.getEventMeasureFormula = getEventMeasureFormula;
|
|
2130
3176
|
exports.getLocalizedText = getLocalizedText;
|
|
2131
3177
|
exports.getMeasureFormula = getMeasureFormula;
|
|
3178
|
+
exports.getProcessDimensionValueFormula = getProcessDimensionValueFormula;
|
|
2132
3179
|
exports.getRuleColor = getRuleColor;
|
|
2133
3180
|
exports.getTransitionMeasureFormula = getTransitionMeasureFormula;
|
|
3181
|
+
exports.inheritDisplayConditionFromHierarchy = inheritDisplayConditionFromHierarchy;
|
|
3182
|
+
exports.isDimensionProcessFilter = isDimensionProcessFilter;
|
|
2134
3183
|
exports.isDimensionsHierarchy = isDimensionsHierarchy;
|
|
2135
3184
|
exports.isFormulaFilterValue = isFormulaFilterValue;
|
|
2136
3185
|
exports.isValidColor = isValidColor;
|
|
@@ -2139,8 +3188,10 @@ exports.mapEventMeasuresToInputs = mapEventMeasuresToInputs;
|
|
|
2139
3188
|
exports.mapFormulaFilterToCalculatorInput = mapFormulaFilterToCalculatorInput;
|
|
2140
3189
|
exports.mapFormulaFiltersToInputs = mapFormulaFiltersToInputs;
|
|
2141
3190
|
exports.mapMeasuresToInputs = mapMeasuresToInputs;
|
|
3191
|
+
exports.mapSettingsFiltersToInputs = mapSettingsFiltersToInputs;
|
|
2142
3192
|
exports.mapSortingToInputs = mapSortingToInputs;
|
|
2143
3193
|
exports.mapTransitionMeasuresToInputs = mapTransitionMeasuresToInputs;
|
|
3194
|
+
exports.measureInnerTemplateFormulas = measureInnerTemplateFormulas;
|
|
2144
3195
|
exports.measureTemplateFormulas = measureTemplateFormulas;
|
|
2145
3196
|
exports.parseClickHouseType = parseClickHouseType;
|
|
2146
3197
|
exports.parseIndicatorLink = parseIndicatorLink;
|
|
@@ -2156,6 +3207,7 @@ exports.replaceDisplayCondition = replaceDisplayCondition;
|
|
|
2156
3207
|
exports.replaceFiltersBySelection = replaceFiltersBySelection;
|
|
2157
3208
|
exports.replaceHierarchiesWithDimensions = replaceHierarchiesWithDimensions;
|
|
2158
3209
|
exports.selectDimensionFromHierarchy = selectDimensionFromHierarchy;
|
|
3210
|
+
exports.themed = themed;
|
|
2159
3211
|
exports.timeTemplates = timeTemplates;
|
|
2160
3212
|
exports.transitionMeasureTemplateFormulas = transitionMeasureTemplateFormulas;
|
|
2161
3213
|
exports.unescapeSpecialCharacters = unescapeSpecialCharacters;
|