@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,17 @@ 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
+ const instanceOfKeys = instance?.constructor?.['_instanceOfKeys'] ?? [];
380
+ return instanceOfKeys.includes(this._instanceOfKey);
381
+ }
370
382
  constructor(config) {
371
383
  this.isBlock = false;
372
384
  this.isBlock = config?.isBlock;
@@ -378,9 +390,39 @@ class ɵBaseExpression {
378
390
  static fromJson(dto, filterParser, expressionParser) {
379
391
  throw new Error(`fromJson not supported on expression type ${this.constructor.name}`);
380
392
  }
393
+ serializeItem(item) {
394
+ return typeof item.toJson === 'function'
395
+ ? item.toJson()
396
+ : classToPlain(item, {
397
+ exposeUnsetFields: false,
398
+ excludePrefixes: ['_'],
399
+ });
400
+ }
401
+ /**
402
+ * Converts instance to json object.
403
+ * @public
404
+ */
405
+ toJson() {
406
+ return classToPlain(this, {
407
+ exposeUnsetFields: false,
408
+ excludePrefixes: ['_'],
409
+ });
410
+ }
381
411
  }
412
+ /**
413
+ * @internal
414
+ * @dontChange
415
+ */
416
+ ɵBaseExpression._instanceOfKey = 'devkit_BaseExpression';
382
417
 
383
418
  class ɵArithmeticExpression extends ɵBaseExpression {
419
+ /**
420
+ * @internal
421
+ * @dontChange
422
+ */
423
+ static get _instanceOfKeys() {
424
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
425
+ }
384
426
  constructor(config) {
385
427
  super(config);
386
428
  this.expressionType = ɵExpressionType.ArithmeticOperation;
@@ -407,8 +449,20 @@ class ɵArithmeticExpression extends ɵBaseExpression {
407
449
  return new ɵArithmeticExpression(this);
408
450
  }
409
451
  }
452
+ /**
453
+ * @internal
454
+ * @dontChange
455
+ */
456
+ ɵArithmeticExpression._instanceOfKey = 'devkit_ArithmeticExpression';
410
457
 
411
458
  class ɵColumnExpression extends ɵBaseExpression {
459
+ /**
460
+ * @internal
461
+ * @dontChange
462
+ */
463
+ static get _instanceOfKeys() {
464
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
465
+ }
412
466
  constructor(config) {
413
467
  super(config);
414
468
  this.expressionType = ɵExpressionType.SchemaColumn;
@@ -426,6 +480,11 @@ class ɵColumnExpression extends ɵBaseExpression {
426
480
  return new ɵColumnExpression(this);
427
481
  }
428
482
  }
483
+ /**
484
+ * @internal
485
+ * @dontChange
486
+ */
487
+ ɵColumnExpression._instanceOfKey = 'devkit_ColumnExpression';
429
488
 
430
489
  /**
431
490
  * Expression parser interface
@@ -438,20 +497,58 @@ class ɵBaseExpressionParser {
438
497
  }
439
498
 
440
499
  class ɵFunctionExpression extends ɵBaseExpression {
500
+ /**
501
+ * @internal
502
+ * @dontChange
503
+ */
504
+ static get _instanceOfKeys() {
505
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
506
+ }
441
507
  constructor(config) {
442
508
  super(config);
443
509
  this.expressionType = ɵExpressionType.Function;
444
510
  }
445
511
  }
512
+ /**
513
+ * @internal
514
+ * @dontChange
515
+ */
516
+ ɵFunctionExpression._instanceOfKey = 'devkit_FunctionExpression';
446
517
 
447
518
  class ɵArgumentFunctionExpression extends ɵFunctionExpression {
519
+ /**
520
+ * @internal
521
+ * @dontChange
522
+ */
523
+ static get _instanceOfKeys() {
524
+ return [...ɵFunctionExpression._instanceOfKeys, this._instanceOfKey];
525
+ }
448
526
  constructor(config) {
449
527
  super(config);
450
528
  this.functionArgument = config?.functionArgument.clone();
451
529
  }
530
+ toJson() {
531
+ const result = super.toJson();
532
+ if (this.functionArgument) {
533
+ result['functionArgument'] = this.serializeItem(this.functionArgument);
534
+ }
535
+ return result;
536
+ }
452
537
  }
538
+ /**
539
+ * @internal
540
+ * @dontChange
541
+ */
542
+ ɵArgumentFunctionExpression._instanceOfKey = 'devkit_ArgumentFunctionExpression';
453
543
 
454
544
  class ɵAggregationFunctionExpression extends ɵArgumentFunctionExpression {
545
+ /**
546
+ * @internal
547
+ * @dontChange
548
+ */
549
+ static get _instanceOfKeys() {
550
+ return [...ɵArgumentFunctionExpression._instanceOfKeys, this._instanceOfKey];
551
+ }
455
552
  constructor(config) {
456
553
  super(config);
457
554
  this.functionType = ɵFunctionType.Aggregation;
@@ -477,8 +574,20 @@ class ɵAggregationFunctionExpression extends ɵArgumentFunctionExpression {
477
574
  return new ɵAggregationFunctionExpression(this);
478
575
  }
479
576
  }
577
+ /**
578
+ * @internal
579
+ * @dontChange
580
+ */
581
+ ɵAggregationFunctionExpression._instanceOfKey = 'devkit_AggregationFunctionExpression';
480
582
 
481
583
  class ɵDatePartFunctionExpression extends ɵArgumentFunctionExpression {
584
+ /**
585
+ * @internal
586
+ * @dontChange
587
+ */
588
+ static get _instanceOfKeys() {
589
+ return [...ɵArgumentFunctionExpression._instanceOfKeys, this._instanceOfKey];
590
+ }
482
591
  constructor(config) {
483
592
  super(config);
484
593
  this.functionType = ɵFunctionType.DatePart;
@@ -497,8 +606,20 @@ class ɵDatePartFunctionExpression extends ɵArgumentFunctionExpression {
497
606
  return new ɵDatePartFunctionExpression(this);
498
607
  }
499
608
  }
609
+ /**
610
+ * @internal
611
+ * @dontChange
612
+ */
613
+ ɵDatePartFunctionExpression._instanceOfKey = 'devkit_DatePartFunctionExpression';
500
614
 
501
615
  class ɵLengthFunctionExpression extends ɵArgumentFunctionExpression {
616
+ /**
617
+ * @internal
618
+ * @dontChange
619
+ */
620
+ static get _instanceOfKeys() {
621
+ return [...ɵArgumentFunctionExpression._instanceOfKeys, this._instanceOfKey];
622
+ }
502
623
  constructor(config) {
503
624
  super(config);
504
625
  this.functionType = ɵFunctionType.Length;
@@ -515,8 +636,20 @@ class ɵLengthFunctionExpression extends ɵArgumentFunctionExpression {
515
636
  return new ɵLengthFunctionExpression(this);
516
637
  }
517
638
  }
639
+ /**
640
+ * @internal
641
+ * @dontChange
642
+ */
643
+ ɵLengthFunctionExpression._instanceOfKey = 'devkit_LengthFunctionExpression';
518
644
 
519
645
  class ɵMacrosFunctionExpression extends ɵFunctionExpression {
646
+ /**
647
+ * @internal
648
+ * @dontChange
649
+ */
650
+ static get _instanceOfKeys() {
651
+ return [...ɵFunctionExpression._instanceOfKeys, this._instanceOfKey];
652
+ }
520
653
  constructor(config) {
521
654
  super(config);
522
655
  this.functionType = ɵFunctionType.Macros;
@@ -534,8 +667,20 @@ class ɵMacrosFunctionExpression extends ɵFunctionExpression {
534
667
  return new ɵMacrosFunctionExpression(this);
535
668
  }
536
669
  }
670
+ /**
671
+ * @internal
672
+ * @dontChange
673
+ */
674
+ ɵMacrosFunctionExpression._instanceOfKey = 'devkit_MacrosFunctionExpression';
537
675
 
538
676
  class ɵWindowFunctionExpression extends ɵArgumentFunctionExpression {
677
+ /**
678
+ * @internal
679
+ * @dontChange
680
+ */
681
+ static get _instanceOfKeys() {
682
+ return [...ɵArgumentFunctionExpression._instanceOfKeys, this._instanceOfKey];
683
+ }
539
684
  constructor(config) {
540
685
  super(config);
541
686
  this.functionType = ɵFunctionType.Window;
@@ -552,8 +697,20 @@ class ɵWindowFunctionExpression extends ɵArgumentFunctionExpression {
552
697
  return new ɵWindowFunctionExpression(this);
553
698
  }
554
699
  }
700
+ /**
701
+ * @internal
702
+ * @dontChange
703
+ */
704
+ ɵWindowFunctionExpression._instanceOfKey = 'devkit_WindowFunctionExpression';
555
705
 
556
706
  class ɵParameterExpression extends ɵBaseExpression {
707
+ /**
708
+ * @internal
709
+ * @dontChange
710
+ */
711
+ static get _instanceOfKeys() {
712
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
713
+ }
557
714
  constructor(config) {
558
715
  super(config);
559
716
  this.expressionType = ɵExpressionType.Parameter;
@@ -626,6 +783,11 @@ class ɵParameterExpression extends ɵBaseExpression {
626
783
  return new ɵParameterExpression(this);
627
784
  }
628
785
  }
786
+ /**
787
+ * @internal
788
+ * @dontChange
789
+ */
790
+ ɵParameterExpression._instanceOfKey = 'devkit_ParameterExpression';
629
791
  __decorate([
630
792
  Exclude(),
631
793
  __metadata("design:type", Object)
@@ -636,6 +798,13 @@ __decorate([
636
798
  ], ɵParameterExpression.prototype, "dataValueType", void 0);
637
799
 
638
800
  class ɵSubQueryExpression extends ɵBaseExpression {
801
+ /**
802
+ * @internal
803
+ * @dontChange
804
+ */
805
+ static get _instanceOfKeys() {
806
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
807
+ }
639
808
  constructor(config) {
640
809
  super(config);
641
810
  this.expressionType = ɵExpressionType.SubQuery;
@@ -661,9 +830,28 @@ class ɵSubQueryExpression extends ɵBaseExpression {
661
830
  clone() {
662
831
  return new ɵSubQueryExpression(this);
663
832
  }
833
+ toJson() {
834
+ const result = super.toJson();
835
+ if (this.subFilters) {
836
+ result['subFilters'] = this.serializeItem(this.subFilters);
837
+ }
838
+ return result;
839
+ }
664
840
  }
841
+ /**
842
+ * @internal
843
+ * @dontChange
844
+ */
845
+ ɵSubQueryExpression._instanceOfKey = 'devkit_SubQueryExpression';
665
846
 
666
847
  class ɵAggregationSubQueryExpression extends ɵSubQueryExpression {
848
+ /**
849
+ * @internal
850
+ * @dontChange
851
+ */
852
+ static get _instanceOfKeys() {
853
+ return [...ɵSubQueryExpression._instanceOfKeys, this._instanceOfKey];
854
+ }
667
855
  constructor(config) {
668
856
  super(config);
669
857
  this.aggregationType = config?.aggregationType;
@@ -686,6 +874,11 @@ class ɵAggregationSubQueryExpression extends ɵSubQueryExpression {
686
874
  return new ɵAggregationSubQueryExpression(this);
687
875
  }
688
876
  }
877
+ /**
878
+ * @internal
879
+ * @dontChange
880
+ */
881
+ ɵAggregationSubQueryExpression._instanceOfKey = 'devkit_AggregationSubQueryExpression';
689
882
 
690
883
  /**
691
884
  * Function expression resolver.
@@ -738,6 +931,13 @@ class ɵExpressionParser extends ɵBaseExpressionParser {
738
931
 
739
932
  const ɵEXPRESSION_TYPE_MOCK = -1;
740
933
  class ɵExpressionMock extends ɵBaseExpression {
934
+ /**
935
+ * @internal
936
+ * @dontChange
937
+ */
938
+ static get _instanceOfKeys() {
939
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
940
+ }
741
941
  constructor(config) {
742
942
  super(config || {});
743
943
  this.expressionType = ɵEXPRESSION_TYPE_MOCK;
@@ -750,8 +950,24 @@ class ɵExpressionMock extends ɵBaseExpression {
750
950
  return new ɵExpressionMock(this);
751
951
  }
752
952
  }
953
+ /**
954
+ * @internal
955
+ * @dontChange
956
+ */
957
+ ɵExpressionMock._instanceOfKey = 'devkit_ExpressionMock';
753
958
 
754
959
  class ɵBaseFilter {
960
+ /**
961
+ * @internal
962
+ * @dontChange
963
+ */
964
+ static get _instanceOfKeys() {
965
+ return [this._instanceOfKey];
966
+ }
967
+ static [Symbol.hasInstance](instance) {
968
+ const instanceOfKeys = instance?.constructor?.['_instanceOfKeys'] ?? [];
969
+ return instanceOfKeys.includes(this._instanceOfKey);
970
+ }
755
971
  constructor(filterType) {
756
972
  this.isEnabled = true;
757
973
  this.trimDateTimeParameterToDate = false;
@@ -764,9 +980,39 @@ class ɵBaseFilter {
764
980
  static fromJson(dto, filterParser, expressionParser) {
765
981
  throw new Error(`fromJson not supported on filter type ${this.constructor.name}`);
766
982
  }
983
+ serializeItem(item) {
984
+ return typeof item.toJson === 'function'
985
+ ? item.toJson()
986
+ : classToPlain(item, {
987
+ exposeUnsetFields: false,
988
+ excludePrefixes: ['_'],
989
+ });
990
+ }
991
+ /**
992
+ * Converts instance to json object.
993
+ * @public
994
+ */
995
+ toJson() {
996
+ return classToPlain(this, {
997
+ exposeUnsetFields: false,
998
+ excludePrefixes: ['_'],
999
+ });
1000
+ }
767
1001
  }
1002
+ /**
1003
+ * @internal
1004
+ * @dontChange
1005
+ */
1006
+ ɵBaseFilter._instanceOfKey = 'devkit_BaseFilter';
768
1007
 
769
1008
  class ɵFilterMock extends ɵBaseFilter {
1009
+ /**
1010
+ * @internal
1011
+ * @dontChange
1012
+ */
1013
+ static get _instanceOfKeys() {
1014
+ return [...ɵBaseFilter._instanceOfKeys, this._instanceOfKey];
1015
+ }
770
1016
  constructor(filterType = ɵFilterType.None) {
771
1017
  super(filterType);
772
1018
  }
@@ -778,6 +1024,11 @@ class ɵFilterMock extends ɵBaseFilter {
778
1024
  return new ɵFilterMock(this.filterType);
779
1025
  }
780
1026
  }
1027
+ /**
1028
+ * @internal
1029
+ * @dontChange
1030
+ */
1031
+ ɵFilterMock._instanceOfKey = 'devkit_FilterMock';
781
1032
 
782
1033
  const ɵparserMock = {
783
1034
  fromJson: (data) => ({
@@ -788,14 +1039,39 @@ const ɵparserMock = {
788
1039
  };
789
1040
 
790
1041
  class ɵSingleFilter extends ɵBaseFilter {
1042
+ /**
1043
+ * @internal
1044
+ * @dontChange
1045
+ */
1046
+ static get _instanceOfKeys() {
1047
+ return [...ɵBaseFilter._instanceOfKeys, this._instanceOfKey];
1048
+ }
791
1049
  constructor(filterType, comparisonType, leftExpression) {
792
1050
  super(filterType);
793
1051
  this.comparisonType = comparisonType;
794
1052
  this.leftExpression = leftExpression.clone();
795
1053
  }
1054
+ toJson() {
1055
+ return {
1056
+ ...super.toJson(),
1057
+ leftExpression: this.serializeItem(this.leftExpression),
1058
+ };
1059
+ }
796
1060
  }
1061
+ /**
1062
+ * @internal
1063
+ * @dontChange
1064
+ */
1065
+ ɵSingleFilter._instanceOfKey = 'devkit_SingleFilter';
797
1066
 
798
1067
  class ɵCompareFilter extends ɵSingleFilter {
1068
+ /**
1069
+ * @internal
1070
+ * @dontChange
1071
+ */
1072
+ static get _instanceOfKeys() {
1073
+ return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1074
+ }
799
1075
  constructor(comparisonType, leftExpression, rightExpression) {
800
1076
  super(ɵFilterType.Compare, comparisonType, leftExpression);
801
1077
  this.rightExpression = rightExpression.clone();
@@ -811,9 +1087,27 @@ class ɵCompareFilter extends ɵSingleFilter {
811
1087
  clone() {
812
1088
  return new ɵCompareFilter(this.comparisonType, this.leftExpression, this.rightExpression);
813
1089
  }
1090
+ toJson() {
1091
+ return {
1092
+ ...super.toJson(),
1093
+ rightExpression: this.serializeItem(this.rightExpression),
1094
+ };
1095
+ }
814
1096
  }
1097
+ /**
1098
+ * @internal
1099
+ * @dontChange
1100
+ */
1101
+ ɵCompareFilter._instanceOfKey = 'devkit_CompareFilter';
815
1102
 
816
1103
  class ɵBetweenFilter extends ɵSingleFilter {
1104
+ /**
1105
+ * @internal
1106
+ * @dontChange
1107
+ */
1108
+ static get _instanceOfKeys() {
1109
+ return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1110
+ }
817
1111
  constructor(leftExpression, rightLessExpression, rightGreaterExpression) {
818
1112
  super(ɵFilterType.Between, ɵComparisonType.Between, leftExpression);
819
1113
  this.rightLessExpression = rightLessExpression.clone();
@@ -830,9 +1124,28 @@ class ɵBetweenFilter extends ɵSingleFilter {
830
1124
  clone() {
831
1125
  return new ɵBetweenFilter(this.leftExpression, this.rightLessExpression, this.rightGreaterExpression);
832
1126
  }
1127
+ toJson() {
1128
+ return {
1129
+ ...super.toJson(),
1130
+ rightLessExpression: this.serializeItem(this.rightLessExpression),
1131
+ rightGreaterExpression: this.serializeItem(this.rightGreaterExpression),
1132
+ };
1133
+ }
833
1134
  }
1135
+ /**
1136
+ * @internal
1137
+ * @dontChange
1138
+ */
1139
+ ɵBetweenFilter._instanceOfKey = 'devkit_BetweenFilter';
834
1140
 
835
1141
  class ɵExistsFilter extends ɵSingleFilter {
1142
+ /**
1143
+ * @internal
1144
+ * @dontChange
1145
+ */
1146
+ static get _instanceOfKeys() {
1147
+ return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1148
+ }
836
1149
  constructor(leftExpression, subFilters, comparisonType = ɵComparisonType.Exists, isAggregative = true) {
837
1150
  super(ɵFilterType.Exists, comparisonType, leftExpression);
838
1151
  this.subFilters = subFilters?.clone();
@@ -850,9 +1163,28 @@ class ɵExistsFilter extends ɵSingleFilter {
850
1163
  clone() {
851
1164
  return new ɵExistsFilter(this.leftExpression, this.subFilters, this.comparisonType, this.isAggregative);
852
1165
  }
1166
+ toJson() {
1167
+ const result = super.toJson();
1168
+ if (this.subFilters) {
1169
+ result['subFilters'] = this.serializeItem(this.subFilters);
1170
+ }
1171
+ return result;
1172
+ }
853
1173
  }
1174
+ /**
1175
+ * @internal
1176
+ * @dontChange
1177
+ */
1178
+ ɵExistsFilter._instanceOfKey = 'devkit_ExistsFilter';
854
1179
 
855
1180
  class ɵInFilter extends ɵSingleFilter {
1181
+ /**
1182
+ * @internal
1183
+ * @dontChange
1184
+ */
1185
+ static get _instanceOfKeys() {
1186
+ return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1187
+ }
856
1188
  constructor(comparisonType, leftExpression, rightExpressions) {
857
1189
  super(ɵFilterType.In, comparisonType, leftExpression);
858
1190
  this.rightExpressions = rightExpressions.map((expression) => expression.clone());
@@ -868,9 +1200,27 @@ class ɵInFilter extends ɵSingleFilter {
868
1200
  clone() {
869
1201
  return new ɵInFilter(this.comparisonType, this.leftExpression, this.rightExpressions);
870
1202
  }
1203
+ toJson() {
1204
+ return {
1205
+ ...super.toJson(),
1206
+ rightExpressions: this.rightExpressions.map((expression) => this.serializeItem(expression)),
1207
+ };
1208
+ }
871
1209
  }
1210
+ /**
1211
+ * @internal
1212
+ * @dontChange
1213
+ */
1214
+ ɵInFilter._instanceOfKey = 'devkit_InFilter';
872
1215
 
873
1216
  class ɵIsNullFilter extends ɵSingleFilter {
1217
+ /**
1218
+ * @internal
1219
+ * @dontChange
1220
+ */
1221
+ static get _instanceOfKeys() {
1222
+ return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1223
+ }
874
1224
  constructor(comparisonType, leftExpression) {
875
1225
  super(ɵFilterType.IsNull, comparisonType, leftExpression);
876
1226
  }
@@ -888,6 +1238,11 @@ class ɵIsNullFilter extends ɵSingleFilter {
888
1238
  return new ɵIsNullFilter(this.comparisonType, this.leftExpression);
889
1239
  }
890
1240
  }
1241
+ /**
1242
+ * @internal
1243
+ * @dontChange
1244
+ */
1245
+ ɵIsNullFilter._instanceOfKey = 'devkit_IsNullFilter';
891
1246
  __decorate([
892
1247
  Expose(),
893
1248
  __metadata("design:type", Boolean),
@@ -1008,11 +1363,19 @@ class ɵValidationUtilities {
1008
1363
  }
1009
1364
 
1010
1365
  class ɵFilterGroup extends ɵBaseFilter {
1366
+ /**
1367
+ * @internal
1368
+ * @dontChange
1369
+ */
1370
+ static get _instanceOfKeys() {
1371
+ return [...ɵBaseFilter._instanceOfKeys, this._instanceOfKey];
1372
+ }
1011
1373
  get items() {
1012
- return classToPlain(this.filters, {
1013
- exposeUnsetFields: false,
1014
- excludePrefixes: ['_'],
1374
+ const result = {};
1375
+ this.filters.forEach((filter, key) => {
1376
+ result[key] = this.serializeItem(filter);
1015
1377
  });
1378
+ return result;
1016
1379
  }
1017
1380
  constructor(logicalOperation = ɵLogicalOperatorType.And) {
1018
1381
  super(ɵFilterType.FilterGroup);
@@ -1052,18 +1415,25 @@ class ɵFilterGroup extends ɵBaseFilter {
1052
1415
  const filter = new ɵCompareFilter(comparisonType, leftExpression, rightExpression);
1053
1416
  this.add(filter, filterKey);
1054
1417
  }
1055
- addSchemaColumnInFilterWithParameters(comparisonType, columnPath, parameterValues) {
1418
+ /**
1419
+ * Creates and adds in filter by values.
1420
+ * @param comparisonType Comparison type.
1421
+ * @param columnPath Column path.
1422
+ * @param parameterValues Parameter values.
1423
+ * @param filterKey Filter key.
1424
+ */
1425
+ addSchemaColumnInFilterWithParameters(comparisonType, columnPath, parameterValues, filterKey) {
1056
1426
  const leftExpression = new ɵColumnExpression({ columnPath });
1057
1427
  const expressions = parameterValues.map((singleParameterValue) => new ɵParameterExpression({
1058
1428
  value: singleParameterValue,
1059
1429
  }));
1060
1430
  const filter = new ɵInFilter(comparisonType, leftExpression, expressions);
1061
- this.add(filter);
1431
+ this.add(filter, filterKey);
1062
1432
  }
1063
- addSchemaColumnIsNullFilter(columnPath) {
1433
+ addSchemaColumnIsNullFilter(columnPath, filterKey) {
1064
1434
  const leftExpression = new ɵColumnExpression({ columnPath });
1065
1435
  const filter = new ɵIsNullFilter(ɵComparisonType.Is_null, leftExpression);
1066
- this.add(filter);
1436
+ this.add(filter, filterKey);
1067
1437
  }
1068
1438
  /**
1069
1439
  * Creates and adds not null filter.
@@ -1080,23 +1450,24 @@ class ɵFilterGroup extends ɵBaseFilter {
1080
1450
  * @param columnPath Column path.
1081
1451
  * @param lessParamValue Less parameter value.
1082
1452
  * @param greaterParamValue Greater parameter value.
1453
+ * @param filterKey Filter key.
1083
1454
  */
1084
- addSchemaColumnBetweenFilterWithParameters(columnPath, lessParamValue, greaterParamValue) {
1455
+ addSchemaColumnBetweenFilterWithParameters(columnPath, lessParamValue, greaterParamValue, filterKey) {
1085
1456
  const leftExpression = new ɵColumnExpression({ columnPath });
1086
1457
  const rightLessExpression = new ɵParameterExpression({ value: lessParamValue });
1087
1458
  const rightGreaterExpression = new ɵParameterExpression({ value: greaterParamValue });
1088
1459
  const filter = new ɵBetweenFilter(leftExpression, rightLessExpression, rightGreaterExpression);
1089
- this.add(filter);
1460
+ this.add(filter, filterKey);
1090
1461
  }
1091
- addExistsFilter(columnPath, subFilters) {
1462
+ addExistsFilter(columnPath, subFilters, filterKey) {
1092
1463
  const leftExpression = new ɵColumnExpression({ columnPath });
1093
1464
  const filter = new ɵExistsFilter(leftExpression, subFilters);
1094
- this.add(filter);
1465
+ this.add(filter, filterKey);
1095
1466
  }
1096
- addNotExistsFilter(columnPath, subFilters) {
1467
+ addNotExistsFilter(columnPath, subFilters, filterKey) {
1097
1468
  const leftExpression = new ɵColumnExpression({ columnPath });
1098
1469
  const filter = new ɵExistsFilter(leftExpression, subFilters, ɵComparisonType.Not_exists);
1099
- this.add(filter);
1470
+ this.add(filter, filterKey);
1100
1471
  }
1101
1472
  add(filter, filterKey) {
1102
1473
  ɵValidationUtilities.checkArgumentEmpty('filter', filter);
@@ -1111,6 +1482,11 @@ class ɵFilterGroup extends ɵBaseFilter {
1111
1482
  return filterGroup;
1112
1483
  }
1113
1484
  }
1485
+ /**
1486
+ * @internal
1487
+ * @dontChange
1488
+ */
1489
+ ɵFilterGroup._instanceOfKey = 'devkit_FilterGroup';
1114
1490
  __decorate([
1115
1491
  Exclude(),
1116
1492
  __metadata("design:type", Object)
@@ -1343,6 +1719,12 @@ class ɵBaseFilterableQuery extends ɵBaseQuery {
1343
1719
  clearFilters() {
1344
1720
  this.filters.filters.clear();
1345
1721
  }
1722
+ getMetadata() {
1723
+ return {
1724
+ ...super.getMetadata(),
1725
+ filters: this.filters.toJson(),
1726
+ };
1727
+ }
1346
1728
  }
1347
1729
 
1348
1730
  /**