@infomaximum/widget-sdk 7.0.0-13 → 7.0.0-15
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 +23 -0
- package/dist/index.d.ts +13496 -13203
- package/dist/index.esm.js +1401 -760
- package/dist/index.js +1402 -759
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -101,46 +101,6 @@ var EActionButtonsTypes;
|
|
|
101
101
|
EActionButtonsTypes["SECONDARY"] = "primary-outlined";
|
|
102
102
|
})(EActionButtonsTypes || (EActionButtonsTypes = {}));
|
|
103
103
|
|
|
104
|
-
/**
|
|
105
|
-
* Глобальный счетчик для генерации ID.
|
|
106
|
-
*
|
|
107
|
-
* @todo
|
|
108
|
-
* В будущем можно заменить единый счетчик на изолированные счетчики в разных контекстах.
|
|
109
|
-
*/
|
|
110
|
-
var id = 1;
|
|
111
|
-
var AutoIdentifiedArrayItemSchema = function (z) {
|
|
112
|
-
return z.object({
|
|
113
|
-
/**
|
|
114
|
-
* Идентификатор, добавляемый системой "на лету" для удобства разработки, не сохраняется на сервер.
|
|
115
|
-
* Гарантируется уникальность id в пределах settings виджета.
|
|
116
|
-
*/
|
|
117
|
-
id: z
|
|
118
|
-
.number()
|
|
119
|
-
.default(-1)
|
|
120
|
-
.transform(function (currentId) { return (currentId === -1 ? id++ : currentId); }),
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
var BaseWidgetSettingsSchema = function (z) {
|
|
124
|
-
return z.object({
|
|
125
|
-
title: z.string().default(""),
|
|
126
|
-
titleSize: themed(z.number().default(14), function (theme) { return theme.widgets.titleSize; }),
|
|
127
|
-
titleColor: themed(ColorSchema(z), function (theme) { return theme.widgets.titleColor; }),
|
|
128
|
-
titleWeight: themed(z.enum(EFontWeight).default(EFontWeight.NORMAL), function (theme) { return theme.widgets.titleWeight; }),
|
|
129
|
-
stateName: z.string().nullable().default(null),
|
|
130
|
-
showMarkdown: z.boolean().default(false),
|
|
131
|
-
markdownMeasures: z.array(MarkdownMeasureSchema(z)).default([]),
|
|
132
|
-
markdownText: z.string().default(""),
|
|
133
|
-
markdownTextSize: z.number().default(14),
|
|
134
|
-
filters: z.array(SettingsFilterSchema(z)).default([]),
|
|
135
|
-
filterMode: z.enum(EWidgetFilterMode).default(EWidgetFilterMode.DEFAULT),
|
|
136
|
-
ignoreFilters: z.boolean().default(false),
|
|
137
|
-
sorting: z.array(WidgetSortingIndicatorSchema(z)).default([]),
|
|
138
|
-
actionButtons: z.array(ActionButtonSchema(z)).default([]),
|
|
139
|
-
paddings: themed(z.union([z.number(), z.string()]).default(8), function (theme) { return theme.widgets.paddings; }),
|
|
140
|
-
viewTheme: z.boolean().default(false),
|
|
141
|
-
});
|
|
142
|
-
};
|
|
143
|
-
|
|
144
104
|
/******************************************************************************
|
|
145
105
|
Copyright (c) Microsoft Corporation.
|
|
146
106
|
|
|
@@ -157,6 +117,20 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
157
117
|
***************************************************************************** */
|
|
158
118
|
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
159
119
|
|
|
120
|
+
var extendStatics = function(d, b) {
|
|
121
|
+
extendStatics = Object.setPrototypeOf ||
|
|
122
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
123
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
124
|
+
return extendStatics(d, b);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
function __extends(d, b) {
|
|
128
|
+
if (typeof b !== "function" && b !== null)
|
|
129
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
130
|
+
extendStatics(d, b);
|
|
131
|
+
function __() { this.constructor = d; }
|
|
132
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
133
|
+
}
|
|
160
134
|
|
|
161
135
|
var __assign = function() {
|
|
162
136
|
__assign = Object.assign || function __assign(t) {
|
|
@@ -210,6 +184,16 @@ function __read(o, n) {
|
|
|
210
184
|
return ar;
|
|
211
185
|
}
|
|
212
186
|
|
|
187
|
+
function __spreadArray(to, from, pack) {
|
|
188
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
189
|
+
if (ar || !(i in from)) {
|
|
190
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
191
|
+
ar[i] = from[i];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
195
|
+
}
|
|
196
|
+
|
|
213
197
|
function __makeTemplateObject(cooked, raw) {
|
|
214
198
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
215
199
|
return cooked;
|
|
@@ -219,6 +203,204 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
219
203
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
220
204
|
};
|
|
221
205
|
|
|
206
|
+
var compact = function (items) { return ((items === null || items === void 0 ? void 0 : items.filter(Boolean)) || []); };
|
|
207
|
+
var compactMap = function (items, f) {
|
|
208
|
+
return compact(items === null || items === void 0 ? void 0 : items.map(f));
|
|
209
|
+
};
|
|
210
|
+
var isNil = function (value) {
|
|
211
|
+
return value === null || value === undefined;
|
|
212
|
+
};
|
|
213
|
+
function memoize(fn) {
|
|
214
|
+
var cache = new Map();
|
|
215
|
+
return function (arg) {
|
|
216
|
+
if (cache.has(arg)) {
|
|
217
|
+
return cache.get(arg);
|
|
218
|
+
}
|
|
219
|
+
var result = fn(arg);
|
|
220
|
+
cache.set(arg, result);
|
|
221
|
+
return result;
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/** Добавляет свойства к функции */
|
|
225
|
+
function assignPropsToFn(fn, props) {
|
|
226
|
+
return Object.assign(fn, props);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** Фабрика версионированных схем. Не содержит состояния */
|
|
230
|
+
var VersionedSchemaFactory = /** @class */ (function () {
|
|
231
|
+
function VersionedSchemaFactory() {
|
|
232
|
+
}
|
|
233
|
+
VersionedSchemaFactory.compareVersions = function (a, b) {
|
|
234
|
+
var _a, _b;
|
|
235
|
+
var partsA = a.split(".").map(Number);
|
|
236
|
+
var partsB = b.split(".").map(Number);
|
|
237
|
+
var length = Math.max(partsA.length, partsB.length);
|
|
238
|
+
for (var i = 0; i < length; i++) {
|
|
239
|
+
var pa = (_a = partsA[i]) !== null && _a !== void 0 ? _a : 0;
|
|
240
|
+
var pb = (_b = partsB[i]) !== null && _b !== void 0 ? _b : 0;
|
|
241
|
+
var diff = Math.sign(pa - pb);
|
|
242
|
+
if (diff !== 0) {
|
|
243
|
+
return diff;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return 0;
|
|
247
|
+
};
|
|
248
|
+
VersionedSchemaFactory.findClosestVersion = function (versions, targetVersion, compare) {
|
|
249
|
+
return versions
|
|
250
|
+
.toSorted(function (a, b) { return compare(b, a); })
|
|
251
|
+
.find(function (version) { return compare(version, targetVersion) <= 0; });
|
|
252
|
+
};
|
|
253
|
+
/** Добавляет метаданные к схеме (curried) */
|
|
254
|
+
VersionedSchemaFactory.annotateSchema = function (meta) {
|
|
255
|
+
if (meta === undefined) {
|
|
256
|
+
return function (schemaFactory) { return schemaFactory; };
|
|
257
|
+
}
|
|
258
|
+
return function (schemaFactory) {
|
|
259
|
+
return (function (z) {
|
|
260
|
+
var restArgs = [];
|
|
261
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
262
|
+
restArgs[_i - 1] = arguments[_i];
|
|
263
|
+
}
|
|
264
|
+
return schemaFactory.apply(void 0, __spreadArray([z], __read(restArgs), false)).meta(meta);
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
/** Построить версионированную схему */
|
|
269
|
+
VersionedSchemaFactory.build = function (_a) {
|
|
270
|
+
var _this = this;
|
|
271
|
+
var history = _a.history, latestVersion = _a.latestVersion, meta = _a.meta;
|
|
272
|
+
var latestFactory = history[latestVersion];
|
|
273
|
+
if (!latestFactory) {
|
|
274
|
+
throw new Error("Не найдено записи в 'history' по 'latestVersion'");
|
|
275
|
+
}
|
|
276
|
+
var map = this.annotateSchema(meta);
|
|
277
|
+
var schema = assignPropsToFn(map(latestFactory), {
|
|
278
|
+
forVersion: function (targetVersion) {
|
|
279
|
+
if (targetVersion === null || targetVersion === undefined) {
|
|
280
|
+
return map(latestFactory);
|
|
281
|
+
}
|
|
282
|
+
if (targetVersion in history) {
|
|
283
|
+
return map(history[targetVersion]);
|
|
284
|
+
}
|
|
285
|
+
var closestVersion = _this.findClosestVersion(Object.keys(history), targetVersion, VersionedSchemaFactory.compareVersions);
|
|
286
|
+
if (closestVersion === undefined || !(closestVersion in history)) {
|
|
287
|
+
throw new Error("\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0435\u0439 \u0441\u0445\u0435\u043C\u044B \u0434\u043B\u044F \u0432\u0435\u0440\u0441\u0438\u0438 '".concat(targetVersion, "'"));
|
|
288
|
+
}
|
|
289
|
+
return map(history[closestVersion]);
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
return schema;
|
|
293
|
+
};
|
|
294
|
+
return VersionedSchemaFactory;
|
|
295
|
+
}());
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Глобальный реестр версионированных схем (публичный слой, только чтение).
|
|
299
|
+
*
|
|
300
|
+
* Отвечает за:
|
|
301
|
+
*
|
|
302
|
+
* 1. Хранение зарегистрированных схем
|
|
303
|
+
* 2. Поиск схем по ключу
|
|
304
|
+
*
|
|
305
|
+
* Не предоставляет API для модификации registry.
|
|
306
|
+
*/
|
|
307
|
+
var SchemaRegistryReader = /** @class */ (function () {
|
|
308
|
+
function SchemaRegistryReader() {
|
|
309
|
+
}
|
|
310
|
+
/** Получить версионированную схему из `registry` по ключу схемы */
|
|
311
|
+
SchemaRegistryReader.get = function (schemaKey) {
|
|
312
|
+
return this.registry.get(schemaKey);
|
|
313
|
+
};
|
|
314
|
+
/**
|
|
315
|
+
* Имя поля в метаданных схемы, в котором хранится идентификатор типа схемы.
|
|
316
|
+
*
|
|
317
|
+
* Это поле добавляется ко всем схемам, зарегистрированным через `SchemaRegistry`.
|
|
318
|
+
*/
|
|
319
|
+
SchemaRegistryReader.typeKey = "type";
|
|
320
|
+
SchemaRegistryReader.registry = new Map();
|
|
321
|
+
return SchemaRegistryReader;
|
|
322
|
+
}());
|
|
323
|
+
/**
|
|
324
|
+
* Глобальный реестр версионированных схем (внутренний слой).
|
|
325
|
+
*
|
|
326
|
+
* Расширяет SchemaRegistryReader возможностью создать запись в registry.
|
|
327
|
+
*
|
|
328
|
+
* Отвечает за:
|
|
329
|
+
* 1. Декларацию схем (build + аннотация)
|
|
330
|
+
* 2. Регистрацию схем по ключу
|
|
331
|
+
*/
|
|
332
|
+
var SchemaRegistry = /** @class */ (function (_super) {
|
|
333
|
+
__extends(SchemaRegistry, _super);
|
|
334
|
+
function SchemaRegistry() {
|
|
335
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
336
|
+
}
|
|
337
|
+
/** Объявляет версионированную схему и регистрирует её во внутреннем `registry` */
|
|
338
|
+
SchemaRegistry.define = function (_a) {
|
|
339
|
+
var _b;
|
|
340
|
+
var key = _a.key, history = _a.history, latestVersion = _a.latestVersion;
|
|
341
|
+
var schema = VersionedSchemaFactory.build({
|
|
342
|
+
history: history,
|
|
343
|
+
latestVersion: latestVersion,
|
|
344
|
+
meta: (_b = {}, _b[this.typeKey] = key, _b),
|
|
345
|
+
});
|
|
346
|
+
this.registry.set(key, schema);
|
|
347
|
+
return schema;
|
|
348
|
+
};
|
|
349
|
+
return SchemaRegistry;
|
|
350
|
+
}(SchemaRegistryReader));
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Глобальный счетчик для генерации ID.
|
|
354
|
+
*
|
|
355
|
+
* @todo
|
|
356
|
+
* В будущем можно заменить единый счетчик на изолированные счетчики в разных контекстах.
|
|
357
|
+
*/
|
|
358
|
+
var id = 1;
|
|
359
|
+
var AutoIdentifiedArrayItemSchema = SchemaRegistry.define({
|
|
360
|
+
key: "AutoIdentifiedArrayItem",
|
|
361
|
+
latestVersion: "17",
|
|
362
|
+
history: {
|
|
363
|
+
"17": function (z) {
|
|
364
|
+
return z.object({
|
|
365
|
+
/**
|
|
366
|
+
* Идентификатор, добавляемый системой "на лету" для удобства разработки, не сохраняется на сервер.
|
|
367
|
+
* Гарантируется уникальность id в пределах settings виджета.
|
|
368
|
+
*/
|
|
369
|
+
id: z
|
|
370
|
+
.number()
|
|
371
|
+
.default(-1)
|
|
372
|
+
.transform(function (currentId) { return (currentId === -1 ? id++ : currentId); }),
|
|
373
|
+
});
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
});
|
|
377
|
+
var BaseWidgetSettingsSchema = SchemaRegistry.define({
|
|
378
|
+
key: "BaseWidgetSettings",
|
|
379
|
+
latestVersion: "17",
|
|
380
|
+
history: {
|
|
381
|
+
"17": function (z) {
|
|
382
|
+
return z.object({
|
|
383
|
+
title: z.string().default(""),
|
|
384
|
+
titleSize: themed(z.number().default(14), function (theme) { return theme.widgets.titleSize; }),
|
|
385
|
+
titleColor: themed(ColorSchema.forVersion("17")(z), function (theme) { return theme.widgets.titleColor; }),
|
|
386
|
+
titleWeight: themed(z.enum(EFontWeight).default(EFontWeight.NORMAL), function (theme) { return theme.widgets.titleWeight; }),
|
|
387
|
+
stateName: z.string().nullable().default(null),
|
|
388
|
+
showMarkdown: z.boolean().default(false),
|
|
389
|
+
markdownMeasures: z.array(MarkdownMeasureSchema.forVersion("17")(z)).default([]),
|
|
390
|
+
markdownText: z.string().default(""),
|
|
391
|
+
markdownTextSize: z.number().default(14),
|
|
392
|
+
filters: z.array(SettingsFilterSchema.forVersion("17")(z)).default([]),
|
|
393
|
+
filterMode: z.enum(EWidgetFilterMode).default(EWidgetFilterMode.DEFAULT),
|
|
394
|
+
ignoreFilters: z.boolean().default(false),
|
|
395
|
+
sorting: z.array(WidgetSortingIndicatorSchema.forVersion("17")(z)).default([]),
|
|
396
|
+
actionButtons: z.array(ActionButtonSchema.forVersion("17")(z)).default([]),
|
|
397
|
+
paddings: themed(z.union([z.number(), z.string()]).default(8), function (theme) { return theme.widgets.paddings; }),
|
|
398
|
+
viewTheme: z.boolean().default(false),
|
|
399
|
+
});
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
});
|
|
403
|
+
|
|
222
404
|
var EWidgetIndicatorType;
|
|
223
405
|
(function (EWidgetIndicatorType) {
|
|
224
406
|
EWidgetIndicatorType["MEASURE"] = "MEASURE";
|
|
@@ -358,35 +540,53 @@ var EHeightMode;
|
|
|
358
540
|
EHeightMode["PERCENT"] = "PERCENT";
|
|
359
541
|
})(EHeightMode || (EHeightMode = {}));
|
|
360
542
|
|
|
361
|
-
var SortDirectionSchema =
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
543
|
+
var SortDirectionSchema = SchemaRegistry.define({
|
|
544
|
+
key: "SortDirection",
|
|
545
|
+
latestVersion: "17",
|
|
546
|
+
history: {
|
|
547
|
+
"17": function (z) {
|
|
548
|
+
return z.union([z.literal(ESortDirection.ascend), z.literal(ESortDirection.descend)]);
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
});
|
|
552
|
+
var SortOrderSchema = SchemaRegistry.define({
|
|
553
|
+
key: "SortOrder",
|
|
554
|
+
latestVersion: "17",
|
|
555
|
+
history: {
|
|
556
|
+
"17": function (z) {
|
|
557
|
+
return z.object({
|
|
558
|
+
/** Формула сортировки */
|
|
559
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
560
|
+
/** Тип данных формулы */
|
|
561
|
+
dbDataType: z.string().optional(),
|
|
562
|
+
/** Направление сортировки */
|
|
563
|
+
direction: SortDirectionSchema.forVersion("17")(z),
|
|
564
|
+
/** Условие применения сортировки */
|
|
565
|
+
displayCondition: FormulaSchema.forVersion("17")(z).optional(),
|
|
566
|
+
});
|
|
567
|
+
},
|
|
568
|
+
},
|
|
569
|
+
});
|
|
570
|
+
var WidgetSortingValueSchema = SchemaRegistry.define({
|
|
571
|
+
key: "WidgetSortingValue",
|
|
572
|
+
latestVersion: "17",
|
|
573
|
+
history: {
|
|
574
|
+
"17": function (z) {
|
|
575
|
+
return z.discriminatedUnion("mode", [
|
|
576
|
+
z.object({
|
|
577
|
+
mode: z.literal(ESortingValueModes.FORMULA),
|
|
578
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
579
|
+
dbDataType: z.string().optional(),
|
|
580
|
+
}),
|
|
581
|
+
z.object({
|
|
582
|
+
mode: z.literal(ESortingValueModes.IN_WIDGET),
|
|
583
|
+
group: z.string(),
|
|
584
|
+
index: z.number(),
|
|
585
|
+
}),
|
|
586
|
+
]);
|
|
587
|
+
},
|
|
588
|
+
},
|
|
589
|
+
});
|
|
390
590
|
|
|
391
591
|
/** Ключи мета-данных внутри схем настроек */
|
|
392
592
|
var ESettingsSchemaMetaKey;
|
|
@@ -398,35 +598,59 @@ var ESettingsSchemaMetaKey;
|
|
|
398
598
|
})(ESettingsSchemaMetaKey || (ESettingsSchemaMetaKey = {}));
|
|
399
599
|
|
|
400
600
|
var _a$7;
|
|
401
|
-
var RangeSchema =
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
z
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
601
|
+
var RangeSchema = SchemaRegistry.define({
|
|
602
|
+
key: "Range",
|
|
603
|
+
latestVersion: "17",
|
|
604
|
+
history: {
|
|
605
|
+
"17": function (z) {
|
|
606
|
+
return z.object({
|
|
607
|
+
unit: z.string().optional(),
|
|
608
|
+
min: z.number().optional(),
|
|
609
|
+
max: z.number().optional(),
|
|
610
|
+
});
|
|
611
|
+
},
|
|
612
|
+
},
|
|
613
|
+
});
|
|
614
|
+
var DisplayConditionSchema = SchemaRegistry.define({
|
|
615
|
+
key: "DisplayCondition",
|
|
616
|
+
latestVersion: "17",
|
|
617
|
+
history: {
|
|
618
|
+
"17": function (z) {
|
|
619
|
+
return z
|
|
620
|
+
.discriminatedUnion("mode", [
|
|
621
|
+
z.object({
|
|
622
|
+
mode: z.literal(EDisplayConditionMode.DISABLED),
|
|
623
|
+
}),
|
|
624
|
+
z.object({
|
|
625
|
+
mode: z.literal(EDisplayConditionMode.FORMULA),
|
|
626
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
627
|
+
}),
|
|
628
|
+
z.object({
|
|
629
|
+
mode: z.literal(EDisplayConditionMode.VARIABLE),
|
|
630
|
+
variableName: NameNullableSchema.forVersion("17")(z),
|
|
631
|
+
variableValue: z.string().nullable().default(null),
|
|
632
|
+
}),
|
|
633
|
+
])
|
|
634
|
+
.default({ mode: EDisplayConditionMode.DISABLED });
|
|
635
|
+
},
|
|
636
|
+
},
|
|
637
|
+
});
|
|
426
638
|
/** Схема ключа сущности (с возможностью находиться в неинициализированном состоянии) */
|
|
427
|
-
var KeyNullableSchema =
|
|
639
|
+
var KeyNullableSchema = SchemaRegistry.define({
|
|
640
|
+
key: "KeyNullable",
|
|
641
|
+
latestVersion: "17",
|
|
642
|
+
history: {
|
|
643
|
+
"17": function (z) { return z.string().nullable().default(null); },
|
|
644
|
+
},
|
|
645
|
+
});
|
|
428
646
|
/** Схема имени сущности (с возможностью находиться в неинициализированном состоянии) */
|
|
429
|
-
var NameNullableSchema =
|
|
647
|
+
var NameNullableSchema = SchemaRegistry.define({
|
|
648
|
+
key: "NameNullable",
|
|
649
|
+
latestVersion: "17",
|
|
650
|
+
history: {
|
|
651
|
+
"17": function (z) { return z.string().nullable().default(null); },
|
|
652
|
+
},
|
|
653
|
+
});
|
|
430
654
|
/**
|
|
431
655
|
* Перечисление системных типов сущностей в схеме настроек виджетов.
|
|
432
656
|
* @note при расширении лучше положить на более общий уровень.
|
|
@@ -437,571 +661,929 @@ var EEntity;
|
|
|
437
661
|
})(EEntity || (EEntity = {}));
|
|
438
662
|
var formulaMeta = Object.freeze((_a$7 = {}, _a$7[ESettingsSchemaMetaKey.entity] = EEntity.formula, _a$7));
|
|
439
663
|
/** Схема формулы */
|
|
440
|
-
var FormulaSchema =
|
|
664
|
+
var FormulaSchema = SchemaRegistry.define({
|
|
665
|
+
key: "Formula",
|
|
666
|
+
latestVersion: "17",
|
|
667
|
+
history: {
|
|
668
|
+
"17": function (z) { return z.string().default("").meta(formulaMeta); },
|
|
669
|
+
},
|
|
670
|
+
});
|
|
441
671
|
/**
|
|
442
672
|
* Схема формулы, которая не может быть пустой строкой, но может быть в
|
|
443
673
|
* неинициализированном состоянии null (вместо пустой строки)
|
|
444
674
|
*
|
|
445
675
|
* @note для обратной совместимости без необходимости писать миграции
|
|
446
676
|
*/
|
|
447
|
-
var FormulaNullableSchema =
|
|
448
|
-
|
|
449
|
-
|
|
677
|
+
var FormulaNullableSchema = SchemaRegistry.define({
|
|
678
|
+
key: "FormulaNullable",
|
|
679
|
+
latestVersion: "17",
|
|
680
|
+
history: {
|
|
681
|
+
"17": function (z) { return z.string().nullable().default(null).meta(formulaMeta); },
|
|
682
|
+
},
|
|
683
|
+
});
|
|
450
684
|
|
|
451
|
-
var WidgetIndicatorSchema =
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
};
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
};
|
|
529
|
-
var
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
685
|
+
var WidgetIndicatorSchema = SchemaRegistry.define({
|
|
686
|
+
key: "WidgetIndicator",
|
|
687
|
+
latestVersion: "17",
|
|
688
|
+
history: {
|
|
689
|
+
"17": function (z) {
|
|
690
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
691
|
+
name: z.string(),
|
|
692
|
+
});
|
|
693
|
+
},
|
|
694
|
+
},
|
|
695
|
+
});
|
|
696
|
+
var FormatSchema = SchemaRegistry.define({
|
|
697
|
+
key: "Format",
|
|
698
|
+
latestVersion: "17",
|
|
699
|
+
history: {
|
|
700
|
+
"17": function (z) {
|
|
701
|
+
return z
|
|
702
|
+
.discriminatedUnion("mode", [
|
|
703
|
+
z.object({
|
|
704
|
+
mode: z.literal(EFormatOrFormattingMode.BASE),
|
|
705
|
+
value: z.enum(EFormatTypes).default(EFormatTypes.STRING).optional(),
|
|
706
|
+
}),
|
|
707
|
+
z.object({
|
|
708
|
+
mode: z.literal(EFormatOrFormattingMode.TEMPLATE),
|
|
709
|
+
value: z.string().default("").optional(),
|
|
710
|
+
}),
|
|
711
|
+
])
|
|
712
|
+
.default({ mode: EFormatOrFormattingMode.BASE, value: EFormatTypes.STRING });
|
|
713
|
+
},
|
|
714
|
+
},
|
|
715
|
+
});
|
|
716
|
+
var FormattingSchema = SchemaRegistry.define({
|
|
717
|
+
key: "Formatting",
|
|
718
|
+
latestVersion: "17",
|
|
719
|
+
history: {
|
|
720
|
+
"17": function (z) {
|
|
721
|
+
return z
|
|
722
|
+
.discriminatedUnion("mode", [
|
|
723
|
+
z.object({
|
|
724
|
+
mode: z.literal(EFormatOrFormattingMode.BASE),
|
|
725
|
+
value: z.enum(EFormattingPresets).default(EFormattingPresets.AUTO),
|
|
726
|
+
}),
|
|
727
|
+
z.object({
|
|
728
|
+
mode: z.literal(EFormatOrFormattingMode.TEMPLATE),
|
|
729
|
+
value: z.string().default(""),
|
|
730
|
+
}),
|
|
731
|
+
])
|
|
732
|
+
.default({ mode: EFormatOrFormattingMode.BASE, value: EFormattingPresets.AUTO });
|
|
733
|
+
},
|
|
734
|
+
},
|
|
735
|
+
});
|
|
736
|
+
var WidgetColumnIndicatorSchema = SchemaRegistry.define({
|
|
737
|
+
key: "WidgetColumnIndicator",
|
|
738
|
+
latestVersion: "17",
|
|
739
|
+
history: {
|
|
740
|
+
"17": function (z) {
|
|
741
|
+
return WidgetIndicatorSchema.forVersion("17")(z).extend({
|
|
742
|
+
dbDataType: z.string().optional(),
|
|
743
|
+
format: FormatSchema.forVersion("17")(z).optional(),
|
|
744
|
+
formatting: FormattingSchema.forVersion("17")(z).optional(),
|
|
745
|
+
displayCondition: DisplayConditionSchema.forVersion("17")(z),
|
|
746
|
+
onClick: z.array(ActionsOnClickSchema.forVersion("17")(z)).default([]).optional(),
|
|
747
|
+
});
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
});
|
|
751
|
+
var WidgetIndicatorFormulaValueSchema = SchemaRegistry.define({
|
|
752
|
+
key: "WidgetIndicatorFormulaValue",
|
|
753
|
+
latestVersion: "17",
|
|
754
|
+
history: {
|
|
755
|
+
"17": function (z) {
|
|
756
|
+
return z.object({
|
|
757
|
+
mode: z.literal(EWidgetIndicatorValueModes.FORMULA),
|
|
758
|
+
formula: FormulaSchema.forVersion("17")(z).optional(),
|
|
759
|
+
});
|
|
760
|
+
},
|
|
761
|
+
},
|
|
762
|
+
});
|
|
763
|
+
var WidgetIndicatorTemplateValueSchema = SchemaRegistry.define({
|
|
764
|
+
key: "WidgetIndicatorTemplateValue",
|
|
765
|
+
latestVersion: "17",
|
|
766
|
+
history: {
|
|
767
|
+
"17": function (z) {
|
|
768
|
+
return z.object({
|
|
769
|
+
mode: z.literal(EWidgetIndicatorValueModes.TEMPLATE),
|
|
770
|
+
/** Имя шаблонной формулы, использующей колонку таблицы */
|
|
771
|
+
templateName: z.string().optional(),
|
|
772
|
+
/** Имя таблицы */
|
|
773
|
+
tableName: z.string().optional(),
|
|
774
|
+
/** Имя колонки */
|
|
775
|
+
columnName: z.string().optional(),
|
|
776
|
+
});
|
|
777
|
+
},
|
|
778
|
+
},
|
|
779
|
+
});
|
|
780
|
+
var ColumnIndicatorValueSchema = SchemaRegistry.define({
|
|
781
|
+
key: "ColumnIndicatorValue",
|
|
782
|
+
latestVersion: "17",
|
|
783
|
+
history: {
|
|
784
|
+
"17": function (z) {
|
|
785
|
+
return z.union([MeasureValueSchema.forVersion("17")(z), DimensionValueSchema.forVersion("17")(z)]);
|
|
786
|
+
},
|
|
787
|
+
},
|
|
788
|
+
});
|
|
789
|
+
var MeasureValueSchema = SchemaRegistry.define({
|
|
790
|
+
key: "MeasureValue",
|
|
791
|
+
latestVersion: "17",
|
|
792
|
+
history: {
|
|
793
|
+
"17": function (z) {
|
|
794
|
+
return z.discriminatedUnion("mode", [
|
|
795
|
+
WidgetIndicatorFormulaValueSchema.forVersion("17")(z),
|
|
796
|
+
WidgetIndicatorTemplateValueSchema.forVersion("17")(z).extend({
|
|
797
|
+
innerTemplateName: z.enum(EMeasureInnerTemplateNames).optional(),
|
|
798
|
+
}),
|
|
799
|
+
]);
|
|
800
|
+
},
|
|
801
|
+
},
|
|
802
|
+
});
|
|
803
|
+
var DimensionValueSchema = SchemaRegistry.define({
|
|
804
|
+
key: "DimensionValue",
|
|
805
|
+
latestVersion: "17",
|
|
806
|
+
history: {
|
|
807
|
+
"17": function (z) {
|
|
808
|
+
return z.discriminatedUnion("mode", [
|
|
809
|
+
WidgetIndicatorFormulaValueSchema.forVersion("17")(z),
|
|
810
|
+
WidgetIndicatorTemplateValueSchema.forVersion("17")(z).extend({
|
|
811
|
+
innerTemplateName: z.never().optional(),
|
|
812
|
+
}),
|
|
813
|
+
]);
|
|
814
|
+
},
|
|
815
|
+
},
|
|
816
|
+
});
|
|
817
|
+
var WidgetIndicatorAggregationValueSchema = SchemaRegistry.define({
|
|
818
|
+
key: "WidgetIndicatorAggregationValue",
|
|
819
|
+
latestVersion: "17",
|
|
820
|
+
history: {
|
|
821
|
+
"17": function (z) {
|
|
822
|
+
return z.object({
|
|
823
|
+
mode: z.literal(EWidgetIndicatorValueModes.AGGREGATION),
|
|
824
|
+
templateName: z.string(),
|
|
825
|
+
processKey: KeyNullableSchema.forVersion("17")(z),
|
|
826
|
+
eventName: NameNullableSchema.forVersion("17")(z),
|
|
827
|
+
eventNameFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
828
|
+
anyEvent: z.literal(true).optional(),
|
|
829
|
+
caseCaseIdFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
830
|
+
filters: z.array(ExtendedFormulaFilterValueSchema.forVersion("17")(z)).default([]),
|
|
831
|
+
tableName: z.string().optional(),
|
|
832
|
+
columnName: z.string().optional(),
|
|
833
|
+
eventTimeFormula: FormulaNullableSchema.forVersion("17")(z).optional(),
|
|
569
834
|
innerTemplateName: z.string().optional(),
|
|
570
|
-
})
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
var WidgetDimensionHierarchySchema = function (z, dimensionSchema) {
|
|
581
|
-
return AutoIdentifiedArrayItemSchema(z).extend({
|
|
582
|
-
name: z.string(),
|
|
583
|
-
// Для иерархии является дискриминатором, для него нельзя задавать дефолтное значение.
|
|
584
|
-
hierarchyDimensions: z.array(dimensionSchema),
|
|
585
|
-
displayCondition: DisplayConditionSchema(z),
|
|
586
|
-
});
|
|
587
|
-
};
|
|
588
|
-
var WidgetIndicatorConversionValueSchema = function (z) {
|
|
589
|
-
return z.object({
|
|
590
|
-
mode: z.literal(EWidgetIndicatorValueModes.CONVERSION),
|
|
591
|
-
startEventNameFormula: FormulaNullableSchema(z),
|
|
592
|
-
startEventProcessKey: KeyNullableSchema(z),
|
|
593
|
-
startEventName: NameNullableSchema(z),
|
|
594
|
-
startEventFilters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
595
|
-
startEventTimeFormula: FormulaNullableSchema(z),
|
|
596
|
-
endEventNameFormula: FormulaNullableSchema(z),
|
|
597
|
-
endEventProcessKey: KeyNullableSchema(z),
|
|
598
|
-
endEventName: NameNullableSchema(z),
|
|
599
|
-
endEventFilters: z.array(ExtendedFormulaFilterValueSchema(z)).default([]),
|
|
600
|
-
endCaseCaseIdFormula: FormulaNullableSchema(z),
|
|
601
|
-
endEventTimeFormula: FormulaNullableSchema(z),
|
|
602
|
-
});
|
|
603
|
-
};
|
|
604
|
-
var WidgetIndicatorDurationValueSchema = function (z) {
|
|
605
|
-
return WidgetIndicatorConversionValueSchema(z).extend({
|
|
606
|
-
mode: z.literal(EWidgetIndicatorValueModes.DURATION),
|
|
607
|
-
templateName: z.string(),
|
|
608
|
-
startEventAppearances: z.enum(EEventAppearances),
|
|
609
|
-
endEventAppearances: z.enum(EEventAppearances),
|
|
610
|
-
});
|
|
611
|
-
};
|
|
612
|
-
var WidgetMeasureSchema = function (z) {
|
|
613
|
-
return WidgetColumnIndicatorSchema(z).extend({
|
|
614
|
-
value: z
|
|
615
|
-
.discriminatedUnion("mode", [
|
|
616
|
-
MeasureValueSchema(z),
|
|
617
|
-
WidgetMeasureAggregationValueSchema(z),
|
|
618
|
-
WidgetIndicatorConversionValueSchema(z),
|
|
619
|
-
WidgetIndicatorDurationValueSchema(z),
|
|
620
|
-
])
|
|
621
|
-
.optional(),
|
|
622
|
-
});
|
|
623
|
-
};
|
|
624
|
-
var MarkdownMeasureSchema = function (z) {
|
|
625
|
-
return WidgetMeasureSchema(z).extend({
|
|
626
|
-
displaySign: z.enum(EMarkdownDisplayMode).default(EMarkdownDisplayMode.NONE),
|
|
627
|
-
});
|
|
628
|
-
};
|
|
629
|
-
var WidgetSortingIndicatorSchema = function (z) {
|
|
630
|
-
return WidgetIndicatorSchema(z).extend({
|
|
631
|
-
direction: SortDirectionSchema(z),
|
|
632
|
-
value: WidgetSortingValueSchema(z),
|
|
633
|
-
});
|
|
634
|
-
};
|
|
635
|
-
var ProcessIndicatorValueSchema = function (z) {
|
|
636
|
-
return z.discriminatedUnion("mode", [
|
|
637
|
-
z.object({
|
|
638
|
-
mode: z.literal(EWidgetIndicatorValueModes.FORMULA),
|
|
639
|
-
formula: FormulaSchema(z),
|
|
640
|
-
}),
|
|
641
|
-
z.object({
|
|
642
|
-
mode: z.literal(EWidgetIndicatorValueModes.TEMPLATE),
|
|
643
|
-
/** Имя шаблонной формулы, использующей колонку таблицы */
|
|
644
|
-
templateName: z.string(),
|
|
645
|
-
}),
|
|
646
|
-
]);
|
|
647
|
-
};
|
|
648
|
-
var ProcessIndicatorSchema = function (z) {
|
|
649
|
-
return WidgetIndicatorSchema(z).extend({
|
|
650
|
-
value: ProcessIndicatorValueSchema(z).optional(),
|
|
651
|
-
dbDataType: z.string().optional(),
|
|
652
|
-
format: FormatSchema(z).optional(),
|
|
653
|
-
formatting: FormattingSchema(z).optional(),
|
|
654
|
-
displayCondition: DisplayConditionSchema(z),
|
|
655
|
-
});
|
|
656
|
-
};
|
|
657
|
-
|
|
658
|
-
var FormulaFilterValueSchema = function (z) {
|
|
659
|
-
var _a;
|
|
660
|
-
return z.object({
|
|
661
|
-
name: z.string().nullish(),
|
|
662
|
-
formula: z.string(),
|
|
663
|
-
sliceIndex: z.number().optional(),
|
|
664
|
-
dbDataType: z.string(),
|
|
665
|
-
format: z.union([z.enum(EFormatTypes), z.string()]).optional(),
|
|
666
|
-
filteringMethod: z.enum(Object.values(formulaFilterMethods)),
|
|
667
|
-
checkedValues: z.array(z.string().nullable()).optional(),
|
|
668
|
-
formValues: z
|
|
669
|
-
.object((_a = {},
|
|
670
|
-
_a[EFormulaFilterFieldKeys.date] = z.string().nullable(),
|
|
671
|
-
_a[EFormulaFilterFieldKeys.dateRange] = z.tuple([z.string(), z.string()]),
|
|
672
|
-
_a[EFormulaFilterFieldKeys.numberRange] = z.tuple([
|
|
673
|
-
z.number().nullable(),
|
|
674
|
-
z.number().nullable(),
|
|
675
|
-
]),
|
|
676
|
-
_a[EFormulaFilterFieldKeys.string] = z.string(),
|
|
677
|
-
// todo: отказаться от использования z.string(), оставить только z.number() [BI-15912]
|
|
678
|
-
_a[EFormulaFilterFieldKeys.lastTimeValue] = z.number().or(z.string()),
|
|
679
|
-
_a[EFormulaFilterFieldKeys.lastTimeUnit] = z.enum(ELastTimeUnit),
|
|
680
|
-
_a[EFormulaFilterFieldKeys.durationUnit] = z.enum(EDurationUnit),
|
|
681
|
-
_a))
|
|
682
|
-
.partial()
|
|
683
|
-
.optional(),
|
|
684
|
-
});
|
|
685
|
-
};
|
|
686
|
-
var ExtendedFormulaFilterValueSchema = function (z) {
|
|
687
|
-
return z.union([FormulaFilterValueSchema(z), z.object({ formula: z.string() })]);
|
|
688
|
-
};
|
|
689
|
-
var DimensionProcessFilterSchema = function (z) {
|
|
690
|
-
return z.object({
|
|
691
|
-
value: z.union([
|
|
692
|
-
WidgetIndicatorAggregationValueSchema(z).extend({
|
|
835
|
+
});
|
|
836
|
+
},
|
|
837
|
+
},
|
|
838
|
+
});
|
|
839
|
+
var WidgetMeasureAggregationValueSchema = SchemaRegistry.define({
|
|
840
|
+
key: "WidgetMeasureAggregationValue",
|
|
841
|
+
latestVersion: "17",
|
|
842
|
+
history: {
|
|
843
|
+
"17": function (z) {
|
|
844
|
+
return WidgetIndicatorAggregationValueSchema.forVersion("17")(z).extend({
|
|
693
845
|
outerAggregation: z.enum(EOuterAggregation),
|
|
694
|
-
})
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
846
|
+
});
|
|
847
|
+
},
|
|
848
|
+
},
|
|
849
|
+
});
|
|
850
|
+
var WidgetIndicatorTimeValueSchema = SchemaRegistry.define({
|
|
851
|
+
key: "WidgetIndicatorTimeValue",
|
|
852
|
+
latestVersion: "17",
|
|
853
|
+
history: {
|
|
854
|
+
"17": function (z) {
|
|
855
|
+
return z.object({
|
|
856
|
+
templateName: z.string(),
|
|
857
|
+
mode: z.union([
|
|
858
|
+
z.literal(EWidgetIndicatorValueModes.START_TIME),
|
|
859
|
+
z.literal(EWidgetIndicatorValueModes.END_TIME),
|
|
860
|
+
]),
|
|
861
|
+
processKey: KeyNullableSchema.forVersion("17")(z),
|
|
862
|
+
eventName: NameNullableSchema.forVersion("17")(z),
|
|
863
|
+
eventTimeFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
864
|
+
caseCaseIdFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
865
|
+
eventNameFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
866
|
+
filters: z.array(ExtendedFormulaFilterValueSchema.forVersion("17")(z)).default([]),
|
|
867
|
+
});
|
|
868
|
+
},
|
|
869
|
+
},
|
|
870
|
+
});
|
|
871
|
+
var WidgetDimensionSchema = SchemaRegistry.define({
|
|
872
|
+
key: "WidgetDimension",
|
|
873
|
+
latestVersion: "17",
|
|
874
|
+
history: {
|
|
875
|
+
"17": function (z) {
|
|
876
|
+
return WidgetColumnIndicatorSchema.forVersion("17")(z).extend({
|
|
877
|
+
value: z
|
|
878
|
+
.discriminatedUnion("mode", [
|
|
879
|
+
DimensionValueSchema.forVersion("17")(z),
|
|
880
|
+
WidgetIndicatorAggregationValueSchema.forVersion("17")(z).extend({
|
|
881
|
+
innerTemplateName: z.string().optional(),
|
|
882
|
+
}),
|
|
883
|
+
WidgetIndicatorTimeValueSchema.forVersion("17")(z),
|
|
884
|
+
])
|
|
885
|
+
.optional(),
|
|
886
|
+
hideEmptyValues: z.boolean().default(false),
|
|
887
|
+
});
|
|
888
|
+
},
|
|
889
|
+
},
|
|
890
|
+
});
|
|
891
|
+
var WidgetDimensionInHierarchySchema = SchemaRegistry.define({
|
|
892
|
+
key: "WidgetDimensionInHierarchy",
|
|
893
|
+
latestVersion: "17",
|
|
894
|
+
history: {
|
|
895
|
+
"17": function (z) { return WidgetDimensionSchema.forVersion("17")(z).omit({ displayCondition: true }); },
|
|
896
|
+
},
|
|
897
|
+
});
|
|
898
|
+
var WidgetDimensionHierarchySchema = SchemaRegistry.define({
|
|
899
|
+
key: "WidgetDimensionHierarchy",
|
|
900
|
+
latestVersion: "17",
|
|
901
|
+
history: {
|
|
902
|
+
"17": function (z, dimensionSchema) {
|
|
903
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
904
|
+
name: z.string(),
|
|
905
|
+
// Для иерархии является дискриминатором, для него нельзя задавать дефолтное значение.
|
|
906
|
+
hierarchyDimensions: z.array(dimensionSchema),
|
|
907
|
+
displayCondition: DisplayConditionSchema.forVersion("17")(z),
|
|
908
|
+
});
|
|
909
|
+
},
|
|
910
|
+
},
|
|
911
|
+
});
|
|
912
|
+
var WidgetIndicatorConversionValueSchema = SchemaRegistry.define({
|
|
913
|
+
key: "WidgetIndicatorConversionValue",
|
|
914
|
+
latestVersion: "17",
|
|
915
|
+
history: {
|
|
916
|
+
"17": function (z) {
|
|
917
|
+
return z.object({
|
|
918
|
+
mode: z.literal(EWidgetIndicatorValueModes.CONVERSION),
|
|
919
|
+
startEventNameFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
920
|
+
startEventProcessKey: KeyNullableSchema.forVersion("17")(z),
|
|
921
|
+
startEventName: NameNullableSchema.forVersion("17")(z),
|
|
922
|
+
startEventFilters: z
|
|
923
|
+
.array(ExtendedFormulaFilterValueSchema.forVersion("17")(z))
|
|
924
|
+
.default([]),
|
|
925
|
+
startEventTimeFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
926
|
+
endEventNameFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
927
|
+
endEventProcessKey: KeyNullableSchema.forVersion("17")(z),
|
|
928
|
+
endEventName: NameNullableSchema.forVersion("17")(z),
|
|
929
|
+
endEventFilters: z.array(ExtendedFormulaFilterValueSchema.forVersion("17")(z)).default([]),
|
|
930
|
+
endCaseCaseIdFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
931
|
+
endEventTimeFormula: FormulaNullableSchema.forVersion("17")(z),
|
|
932
|
+
});
|
|
933
|
+
},
|
|
934
|
+
},
|
|
935
|
+
});
|
|
936
|
+
var WidgetIndicatorDurationValueSchema = SchemaRegistry.define({
|
|
937
|
+
key: "WidgetIndicatorDurationValue",
|
|
938
|
+
latestVersion: "17",
|
|
939
|
+
history: {
|
|
940
|
+
"17": function (z) {
|
|
941
|
+
return WidgetIndicatorConversionValueSchema.forVersion("17")(z).extend({
|
|
942
|
+
mode: z.literal(EWidgetIndicatorValueModes.DURATION),
|
|
943
|
+
templateName: z.string(),
|
|
944
|
+
startEventAppearances: z.enum(EEventAppearances),
|
|
945
|
+
endEventAppearances: z.enum(EEventAppearances),
|
|
946
|
+
});
|
|
947
|
+
},
|
|
948
|
+
},
|
|
949
|
+
});
|
|
950
|
+
var WidgetMeasureSchema = SchemaRegistry.define({
|
|
951
|
+
key: "WidgetMeasure",
|
|
952
|
+
latestVersion: "17",
|
|
953
|
+
history: {
|
|
954
|
+
"17": function (z) {
|
|
955
|
+
return WidgetColumnIndicatorSchema.forVersion("17")(z).extend({
|
|
956
|
+
value: z
|
|
957
|
+
.discriminatedUnion("mode", [
|
|
958
|
+
MeasureValueSchema.forVersion("17")(z),
|
|
959
|
+
WidgetMeasureAggregationValueSchema.forVersion("17")(z),
|
|
960
|
+
WidgetIndicatorConversionValueSchema.forVersion("17")(z),
|
|
961
|
+
WidgetIndicatorDurationValueSchema.forVersion("17")(z),
|
|
962
|
+
])
|
|
963
|
+
.optional(),
|
|
964
|
+
});
|
|
965
|
+
},
|
|
966
|
+
},
|
|
967
|
+
});
|
|
968
|
+
var MarkdownMeasureSchema = SchemaRegistry.define({
|
|
969
|
+
key: "MarkdownMeasure",
|
|
970
|
+
latestVersion: "17",
|
|
971
|
+
history: {
|
|
972
|
+
"17": function (z) {
|
|
973
|
+
return WidgetMeasureSchema.forVersion("17")(z).extend({
|
|
974
|
+
displaySign: z.enum(EMarkdownDisplayMode).default(EMarkdownDisplayMode.NONE),
|
|
975
|
+
});
|
|
976
|
+
},
|
|
977
|
+
},
|
|
978
|
+
});
|
|
979
|
+
var WidgetSortingIndicatorSchema = SchemaRegistry.define({
|
|
980
|
+
key: "WidgetSortingIndicator",
|
|
981
|
+
latestVersion: "17",
|
|
982
|
+
history: {
|
|
983
|
+
"17": function (z) {
|
|
984
|
+
return WidgetIndicatorSchema.forVersion("17")(z).extend({
|
|
985
|
+
direction: SortDirectionSchema.forVersion("17")(z),
|
|
986
|
+
value: WidgetSortingValueSchema.forVersion("17")(z),
|
|
987
|
+
});
|
|
988
|
+
},
|
|
989
|
+
},
|
|
990
|
+
});
|
|
991
|
+
var ProcessIndicatorValueSchema = SchemaRegistry.define({
|
|
992
|
+
key: "ProcessIndicatorValue",
|
|
993
|
+
latestVersion: "17",
|
|
994
|
+
history: {
|
|
995
|
+
"17": function (z) {
|
|
996
|
+
return z.discriminatedUnion("mode", [
|
|
997
|
+
z.object({
|
|
998
|
+
mode: z.literal(EWidgetIndicatorValueModes.FORMULA),
|
|
999
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
1000
|
+
}),
|
|
1001
|
+
z.object({
|
|
1002
|
+
mode: z.literal(EWidgetIndicatorValueModes.TEMPLATE),
|
|
1003
|
+
/** Имя шаблонной формулы, использующей колонку таблицы */
|
|
1004
|
+
templateName: z.string(),
|
|
1005
|
+
}),
|
|
1006
|
+
]);
|
|
1007
|
+
},
|
|
1008
|
+
},
|
|
1009
|
+
});
|
|
1010
|
+
var ProcessIndicatorSchema = SchemaRegistry.define({
|
|
1011
|
+
key: "ProcessIndicator",
|
|
1012
|
+
latestVersion: "17",
|
|
1013
|
+
history: {
|
|
1014
|
+
"17": function (z) {
|
|
1015
|
+
return WidgetIndicatorSchema.forVersion("17")(z).extend({
|
|
1016
|
+
value: ProcessIndicatorValueSchema.forVersion("17")(z).optional(),
|
|
1017
|
+
dbDataType: z.string().optional(),
|
|
1018
|
+
format: FormatSchema.forVersion("17")(z).optional(),
|
|
1019
|
+
formatting: FormattingSchema.forVersion("17")(z).optional(),
|
|
1020
|
+
displayCondition: DisplayConditionSchema.forVersion("17")(z),
|
|
1021
|
+
});
|
|
1022
|
+
},
|
|
1023
|
+
},
|
|
1024
|
+
});
|
|
715
1025
|
|
|
716
|
-
var
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
var
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
};
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
}
|
|
802
|
-
};
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
};
|
|
829
|
-
var
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
};
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
}
|
|
1026
|
+
var FormulaFilterValueSchema = SchemaRegistry.define({
|
|
1027
|
+
key: "FormulaFilterValue",
|
|
1028
|
+
latestVersion: "17",
|
|
1029
|
+
history: {
|
|
1030
|
+
"17": function (z) {
|
|
1031
|
+
var _a;
|
|
1032
|
+
return z.object({
|
|
1033
|
+
name: z.string().nullish(),
|
|
1034
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
1035
|
+
sliceIndex: z.number().optional(),
|
|
1036
|
+
dbDataType: z.string(),
|
|
1037
|
+
format: z.union([z.enum(EFormatTypes), z.string()]).optional(),
|
|
1038
|
+
filteringMethod: z.enum(Object.values(formulaFilterMethods)),
|
|
1039
|
+
checkedValues: z.array(z.string().nullable()).default([]).optional(),
|
|
1040
|
+
formValues: z
|
|
1041
|
+
.object((_a = {},
|
|
1042
|
+
_a[EFormulaFilterFieldKeys.date] = z.string().nullable(),
|
|
1043
|
+
_a[EFormulaFilterFieldKeys.dateRange] = z.tuple([z.string(), z.string()]),
|
|
1044
|
+
_a[EFormulaFilterFieldKeys.numberRange] = z.tuple([
|
|
1045
|
+
z.number().nullable(),
|
|
1046
|
+
z.number().nullable(),
|
|
1047
|
+
]),
|
|
1048
|
+
_a[EFormulaFilterFieldKeys.string] = z.string(),
|
|
1049
|
+
// todo: отказаться от использования z.string(), оставить только z.number() [BI-15912]
|
|
1050
|
+
_a[EFormulaFilterFieldKeys.lastTimeValue] = z.number().or(z.string()),
|
|
1051
|
+
_a[EFormulaFilterFieldKeys.lastTimeUnit] = z.enum(ELastTimeUnit),
|
|
1052
|
+
_a[EFormulaFilterFieldKeys.durationUnit] = z.enum(EDurationUnit),
|
|
1053
|
+
_a))
|
|
1054
|
+
.partial()
|
|
1055
|
+
.optional(),
|
|
1056
|
+
});
|
|
1057
|
+
},
|
|
1058
|
+
},
|
|
1059
|
+
});
|
|
1060
|
+
var ExtendedFormulaFilterValueSchema = SchemaRegistry.define({
|
|
1061
|
+
key: "ExtendedFormulaFilterValue",
|
|
1062
|
+
latestVersion: "17",
|
|
1063
|
+
history: {
|
|
1064
|
+
"17": function (z) {
|
|
1065
|
+
return z.union([
|
|
1066
|
+
FormulaFilterValueSchema.forVersion("17")(z),
|
|
1067
|
+
z.object({ formula: FormulaSchema.forVersion("17")(z) }),
|
|
1068
|
+
]);
|
|
1069
|
+
},
|
|
1070
|
+
},
|
|
1071
|
+
});
|
|
1072
|
+
var DimensionProcessFilterSchema = SchemaRegistry.define({
|
|
1073
|
+
key: "DimensionProcessFilter",
|
|
1074
|
+
latestVersion: "17",
|
|
1075
|
+
history: {
|
|
1076
|
+
"17": function (z) {
|
|
1077
|
+
return z.object({
|
|
1078
|
+
value: z.union([
|
|
1079
|
+
WidgetIndicatorAggregationValueSchema.forVersion("17")(z).extend({
|
|
1080
|
+
outerAggregation: z.enum(EOuterAggregation),
|
|
1081
|
+
}),
|
|
1082
|
+
WidgetIndicatorAggregationValueSchema.forVersion("17")(z).extend({
|
|
1083
|
+
innerTemplateName: z.string().optional(),
|
|
1084
|
+
}),
|
|
1085
|
+
WidgetIndicatorTimeValueSchema.forVersion("17")(z),
|
|
1086
|
+
z.object({
|
|
1087
|
+
mode: z.literal(EWidgetIndicatorValueModes.FORMULA),
|
|
1088
|
+
formula: FormulaSchema.forVersion("17")(z).optional(),
|
|
1089
|
+
}),
|
|
1090
|
+
]),
|
|
1091
|
+
dbDataType: z.string(),
|
|
1092
|
+
condition: z.object({
|
|
1093
|
+
filteringMethod: z.enum(Object.values(formulaFilterMethods)),
|
|
1094
|
+
timeUnit: z.enum(EDimensionProcessFilterTimeUnit).optional(),
|
|
1095
|
+
values: z.array(z.string().nullable()),
|
|
1096
|
+
}),
|
|
1097
|
+
});
|
|
1098
|
+
},
|
|
1099
|
+
},
|
|
1100
|
+
});
|
|
1101
|
+
var SettingsFilterSchema = SchemaRegistry.define({
|
|
1102
|
+
key: "SettingsFilter",
|
|
1103
|
+
latestVersion: "17",
|
|
1104
|
+
history: {
|
|
1105
|
+
"17": function (z) {
|
|
1106
|
+
return z.union([
|
|
1107
|
+
ExtendedFormulaFilterValueSchema.forVersion("17")(z),
|
|
1108
|
+
DimensionProcessFilterSchema.forVersion("17")(z),
|
|
1109
|
+
]);
|
|
1110
|
+
},
|
|
1111
|
+
},
|
|
1112
|
+
});
|
|
1113
|
+
|
|
1114
|
+
var ActionOnClickParameterCommonSchema = SchemaRegistry.define({
|
|
1115
|
+
key: "ActionOnClickParameterCommon",
|
|
1116
|
+
latestVersion: "17",
|
|
1117
|
+
history: {
|
|
1118
|
+
"17": function (z) {
|
|
1119
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
1120
|
+
name: z.string(),
|
|
1121
|
+
});
|
|
1122
|
+
},
|
|
1123
|
+
},
|
|
1124
|
+
});
|
|
1125
|
+
var ParameterFromColumnSchema = SchemaRegistry.define({
|
|
1126
|
+
key: "ParameterFromColumn",
|
|
1127
|
+
latestVersion: "17",
|
|
1128
|
+
history: {
|
|
1129
|
+
"17": function (z) {
|
|
1130
|
+
return z.object({
|
|
1131
|
+
inputMethod: z.literal(EWidgetActionInputMethod.COLUMN),
|
|
1132
|
+
tableName: z.string().nullable().default(null),
|
|
1133
|
+
columnName: z.string().nullable().default(null),
|
|
1134
|
+
dbDataType: z.string().optional(),
|
|
1135
|
+
});
|
|
1136
|
+
},
|
|
1137
|
+
},
|
|
1138
|
+
});
|
|
1139
|
+
var ParameterFromVariableSchema = SchemaRegistry.define({
|
|
1140
|
+
key: "ParameterFromVariable",
|
|
1141
|
+
latestVersion: "17",
|
|
1142
|
+
history: {
|
|
1143
|
+
"17": function (z) {
|
|
1144
|
+
return z.object({
|
|
1145
|
+
inputMethod: z.literal(EWidgetActionInputMethod.VARIABLE),
|
|
1146
|
+
sourceVariable: z.string().nullable().default(null),
|
|
1147
|
+
});
|
|
1148
|
+
},
|
|
1149
|
+
},
|
|
1150
|
+
});
|
|
1151
|
+
var ParameterFromFormulaSchema = SchemaRegistry.define({
|
|
1152
|
+
key: "ParameterFromFormula",
|
|
1153
|
+
latestVersion: "17",
|
|
1154
|
+
history: {
|
|
1155
|
+
"17": function (z) {
|
|
1156
|
+
return z.object({
|
|
1157
|
+
inputMethod: z.literal(EWidgetActionInputMethod.FORMULA),
|
|
1158
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
1159
|
+
considerFilters: z.boolean().default(false),
|
|
1160
|
+
dbDataType: z.string().optional(),
|
|
1161
|
+
});
|
|
1162
|
+
},
|
|
1163
|
+
},
|
|
1164
|
+
});
|
|
1165
|
+
var ParameterFromEventSchema = SchemaRegistry.define({
|
|
1166
|
+
key: "ParameterFromEvent",
|
|
1167
|
+
latestVersion: "17",
|
|
1168
|
+
history: {
|
|
1169
|
+
"17": function (z) {
|
|
1170
|
+
return z.object({
|
|
1171
|
+
inputMethod: z.literal(EWidgetActionInputMethod.EVENT),
|
|
1172
|
+
});
|
|
1173
|
+
},
|
|
1174
|
+
},
|
|
1175
|
+
});
|
|
1176
|
+
var ParameterFromStartEventSchema = SchemaRegistry.define({
|
|
1177
|
+
key: "ParameterFromStartEvent",
|
|
1178
|
+
latestVersion: "17",
|
|
1179
|
+
history: {
|
|
1180
|
+
"17": function (z) {
|
|
1181
|
+
return z.object({
|
|
1182
|
+
inputMethod: z.literal(EWidgetActionInputMethod.START_EVENT),
|
|
1183
|
+
});
|
|
1184
|
+
},
|
|
1185
|
+
},
|
|
1186
|
+
});
|
|
1187
|
+
var ParameterFromEndEventSchema = SchemaRegistry.define({
|
|
1188
|
+
key: "ParameterFromEndEvent",
|
|
1189
|
+
latestVersion: "17",
|
|
1190
|
+
history: {
|
|
1191
|
+
"17": function (z) {
|
|
1192
|
+
return z.object({
|
|
1193
|
+
inputMethod: z.literal(EWidgetActionInputMethod.FINISH_EVENT),
|
|
1194
|
+
});
|
|
1195
|
+
},
|
|
1196
|
+
},
|
|
1197
|
+
});
|
|
1198
|
+
var ParameterFromAggregationSchema = SchemaRegistry.define({
|
|
1199
|
+
key: "ParameterFromAggregation",
|
|
1200
|
+
latestVersion: "17",
|
|
1201
|
+
history: {
|
|
1202
|
+
"17": function (z) {
|
|
1203
|
+
return z.object({
|
|
1204
|
+
inputMethod: z.literal(EWidgetActionInputMethod.AGGREGATION),
|
|
1205
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
1206
|
+
considerFilters: z.boolean().default(false),
|
|
1207
|
+
dbDataType: z.string().optional(),
|
|
1208
|
+
});
|
|
1209
|
+
},
|
|
1210
|
+
},
|
|
1211
|
+
});
|
|
1212
|
+
var ParameterFromManualInputSchema = SchemaRegistry.define({
|
|
1213
|
+
key: "ParameterFromManualInput",
|
|
1214
|
+
latestVersion: "17",
|
|
1215
|
+
history: {
|
|
1216
|
+
"17": function (z) {
|
|
1217
|
+
return z.object({
|
|
1218
|
+
inputMethod: z.literal(EWidgetActionInputMethod.MANUALLY),
|
|
1219
|
+
description: z.string().default(""),
|
|
1220
|
+
defaultValue: FormulaSchema.forVersion("17")(z),
|
|
1221
|
+
dbDataType: z.string().optional(),
|
|
1222
|
+
filterByRows: z.boolean().default(false),
|
|
1223
|
+
validation: FormulaSchema.forVersion("17")(z),
|
|
1224
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1225
|
+
});
|
|
1226
|
+
},
|
|
1227
|
+
},
|
|
1228
|
+
});
|
|
1229
|
+
var ParameterFromStaticListSchema = SchemaRegistry.define({
|
|
1230
|
+
key: "ParameterFromStaticList",
|
|
1231
|
+
latestVersion: "17",
|
|
1232
|
+
history: {
|
|
1233
|
+
"17": function (z) {
|
|
1234
|
+
return z.object({
|
|
1235
|
+
inputMethod: z.literal(EWidgetActionInputMethod.STATIC_LIST),
|
|
1236
|
+
options: z.string().default(""),
|
|
1237
|
+
defaultValue: z
|
|
1238
|
+
.union([z.string(), z.array(z.string())])
|
|
1239
|
+
.nullable()
|
|
1240
|
+
.default(null),
|
|
1241
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1242
|
+
});
|
|
1243
|
+
},
|
|
1244
|
+
},
|
|
1245
|
+
});
|
|
1246
|
+
var ParameterFromDynamicListSchema = SchemaRegistry.define({
|
|
1247
|
+
key: "ParameterFromDynamicList",
|
|
1248
|
+
latestVersion: "17",
|
|
1249
|
+
history: {
|
|
1250
|
+
"17": function (z) {
|
|
1251
|
+
return z.object({
|
|
1252
|
+
inputMethod: z.literal(EWidgetActionInputMethod.DYNAMIC_LIST),
|
|
1253
|
+
options: FormulaSchema.forVersion("17")(z),
|
|
1254
|
+
defaultValue: FormulaSchema.forVersion("17")(z),
|
|
1255
|
+
dbDataType: z.string().optional(),
|
|
1256
|
+
displayOptions: FormulaSchema.forVersion("17")(z),
|
|
1257
|
+
filters: z.array(ExtendedFormulaFilterValueSchema.forVersion("17")(z)).default([]),
|
|
1258
|
+
filterByRows: z.boolean().default(false),
|
|
1259
|
+
considerFilters: z.boolean().default(false),
|
|
1260
|
+
insertAnyValues: z.boolean().default(false),
|
|
1261
|
+
validation: FormulaSchema.forVersion("17")(z),
|
|
1262
|
+
acceptEmptyValue: z.boolean().default(false),
|
|
1263
|
+
});
|
|
1264
|
+
},
|
|
1265
|
+
},
|
|
1266
|
+
});
|
|
1267
|
+
var ParameterFromDataModelSchema = SchemaRegistry.define({
|
|
1268
|
+
key: "ParameterFromDataModel",
|
|
1269
|
+
latestVersion: "17",
|
|
1270
|
+
history: {
|
|
1271
|
+
"17": function (z) {
|
|
1272
|
+
return z.object({
|
|
1273
|
+
inputMethod: z.literal(EWidgetActionInputMethod.DATA_MODEL),
|
|
1274
|
+
option: z.enum(EDataModelOption).default(EDataModelOption.TABLE_LIST),
|
|
1275
|
+
/**
|
|
1276
|
+
* Используется только при COLUMN_LIST. Не делаем union по option, чтобы сохранить
|
|
1277
|
+
* одновременно default для option и работоспособность внешнего discriminated union.
|
|
1278
|
+
*/
|
|
1279
|
+
parent: NameNullableSchema.forVersion("17")(z),
|
|
1280
|
+
});
|
|
1281
|
+
},
|
|
1282
|
+
},
|
|
1283
|
+
});
|
|
1284
|
+
var ActionOnClickParameterSchema = SchemaRegistry.define({
|
|
1285
|
+
key: "ActionOnClickParameter",
|
|
1286
|
+
latestVersion: "17",
|
|
1287
|
+
history: {
|
|
1288
|
+
"17": function (z) {
|
|
1289
|
+
return z.intersection(ActionOnClickParameterCommonSchema.forVersion("17")(z), z.discriminatedUnion("inputMethod", [
|
|
1290
|
+
ParameterFromColumnSchema.forVersion("17")(z),
|
|
1291
|
+
ParameterFromVariableSchema.forVersion("17")(z),
|
|
1292
|
+
ParameterFromFormulaSchema.forVersion("17")(z),
|
|
1293
|
+
ParameterFromEventSchema.forVersion("17")(z),
|
|
1294
|
+
ParameterFromStartEventSchema.forVersion("17")(z),
|
|
1295
|
+
ParameterFromEndEventSchema.forVersion("17")(z),
|
|
1296
|
+
ParameterFromAggregationSchema.forVersion("17")(z),
|
|
1297
|
+
ParameterFromManualInputSchema.forVersion("17")(z),
|
|
1298
|
+
ParameterFromStaticListSchema.forVersion("17")(z),
|
|
1299
|
+
ParameterFromDynamicListSchema.forVersion("17")(z),
|
|
1300
|
+
ParameterFromDataModelSchema.forVersion("17")(z),
|
|
1301
|
+
]));
|
|
1302
|
+
},
|
|
1303
|
+
},
|
|
1304
|
+
});
|
|
1305
|
+
var ActionCommonSchema = SchemaRegistry.define({
|
|
1306
|
+
key: "ActionCommon",
|
|
1307
|
+
latestVersion: "17",
|
|
1308
|
+
history: {
|
|
1309
|
+
"17": function (z) {
|
|
1310
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
1311
|
+
name: z.string(),
|
|
1312
|
+
});
|
|
1313
|
+
},
|
|
1314
|
+
},
|
|
1315
|
+
});
|
|
1316
|
+
var ActionDrillDownSchema = SchemaRegistry.define({
|
|
1317
|
+
key: "ActionDrillDown",
|
|
1318
|
+
latestVersion: "17",
|
|
1319
|
+
history: {
|
|
1320
|
+
"17": function (z) {
|
|
1321
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1322
|
+
type: z.literal(EActionTypes.DRILL_DOWN),
|
|
1323
|
+
variables: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1324
|
+
});
|
|
1325
|
+
},
|
|
1326
|
+
},
|
|
1327
|
+
});
|
|
1328
|
+
var ActionGoToURLSchema = SchemaRegistry.define({
|
|
1329
|
+
key: "ActionGoToURL",
|
|
1330
|
+
latestVersion: "17",
|
|
1331
|
+
history: {
|
|
1332
|
+
"17": function (z) {
|
|
1333
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1334
|
+
type: z.literal(EActionTypes.OPEN_URL),
|
|
1335
|
+
url: z.string(),
|
|
1336
|
+
newWindow: z.boolean().default(true),
|
|
1337
|
+
variables: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1338
|
+
});
|
|
1339
|
+
},
|
|
1340
|
+
},
|
|
1341
|
+
});
|
|
1342
|
+
var ActivateConditionSchema = SchemaRegistry.define({
|
|
1343
|
+
key: "ActivateCondition",
|
|
1344
|
+
latestVersion: "17",
|
|
1345
|
+
history: {
|
|
1346
|
+
"17": function (z) {
|
|
1347
|
+
return z
|
|
1348
|
+
.discriminatedUnion("mode", [
|
|
1349
|
+
z.object({
|
|
1350
|
+
mode: z.literal(EActivateConditionMode.FORMULA),
|
|
1351
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
1352
|
+
}),
|
|
1353
|
+
z.object({
|
|
1354
|
+
mode: z.literal(EActivateConditionMode.VARIABLE),
|
|
1355
|
+
variableName: z.string().nullable().default(null),
|
|
1356
|
+
variableValue: z.string().nullable().default(null),
|
|
1357
|
+
}),
|
|
1358
|
+
])
|
|
1359
|
+
.default({ mode: EActivateConditionMode.FORMULA, formula: "" });
|
|
1360
|
+
},
|
|
1361
|
+
},
|
|
1362
|
+
});
|
|
1363
|
+
var ActionRunScriptSchema = SchemaRegistry.define({
|
|
1364
|
+
key: "ActionRunScript",
|
|
1365
|
+
latestVersion: "17",
|
|
1366
|
+
history: {
|
|
1367
|
+
"17": function (z) {
|
|
1368
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1369
|
+
type: z.literal(EActionTypes.EXECUTE_SCRIPT),
|
|
1370
|
+
parameters: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1371
|
+
scriptKey: z.string(),
|
|
1372
|
+
autoUpdate: z.enum(EAutoUpdateMode).default(EAutoUpdateMode.THIS_WIDGET),
|
|
1373
|
+
hideInactiveButton: z.boolean().default(false),
|
|
1374
|
+
activateCondition: ActivateConditionSchema.forVersion("17")(z),
|
|
1375
|
+
hint: z.string().default(""),
|
|
1376
|
+
variables: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1377
|
+
runButtonText: z.string().default(""),
|
|
1378
|
+
});
|
|
1379
|
+
},
|
|
1380
|
+
},
|
|
1381
|
+
});
|
|
1382
|
+
var ActionUpdateVariableSchema = SchemaRegistry.define({
|
|
1383
|
+
key: "ActionUpdateVariable",
|
|
1384
|
+
latestVersion: "17",
|
|
1385
|
+
history: {
|
|
1386
|
+
"17": function (z) {
|
|
1387
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1388
|
+
type: z.literal(EActionTypes.UPDATE_VARIABLE),
|
|
1389
|
+
variables: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1390
|
+
});
|
|
1391
|
+
},
|
|
1392
|
+
},
|
|
1393
|
+
});
|
|
1394
|
+
var ActionOpenInSchema = SchemaRegistry.define({
|
|
1395
|
+
key: "ActionOpenIn",
|
|
1396
|
+
latestVersion: "17",
|
|
1397
|
+
history: {
|
|
1398
|
+
"17": function (z) {
|
|
1399
|
+
return z.discriminatedUnion("openIn", [
|
|
1400
|
+
z.object({
|
|
1401
|
+
openIn: z.literal(EViewOpenIn.DRAWER_WINDOW),
|
|
1402
|
+
alignment: z.enum(EDrawerPlacement).default(EDrawerPlacement.RIGHT),
|
|
1403
|
+
inheritFilter: z.boolean().default(true),
|
|
1404
|
+
}),
|
|
1405
|
+
z.object({
|
|
1406
|
+
openIn: z.literal(EViewOpenIn.PLACEHOLDER),
|
|
1407
|
+
placeholderName: z.string().optional(),
|
|
1408
|
+
}),
|
|
1409
|
+
z.object({
|
|
1410
|
+
openIn: z.literal(EViewOpenIn.MODAL_WINDOW),
|
|
1411
|
+
positionByClick: z.boolean().default(false),
|
|
1412
|
+
inheritFilter: z.boolean().default(true),
|
|
1413
|
+
}),
|
|
1414
|
+
z.object({
|
|
1415
|
+
openIn: z.literal(EViewOpenIn.WINDOW),
|
|
1416
|
+
newWindow: z.boolean().default(true),
|
|
1417
|
+
inheritFilter: z.boolean().default(true),
|
|
1418
|
+
}),
|
|
1419
|
+
]);
|
|
1420
|
+
},
|
|
1421
|
+
},
|
|
1422
|
+
});
|
|
1423
|
+
var ActionOpenViewCommonSchema = SchemaRegistry.define({
|
|
1424
|
+
key: "ActionOpenViewCommon",
|
|
1425
|
+
latestVersion: "17",
|
|
1426
|
+
history: {
|
|
1427
|
+
"17": function (z) {
|
|
1428
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1429
|
+
type: z.literal(EActionTypes.OPEN_VIEW),
|
|
1430
|
+
variables: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1431
|
+
});
|
|
1432
|
+
},
|
|
1433
|
+
},
|
|
1434
|
+
});
|
|
1435
|
+
var ActionOpenViewSchema = SchemaRegistry.define({
|
|
1436
|
+
key: "ActionOpenView",
|
|
1437
|
+
latestVersion: "17",
|
|
1438
|
+
history: {
|
|
1439
|
+
"17": function (z) {
|
|
1440
|
+
return z.intersection(z.discriminatedUnion("mode", [
|
|
1441
|
+
ActionOpenViewCommonSchema.forVersion("17")(z).extend({
|
|
1442
|
+
mode: z.literal(EViewMode.GENERATED_BY_SCRIPT),
|
|
1443
|
+
scriptKey: z.string().optional(),
|
|
1444
|
+
parameters: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1445
|
+
displayName: z.string().default(""),
|
|
1446
|
+
}),
|
|
1447
|
+
ActionOpenViewCommonSchema.forVersion("17")(z).extend({
|
|
1448
|
+
mode: z.literal(EViewMode.EXISTED_VIEW),
|
|
1449
|
+
viewKey: z.string().optional(),
|
|
1450
|
+
parameters: z.array(ActionOnClickParameterSchema.forVersion("17")(z)).default([]),
|
|
1451
|
+
}),
|
|
1452
|
+
ActionOpenViewCommonSchema.forVersion("17")(z).extend({
|
|
1453
|
+
mode: z.literal(EViewMode.EMPTY),
|
|
1454
|
+
placeholderName: z.string().optional(),
|
|
1455
|
+
openIn: z.literal(EViewOpenIn.PLACEHOLDER),
|
|
1456
|
+
}),
|
|
1457
|
+
]), ActionOpenInSchema.forVersion("17")(z));
|
|
1458
|
+
},
|
|
1459
|
+
},
|
|
1460
|
+
});
|
|
1461
|
+
var ActionsOnClickSchema = SchemaRegistry.define({
|
|
1462
|
+
key: "ActionsOnClick",
|
|
1463
|
+
latestVersion: "17",
|
|
1464
|
+
history: {
|
|
1465
|
+
"17": function (z) {
|
|
1466
|
+
return z.union([
|
|
1467
|
+
ActionGoToURLSchema.forVersion("17")(z),
|
|
1468
|
+
ActionRunScriptSchema.forVersion("17")(z),
|
|
1469
|
+
ActionUpdateVariableSchema.forVersion("17")(z),
|
|
1470
|
+
ActionOpenViewSchema.forVersion("17")(z),
|
|
1471
|
+
ActionDrillDownSchema.forVersion("17")(z),
|
|
1472
|
+
]);
|
|
1473
|
+
},
|
|
1474
|
+
},
|
|
1475
|
+
});
|
|
1476
|
+
var WidgetActionParameterCommonSchema = SchemaRegistry.define({
|
|
1477
|
+
key: "WidgetActionParameterCommon",
|
|
1478
|
+
latestVersion: "17",
|
|
1479
|
+
history: {
|
|
1480
|
+
"17": function (z) {
|
|
1481
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
1482
|
+
name: z.string(),
|
|
1483
|
+
displayName: z.string().default(""),
|
|
1484
|
+
isHidden: z.boolean().default(false),
|
|
1485
|
+
});
|
|
1486
|
+
},
|
|
1487
|
+
},
|
|
1488
|
+
});
|
|
1489
|
+
var WidgetActionParameterSchema = SchemaRegistry.define({
|
|
1490
|
+
key: "WidgetActionParameter",
|
|
1491
|
+
latestVersion: "17",
|
|
1492
|
+
history: {
|
|
1493
|
+
"17": function (z) {
|
|
1494
|
+
return z.intersection(WidgetActionParameterCommonSchema.forVersion("17")(z), z.discriminatedUnion("inputMethod", [
|
|
1495
|
+
ParameterFromColumnSchema.forVersion("17")(z),
|
|
1496
|
+
ParameterFromVariableSchema.forVersion("17")(z),
|
|
1497
|
+
ParameterFromFormulaSchema.forVersion("17")(z),
|
|
1498
|
+
ParameterFromManualInputSchema.forVersion("17")(z),
|
|
1499
|
+
ParameterFromStaticListSchema.forVersion("17")(z),
|
|
1500
|
+
ParameterFromDynamicListSchema.forVersion("17")(z),
|
|
1501
|
+
ParameterFromAggregationSchema.forVersion("17")(z),
|
|
1502
|
+
ParameterFromDataModelSchema.forVersion("17")(z),
|
|
1503
|
+
]));
|
|
1504
|
+
},
|
|
1505
|
+
},
|
|
1506
|
+
});
|
|
1507
|
+
var WidgetActionSchema = SchemaRegistry.define({
|
|
1508
|
+
key: "WidgetAction",
|
|
1509
|
+
latestVersion: "17",
|
|
1510
|
+
history: {
|
|
1511
|
+
"17": function (z) {
|
|
1512
|
+
return ActionCommonSchema.forVersion("17")(z).extend({
|
|
1513
|
+
parameters: z.array(WidgetActionParameterSchema.forVersion("17")(z)).default([]),
|
|
1514
|
+
type: z.literal(EActionTypes.EXECUTE_SCRIPT),
|
|
1515
|
+
scriptKey: z.string(),
|
|
1516
|
+
autoUpdate: z.enum(EAutoUpdateMode).default(EAutoUpdateMode.THIS_WIDGET),
|
|
1517
|
+
description: z.string().default(""),
|
|
1518
|
+
hideInactiveButton: z.boolean().default(false),
|
|
1519
|
+
hint: z.string().default(""),
|
|
1520
|
+
activateCondition: ActivateConditionSchema.forVersion("17")(z),
|
|
1521
|
+
variables: z.array(WidgetActionParameterSchema.forVersion("17")(z)).default([]),
|
|
1522
|
+
runButtonText: z.string().default(""),
|
|
1523
|
+
});
|
|
1524
|
+
},
|
|
1525
|
+
},
|
|
1526
|
+
});
|
|
1527
|
+
var ViewActionParameterSchema = SchemaRegistry.define({
|
|
1528
|
+
key: "ViewActionParameter",
|
|
1529
|
+
latestVersion: "17",
|
|
1530
|
+
history: {
|
|
1531
|
+
"17": function (z) {
|
|
1532
|
+
return z.intersection(AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({ name: z.string() }), z.discriminatedUnion("inputMethod", [
|
|
1533
|
+
ParameterFromAggregationSchema.forVersion("17")(z),
|
|
1534
|
+
ParameterFromVariableSchema.forVersion("17")(z),
|
|
1535
|
+
]));
|
|
1536
|
+
},
|
|
1537
|
+
},
|
|
1538
|
+
});
|
|
1539
|
+
var ViewActionSchema = SchemaRegistry.define({
|
|
1540
|
+
key: "ViewAction",
|
|
1541
|
+
latestVersion: "17",
|
|
1542
|
+
history: {
|
|
1543
|
+
"17": function (z) {
|
|
1544
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
1545
|
+
name: z.string(),
|
|
1546
|
+
buttonType: z.enum(EActionButtonsTypes).default(EActionButtonsTypes.BASE),
|
|
1547
|
+
type: z.literal(EActionTypes.EXECUTE_SCRIPT).default(EActionTypes.EXECUTE_SCRIPT),
|
|
1548
|
+
parameters: z.array(ViewActionParameterSchema.forVersion("17")(z)).default([]),
|
|
1549
|
+
scriptKey: KeyNullableSchema.forVersion("17")(z),
|
|
1550
|
+
autoUpdate: z
|
|
1551
|
+
.union([z.literal(EAutoUpdateMode.NONE), z.literal(EAutoUpdateMode.ALL_VIEWS)])
|
|
1552
|
+
.default(EAutoUpdateMode.NONE),
|
|
1553
|
+
});
|
|
1554
|
+
},
|
|
1555
|
+
},
|
|
1556
|
+
});
|
|
1557
|
+
var ActionSchema = SchemaRegistry.define({
|
|
1558
|
+
key: "Action",
|
|
1559
|
+
latestVersion: "17",
|
|
1560
|
+
history: {
|
|
1561
|
+
"17": function (z) {
|
|
1562
|
+
return z.union([
|
|
1563
|
+
ActionsOnClickSchema.forVersion("17")(z),
|
|
1564
|
+
WidgetActionSchema.forVersion("17")(z),
|
|
1565
|
+
ViewActionSchema.forVersion("17")(z),
|
|
1566
|
+
]);
|
|
1567
|
+
},
|
|
1568
|
+
},
|
|
1569
|
+
});
|
|
1570
|
+
var ActionButtonSchema = SchemaRegistry.define({
|
|
1571
|
+
key: "ActionButton",
|
|
1572
|
+
latestVersion: "17",
|
|
1573
|
+
history: {
|
|
1574
|
+
"17": function (z) {
|
|
1575
|
+
return AutoIdentifiedArrayItemSchema.forVersion("17")(z).extend({
|
|
1576
|
+
name: z.string(),
|
|
1577
|
+
onClick: z.array(WidgetActionSchema.forVersion("17")(z)).default([]),
|
|
1578
|
+
buttonType: z.enum(EActionButtonsTypes).default(EActionButtonsTypes.BASE),
|
|
1579
|
+
backgroundColor: ColorSchema.forVersion("17")(z),
|
|
1580
|
+
borderColor: ColorSchema.forVersion("17")(z),
|
|
1581
|
+
color: ColorSchema.forVersion("17")(z),
|
|
1582
|
+
hint: z.string().default(""),
|
|
1583
|
+
});
|
|
1584
|
+
},
|
|
1585
|
+
},
|
|
1586
|
+
});
|
|
1005
1587
|
|
|
1006
1588
|
var ESimpleDataType;
|
|
1007
1589
|
(function (ESimpleDataType) {
|
|
@@ -1086,25 +1668,6 @@ var isFormulaFilterValue = function (value) {
|
|
|
1086
1668
|
};
|
|
1087
1669
|
var isDimensionProcessFilter = function (filter) { return "value" in filter && "condition" in filter; };
|
|
1088
1670
|
|
|
1089
|
-
var compact = function (items) { return ((items === null || items === void 0 ? void 0 : items.filter(Boolean)) || []); };
|
|
1090
|
-
var compactMap = function (items, f) {
|
|
1091
|
-
return compact(items === null || items === void 0 ? void 0 : items.map(f));
|
|
1092
|
-
};
|
|
1093
|
-
var isNil = function (value) {
|
|
1094
|
-
return value === null || value === undefined;
|
|
1095
|
-
};
|
|
1096
|
-
function memoize(fn) {
|
|
1097
|
-
var cache = new Map();
|
|
1098
|
-
return function (arg) {
|
|
1099
|
-
if (cache.has(arg)) {
|
|
1100
|
-
return cache.get(arg);
|
|
1101
|
-
}
|
|
1102
|
-
var result = fn(arg);
|
|
1103
|
-
cache.set(arg, result);
|
|
1104
|
-
return result;
|
|
1105
|
-
};
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
1671
|
var EClickHouseBaseTypes;
|
|
1109
1672
|
(function (EClickHouseBaseTypes) {
|
|
1110
1673
|
// DATE
|
|
@@ -2669,21 +3232,27 @@ var getColorByIndex = function (index) {
|
|
|
2669
3232
|
return color;
|
|
2670
3233
|
};
|
|
2671
3234
|
|
|
2672
|
-
var WidgetPresetSettingsSchema =
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
}
|
|
3235
|
+
var WidgetPresetSettingsSchema = SchemaRegistry.define({
|
|
3236
|
+
key: "WidgetPresetSettings",
|
|
3237
|
+
latestVersion: "17",
|
|
3238
|
+
history: {
|
|
3239
|
+
"17": function (z) {
|
|
3240
|
+
return BaseWidgetSettingsSchema.forVersion("17")(z)
|
|
3241
|
+
.pick({
|
|
3242
|
+
filterMode: true,
|
|
3243
|
+
ignoreFilters: true,
|
|
3244
|
+
stateName: true,
|
|
3245
|
+
titleColor: true,
|
|
3246
|
+
titleSize: true,
|
|
3247
|
+
titleWeight: true,
|
|
3248
|
+
paddings: true,
|
|
3249
|
+
})
|
|
3250
|
+
.extend({
|
|
3251
|
+
textSize: z.number().default(12),
|
|
3252
|
+
});
|
|
3253
|
+
},
|
|
3254
|
+
},
|
|
3255
|
+
});
|
|
2687
3256
|
|
|
2688
3257
|
/**
|
|
2689
3258
|
* Привязывает мета-информацию о теме к Zod-схеме
|
|
@@ -2708,79 +3277,151 @@ var themed = function (scheme, selectThemeValue) {
|
|
|
2708
3277
|
return scheme.meta((_a = {}, _a[ESettingsSchemaMetaKey.themeValue] = selectThemeValue, _a));
|
|
2709
3278
|
};
|
|
2710
3279
|
|
|
2711
|
-
var ColorBaseSchema =
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
}
|
|
2722
|
-
};
|
|
2723
|
-
var
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
}
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
}
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
.
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
}
|
|
2770
|
-
};
|
|
2771
|
-
var
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
3280
|
+
var ColorBaseSchema = SchemaRegistry.define({
|
|
3281
|
+
key: "ColorBase",
|
|
3282
|
+
latestVersion: "17",
|
|
3283
|
+
history: {
|
|
3284
|
+
"17": function (z) {
|
|
3285
|
+
return z.object({
|
|
3286
|
+
mode: z.literal(EColorMode.BASE),
|
|
3287
|
+
value: z.string(),
|
|
3288
|
+
});
|
|
3289
|
+
},
|
|
3290
|
+
},
|
|
3291
|
+
});
|
|
3292
|
+
var ColorRuleSchema = SchemaRegistry.define({
|
|
3293
|
+
key: "ColorRule",
|
|
3294
|
+
latestVersion: "17",
|
|
3295
|
+
history: {
|
|
3296
|
+
"17": function (z) {
|
|
3297
|
+
return z.object({
|
|
3298
|
+
mode: z.literal(EColorMode.RULE),
|
|
3299
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
3300
|
+
});
|
|
3301
|
+
},
|
|
3302
|
+
},
|
|
3303
|
+
});
|
|
3304
|
+
var ColorAutoSchema = SchemaRegistry.define({
|
|
3305
|
+
key: "ColorAuto",
|
|
3306
|
+
latestVersion: "17",
|
|
3307
|
+
history: {
|
|
3308
|
+
"17": function (z) {
|
|
3309
|
+
return z.object({
|
|
3310
|
+
mode: z.literal(EColorMode.AUTO),
|
|
3311
|
+
});
|
|
3312
|
+
},
|
|
3313
|
+
},
|
|
3314
|
+
});
|
|
3315
|
+
var ColorDisabledSchema = SchemaRegistry.define({
|
|
3316
|
+
key: "ColorDisabled",
|
|
3317
|
+
latestVersion: "17",
|
|
3318
|
+
history: {
|
|
3319
|
+
"17": function (z) {
|
|
3320
|
+
return z.object({
|
|
3321
|
+
mode: z.literal(EColorMode.DISABLED),
|
|
3322
|
+
});
|
|
3323
|
+
},
|
|
3324
|
+
},
|
|
3325
|
+
});
|
|
3326
|
+
var ColorGradientSchema = SchemaRegistry.define({
|
|
3327
|
+
key: "ColorGradient",
|
|
3328
|
+
latestVersion: "17",
|
|
3329
|
+
history: {
|
|
3330
|
+
"17": function (z) {
|
|
3331
|
+
return z.object({
|
|
3332
|
+
mode: z.literal(EColorMode.GRADIENT),
|
|
3333
|
+
startValue: z.string(),
|
|
3334
|
+
endValue: z.string(),
|
|
3335
|
+
classCount: z.number().min(3).max(10).nullish(),
|
|
3336
|
+
});
|
|
3337
|
+
},
|
|
3338
|
+
},
|
|
3339
|
+
});
|
|
3340
|
+
var ColorFormulaSchema = SchemaRegistry.define({
|
|
3341
|
+
key: "ColorFormula",
|
|
3342
|
+
latestVersion: "17",
|
|
3343
|
+
history: {
|
|
3344
|
+
"17": function (z) {
|
|
3345
|
+
return z.object({
|
|
3346
|
+
mode: z.literal(EColorMode.FORMULA),
|
|
3347
|
+
formula: FormulaSchema.forVersion("17")(z),
|
|
3348
|
+
});
|
|
3349
|
+
},
|
|
3350
|
+
},
|
|
3351
|
+
});
|
|
3352
|
+
var ColorValuesSchema = SchemaRegistry.define({
|
|
3353
|
+
key: "ColorValues",
|
|
3354
|
+
latestVersion: "17",
|
|
3355
|
+
history: {
|
|
3356
|
+
"17": function (z) {
|
|
3357
|
+
return z.object({
|
|
3358
|
+
mode: z.literal(EColorMode.VALUES),
|
|
3359
|
+
items: z
|
|
3360
|
+
.array(z.object({
|
|
3361
|
+
value: z.string(),
|
|
3362
|
+
color: z.union([
|
|
3363
|
+
ColorBaseSchema.forVersion("17")(z),
|
|
3364
|
+
ColorRuleSchema.forVersion("17")(z),
|
|
3365
|
+
]),
|
|
3366
|
+
}))
|
|
3367
|
+
.default([]),
|
|
3368
|
+
});
|
|
3369
|
+
},
|
|
3370
|
+
},
|
|
3371
|
+
});
|
|
3372
|
+
var ColorByDimensionSchema = SchemaRegistry.define({
|
|
3373
|
+
key: "ColorByDimension",
|
|
3374
|
+
latestVersion: "17",
|
|
3375
|
+
history: {
|
|
3376
|
+
"17": function (z) {
|
|
3377
|
+
return z.object({
|
|
3378
|
+
mode: z.literal(EColorMode.BY_DIMENSION),
|
|
3379
|
+
/** Имя разреза из области видимости правила отображения */
|
|
3380
|
+
dimensionName: z.string(),
|
|
3381
|
+
items: z
|
|
3382
|
+
.array(z.object({
|
|
3383
|
+
value: z.string(),
|
|
3384
|
+
color: z.union([
|
|
3385
|
+
ColorBaseSchema.forVersion("17")(z),
|
|
3386
|
+
ColorRuleSchema.forVersion("17")(z),
|
|
3387
|
+
]),
|
|
3388
|
+
}))
|
|
3389
|
+
.default([]),
|
|
3390
|
+
});
|
|
3391
|
+
},
|
|
3392
|
+
},
|
|
3393
|
+
});
|
|
3394
|
+
var ColoredValueSchema = SchemaRegistry.define({
|
|
3395
|
+
key: "ColoredValue",
|
|
3396
|
+
latestVersion: "17",
|
|
3397
|
+
history: {
|
|
3398
|
+
"17": function (z) {
|
|
3399
|
+
return z.object({
|
|
3400
|
+
value: z.string(),
|
|
3401
|
+
color: z.union([ColorBaseSchema.forVersion("17")(z), ColorRuleSchema.forVersion("17")(z)]),
|
|
3402
|
+
});
|
|
3403
|
+
},
|
|
3404
|
+
},
|
|
3405
|
+
});
|
|
3406
|
+
var ColorSchema = SchemaRegistry.define({
|
|
3407
|
+
key: "Color",
|
|
3408
|
+
latestVersion: "17",
|
|
3409
|
+
history: {
|
|
3410
|
+
"17": function (z) {
|
|
3411
|
+
return z
|
|
3412
|
+
.discriminatedUnion("mode", [
|
|
3413
|
+
ColorAutoSchema.forVersion("17")(z),
|
|
3414
|
+
ColorDisabledSchema.forVersion("17")(z),
|
|
3415
|
+
ColorBaseSchema.forVersion("17")(z),
|
|
3416
|
+
ColorRuleSchema.forVersion("17")(z),
|
|
3417
|
+
ColorGradientSchema.forVersion("17")(z),
|
|
3418
|
+
ColorFormulaSchema.forVersion("17")(z),
|
|
3419
|
+
ColorValuesSchema.forVersion("17")(z),
|
|
3420
|
+
ColorByDimensionSchema.forVersion("17")(z),
|
|
3421
|
+
])
|
|
3422
|
+
.default({ mode: EColorMode.AUTO });
|
|
3423
|
+
},
|
|
3424
|
+
},
|
|
3425
|
+
});
|
|
2785
3426
|
|
|
2786
|
-
export { ActionButtonSchema, ActionDrillDownSchema, ActionGoToURLSchema, ActionOnClickParameterSchema, ActionOpenInSchema, ActionOpenViewSchema, ActionRunScriptSchema, ActionSchema, ActionUpdateVariableSchema, ActionsOnClickSchema, AutoIdentifiedArrayItemSchema, BaseWidgetSettingsSchema, ColorAutoSchema, ColorBaseSchema, ColorByDimensionSchema, ColorDisabledSchema, ColorFormulaSchema, ColorGradientSchema, ColorRuleSchema, ColorSchema, ColorValuesSchema, ColoredValueSchema, ColumnIndicatorValueSchema, DimensionProcessFilterSchema, DimensionValueSchema, DisplayConditionSchema, EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionProcessFilterTimeUnit, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatOrFormattingMode, EFormulaFilterFieldKeys, EHeightMode, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureInnerTemplateNames, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESettingsSchemaMetaKey, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, ExtendedFormulaFilterValueSchema, FormatSchema, FormattingSchema, FormulaFilterValueSchema, FormulaNullableSchema, FormulaSchema, KeyNullableSchema, MarkdownMeasureSchema, MeasureValueSchema, NameNullableSchema, OuterAggregation, ParameterFromAggregationSchema, ParameterFromColumnSchema, ParameterFromDataModelSchema, ParameterFromDynamicListSchema, ParameterFromEndEventSchema, ParameterFromEventSchema, ParameterFromFormulaSchema, ParameterFromManualInputSchema, ParameterFromStartEventSchema, ParameterFromStaticListSchema, ParameterFromVariableSchema, ProcessIndicatorSchema, ProcessIndicatorValueSchema, RangeSchema, SettingsFilterSchema, SortDirectionSchema, SortOrderSchema, ViewActionParameterSchema, ViewActionSchema, WidgetActionParameterSchema, WidgetActionSchema, WidgetColumnIndicatorSchema, WidgetDimensionHierarchySchema, WidgetDimensionInHierarchySchema, WidgetDimensionSchema, WidgetIndicatorAggregationValueSchema, WidgetIndicatorConversionValueSchema, WidgetIndicatorDurationValueSchema, WidgetIndicatorFormulaValueSchema, WidgetIndicatorSchema, WidgetIndicatorTemplateValueSchema, WidgetIndicatorTimeValueSchema, WidgetMeasureAggregationValueSchema, WidgetMeasureSchema, WidgetPresetSettingsSchema, WidgetSortingIndicatorSchema, WidgetSortingValueSchema, apiVersion, apiVersions, applyIndexToArrayFormula, availableFormatsBySimpleType, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, createEscaper, createAggregationTemplate as createMeasureAggregationTemplate, curlyBracketsContentPattern, dashboardLinkRegExp, defaultActionsConfig, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, doubleQuoteContentPattern, durationTemplates, escapeCurlyBracketLinkName, escapeDoubleQuoteLinkName, eventMeasureTemplateFormulas, fillTemplateSql, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getMeasureFormula, getProcessDimensionValueFormula, getRuleColor, getTransitionMeasureFormula, inheritDisplayConditionFromHierarchy, isDimensionProcessFilter, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSettingsFiltersToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureInnerTemplateFormulas, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, themed, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|
|
3427
|
+
export { ActionButtonSchema, ActionDrillDownSchema, ActionGoToURLSchema, ActionOnClickParameterSchema, ActionOpenInSchema, ActionOpenViewSchema, ActionRunScriptSchema, ActionSchema, ActionUpdateVariableSchema, ActionsOnClickSchema, AutoIdentifiedArrayItemSchema, BaseWidgetSettingsSchema, ColorAutoSchema, ColorBaseSchema, ColorByDimensionSchema, ColorDisabledSchema, ColorFormulaSchema, ColorGradientSchema, ColorRuleSchema, ColorSchema, ColorValuesSchema, ColoredValueSchema, ColumnIndicatorValueSchema, DimensionProcessFilterSchema, DimensionValueSchema, DisplayConditionSchema, EActionButtonsTypes, EActionTypes, EActivateConditionMode, EAutoUpdateMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDataModelOption, EDimensionAggregationTemplateName, EDimensionProcessFilterTimeUnit, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatOrFormattingMode, EFormulaFilterFieldKeys, EHeightMode, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureInnerTemplateNames, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESettingsSchemaMetaKey, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, ExtendedFormulaFilterValueSchema, FormatSchema, FormattingSchema, FormulaFilterValueSchema, FormulaNullableSchema, FormulaSchema, KeyNullableSchema, MarkdownMeasureSchema, MeasureValueSchema, NameNullableSchema, OuterAggregation, ParameterFromAggregationSchema, ParameterFromColumnSchema, ParameterFromDataModelSchema, ParameterFromDynamicListSchema, ParameterFromEndEventSchema, ParameterFromEventSchema, ParameterFromFormulaSchema, ParameterFromManualInputSchema, ParameterFromStartEventSchema, ParameterFromStaticListSchema, ParameterFromVariableSchema, ProcessIndicatorSchema, ProcessIndicatorValueSchema, RangeSchema, SchemaRegistryReader, SettingsFilterSchema, SortDirectionSchema, SortOrderSchema, VersionedSchemaFactory, ViewActionParameterSchema, ViewActionSchema, WidgetActionParameterSchema, WidgetActionSchema, WidgetColumnIndicatorSchema, WidgetDimensionHierarchySchema, WidgetDimensionInHierarchySchema, WidgetDimensionSchema, WidgetIndicatorAggregationValueSchema, WidgetIndicatorConversionValueSchema, WidgetIndicatorDurationValueSchema, WidgetIndicatorFormulaValueSchema, WidgetIndicatorSchema, WidgetIndicatorTemplateValueSchema, WidgetIndicatorTimeValueSchema, WidgetMeasureAggregationValueSchema, WidgetMeasureSchema, WidgetPresetSettingsSchema, WidgetSortingIndicatorSchema, WidgetSortingValueSchema, apiVersion, apiVersions, applyIndexToArrayFormula, availableFormatsBySimpleType, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, createEscaper, createAggregationTemplate as createMeasureAggregationTemplate, curlyBracketsContentPattern, dashboardLinkRegExp, defaultActionsConfig, dimensionAggregationTemplates, dimensionTemplateFormulas, displayConditionTemplate, doubleQuoteContentPattern, durationTemplates, escapeCurlyBracketLinkName, escapeDoubleQuoteLinkName, eventMeasureTemplateFormulas, fillTemplateSql, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getMeasureFormula, getProcessDimensionValueFormula, getRuleColor, getTransitionMeasureFormula, inheritDisplayConditionFromHierarchy, isDimensionProcessFilter, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSettingsFiltersToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureInnerTemplateFormulas, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, themed, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
|