@creatio/base 0.810.0 → 0.811.1

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/esm2020/lib/index.mjs +2 -1
  3. package/esm2020/lib/public/esq/data-model/enums/comparison-type.enum.mjs +2 -1
  4. package/esm2020/lib/public/esq/data-model/expressions/arithmetic/arithmetic-expression.mjs +13 -1
  5. package/esm2020/lib/public/esq/data-model/expressions/base-expression.mjs +36 -1
  6. package/esm2020/lib/public/esq/data-model/expressions/columns/column-expression.mjs +13 -1
  7. package/esm2020/lib/public/esq/data-model/expressions/functions/aggregation-function-expression.mjs +13 -1
  8. package/esm2020/lib/public/esq/data-model/expressions/functions/argument-function-expression.mjs +20 -1
  9. package/esm2020/lib/public/esq/data-model/expressions/functions/date-part-function-expression.mjs +13 -1
  10. package/esm2020/lib/public/esq/data-model/expressions/functions/function-expression.mjs +13 -1
  11. package/esm2020/lib/public/esq/data-model/expressions/functions/length-function-expression.mjs +13 -1
  12. package/esm2020/lib/public/esq/data-model/expressions/functions/macros-function-expression.mjs +13 -1
  13. package/esm2020/lib/public/esq/data-model/expressions/functions/window-function-expression.mjs +13 -1
  14. package/esm2020/lib/public/esq/data-model/expressions/mocks/expression.mock.mjs +13 -1
  15. package/esm2020/lib/public/esq/data-model/expressions/parameters/parameter-expression.mjs +13 -1
  16. package/esm2020/lib/public/esq/data-model/expressions/sub-queries/aggregation-sub-query-expression.mjs +13 -1
  17. package/esm2020/lib/public/esq/data-model/expressions/sub-queries/sub-query-expression.mjs +20 -1
  18. package/esm2020/lib/public/esq/data-model/filters/base-filter.mjs +36 -1
  19. package/esm2020/lib/public/esq/data-model/filters/between-filter.mjs +20 -1
  20. package/esm2020/lib/public/esq/data-model/filters/compare-filter.mjs +19 -1
  21. package/esm2020/lib/public/esq/data-model/filters/exists-filter.mjs +20 -1
  22. package/esm2020/lib/public/esq/data-model/filters/filter-group.mjs +36 -15
  23. package/esm2020/lib/public/esq/data-model/filters/in-filter.mjs +19 -1
  24. package/esm2020/lib/public/esq/data-model/filters/isnull-filter.mjs +13 -1
  25. package/esm2020/lib/public/esq/data-model/filters/mocks/filter.mock.mjs +13 -1
  26. package/esm2020/lib/public/esq/data-model/filters/single-filter.mjs +19 -1
  27. package/esm2020/lib/public/esq/data-model/queries/base-filterable-query.mjs +7 -1
  28. package/esm2020/lib/public/interfaces/index.mjs +2 -0
  29. package/esm2020/lib/public/interfaces/serializable.mjs +2 -0
  30. package/fesm2015/creatio-base.mjs +382 -14
  31. package/fesm2015/creatio-base.mjs.map +1 -1
  32. package/fesm2020/creatio-base.mjs +396 -14
  33. package/fesm2020/creatio-base.mjs.map +1 -1
  34. package/index.d.ts +87 -7
  35. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
+ import { classToPlain, Exclude, Expose } from 'class-transformer';
1
2
  import { __decorate, __metadata } from 'tslib';
2
- import { Exclude, classToPlain, Expose } from 'class-transformer';
3
3
 
4
4
  /**
5
5
  * @public
@@ -203,6 +203,7 @@ var ɵArithmeticOperation;
203
203
  ɵArithmeticOperation[ɵArithmeticOperation["Division"] = 3] = "Division";
204
204
  })(ɵArithmeticOperation || (ɵArithmeticOperation = {}));
205
205
 
206
+ /* eslint-disable @typescript-eslint/naming-convention */
206
207
  var ɵComparisonType;
207
208
  (function (ɵComparisonType) {
208
209
  ɵComparisonType[ɵComparisonType["Between"] = 0] = "Between";
@@ -367,6 +368,18 @@ var ɵQueryMacrosType;
367
368
  })(ɵQueryMacrosType || (ɵQueryMacrosType = {}));
368
369
 
369
370
  class ɵBaseExpression {
371
+ /**
372
+ * @internal
373
+ * @dontChange
374
+ */
375
+ static get _instanceOfKeys() {
376
+ return [this._instanceOfKey];
377
+ }
378
+ static [Symbol.hasInstance](instance) {
379
+ var _a, _b;
380
+ const instanceOfKeys = (_b = (_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKeys']) !== null && _b !== void 0 ? _b : [];
381
+ return instanceOfKeys.includes(this._instanceOfKey);
382
+ }
370
383
  constructor(config) {
371
384
  this.isBlock = false;
372
385
  this.isBlock = config === null || config === void 0 ? void 0 : config.isBlock;
@@ -378,9 +391,39 @@ class ɵBaseExpression {
378
391
  static fromJson(dto, filterParser, expressionParser) {
379
392
  throw new Error(`fromJson not supported on expression type ${this.constructor.name}`);
380
393
  }
394
+ serializeItem(item) {
395
+ return typeof item.toJson === 'function'
396
+ ? item.toJson()
397
+ : classToPlain(item, {
398
+ exposeUnsetFields: false,
399
+ excludePrefixes: ['_'],
400
+ });
401
+ }
402
+ /**
403
+ * Converts instance to json object.
404
+ * @public
405
+ */
406
+ toJson() {
407
+ return classToPlain(this, {
408
+ exposeUnsetFields: false,
409
+ excludePrefixes: ['_'],
410
+ });
411
+ }
381
412
  }
413
+ /**
414
+ * @internal
415
+ * @dontChange
416
+ */
417
+ ɵBaseExpression._instanceOfKey = 'devkit_BaseExpression';
382
418
 
383
419
  class ɵArithmeticExpression extends ɵBaseExpression {
420
+ /**
421
+ * @internal
422
+ * @dontChange
423
+ */
424
+ static get _instanceOfKeys() {
425
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
426
+ }
384
427
  constructor(config) {
385
428
  super(config);
386
429
  this.expressionType = ɵExpressionType.ArithmeticOperation;
@@ -407,8 +450,20 @@ class ɵArithmeticExpression extends ɵBaseExpression {
407
450
  return new ɵArithmeticExpression(this);
408
451
  }
409
452
  }
453
+ /**
454
+ * @internal
455
+ * @dontChange
456
+ */
457
+ ɵArithmeticExpression._instanceOfKey = 'devkit_ArithmeticExpression';
410
458
 
411
459
  class ɵColumnExpression extends ɵBaseExpression {
460
+ /**
461
+ * @internal
462
+ * @dontChange
463
+ */
464
+ static get _instanceOfKeys() {
465
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
466
+ }
412
467
  constructor(config) {
413
468
  super(config);
414
469
  this.expressionType = ɵExpressionType.SchemaColumn;
@@ -426,6 +481,11 @@ class ɵColumnExpression extends ɵBaseExpression {
426
481
  return new ɵColumnExpression(this);
427
482
  }
428
483
  }
484
+ /**
485
+ * @internal
486
+ * @dontChange
487
+ */
488
+ ɵColumnExpression._instanceOfKey = 'devkit_ColumnExpression';
429
489
 
430
490
  /**
431
491
  * Expression parser interface
@@ -438,20 +498,58 @@ class ɵBaseExpressionParser {
438
498
  }
439
499
 
440
500
  class ɵFunctionExpression extends ɵBaseExpression {
501
+ /**
502
+ * @internal
503
+ * @dontChange
504
+ */
505
+ static get _instanceOfKeys() {
506
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
507
+ }
441
508
  constructor(config) {
442
509
  super(config);
443
510
  this.expressionType = ɵExpressionType.Function;
444
511
  }
445
512
  }
513
+ /**
514
+ * @internal
515
+ * @dontChange
516
+ */
517
+ ɵFunctionExpression._instanceOfKey = 'devkit_FunctionExpression';
446
518
 
447
519
  class ɵArgumentFunctionExpression extends ɵFunctionExpression {
520
+ /**
521
+ * @internal
522
+ * @dontChange
523
+ */
524
+ static get _instanceOfKeys() {
525
+ return [...ɵFunctionExpression._instanceOfKeys, this._instanceOfKey];
526
+ }
448
527
  constructor(config) {
449
528
  super(config);
450
529
  this.functionArgument = config === null || config === void 0 ? void 0 : config.functionArgument.clone();
451
530
  }
531
+ toJson() {
532
+ const result = super.toJson();
533
+ if (this.functionArgument) {
534
+ result['functionArgument'] = this.serializeItem(this.functionArgument);
535
+ }
536
+ return result;
537
+ }
452
538
  }
539
+ /**
540
+ * @internal
541
+ * @dontChange
542
+ */
543
+ ɵArgumentFunctionExpression._instanceOfKey = 'devkit_ArgumentFunctionExpression';
453
544
 
454
545
  class ɵAggregationFunctionExpression extends ɵArgumentFunctionExpression {
546
+ /**
547
+ * @internal
548
+ * @dontChange
549
+ */
550
+ static get _instanceOfKeys() {
551
+ return [...ɵArgumentFunctionExpression._instanceOfKeys, this._instanceOfKey];
552
+ }
455
553
  constructor(config) {
456
554
  super(config);
457
555
  this.functionType = ɵFunctionType.Aggregation;
@@ -477,8 +575,20 @@ class ɵAggregationFunctionExpression extends ɵArgumentFunctionExpression {
477
575
  return new ɵAggregationFunctionExpression(this);
478
576
  }
479
577
  }
578
+ /**
579
+ * @internal
580
+ * @dontChange
581
+ */
582
+ ɵAggregationFunctionExpression._instanceOfKey = 'devkit_AggregationFunctionExpression';
480
583
 
481
584
  class ɵDatePartFunctionExpression extends ɵArgumentFunctionExpression {
585
+ /**
586
+ * @internal
587
+ * @dontChange
588
+ */
589
+ static get _instanceOfKeys() {
590
+ return [...ɵArgumentFunctionExpression._instanceOfKeys, this._instanceOfKey];
591
+ }
482
592
  constructor(config) {
483
593
  super(config);
484
594
  this.functionType = ɵFunctionType.DatePart;
@@ -497,8 +607,20 @@ class ɵDatePartFunctionExpression extends ɵArgumentFunctionExpression {
497
607
  return new ɵDatePartFunctionExpression(this);
498
608
  }
499
609
  }
610
+ /**
611
+ * @internal
612
+ * @dontChange
613
+ */
614
+ ɵDatePartFunctionExpression._instanceOfKey = 'devkit_DatePartFunctionExpression';
500
615
 
501
616
  class ɵLengthFunctionExpression extends ɵArgumentFunctionExpression {
617
+ /**
618
+ * @internal
619
+ * @dontChange
620
+ */
621
+ static get _instanceOfKeys() {
622
+ return [...ɵArgumentFunctionExpression._instanceOfKeys, this._instanceOfKey];
623
+ }
502
624
  constructor(config) {
503
625
  super(config);
504
626
  this.functionType = ɵFunctionType.Length;
@@ -515,8 +637,20 @@ class ɵLengthFunctionExpression extends ɵArgumentFunctionExpression {
515
637
  return new ɵLengthFunctionExpression(this);
516
638
  }
517
639
  }
640
+ /**
641
+ * @internal
642
+ * @dontChange
643
+ */
644
+ ɵLengthFunctionExpression._instanceOfKey = 'devkit_LengthFunctionExpression';
518
645
 
519
646
  class ɵMacrosFunctionExpression extends ɵFunctionExpression {
647
+ /**
648
+ * @internal
649
+ * @dontChange
650
+ */
651
+ static get _instanceOfKeys() {
652
+ return [...ɵFunctionExpression._instanceOfKeys, this._instanceOfKey];
653
+ }
520
654
  constructor(config) {
521
655
  super(config);
522
656
  this.functionType = ɵFunctionType.Macros;
@@ -534,8 +668,20 @@ class ɵMacrosFunctionExpression extends ɵFunctionExpression {
534
668
  return new ɵMacrosFunctionExpression(this);
535
669
  }
536
670
  }
671
+ /**
672
+ * @internal
673
+ * @dontChange
674
+ */
675
+ ɵMacrosFunctionExpression._instanceOfKey = 'devkit_MacrosFunctionExpression';
537
676
 
538
677
  class ɵWindowFunctionExpression extends ɵArgumentFunctionExpression {
678
+ /**
679
+ * @internal
680
+ * @dontChange
681
+ */
682
+ static get _instanceOfKeys() {
683
+ return [...ɵArgumentFunctionExpression._instanceOfKeys, this._instanceOfKey];
684
+ }
539
685
  constructor(config) {
540
686
  super(config);
541
687
  this.functionType = ɵFunctionType.Window;
@@ -552,8 +698,20 @@ class ɵWindowFunctionExpression extends ɵArgumentFunctionExpression {
552
698
  return new ɵWindowFunctionExpression(this);
553
699
  }
554
700
  }
701
+ /**
702
+ * @internal
703
+ * @dontChange
704
+ */
705
+ ɵWindowFunctionExpression._instanceOfKey = 'devkit_WindowFunctionExpression';
555
706
 
556
707
  class ɵParameterExpression extends ɵBaseExpression {
708
+ /**
709
+ * @internal
710
+ * @dontChange
711
+ */
712
+ static get _instanceOfKeys() {
713
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
714
+ }
557
715
  constructor(config) {
558
716
  var _a;
559
717
  super(config);
@@ -624,6 +782,11 @@ class ɵParameterExpression extends ɵBaseExpression {
624
782
  return new ɵParameterExpression(this);
625
783
  }
626
784
  }
785
+ /**
786
+ * @internal
787
+ * @dontChange
788
+ */
789
+ ɵParameterExpression._instanceOfKey = 'devkit_ParameterExpression';
627
790
  __decorate([
628
791
  Exclude(),
629
792
  __metadata("design:type", Object)
@@ -634,6 +797,13 @@ __decorate([
634
797
  ], ɵParameterExpression.prototype, "dataValueType", void 0);
635
798
 
636
799
  class ɵSubQueryExpression extends ɵBaseExpression {
800
+ /**
801
+ * @internal
802
+ * @dontChange
803
+ */
804
+ static get _instanceOfKeys() {
805
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
806
+ }
637
807
  constructor(config) {
638
808
  super(config);
639
809
  this.expressionType = ɵExpressionType.SubQuery;
@@ -659,9 +829,28 @@ class ɵSubQueryExpression extends ɵBaseExpression {
659
829
  clone() {
660
830
  return new ɵSubQueryExpression(this);
661
831
  }
832
+ toJson() {
833
+ const result = super.toJson();
834
+ if (this.subFilters) {
835
+ result['subFilters'] = this.serializeItem(this.subFilters);
836
+ }
837
+ return result;
838
+ }
662
839
  }
840
+ /**
841
+ * @internal
842
+ * @dontChange
843
+ */
844
+ ɵSubQueryExpression._instanceOfKey = 'devkit_SubQueryExpression';
663
845
 
664
846
  class ɵAggregationSubQueryExpression extends ɵSubQueryExpression {
847
+ /**
848
+ * @internal
849
+ * @dontChange
850
+ */
851
+ static get _instanceOfKeys() {
852
+ return [...ɵSubQueryExpression._instanceOfKeys, this._instanceOfKey];
853
+ }
665
854
  constructor(config) {
666
855
  super(config);
667
856
  this.aggregationType = config === null || config === void 0 ? void 0 : config.aggregationType;
@@ -680,6 +869,11 @@ class ɵAggregationSubQueryExpression extends ɵSubQueryExpression {
680
869
  return new ɵAggregationSubQueryExpression(this);
681
870
  }
682
871
  }
872
+ /**
873
+ * @internal
874
+ * @dontChange
875
+ */
876
+ ɵAggregationSubQueryExpression._instanceOfKey = 'devkit_AggregationSubQueryExpression';
683
877
 
684
878
  /**
685
879
  * Function expression resolver.
@@ -732,6 +926,13 @@ class ɵExpressionParser extends ɵBaseExpressionParser {
732
926
 
733
927
  const ɵEXPRESSION_TYPE_MOCK = -1;
734
928
  class ɵExpressionMock extends ɵBaseExpression {
929
+ /**
930
+ * @internal
931
+ * @dontChange
932
+ */
933
+ static get _instanceOfKeys() {
934
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
935
+ }
735
936
  constructor(config) {
736
937
  super(config || {});
737
938
  this.expressionType = ɵEXPRESSION_TYPE_MOCK;
@@ -744,8 +945,25 @@ class ɵExpressionMock extends ɵBaseExpression {
744
945
  return new ɵExpressionMock(this);
745
946
  }
746
947
  }
948
+ /**
949
+ * @internal
950
+ * @dontChange
951
+ */
952
+ ɵExpressionMock._instanceOfKey = 'devkit_ExpressionMock';
747
953
 
748
954
  class ɵBaseFilter {
955
+ /**
956
+ * @internal
957
+ * @dontChange
958
+ */
959
+ static get _instanceOfKeys() {
960
+ return [this._instanceOfKey];
961
+ }
962
+ static [Symbol.hasInstance](instance) {
963
+ var _a, _b;
964
+ const instanceOfKeys = (_b = (_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKeys']) !== null && _b !== void 0 ? _b : [];
965
+ return instanceOfKeys.includes(this._instanceOfKey);
966
+ }
749
967
  constructor(filterType) {
750
968
  this.isEnabled = true;
751
969
  this.trimDateTimeParameterToDate = false;
@@ -758,9 +976,39 @@ class ɵBaseFilter {
758
976
  static fromJson(dto, filterParser, expressionParser) {
759
977
  throw new Error(`fromJson not supported on filter type ${this.constructor.name}`);
760
978
  }
979
+ serializeItem(item) {
980
+ return typeof item.toJson === 'function'
981
+ ? item.toJson()
982
+ : classToPlain(item, {
983
+ exposeUnsetFields: false,
984
+ excludePrefixes: ['_'],
985
+ });
986
+ }
987
+ /**
988
+ * Converts instance to json object.
989
+ * @public
990
+ */
991
+ toJson() {
992
+ return classToPlain(this, {
993
+ exposeUnsetFields: false,
994
+ excludePrefixes: ['_'],
995
+ });
996
+ }
761
997
  }
998
+ /**
999
+ * @internal
1000
+ * @dontChange
1001
+ */
1002
+ ɵBaseFilter._instanceOfKey = 'devkit_BaseFilter';
762
1003
 
763
1004
  class ɵFilterMock extends ɵBaseFilter {
1005
+ /**
1006
+ * @internal
1007
+ * @dontChange
1008
+ */
1009
+ static get _instanceOfKeys() {
1010
+ return [...ɵBaseFilter._instanceOfKeys, this._instanceOfKey];
1011
+ }
764
1012
  constructor(filterType = ɵFilterType.None) {
765
1013
  super(filterType);
766
1014
  }
@@ -772,6 +1020,11 @@ class ɵFilterMock extends ɵBaseFilter {
772
1020
  return new ɵFilterMock(this.filterType);
773
1021
  }
774
1022
  }
1023
+ /**
1024
+ * @internal
1025
+ * @dontChange
1026
+ */
1027
+ ɵFilterMock._instanceOfKey = 'devkit_FilterMock';
775
1028
 
776
1029
  const ɵparserMock = {
777
1030
  fromJson: (data) => (Object.assign(Object.assign({}, data), { clone: () => data })),
@@ -779,14 +1032,36 @@ const ɵparserMock = {
779
1032
  };
780
1033
 
781
1034
  class ɵSingleFilter extends ɵBaseFilter {
1035
+ /**
1036
+ * @internal
1037
+ * @dontChange
1038
+ */
1039
+ static get _instanceOfKeys() {
1040
+ return [...ɵBaseFilter._instanceOfKeys, this._instanceOfKey];
1041
+ }
782
1042
  constructor(filterType, comparisonType, leftExpression) {
783
1043
  super(filterType);
784
1044
  this.comparisonType = comparisonType;
785
1045
  this.leftExpression = leftExpression.clone();
786
1046
  }
1047
+ toJson() {
1048
+ return Object.assign(Object.assign({}, super.toJson()), { leftExpression: this.serializeItem(this.leftExpression) });
1049
+ }
787
1050
  }
1051
+ /**
1052
+ * @internal
1053
+ * @dontChange
1054
+ */
1055
+ ɵSingleFilter._instanceOfKey = 'devkit_SingleFilter';
788
1056
 
789
1057
  class ɵCompareFilter extends ɵSingleFilter {
1058
+ /**
1059
+ * @internal
1060
+ * @dontChange
1061
+ */
1062
+ static get _instanceOfKeys() {
1063
+ return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1064
+ }
790
1065
  constructor(comparisonType, leftExpression, rightExpression) {
791
1066
  super(ɵFilterType.Compare, comparisonType, leftExpression);
792
1067
  this.rightExpression = rightExpression.clone();
@@ -802,9 +1077,24 @@ class ɵCompareFilter extends ɵSingleFilter {
802
1077
  clone() {
803
1078
  return new ɵCompareFilter(this.comparisonType, this.leftExpression, this.rightExpression);
804
1079
  }
1080
+ toJson() {
1081
+ return Object.assign(Object.assign({}, super.toJson()), { rightExpression: this.serializeItem(this.rightExpression) });
1082
+ }
805
1083
  }
1084
+ /**
1085
+ * @internal
1086
+ * @dontChange
1087
+ */
1088
+ ɵCompareFilter._instanceOfKey = 'devkit_CompareFilter';
806
1089
 
807
1090
  class ɵBetweenFilter extends ɵSingleFilter {
1091
+ /**
1092
+ * @internal
1093
+ * @dontChange
1094
+ */
1095
+ static get _instanceOfKeys() {
1096
+ return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1097
+ }
808
1098
  constructor(leftExpression, rightLessExpression, rightGreaterExpression) {
809
1099
  super(ɵFilterType.Between, ɵComparisonType.Between, leftExpression);
810
1100
  this.rightLessExpression = rightLessExpression.clone();
@@ -821,9 +1111,24 @@ class ɵBetweenFilter extends ɵSingleFilter {
821
1111
  clone() {
822
1112
  return new ɵBetweenFilter(this.leftExpression, this.rightLessExpression, this.rightGreaterExpression);
823
1113
  }
1114
+ toJson() {
1115
+ return Object.assign(Object.assign({}, super.toJson()), { rightLessExpression: this.serializeItem(this.rightLessExpression), rightGreaterExpression: this.serializeItem(this.rightGreaterExpression) });
1116
+ }
824
1117
  }
1118
+ /**
1119
+ * @internal
1120
+ * @dontChange
1121
+ */
1122
+ ɵBetweenFilter._instanceOfKey = 'devkit_BetweenFilter';
825
1123
 
826
1124
  class ɵExistsFilter extends ɵSingleFilter {
1125
+ /**
1126
+ * @internal
1127
+ * @dontChange
1128
+ */
1129
+ static get _instanceOfKeys() {
1130
+ return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1131
+ }
827
1132
  constructor(leftExpression, subFilters, comparisonType = ɵComparisonType.Exists, isAggregative = true) {
828
1133
  super(ɵFilterType.Exists, comparisonType, leftExpression);
829
1134
  this.subFilters = subFilters === null || subFilters === void 0 ? void 0 : subFilters.clone();
@@ -841,9 +1146,28 @@ class ɵExistsFilter extends ɵSingleFilter {
841
1146
  clone() {
842
1147
  return new ɵExistsFilter(this.leftExpression, this.subFilters, this.comparisonType, this.isAggregative);
843
1148
  }
1149
+ toJson() {
1150
+ const result = super.toJson();
1151
+ if (this.subFilters) {
1152
+ result['subFilters'] = this.serializeItem(this.subFilters);
1153
+ }
1154
+ return result;
1155
+ }
844
1156
  }
1157
+ /**
1158
+ * @internal
1159
+ * @dontChange
1160
+ */
1161
+ ɵExistsFilter._instanceOfKey = 'devkit_ExistsFilter';
845
1162
 
846
1163
  class ɵInFilter extends ɵSingleFilter {
1164
+ /**
1165
+ * @internal
1166
+ * @dontChange
1167
+ */
1168
+ static get _instanceOfKeys() {
1169
+ return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1170
+ }
847
1171
  constructor(comparisonType, leftExpression, rightExpressions) {
848
1172
  super(ɵFilterType.In, comparisonType, leftExpression);
849
1173
  this.rightExpressions = rightExpressions.map((expression) => expression.clone());
@@ -860,9 +1184,24 @@ class ɵInFilter extends ɵSingleFilter {
860
1184
  clone() {
861
1185
  return new ɵInFilter(this.comparisonType, this.leftExpression, this.rightExpressions);
862
1186
  }
1187
+ toJson() {
1188
+ return Object.assign(Object.assign({}, super.toJson()), { rightExpressions: this.rightExpressions.map((expression) => this.serializeItem(expression)) });
1189
+ }
863
1190
  }
1191
+ /**
1192
+ * @internal
1193
+ * @dontChange
1194
+ */
1195
+ ɵInFilter._instanceOfKey = 'devkit_InFilter';
864
1196
 
865
1197
  class ɵIsNullFilter extends ɵSingleFilter {
1198
+ /**
1199
+ * @internal
1200
+ * @dontChange
1201
+ */
1202
+ static get _instanceOfKeys() {
1203
+ return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1204
+ }
866
1205
  constructor(comparisonType, leftExpression) {
867
1206
  super(ɵFilterType.IsNull, comparisonType, leftExpression);
868
1207
  }
@@ -880,6 +1219,11 @@ class ɵIsNullFilter extends ɵSingleFilter {
880
1219
  return new ɵIsNullFilter(this.comparisonType, this.leftExpression);
881
1220
  }
882
1221
  }
1222
+ /**
1223
+ * @internal
1224
+ * @dontChange
1225
+ */
1226
+ ɵIsNullFilter._instanceOfKey = 'devkit_IsNullFilter';
883
1227
  __decorate([
884
1228
  Expose(),
885
1229
  __metadata("design:type", Boolean),
@@ -1000,11 +1344,19 @@ class ɵValidationUtilities {
1000
1344
  }
1001
1345
 
1002
1346
  class ɵFilterGroup extends ɵBaseFilter {
1347
+ /**
1348
+ * @internal
1349
+ * @dontChange
1350
+ */
1351
+ static get _instanceOfKeys() {
1352
+ return [...ɵBaseFilter._instanceOfKeys, this._instanceOfKey];
1353
+ }
1003
1354
  get items() {
1004
- return classToPlain(this.filters, {
1005
- exposeUnsetFields: false,
1006
- excludePrefixes: ['_'],
1355
+ const result = {};
1356
+ this.filters.forEach((filter, key) => {
1357
+ result[key] = this.serializeItem(filter);
1007
1358
  });
1359
+ return result;
1008
1360
  }
1009
1361
  constructor(logicalOperation = ɵLogicalOperatorType.And) {
1010
1362
  super(ɵFilterType.FilterGroup);
@@ -1044,18 +1396,25 @@ class ɵFilterGroup extends ɵBaseFilter {
1044
1396
  const filter = new ɵCompareFilter(comparisonType, leftExpression, rightExpression);
1045
1397
  this.add(filter, filterKey);
1046
1398
  }
1047
- addSchemaColumnInFilterWithParameters(comparisonType, columnPath, parameterValues) {
1399
+ /**
1400
+ * Creates and adds in filter by values.
1401
+ * @param comparisonType Comparison type.
1402
+ * @param columnPath Column path.
1403
+ * @param parameterValues Parameter values.
1404
+ * @param filterKey Filter key.
1405
+ */
1406
+ addSchemaColumnInFilterWithParameters(comparisonType, columnPath, parameterValues, filterKey) {
1048
1407
  const leftExpression = new ɵColumnExpression({ columnPath });
1049
1408
  const expressions = parameterValues.map((singleParameterValue) => new ɵParameterExpression({
1050
1409
  value: singleParameterValue,
1051
1410
  }));
1052
1411
  const filter = new ɵInFilter(comparisonType, leftExpression, expressions);
1053
- this.add(filter);
1412
+ this.add(filter, filterKey);
1054
1413
  }
1055
- addSchemaColumnIsNullFilter(columnPath) {
1414
+ addSchemaColumnIsNullFilter(columnPath, filterKey) {
1056
1415
  const leftExpression = new ɵColumnExpression({ columnPath });
1057
1416
  const filter = new ɵIsNullFilter(ɵComparisonType.Is_null, leftExpression);
1058
- this.add(filter);
1417
+ this.add(filter, filterKey);
1059
1418
  }
1060
1419
  /**
1061
1420
  * Creates and adds not null filter.
@@ -1072,23 +1431,24 @@ class ɵFilterGroup extends ɵBaseFilter {
1072
1431
  * @param columnPath Column path.
1073
1432
  * @param lessParamValue Less parameter value.
1074
1433
  * @param greaterParamValue Greater parameter value.
1434
+ * @param filterKey Filter key.
1075
1435
  */
1076
- addSchemaColumnBetweenFilterWithParameters(columnPath, lessParamValue, greaterParamValue) {
1436
+ addSchemaColumnBetweenFilterWithParameters(columnPath, lessParamValue, greaterParamValue, filterKey) {
1077
1437
  const leftExpression = new ɵColumnExpression({ columnPath });
1078
1438
  const rightLessExpression = new ɵParameterExpression({ value: lessParamValue });
1079
1439
  const rightGreaterExpression = new ɵParameterExpression({ value: greaterParamValue });
1080
1440
  const filter = new ɵBetweenFilter(leftExpression, rightLessExpression, rightGreaterExpression);
1081
- this.add(filter);
1441
+ this.add(filter, filterKey);
1082
1442
  }
1083
- addExistsFilter(columnPath, subFilters) {
1443
+ addExistsFilter(columnPath, subFilters, filterKey) {
1084
1444
  const leftExpression = new ɵColumnExpression({ columnPath });
1085
1445
  const filter = new ɵExistsFilter(leftExpression, subFilters);
1086
- this.add(filter);
1446
+ this.add(filter, filterKey);
1087
1447
  }
1088
- addNotExistsFilter(columnPath, subFilters) {
1448
+ addNotExistsFilter(columnPath, subFilters, filterKey) {
1089
1449
  const leftExpression = new ɵColumnExpression({ columnPath });
1090
1450
  const filter = new ɵExistsFilter(leftExpression, subFilters, ɵComparisonType.Not_exists);
1091
- this.add(filter);
1451
+ this.add(filter, filterKey);
1092
1452
  }
1093
1453
  add(filter, filterKey) {
1094
1454
  ɵValidationUtilities.checkArgumentEmpty('filter', filter);
@@ -1103,6 +1463,11 @@ class ɵFilterGroup extends ɵBaseFilter {
1103
1463
  return filterGroup;
1104
1464
  }
1105
1465
  }
1466
+ /**
1467
+ * @internal
1468
+ * @dontChange
1469
+ */
1470
+ ɵFilterGroup._instanceOfKey = 'devkit_FilterGroup';
1106
1471
  __decorate([
1107
1472
  Exclude(),
1108
1473
  __metadata("design:type", Object)
@@ -1331,6 +1696,9 @@ class ɵBaseFilterableQuery extends ɵBaseQuery {
1331
1696
  clearFilters() {
1332
1697
  this.filters.filters.clear();
1333
1698
  }
1699
+ getMetadata() {
1700
+ return Object.assign(Object.assign({}, super.getMetadata()), { filters: this.filters.toJson() });
1701
+ }
1334
1702
  }
1335
1703
 
1336
1704
  /**