-
Notifications
You must be signed in to change notification settings - Fork 36
/
models.ts
946 lines (769 loc) · 23.9 KB
/
models.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
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
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
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
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
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
declare var require: Function;
export const Validators = require('./validators/core/validator').Validators;
export type KeyValuePair = {
key: string;
value: string;
}
export interface ITechnicalDetails {
requestId?: string;
errorInfo?: KeyValuePair[];
}
export interface IError {
message: string;
detailedMessage?: string;
errorCode?: string;
technicalDetails?: ITechnicalDetails;
}
export enum PageSizeType {
Widescreen,
Standard,
Cortana,
Letter,
Custom
}
export enum DisplayOption {
FitToPage,
FitToWidth,
ActualSize
}
export enum BackgroundType {
Default,
Transparent
}
export interface IPageSize {
type: PageSizeType;
}
export interface ICustomPageSize extends IPageSize {
width?: number;
height?: number;
}
export type PagesLayout = { [key: string]: IPageLayout; };
export type VisualsLayout = { [key: string]: IVisualLayout; };
export interface IPageLayout {
defaultLayout?: IVisualLayout;
visualsLayout: VisualsLayout;
}
export enum VisualContainerDisplayMode {
Visible,
Hidden
}
export enum LayoutType {
Master,
Custom,
MobilePortrait,
MobileLandscape
}
export interface IVisualLayout {
x?: number;
y?: number;
z?: number;
width?: number;
height?: number;
displayState?: IVisualContainerDisplayState;
}
export interface IVisualContainerDisplayState {
mode: VisualContainerDisplayMode;
}
export interface ICustomLayout {
pageSize?: IPageSize;
displayOption?: DisplayOption;
pagesLayout?: PagesLayout;
}
export interface IReport {
id: string;
displayName: string;
}
export enum SectionVisibility {
AlwaysVisible,
HiddenInViewMode,
}
export interface IPage {
// unique name of a page.
name: string;
// Display name of a page.
displayName: string;
// True if the page is active.
isActive?: boolean;
// Default is AlwaysVisible.
visibility?: SectionVisibility;
// Page size as saved in the report.
defaultSize?: ICustomPageSize;
// Page display options as saved in the report.
defaultDisplayOption?: DisplayOption;
}
export interface IVisual {
name: string;
title: string;
type: string;
layout?: IVisualLayout;
}
export enum Permissions {
Read = 0,
ReadWrite = 1,
Copy = 2,
Create = 4,
All = 7
}
export enum ViewMode {
View,
Edit
}
export enum TokenType {
Aad,
Embed
}
export type PageView = "fitToWidth" | "oneColumn" | "actualSize";
export interface IQnaVisualRenderedEvent {
question: string;
normalizedQuestion?: string;
}
export interface IVisualCustomCommandEvent {
visualName: string;
command: string;
}
export interface ISelection {
visual: IVisual;
page: IPage;
report: IReport;
dataPoints: IIdentityValue<IEqualsDataReference>[];
regions: IIdentityValue<IEqualsDataReference | IBetweenDataReference>[];
filters: IFilter[];
}
export interface ISwipeEvent {
currentPosition: IPosition;
startPosition: IPosition;
}
export interface IPosition {
x: number;
y: number;
}
export type Extensions = IExtension[];
export interface IExtension {
command?: ICommandExtension;
}
export interface IExtensionItem {
name: string;
extend: IExtensionPoints;
}
export interface ICommandExtension extends IExtensionItem {
title: string;
icon?: string;
}
// TODO: ExtensionPoints should extend _.Dictionary<ExtensionPoint>. This will need to add lodash to the project.
export interface IExtensionPoints {
visualContextMenu?: IMenuExtension;
visualOptionsMenu?: IMenuExtension;
}
export interface IExtensionPoint {
}
export interface IMenuExtension extends IExtensionPoint {
title?: string;
icon?: string;
}
export interface IBaseFilterTarget {
table: string;
}
export interface IFilterColumnTarget extends IBaseFilterTarget {
column: string;
aggregationFunction?: string;
}
export interface IFilterKeyColumnsTarget extends IFilterColumnTarget {
keys: string[];
}
export interface IFilterKeyHierarchyTarget extends IFilterHierarchyTarget {
keys: string[];
}
export interface IFilterHierarchyTarget extends IBaseFilterTarget {
hierarchy: string;
hierarchyLevel: string;
aggregationFunction?: string;
}
export interface INotSupportedFilterTarget extends IBaseFilterTarget {}
export interface IFilterMeasureTarget extends IBaseFilterTarget {
measure: string;
}
export declare type IFilterKeyTarget = (IFilterKeyColumnsTarget | IFilterKeyHierarchyTarget);
export declare type IFilterTarget = (IFilterColumnTarget | IFilterHierarchyTarget | IFilterMeasureTarget | INotSupportedFilterTarget);
export interface IFilter {
$schema: string;
target: IFilterTarget;
filterType: FilterType;
}
export interface INotSupportedFilter extends IFilter {
message: string;
notSupportedTypeName: string;
}
export interface IIncludeExcludeFilter extends IFilter {
values: (string | number | boolean)[];
isExclude: boolean;
}
export interface ITopNFilter extends IFilter {
operator: TopNFilterOperators;
itemCount: number;
}
export interface IRelativeDateFilter extends IFilter {
operator: RelativeDateOperators;
timeUnitsCount: number;
timeUnitType: RelativeDateFilterTimeUnit;
includeToday: boolean;
}
export interface IBasicFilter extends IFilter {
operator: BasicFilterOperators;
values: (string | number | boolean)[];
}
export interface IBasicFilterWithKeys extends IBasicFilter {
target: IFilterKeyTarget;
keyValues: (string | number | boolean)[][];
}
export type ReportLevelFilters = IBasicFilter | IBasicFilterWithKeys | IAdvancedFilter | IRelativeDateFilter;
export type PageLevelFilters = IBasicFilter | IBasicFilterWithKeys | IAdvancedFilter | IRelativeDateFilter;
export type VisualLevelFilters = IBasicFilter | IBasicFilterWithKeys | IAdvancedFilter | IRelativeDateFilter | ITopNFilter | IIncludeExcludeFilter;
export type ISlicerFilter = IBasicFilter | IBasicFilterWithKeys | IAdvancedFilter | IRelativeDateFilter;
export type TopNFilterOperators = "Top" | "Bottom";
export type BasicFilterOperators = "In" | "NotIn" | "All";
export type AdvancedFilterLogicalOperators = "And" | "Or";
export type AdvancedFilterConditionOperators = "None" | "LessThan" | "LessThanOrEqual" | "GreaterThan" | "GreaterThanOrEqual" | "Contains" | "DoesNotContain" | "StartsWith" | "DoesNotStartWith" | "Is" | "IsNot" | "IsBlank" | "IsNotBlank";
export type SlicerSelector = IVisualSelector;
export interface IAdvancedFilterCondition {
value: (string | number | boolean | Date);
operator: AdvancedFilterConditionOperators;
}
export interface IAdvancedFilter extends IFilter {
logicalOperator: AdvancedFilterLogicalOperators;
conditions: IAdvancedFilterCondition[];
}
export enum FilterType {
Advanced = 0,
Basic = 1,
Unknown = 2,
IncludeExclude = 3,
RelativeDate = 4,
TopN = 5,
}
export enum RelativeDateFilterTimeUnit {
Days = 0,
Weeks = 1,
CalendarWeeks = 2,
Months = 3,
CalendarMonths = 4,
Years = 5,
CalendarYears = 6,
}
export enum RelativeDateOperators {
InLast = 0,
InThis = 1,
InNext = 2,
}
export abstract class Filter {
static schema: string;
protected static schemaUrl: string;
target: IFilterTarget;
filterType: FilterType;
protected schemaUrl: string;
constructor(
target: IFilterTarget,
filterType: FilterType
) {
this.target = target;
this.filterType = filterType;
}
toJSON(): IFilter {
return {
$schema: this.schemaUrl,
target: this.target,
filterType: this.filterType
};
};
}
export class NotSupportedFilter extends Filter {
static schemaUrl: string = "http://powerbi.com/product/schema#notSupported";
message: string;
notSupportedTypeName: string;
constructor(
target: IFilterTarget,
message: string,
notSupportedTypeName: string) {
super(target, FilterType.Unknown);
this.message = message;
this.notSupportedTypeName = notSupportedTypeName;
this.schemaUrl = NotSupportedFilter.schemaUrl;
}
toJSON(): INotSupportedFilter {
const filter = <INotSupportedFilter>super.toJSON();
filter.message = this.message;
filter.notSupportedTypeName = this.notSupportedTypeName;
return filter;
}
}
export class IncludeExcludeFilter extends Filter {
static schemaUrl: string = "http://powerbi.com/product/schema#includeExclude";
values: (string | number | boolean)[];
isExclude: boolean;
constructor(
target: IFilterTarget,
isExclude: boolean,
values: (string | number | boolean)[]) {
super(target, FilterType.IncludeExclude);
this.values = values;
this.isExclude = isExclude;
this.schemaUrl = IncludeExcludeFilter.schemaUrl;
}
toJSON(): IIncludeExcludeFilter {
const filter = <IIncludeExcludeFilter>super.toJSON();
filter.isExclude = this.isExclude;
filter.values = this.values;
return filter;
}
}
export class TopNFilter extends Filter {
static schemaUrl: string = "http://powerbi.com/product/schema#topN";
operator: TopNFilterOperators;
itemCount: number;
constructor(
target: IFilterTarget,
operator: TopNFilterOperators,
itemCount: number) {
super(target, FilterType.TopN);
this.operator = operator;
this.itemCount = itemCount;
this.schemaUrl = TopNFilter.schemaUrl;
}
toJSON(): ITopNFilter {
const filter = <ITopNFilter>super.toJSON();
filter.operator = this.operator;
filter.itemCount = this.itemCount;
return filter;
}
}
export class RelativeDateFilter extends Filter {
static schemaUrl: string = "http://powerbi.com/product/schema#relativeDate";
operator: RelativeDateOperators;
timeUnitsCount: number;
timeUnitType: RelativeDateFilterTimeUnit;
includeToday: boolean;
constructor(
target: IFilterTarget,
operator: RelativeDateOperators,
timeUnitsCount: number,
timeUnitType: RelativeDateFilterTimeUnit,
includeToday: boolean) {
super(target, FilterType.RelativeDate);
this.operator = operator;
this.timeUnitsCount = timeUnitsCount;
this.timeUnitType = timeUnitType;
this.includeToday = includeToday;
this.schemaUrl = RelativeDateFilter.schemaUrl;
}
toJSON(): IRelativeDateFilter {
const filter = <IRelativeDateFilter>super.toJSON();
filter.operator = this.operator;
filter.timeUnitsCount = this.timeUnitsCount;
filter.timeUnitType = this.timeUnitType;
filter.includeToday = this.includeToday;
return filter;
}
}
export class BasicFilter extends Filter {
static schemaUrl: string = "http://powerbi.com/product/schema#basic";
operator: BasicFilterOperators;
values: (string | number | boolean)[];
keyValues: (string | number | boolean)[][];
constructor(
target: IFilterTarget,
operator: BasicFilterOperators,
...values: ((string | number | boolean) | (string | number | boolean)[])[]
) {
super(target, FilterType.Basic);
this.operator = operator;
this.schemaUrl = BasicFilter.schemaUrl;
if (values.length === 0 && operator !== "All") {
throw new Error(`values must be a non-empty array unless your operator is "All".`);
}
/**
* Accept values as array instead of as individual arguments
* new BasicFilter('a', 'b', 1, 2);
* new BasicFilter('a', 'b', [1,2]);
*/
if (Array.isArray(values[0])) {
this.values = <(string | number | boolean)[]>values[0];
}
else {
this.values = <(string | number | boolean)[]>values;
}
}
toJSON(): IBasicFilter {
const filter = <IBasicFilter>super.toJSON();
filter.operator = this.operator;
filter.values = this.values;
return filter;
}
}
export class BasicFilterWithKeys extends BasicFilter {
keyValues: (string | number | boolean)[][];
target: IFilterKeyTarget;
constructor(
target: IFilterKeyTarget,
operator: BasicFilterOperators,
values: ((string | number | boolean) | (string | number | boolean)[]),
keyValues: (string | number | boolean)[][]
) {
super(target, operator, values);
this.keyValues = keyValues;
this.target = target;
let numberOfKeys = target.keys ? target.keys.length : 0;
if (numberOfKeys > 0 && !keyValues) {
throw new Error(`You shold pass the values to be filtered for each key. You passed: no values and ${numberOfKeys} keys`);
}
if (numberOfKeys === 0 && keyValues && keyValues.length > 0) {
throw new Error(`You passed key values but your target object doesn't contain the keys to be filtered`);
}
for (let i = 0 ; i < this.keyValues.length ; i++) {
if (this.keyValues[i] ) {
let lengthOfArray = this.keyValues[i].length;
if (lengthOfArray !== numberOfKeys) {
throw new Error(`Each tuple of key values should contain a value for each of the keys. You passed: ${lengthOfArray} values and ${numberOfKeys} keys`);
}
}
}
}
toJSON(): IBasicFilter {
const filter = <IBasicFilterWithKeys>super.toJSON();
filter.keyValues = this.keyValues;
return filter;
}
}
export class AdvancedFilter extends Filter {
static schemaUrl: string = "http://powerbi.com/product/schema#advanced";
logicalOperator: AdvancedFilterLogicalOperators;
conditions: IAdvancedFilterCondition[];
constructor(
target: IFilterTarget,
logicalOperator: AdvancedFilterLogicalOperators,
...conditions: (IAdvancedFilterCondition | IAdvancedFilterCondition[])[]
) {
super(target, FilterType.Advanced);
this.schemaUrl = AdvancedFilter.schemaUrl;
// Guard statements
if (typeof logicalOperator !== "string" || logicalOperator.length === 0) {
// TODO: It would be nicer to list out the possible logical operators.
throw new Error(`logicalOperator must be a valid operator, You passed: ${logicalOperator}`);
}
this.logicalOperator = logicalOperator;
let extractedConditions: IAdvancedFilterCondition[];
/**
* Accept conditions as array instead of as individual arguments
* new AdvancedFilter('a', 'b', "And", { value: 1, operator: "Equals" }, { value: 2, operator: "IsGreaterThan" });
* new AdvancedFilter('a', 'b', "And", [{ value: 1, operator: "Equals" }, { value: 2, operator: "IsGreaterThan" }]);
*/
if (Array.isArray(conditions[0])) {
extractedConditions = <IAdvancedFilterCondition[]>conditions[0];
}
else {
extractedConditions = <IAdvancedFilterCondition[]>conditions;
}
if (extractedConditions.length === 0) {
throw new Error(`conditions must be a non-empty array. You passed: ${conditions}`);
}
if (extractedConditions.length > 2) {
throw new Error(`AdvancedFilters may not have more than two conditions. You passed: ${conditions.length}`);
}
if (extractedConditions.length === 1 && logicalOperator !== "And") {
throw new Error(`Logical Operator must be "And" when there is only one condition provided`);
}
this.conditions = extractedConditions;
}
toJSON(): IAdvancedFilter {
const filter = <IAdvancedFilter>super.toJSON();
filter.logicalOperator = this.logicalOperator;
filter.conditions = this.conditions;
return filter;
}
}
export interface IDataReference {
target: IFilterTarget;
}
export interface IEqualsDataReference extends IDataReference {
equals: string | boolean | number | Date;
}
export interface IBetweenDataReference extends IDataReference {
between: (string | boolean | number)[];
}
export interface IValueDataReference extends IDataReference {
value: string | boolean | number | Date;
formattedValue: string;
}
export interface IIdentityValue<T extends IDataReference> {
identity: T[];
values: IValueDataReference[];
}
export function isFilterKeyColumnsTarget(target: IFilterTarget): boolean {
return isColumn(target) && !!(<IFilterKeyColumnsTarget>target).keys;
}
export function isBasicFilterWithKeys(filter: IFilter): boolean {
return getFilterType(filter) === FilterType.Basic && !!(<IBasicFilterWithKeys>filter).keyValues;
}
export function getFilterType(filter: IFilter): FilterType {
if(filter.filterType) {
return filter.filterType;
}
const basicFilter = filter as IBasicFilter;
const advancedFilter = filter as IAdvancedFilter;
if ((typeof basicFilter.operator === "string")
&& (Array.isArray(basicFilter.values))
) {
return FilterType.Basic;
}
else if ((typeof advancedFilter.logicalOperator === "string")
&& (Array.isArray(advancedFilter.conditions))
) {
return FilterType.Advanced;
}
else {
return FilterType.Unknown;
}
}
export function isMeasure(arg: any): arg is IFilterMeasureTarget {
return arg.table !== undefined && arg.measure !== undefined;
}
export function isColumn(arg: any): arg is IFilterColumnTarget {
return arg.table !== undefined && arg.column !== undefined;
}
export function isHierarchy(arg: any): arg is IFilterHierarchyTarget {
return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;
}
export interface IReportLoadConfiguration {
accessToken: string;
id: string;
groupId?: string;
settings?: ISettings;
pageName?: string;
filters?: ReportLevelFilters[];
slicers?: ISlicer[];
permissions?: Permissions;
viewMode?: ViewMode;
tokenType?: TokenType;
bookmark?: IApplyBookmarkRequest;
}
export interface IReportCreateConfiguration {
accessToken: string;
datasetId: string;
groupId?: string;
settings?: ISettings;
tokenType?: TokenType;
}
export interface IDashboardLoadConfiguration {
accessToken: string;
id: string;
groupId?: string;
pageView?: PageView;
tokenType?: TokenType;
}
export interface ITileLoadConfiguration {
accessToken: string;
id: string;
dashboardId: string;
groupId?: string;
tokenType?: TokenType;
width?: number;
height?: number;
}
export interface ISettings {
background?: BackgroundType;
bookmarksPaneEnabled?: boolean;
customLayout?: ICustomLayout;
extensions?: Extensions;
filterPaneEnabled?: boolean;
layoutType?: LayoutType;
navContentPaneEnabled?: boolean;
useCustomSaveAsDialog?: boolean;
}
export interface ISaveAsParameters {
name: string;
}
export interface IQnaSettings {
filterPaneEnabled?: boolean;
}
export interface ILoadQnaConfiguration {
accessToken: string;
datasetIds: string[];
groupId?: string;
question?: string;
viewMode?: QnaMode;
settings?: IQnaSettings;
tokenType?: TokenType;
}
export enum QnaMode {
Interactive,
ResultOnly,
}
export enum ExportDataType {
Summarized,
Underlying,
}
export enum BookmarksPlayMode {
Off,
Presentation,
}
export interface IQnaInterpretInputData {
question: string;
datasetIds?: string[];
}
export interface IReportBookmark {
name: string;
displayName: string;
state: string;
}
export interface IPlayBookmarkRequest {
playMode: BookmarksPlayMode;
}
export interface IAddBookmarkRequest {
state?: string;
displayName?: string;
apply?: boolean;
}
export type IApplyBookmarkRequest = IApplyBookmarkStateRequest | IApplyBookmarkByNameRequest;
export interface IApplyBookmarkStateRequest {
state: string;
}
export interface IApplyBookmarkByNameRequest {
name: string;
}
export interface IExportDataRequest {
rows?: number;
exportDataType?: ExportDataType;
}
export interface IExportDataResult {
data: string;
}
/*
* Selectors
*/
export interface ISelector {
$schema: string;
}
export interface IVisualSelector extends ISelector {
visualName: string;
}
export abstract class Selector implements ISelector {
public $schema: string;
constructor(schema: string) {
this.$schema = schema;
}
toJSON(): ISelector {
return {
$schema: this.$schema
};
};
}
export class VisualSelector extends Selector implements IVisualSelector {
static schemaUrl: string = "http://powerbi.com/product/schema#visualSelector";
public visualName: string;
constructor(visualName: string) {
super(VisualSelector.schemaUrl);
this.visualName = visualName;
}
toJSON(): IVisualSelector {
const selector = <IVisualSelector>super.toJSON();
selector.visualName = this.visualName;
return selector;
}
}
/*
* Slicers
*/
export interface ISlicer {
selector: SlicerSelector;
state: ISlicerState;
}
export interface ISlicerState {
filters: ISlicerFilter[];
}
function normalizeError(error: any): IError {
let message = error.message;
if (!message) {
message = `${error.path} is invalid. Not meeting ${error.keyword} constraint`;
}
return {
message
};
}
export function validateVisualSelector(input: any): IError[] {
let errors: any[] = Validators.visualSelectorValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateSlicer(input: any): IError[] {
let errors: any[] = Validators.slicerValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateSlicerState(input: any): IError[] {
let errors: any[] = Validators.slicerStateValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validatePlayBookmarkRequest(input: any): IError[] {
let errors: any[] = Validators.playBookmarkRequestValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateAddBookmarkRequest(input: any): IError[] {
let errors: any[] = Validators.addBookmarkRequestValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateApplyBookmarkByNameRequest(input: any): IError[] {
let errors: any[] = Validators.applyBookmarkByNameRequestValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateApplyBookmarkStateRequest(input: any): IError[] {
let errors: any[] = Validators.applyBookmarkStateRequestValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateSettings(input: any): IError[] {
let errors: any[] = Validators.settingsValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateCustomPageSize(input: any): IError[] {
let errors: any[] = Validators.customPageSizeValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateExtension(input: any): IError[] {
let errors: any[] = Validators.extentionValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateReportLoad(input: any): IError[] {
let errors: any[] = Validators.reportLoadValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateCreateReport(input: any): IError[] {
let errors: any[] = Validators.reportCreateValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateDashboardLoad(input: any): IError[] {
let errors: any[] = Validators.dashboardLoadValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateTileLoad(input: any): IError[] {
let errors: any[] = Validators.tileLoadValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validatePage(input: any): IError[] {
let errors: any[] = Validators.pageValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateFilter(input: any): IError[] {
let errors: any[] = Validators.filtersValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateSaveAsParameters(input: any): IError[] {
let errors: any[] = Validators.saveAsParametersValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateLoadQnaConfiguration(input: any): IError[] {
let errors: any[] = Validators.loadQnaValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateQnaInterpretInputData(input: any): IError[] {
let errors: any[] = Validators.qnaInterpretInputDataValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}
export function validateExportDataRequest(input: any): IError[] {
let errors: any[] = Validators.exportDataRequestValidator.validate(input);
return errors ? errors.map(normalizeError) : undefined;
}