@creatio/base 0.812.0 → 0.813.0

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 (38) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/esm2020/lib/public/esq/data-model/columns/base-query-column.mjs +7 -1
  3. package/esm2020/lib/public/esq/data-model/expressions/arithmetic/arithmetic-expression.mjs +7 -1
  4. package/esm2020/lib/public/esq/data-model/expressions/base-expression.mjs +1 -1
  5. package/esm2020/lib/public/esq/data-model/expressions/columns/column-expression.mjs +11 -1
  6. package/esm2020/lib/public/esq/data-model/expressions/functions/argument-function-expression.mjs +7 -1
  7. package/esm2020/lib/public/esq/data-model/expressions/functions/macros-function-expression.mjs +7 -1
  8. package/esm2020/lib/public/esq/data-model/expressions/mocks/expression.mock.mjs +7 -1
  9. package/esm2020/lib/public/esq/data-model/expressions/parameters/parameter-expression.mjs +7 -1
  10. package/esm2020/lib/public/esq/data-model/expressions/sub-queries/sub-query-expression.mjs +31 -8
  11. package/esm2020/lib/public/esq/data-model/filters/base-filter.mjs +1 -1
  12. package/esm2020/lib/public/esq/data-model/filters/between-filter.mjs +11 -1
  13. package/esm2020/lib/public/esq/data-model/filters/compare-filter.mjs +7 -1
  14. package/esm2020/lib/public/esq/data-model/filters/exists-filter.mjs +7 -1
  15. package/esm2020/lib/public/esq/data-model/filters/filter-group.mjs +32 -1
  16. package/esm2020/lib/public/esq/data-model/filters/in-filter.mjs +10 -1
  17. package/esm2020/lib/public/esq/data-model/filters/mocks/filter.mock.mjs +7 -1
  18. package/esm2020/lib/public/esq/data-model/filters/single-filter.mjs +7 -1
  19. package/esm2020/lib/public/esq/data-model/index.mjs +2 -1
  20. package/esm2020/lib/public/esq/data-model/queries/base-filterable-query.mjs +19 -1
  21. package/esm2020/lib/public/esq/data-model/queries/entity-schema-query.mjs +18 -3
  22. package/esm2020/lib/public/esq/data-model/used-column.mjs +2 -0
  23. package/esm2020/lib/public/models/index.mjs +3 -1
  24. package/esm2020/lib/public/models/item-creation-config.mjs +2 -0
  25. package/esm2020/lib/public/models/request/index.mjs +2 -1
  26. package/esm2020/lib/public/models/request/request-registration-config.model.mjs +2 -0
  27. package/esm2020/lib/public/models/view-model-collection.mjs +2 -0
  28. package/esm2020/lib/public/services/index.mjs +2 -1
  29. package/esm2020/lib/public/services/mask-service/base-mask.service.mjs +2 -0
  30. package/esm2020/lib/public/services/mask-service/index.mjs +3 -0
  31. package/esm2020/lib/public/services/mask-service/schema-view-mask.request.mjs +24 -0
  32. package/esm2020/lib/public/services/model/data-source-aggregation-config.mjs +1 -1
  33. package/fesm2015/creatio-base.mjs +406 -203
  34. package/fesm2015/creatio-base.mjs.map +1 -1
  35. package/fesm2020/creatio-base.mjs +407 -211
  36. package/fesm2020/creatio-base.mjs.map +1 -1
  37. package/index.d.ts +135 -0
  38. package/package.json +1 -1
@@ -469,6 +469,12 @@ class ɵArithmeticExpression extends ɵBaseExpression {
469
469
  clone() {
470
470
  return new ɵArithmeticExpression(this);
471
471
  }
472
+ /**
473
+ * @internal
474
+ */
475
+ _getUsedColumns() {
476
+ return [...this.leftArithmeticOperand._getUsedColumns(), ...this.rightArithmeticOperand._getUsedColumns()];
477
+ }
472
478
  }
473
479
  /**
474
480
  * @internal
@@ -500,6 +506,16 @@ class ɵColumnExpression extends ɵBaseExpression {
500
506
  clone() {
501
507
  return new ɵColumnExpression(this);
502
508
  }
509
+ /**
510
+ * @internal
511
+ */
512
+ _getUsedColumns() {
513
+ return [
514
+ {
515
+ path: this.columnPath,
516
+ },
517
+ ];
518
+ }
503
519
  }
504
520
  /**
505
521
  * @internal
@@ -555,6 +571,13 @@ class ɵArgumentFunctionExpression extends ɵFunctionExpression {
555
571
  }
556
572
  return result;
557
573
  }
574
+ /**
575
+ * @internal
576
+ */
577
+ _getUsedColumns() {
578
+ var _a, _b;
579
+ return (_b = (_a = this.functionArgument) === null || _a === void 0 ? void 0 : _a._getUsedColumns()) !== null && _b !== void 0 ? _b : [];
580
+ }
558
581
  }
559
582
  /**
560
583
  * @internal
@@ -690,6 +713,13 @@ class ɵMacrosFunctionExpression extends ɵFunctionExpression {
690
713
  clone() {
691
714
  return new ɵMacrosFunctionExpression(this);
692
715
  }
716
+ /**
717
+ * @internal
718
+ */
719
+ _getUsedColumns() {
720
+ var _a, _b;
721
+ return (_b = (_a = this.functionArgument) === null || _a === void 0 ? void 0 : _a._getUsedColumns()) !== null && _b !== void 0 ? _b : [];
722
+ }
693
723
  }
694
724
  /**
695
725
  * @internal
@@ -804,6 +834,12 @@ class ɵParameterExpression extends ɵBaseExpression {
804
834
  clone() {
805
835
  return new ɵParameterExpression(this);
806
836
  }
837
+ /**
838
+ * @internal
839
+ */
840
+ _getUsedColumns() {
841
+ return [];
842
+ }
807
843
  }
808
844
  /**
809
845
  * @internal
@@ -819,161 +855,6 @@ __decorate([
819
855
  __metadata("design:type", Number)
820
856
  ], ɵParameterExpression.prototype, "dataValueType", void 0);
821
857
 
822
- class ɵSubQueryExpression extends ɵBaseExpression {
823
- /**
824
- * @internal
825
- * @dontChange
826
- */
827
- static get _instanceOfKeys() {
828
- return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
829
- }
830
- constructor(config) {
831
- super(config);
832
- this.expressionType = ɵExpressionType.SubQuery;
833
- this.columnPath = config === null || config === void 0 ? void 0 : config.columnPath;
834
- const subFilter = config === null || config === void 0 ? void 0 : config.subFilters;
835
- this.subFilters = typeof (subFilter === null || subFilter === void 0 ? void 0 : subFilter.clone) === 'function' ? subFilter.clone() : subFilter;
836
- this.subOrderDirection = config.subOrderDirection;
837
- this.subOrderColumn = config.subOrderColumn;
838
- }
839
- /**
840
- * Parses expression from json.
841
- * @public
842
- */
843
- static fromJson(dto, filterParser) {
844
- const expression = new ɵSubQueryExpression({
845
- columnPath: dto['columnPath'],
846
- subFilters: filterParser.fromJson(dto['subFilters']),
847
- subOrderDirection: dto['subOrderDirection'],
848
- subOrderColumn: dto['subOrderColumn'],
849
- });
850
- return expression;
851
- }
852
- clone() {
853
- return new ɵSubQueryExpression(this);
854
- }
855
- toJson() {
856
- const result = super.toJson();
857
- if (this.subFilters) {
858
- result['subFilters'] = this.serializeItem(this.subFilters);
859
- }
860
- return result;
861
- }
862
- }
863
- /**
864
- * @internal
865
- * @dontChange
866
- */
867
- ɵSubQueryExpression._instanceOfKey = 'devkit_SubQueryExpression';
868
-
869
- class ɵAggregationSubQueryExpression extends ɵSubQueryExpression {
870
- /**
871
- * @internal
872
- * @dontChange
873
- */
874
- static get _instanceOfKeys() {
875
- return [...ɵSubQueryExpression._instanceOfKeys, this._instanceOfKey];
876
- }
877
- constructor(config) {
878
- super(config);
879
- this.aggregationType = config === null || config === void 0 ? void 0 : config.aggregationType;
880
- this.functionType = config === null || config === void 0 ? void 0 : config.functionType;
881
- }
882
- /**
883
- * Parses expression from json.
884
- * @public
885
- */
886
- static fromJson(dto, filterParser) {
887
- const subQueryExpression = super.fromJson(dto, filterParser);
888
- const expression = new ɵAggregationSubQueryExpression(Object.assign({ aggregationType: dto['aggregationType'], functionType: dto['functionType'] }, subQueryExpression));
889
- return expression;
890
- }
891
- clone() {
892
- return new ɵAggregationSubQueryExpression(this);
893
- }
894
- }
895
- /**
896
- * @internal
897
- * @dontChange
898
- */
899
- ɵAggregationSubQueryExpression._instanceOfKey = 'devkit_AggregationSubQueryExpression';
900
-
901
- /**
902
- * Function expression resolver.
903
- * @public
904
- */
905
- class FunctionExpressionResolver {
906
- static resolve(dto) {
907
- const expressionClass = {
908
- [ɵFunctionType.Macros]: ɵMacrosFunctionExpression,
909
- [ɵFunctionType.Length]: ɵLengthFunctionExpression,
910
- [ɵFunctionType.Window]: ɵWindowFunctionExpression,
911
- [ɵFunctionType.DatePart]: ɵDatePartFunctionExpression,
912
- [ɵFunctionType.DateAdd]: ɵDatePartFunctionExpression,
913
- [ɵFunctionType.DateDiff]: ɵDatePartFunctionExpression,
914
- };
915
- return expressionClass[dto['functionType']];
916
- }
917
- }
918
- /**
919
- * Expression resolver.
920
- * @public
921
- */
922
- class ɵExpressionResolver {
923
- static resolve(expressionType, dto) {
924
- const expressionClass = {
925
- [ɵExpressionType.SchemaColumn]: ɵColumnExpression,
926
- [ɵExpressionType.Parameter]: ɵParameterExpression,
927
- [ɵExpressionType.SubQuery]: ɵAggregationSubQueryExpression,
928
- [ɵExpressionType.ArithmeticOperation]: ɵArithmeticExpression,
929
- [ɵExpressionType.Function]: FunctionExpressionResolver.resolve(dto),
930
- };
931
- return expressionClass[expressionType];
932
- }
933
- }
934
-
935
- /**
936
- * Expression parser.
937
- * @public
938
- */
939
- class ɵExpressionParser extends ɵBaseExpressionParser {
940
- /**
941
- * Parses expression from json.
942
- * @public
943
- */
944
- static fromJson(dto, filterParser) {
945
- const expressionType = dto['expressionType'];
946
- return ɵExpressionResolver.resolve(expressionType, dto).fromJson(dto, filterParser, ɵExpressionParser);
947
- }
948
- }
949
-
950
- const ɵEXPRESSION_TYPE_MOCK = -1;
951
- class ɵExpressionMock extends ɵBaseExpression {
952
- /**
953
- * @internal
954
- * @dontChange
955
- */
956
- static get _instanceOfKeys() {
957
- return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
958
- }
959
- constructor(config) {
960
- super(config || {});
961
- this.expressionType = ɵEXPRESSION_TYPE_MOCK;
962
- }
963
- // eslint-disable-next-line @typescript-eslint/ban-types
964
- get plainObject() {
965
- return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
966
- }
967
- clone() {
968
- return new ɵExpressionMock(this);
969
- }
970
- }
971
- /**
972
- * @internal
973
- * @dontChange
974
- */
975
- ɵExpressionMock._instanceOfKey = 'devkit_ExpressionMock';
976
-
977
858
  class ɵBaseFilter {
978
859
  /**
979
860
  * @internal
@@ -1024,36 +905,6 @@ class ɵBaseFilter {
1024
905
  */
1025
906
  ɵBaseFilter._instanceOfKey = 'devkit_BaseFilter';
1026
907
 
1027
- class ɵFilterMock extends ɵBaseFilter {
1028
- /**
1029
- * @internal
1030
- * @dontChange
1031
- */
1032
- static get _instanceOfKeys() {
1033
- return [...ɵBaseFilter._instanceOfKeys, this._instanceOfKey];
1034
- }
1035
- constructor(filterType = ɵFilterType.None) {
1036
- super(filterType);
1037
- }
1038
- // eslint-disable-next-line @typescript-eslint/ban-types
1039
- get plainObject() {
1040
- return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
1041
- }
1042
- clone() {
1043
- return new ɵFilterMock(this.filterType);
1044
- }
1045
- }
1046
- /**
1047
- * @internal
1048
- * @dontChange
1049
- */
1050
- ɵFilterMock._instanceOfKey = 'devkit_FilterMock';
1051
-
1052
- const ɵparserMock = {
1053
- fromJson: (data) => (Object.assign(Object.assign({}, data), { clone: () => data })),
1054
- clone: () => this,
1055
- };
1056
-
1057
908
  class ɵSingleFilter extends ɵBaseFilter {
1058
909
  /**
1059
910
  * @internal
@@ -1070,6 +921,12 @@ class ɵSingleFilter extends ɵBaseFilter {
1070
921
  toJson() {
1071
922
  return Object.assign(Object.assign({}, super.toJson()), { leftExpression: this.serializeItem(this.leftExpression) });
1072
923
  }
924
+ /**
925
+ * @internal
926
+ */
927
+ _getUsedColumns() {
928
+ return this.leftExpression._getUsedColumns();
929
+ }
1073
930
  }
1074
931
  /**
1075
932
  * @internal
@@ -1077,7 +934,7 @@ class ɵSingleFilter extends ɵBaseFilter {
1077
934
  */
1078
935
  ɵSingleFilter._instanceOfKey = 'devkit_SingleFilter';
1079
936
 
1080
- class ɵCompareFilter extends ɵSingleFilter {
937
+ class ɵBetweenFilter extends ɵSingleFilter {
1081
938
  /**
1082
939
  * @internal
1083
940
  * @dontChange
@@ -1085,35 +942,46 @@ class ɵCompareFilter extends ɵSingleFilter {
1085
942
  static get _instanceOfKeys() {
1086
943
  return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1087
944
  }
1088
- constructor(comparisonType, leftExpression, rightExpression) {
1089
- super(ɵFilterType.Compare, comparisonType, leftExpression);
1090
- this.rightExpression = rightExpression.clone();
945
+ constructor(leftExpression, rightLessExpression, rightGreaterExpression) {
946
+ super(ɵFilterType.Between, ɵComparisonType.Between, leftExpression);
947
+ this.rightLessExpression = rightLessExpression.clone();
948
+ this.rightGreaterExpression = rightGreaterExpression.clone();
1091
949
  }
1092
950
  /**
1093
951
  * Parses filter from json.
1094
952
  * @public
1095
953
  */
1096
954
  static fromJson(dto, filterParser, expressionParser) {
1097
- const filter = new ɵCompareFilter(dto['comparisonType'], expressionParser.fromJson(dto['leftExpression'], filterParser), expressionParser.fromJson(dto['rightExpression'], filterParser));
955
+ const filter = new ɵBetweenFilter(expressionParser.fromJson(dto['leftExpression'], filterParser), expressionParser.fromJson(dto['rightLessExpression'], filterParser), expressionParser.fromJson(dto['rightGreaterExpression'], filterParser));
1098
956
  return filter;
1099
957
  }
1100
958
  clone() {
1101
- const filter = new ɵCompareFilter(this.comparisonType, this.leftExpression, this.rightExpression);
959
+ const filter = new ɵBetweenFilter(this.leftExpression, this.rightLessExpression, this.rightGreaterExpression);
1102
960
  filter.isEnabled = this.isEnabled;
1103
961
  filter.trimDateTimeParameterToDate = this.trimDateTimeParameterToDate;
1104
962
  return filter;
1105
963
  }
1106
964
  toJson() {
1107
- return Object.assign(Object.assign({}, super.toJson()), { rightExpression: this.serializeItem(this.rightExpression) });
965
+ return Object.assign(Object.assign({}, super.toJson()), { rightLessExpression: this.serializeItem(this.rightLessExpression), rightGreaterExpression: this.serializeItem(this.rightGreaterExpression) });
966
+ }
967
+ /**
968
+ * @internal
969
+ */
970
+ _getUsedColumns() {
971
+ return [
972
+ ...super._getUsedColumns(),
973
+ ...this.rightLessExpression._getUsedColumns(),
974
+ ...this.rightGreaterExpression._getUsedColumns(),
975
+ ];
1108
976
  }
1109
977
  }
1110
978
  /**
1111
979
  * @internal
1112
980
  * @dontChange
1113
981
  */
1114
- ɵCompareFilter._instanceOfKey = 'devkit_CompareFilter';
982
+ ɵBetweenFilter._instanceOfKey = 'devkit_BetweenFilter';
1115
983
 
1116
- class ɵBetweenFilter extends ɵSingleFilter {
984
+ class ɵCompareFilter extends ɵSingleFilter {
1117
985
  /**
1118
986
  * @internal
1119
987
  * @dontChange
@@ -1121,34 +989,39 @@ class ɵBetweenFilter extends ɵSingleFilter {
1121
989
  static get _instanceOfKeys() {
1122
990
  return [...ɵSingleFilter._instanceOfKeys, this._instanceOfKey];
1123
991
  }
1124
- constructor(leftExpression, rightLessExpression, rightGreaterExpression) {
1125
- super(ɵFilterType.Between, ɵComparisonType.Between, leftExpression);
1126
- this.rightLessExpression = rightLessExpression.clone();
1127
- this.rightGreaterExpression = rightGreaterExpression.clone();
992
+ constructor(comparisonType, leftExpression, rightExpression) {
993
+ super(ɵFilterType.Compare, comparisonType, leftExpression);
994
+ this.rightExpression = rightExpression.clone();
1128
995
  }
1129
996
  /**
1130
997
  * Parses filter from json.
1131
998
  * @public
1132
999
  */
1133
1000
  static fromJson(dto, filterParser, expressionParser) {
1134
- const filter = new ɵBetweenFilter(expressionParser.fromJson(dto['leftExpression'], filterParser), expressionParser.fromJson(dto['rightLessExpression'], filterParser), expressionParser.fromJson(dto['rightGreaterExpression'], filterParser));
1001
+ const filter = new ɵCompareFilter(dto['comparisonType'], expressionParser.fromJson(dto['leftExpression'], filterParser), expressionParser.fromJson(dto['rightExpression'], filterParser));
1135
1002
  return filter;
1136
1003
  }
1137
1004
  clone() {
1138
- const filter = new ɵBetweenFilter(this.leftExpression, this.rightLessExpression, this.rightGreaterExpression);
1005
+ const filter = new ɵCompareFilter(this.comparisonType, this.leftExpression, this.rightExpression);
1139
1006
  filter.isEnabled = this.isEnabled;
1140
1007
  filter.trimDateTimeParameterToDate = this.trimDateTimeParameterToDate;
1141
1008
  return filter;
1142
1009
  }
1143
1010
  toJson() {
1144
- return Object.assign(Object.assign({}, super.toJson()), { rightLessExpression: this.serializeItem(this.rightLessExpression), rightGreaterExpression: this.serializeItem(this.rightGreaterExpression) });
1011
+ return Object.assign(Object.assign({}, super.toJson()), { rightExpression: this.serializeItem(this.rightExpression) });
1012
+ }
1013
+ /**
1014
+ * @internal
1015
+ */
1016
+ _getUsedColumns() {
1017
+ return [...super._getUsedColumns(), ...this.rightExpression._getUsedColumns()];
1145
1018
  }
1146
1019
  }
1147
1020
  /**
1148
1021
  * @internal
1149
1022
  * @dontChange
1150
1023
  */
1151
- ɵBetweenFilter._instanceOfKey = 'devkit_BetweenFilter';
1024
+ ɵCompareFilter._instanceOfKey = 'devkit_CompareFilter';
1152
1025
 
1153
1026
  class ɵExistsFilter extends ɵSingleFilter {
1154
1027
  /**
@@ -1185,6 +1058,13 @@ class ɵExistsFilter extends ɵSingleFilter {
1185
1058
  }
1186
1059
  return result;
1187
1060
  }
1061
+ /**
1062
+ * @internal
1063
+ */
1064
+ _getUsedColumns() {
1065
+ var _a, _b;
1066
+ return [...super._getUsedColumns(), ...((_b = (_a = this.subFilters) === null || _a === void 0 ? void 0 : _a._getUsedColumns()) !== null && _b !== void 0 ? _b : [])];
1067
+ }
1188
1068
  }
1189
1069
  /**
1190
1070
  * @internal
@@ -1222,6 +1102,15 @@ class ɵInFilter extends ɵSingleFilter {
1222
1102
  toJson() {
1223
1103
  return Object.assign(Object.assign({}, super.toJson()), { rightExpressions: this.rightExpressions.map((expression) => this.serializeItem(expression)) });
1224
1104
  }
1105
+ /**
1106
+ * @internal
1107
+ */
1108
+ _getUsedColumns() {
1109
+ const rightExpressionsUsedColumns = this.rightExpressions
1110
+ .map((expression) => expression._getUsedColumns())
1111
+ .flat();
1112
+ return [...super._getUsedColumns(), ...rightExpressionsUsedColumns];
1113
+ }
1225
1114
  }
1226
1115
  /**
1227
1116
  * @internal
@@ -1414,6 +1303,22 @@ class ɵFilterGroup extends ɵBaseFilter {
1414
1303
  });
1415
1304
  return group;
1416
1305
  }
1306
+ /**
1307
+ * Converts instance to json object.
1308
+ * @public
1309
+ */
1310
+ toJson() {
1311
+ const result = {};
1312
+ result['filterType'] = this.filterType;
1313
+ result['isEnabled'] = this.isEnabled;
1314
+ result['logicalOperation'] = this.logicalOperation;
1315
+ result['trimDateTimeParameterToDate'] = this.trimDateTimeParameterToDate;
1316
+ result['items'] = this.items;
1317
+ if (this.rootSchemaName) {
1318
+ result['rootSchemaName'] = this.rootSchemaName;
1319
+ }
1320
+ return result;
1321
+ }
1417
1322
  _createParameterValueExpressions(values) {
1418
1323
  return values.map((value) => new ɵParameterExpression({
1419
1324
  value: value,
@@ -1517,6 +1422,24 @@ class ɵFilterGroup extends ɵBaseFilter {
1517
1422
  filterGroup.trimDateTimeParameterToDate = this.trimDateTimeParameterToDate;
1518
1423
  return filterGroup;
1519
1424
  }
1425
+ /**
1426
+ * @internal
1427
+ */
1428
+ _getUsedColumns() {
1429
+ const result = [];
1430
+ this.filters.forEach((filter) => {
1431
+ let filterUsedColumns = filter._getUsedColumns ? filter._getUsedColumns() : [];
1432
+ filterUsedColumns = filterUsedColumns.map((usedColumn) => {
1433
+ var _a;
1434
+ return ({
1435
+ path: usedColumn.path,
1436
+ schemaName: (_a = usedColumn.schemaName) !== null && _a !== void 0 ? _a : this.rootSchemaName,
1437
+ });
1438
+ });
1439
+ result.push(...filterUsedColumns);
1440
+ });
1441
+ return result;
1442
+ }
1520
1443
  }
1521
1444
  /**
1522
1445
  * @internal
@@ -1533,6 +1456,226 @@ __decorate([
1533
1456
  __metadata("design:paramtypes", [])
1534
1457
  ], ɵFilterGroup.prototype, "items", null);
1535
1458
 
1459
+ class ɵSubQueryExpression extends ɵBaseExpression {
1460
+ /**
1461
+ * @internal
1462
+ * @dontChange
1463
+ */
1464
+ static get _instanceOfKeys() {
1465
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
1466
+ }
1467
+ constructor(config) {
1468
+ super(config);
1469
+ this.expressionType = ɵExpressionType.SubQuery;
1470
+ this.columnPath = config === null || config === void 0 ? void 0 : config.columnPath;
1471
+ const subFilters = config === null || config === void 0 ? void 0 : config.subFilters;
1472
+ if (typeof (subFilters === null || subFilters === void 0 ? void 0 : subFilters.clone) === 'function') {
1473
+ this.subFilters = subFilters.clone();
1474
+ }
1475
+ else if (subFilters) {
1476
+ this.subFilters = new ɵFilterGroup(subFilters.logicalOperation, subFilters.rootSchemaName);
1477
+ Object.entries(subFilters.items).forEach(([key, filter]) => {
1478
+ this.subFilters.add(filter, key);
1479
+ });
1480
+ }
1481
+ else {
1482
+ this.subFilters = subFilters;
1483
+ }
1484
+ this.subOrderDirection = config.subOrderDirection;
1485
+ this.subOrderColumn = config.subOrderColumn;
1486
+ }
1487
+ /**
1488
+ * Parses expression from json.
1489
+ * @public
1490
+ */
1491
+ static fromJson(dto, filterParser) {
1492
+ const expression = new ɵSubQueryExpression({
1493
+ columnPath: dto['columnPath'],
1494
+ subFilters: filterParser.fromJson(dto['subFilters']),
1495
+ subOrderDirection: dto['subOrderDirection'],
1496
+ subOrderColumn: dto['subOrderColumn'],
1497
+ });
1498
+ return expression;
1499
+ }
1500
+ clone() {
1501
+ return new ɵSubQueryExpression(this);
1502
+ }
1503
+ toJson() {
1504
+ const result = super.toJson();
1505
+ if (this.subFilters) {
1506
+ result['subFilters'] = this.serializeItem(this.subFilters);
1507
+ }
1508
+ return result;
1509
+ }
1510
+ /**
1511
+ * @internal
1512
+ */
1513
+ _getUsedColumns() {
1514
+ var _a, _b;
1515
+ return [
1516
+ {
1517
+ path: this.columnPath,
1518
+ },
1519
+ ...((_b = (_a = this.subFilters) === null || _a === void 0 ? void 0 : _a._getUsedColumns()) !== null && _b !== void 0 ? _b : []),
1520
+ ];
1521
+ }
1522
+ }
1523
+ /**
1524
+ * @internal
1525
+ * @dontChange
1526
+ */
1527
+ ɵSubQueryExpression._instanceOfKey = 'devkit_SubQueryExpression';
1528
+
1529
+ class ɵAggregationSubQueryExpression extends ɵSubQueryExpression {
1530
+ /**
1531
+ * @internal
1532
+ * @dontChange
1533
+ */
1534
+ static get _instanceOfKeys() {
1535
+ return [...ɵSubQueryExpression._instanceOfKeys, this._instanceOfKey];
1536
+ }
1537
+ constructor(config) {
1538
+ super(config);
1539
+ this.aggregationType = config === null || config === void 0 ? void 0 : config.aggregationType;
1540
+ this.functionType = config === null || config === void 0 ? void 0 : config.functionType;
1541
+ }
1542
+ /**
1543
+ * Parses expression from json.
1544
+ * @public
1545
+ */
1546
+ static fromJson(dto, filterParser) {
1547
+ const subQueryExpression = super.fromJson(dto, filterParser);
1548
+ const expression = new ɵAggregationSubQueryExpression(Object.assign({ aggregationType: dto['aggregationType'], functionType: dto['functionType'] }, subQueryExpression));
1549
+ return expression;
1550
+ }
1551
+ clone() {
1552
+ return new ɵAggregationSubQueryExpression(this);
1553
+ }
1554
+ }
1555
+ /**
1556
+ * @internal
1557
+ * @dontChange
1558
+ */
1559
+ ɵAggregationSubQueryExpression._instanceOfKey = 'devkit_AggregationSubQueryExpression';
1560
+
1561
+ /**
1562
+ * Function expression resolver.
1563
+ * @public
1564
+ */
1565
+ class FunctionExpressionResolver {
1566
+ static resolve(dto) {
1567
+ const expressionClass = {
1568
+ [ɵFunctionType.Macros]: ɵMacrosFunctionExpression,
1569
+ [ɵFunctionType.Length]: ɵLengthFunctionExpression,
1570
+ [ɵFunctionType.Window]: ɵWindowFunctionExpression,
1571
+ [ɵFunctionType.DatePart]: ɵDatePartFunctionExpression,
1572
+ [ɵFunctionType.DateAdd]: ɵDatePartFunctionExpression,
1573
+ [ɵFunctionType.DateDiff]: ɵDatePartFunctionExpression,
1574
+ };
1575
+ return expressionClass[dto['functionType']];
1576
+ }
1577
+ }
1578
+ /**
1579
+ * Expression resolver.
1580
+ * @public
1581
+ */
1582
+ class ɵExpressionResolver {
1583
+ static resolve(expressionType, dto) {
1584
+ const expressionClass = {
1585
+ [ɵExpressionType.SchemaColumn]: ɵColumnExpression,
1586
+ [ɵExpressionType.Parameter]: ɵParameterExpression,
1587
+ [ɵExpressionType.SubQuery]: ɵAggregationSubQueryExpression,
1588
+ [ɵExpressionType.ArithmeticOperation]: ɵArithmeticExpression,
1589
+ [ɵExpressionType.Function]: FunctionExpressionResolver.resolve(dto),
1590
+ };
1591
+ return expressionClass[expressionType];
1592
+ }
1593
+ }
1594
+
1595
+ /**
1596
+ * Expression parser.
1597
+ * @public
1598
+ */
1599
+ class ɵExpressionParser extends ɵBaseExpressionParser {
1600
+ /**
1601
+ * Parses expression from json.
1602
+ * @public
1603
+ */
1604
+ static fromJson(dto, filterParser) {
1605
+ const expressionType = dto['expressionType'];
1606
+ return ɵExpressionResolver.resolve(expressionType, dto).fromJson(dto, filterParser, ɵExpressionParser);
1607
+ }
1608
+ }
1609
+
1610
+ const ɵEXPRESSION_TYPE_MOCK = -1;
1611
+ class ɵExpressionMock extends ɵBaseExpression {
1612
+ /**
1613
+ * @internal
1614
+ * @dontChange
1615
+ */
1616
+ static get _instanceOfKeys() {
1617
+ return [...ɵBaseExpression._instanceOfKeys, this._instanceOfKey];
1618
+ }
1619
+ constructor(config) {
1620
+ super(config || {});
1621
+ this.expressionType = ɵEXPRESSION_TYPE_MOCK;
1622
+ }
1623
+ // eslint-disable-next-line @typescript-eslint/ban-types
1624
+ get plainObject() {
1625
+ return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
1626
+ }
1627
+ clone() {
1628
+ return new ɵExpressionMock(this);
1629
+ }
1630
+ /**
1631
+ * @internal
1632
+ */
1633
+ _getUsedColumns() {
1634
+ return [];
1635
+ }
1636
+ }
1637
+ /**
1638
+ * @internal
1639
+ * @dontChange
1640
+ */
1641
+ ɵExpressionMock._instanceOfKey = 'devkit_ExpressionMock';
1642
+
1643
+ class ɵFilterMock extends ɵBaseFilter {
1644
+ /**
1645
+ * @internal
1646
+ * @dontChange
1647
+ */
1648
+ static get _instanceOfKeys() {
1649
+ return [...ɵBaseFilter._instanceOfKeys, this._instanceOfKey];
1650
+ }
1651
+ constructor(filterType = ɵFilterType.None) {
1652
+ super(filterType);
1653
+ }
1654
+ // eslint-disable-next-line @typescript-eslint/ban-types
1655
+ get plainObject() {
1656
+ return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
1657
+ }
1658
+ clone() {
1659
+ return new ɵFilterMock(this.filterType);
1660
+ }
1661
+ /**
1662
+ * @internal
1663
+ */
1664
+ _getUsedColumns() {
1665
+ return [];
1666
+ }
1667
+ }
1668
+ /**
1669
+ * @internal
1670
+ * @dontChange
1671
+ */
1672
+ ɵFilterMock._instanceOfKey = 'devkit_FilterMock';
1673
+
1674
+ const ɵparserMock = {
1675
+ fromJson: (data) => (Object.assign(Object.assign({}, data), { clone: () => data })),
1676
+ clone: () => this,
1677
+ };
1678
+
1536
1679
  /**
1537
1680
  * Filter parser interface
1538
1681
  * @public
@@ -1627,6 +1770,12 @@ class ɵBaseQueryColumn {
1627
1770
  this.caption = caption;
1628
1771
  return this;
1629
1772
  }
1773
+ /**
1774
+ * @internal
1775
+ */
1776
+ _getUsedColumns() {
1777
+ return this.expression._getUsedColumns();
1778
+ }
1630
1779
  }
1631
1780
 
1632
1781
  class ɵArithmeticQueryColumn extends ɵBaseQueryColumn {
@@ -1759,7 +1908,23 @@ class ɵBaseFilterableQuery extends ɵBaseQuery {
1759
1908
  getMetadata() {
1760
1909
  return Object.assign(Object.assign({}, super.getMetadata()), { filters: this.filters.toJson() });
1761
1910
  }
1911
+ /**
1912
+ * @internal
1913
+ */
1914
+ _getUsedColumns() {
1915
+ const usedColumns = this.filters._getUsedColumns();
1916
+ usedColumns.forEach((usedColumn) => {
1917
+ if (!usedColumn.schemaName) {
1918
+ usedColumn.schemaName = this.rootSchemaName;
1919
+ }
1920
+ });
1921
+ return usedColumns;
1922
+ }
1762
1923
  }
1924
+ __decorate([
1925
+ Exclude(),
1926
+ __metadata("design:type", Object)
1927
+ ], ɵBaseFilterableQuery.prototype, "filters", void 0);
1763
1928
 
1764
1929
  /**
1765
1930
  * @public
@@ -1966,6 +2131,21 @@ class ɵEntitySchemaQuery extends ɵBaseFilterableQuery {
1966
2131
  this._internalAddColumn(columnAlias, column);
1967
2132
  return column;
1968
2133
  }
2134
+ /**
2135
+ * @internal
2136
+ */
2137
+ _getUsedColumns() {
2138
+ const usedColumns = [];
2139
+ this._columns.forEach((column) => {
2140
+ usedColumns.push(...column._getUsedColumns());
2141
+ });
2142
+ usedColumns.forEach((usedColumn) => {
2143
+ if (!usedColumn.schemaName) {
2144
+ usedColumn.schemaName = this.rootSchemaName;
2145
+ }
2146
+ });
2147
+ return [...usedColumns, ...super._getUsedColumns()];
2148
+ }
1969
2149
  }
1970
2150
 
1971
2151
  /**
@@ -2063,9 +2243,32 @@ var ɵModelParameterType;
2063
2243
  ɵModelParameterType["Never"] = "never";
2064
2244
  })(ɵModelParameterType || (ɵModelParameterType = {}));
2065
2245
 
2246
+ /**
2247
+ * @public
2248
+ * @description Actions of mask request.
2249
+ */
2250
+ var ɵSchemaViewMaskRequestAction;
2251
+ (function (ɵSchemaViewMaskRequestAction) {
2252
+ ɵSchemaViewMaskRequestAction["AddTask"] = "addTask";
2253
+ ɵSchemaViewMaskRequestAction["RemoveTask"] = "removeTask";
2254
+ })(ɵSchemaViewMaskRequestAction || (ɵSchemaViewMaskRequestAction = {}));
2255
+ /**
2256
+ * @public
2257
+ * @description Request to show mask.
2258
+ */
2259
+ class ɵSchemaViewMaskRequest extends ɵBaseRequest {
2260
+ constructor(action, taskName, $context) {
2261
+ super();
2262
+ this.action = action;
2263
+ this.taskName = taskName;
2264
+ this.$context = $context;
2265
+ this.type = 'crt.SchemaViewMaskRequest';
2266
+ }
2267
+ }
2268
+
2066
2269
  /**
2067
2270
  * Generated bundle index. Do not edit.
2068
2271
  */
2069
2272
 
2070
- export { LookupMode, ɵAggregationEvalType, ɵAggregationFunction, ɵAggregationFunctionColumn, ɵAggregationFunctionExpression, ɵAggregationSubQueryColumn, ɵAggregationSubQueryExpression, ɵAggregationType, ɵArgumentEmptyException, ɵArgumentFunctionExpression, ɵArgumentOutOfRangeException, ɵArithmeticExpression, ɵArithmeticOperation, ɵArithmeticQueryColumn, ɵBaseExpression, ɵBaseExpressionParser, ɵBaseFilter, ɵBaseFilterParser, ɵBaseFilterableQuery, ɵBaseQuery, ɵBaseQueryColumn, ɵBaseRequest, ɵBetweenFilter, ɵColumnExpression, ɵCompareFilter, ɵComparisonType, ɵDEFAULT_COLUMN_PLAIN_OBJ, ɵDEFAULT_FILTER_PLAIN_OBJ, ɵDataSchemaAttributeType, ɵDataSchemaAttributeUsageType, ɵDataSchemaType, ɵDataSourceScope, ɵDataValueType, ɵDatePartFunctionColumn, ɵDatePartFunctionExpression, ɵDatePartType, ɵDefaultValueSource, ɵDeleteQuery, ɵEMPTY_GUID, ɵEXPRESSION_TYPE_MOCK, ɵEntityQueryColumn, ɵEntitySchemaQuery, ɵExistsFilter, ɵExpressionMock, ɵExpressionParser, ɵExpressionResolver, ɵExpressionType, ɵFilterGroup, ɵFilterMock, ɵFilterParser, ɵFilterResolver, ɵFilterType, ɵFunctionExpression, ɵFunctionType, ɵInFilter, ɵInsertQuery, ɵIsNullFilter, ɵItemNotFoundException, ɵLengthFunctionColumn, ɵLengthFunctionExpression, ɵLogicalOperatorType, ɵMacrosFunctionColumn, ɵMacrosFunctionExpression, ɵModelInPageAction, ɵModelParameterType, ɵNextHandlerAlreadySpecifiedException, ɵOrderDirection, ɵParameterExpression, ɵParameterQueryColumn, ɵQueryMacrosType, ɵQueryOperationType, ɵSelectLocalizationQuery, ɵSingleFilter, ɵSubQueryColumn, ɵSubQueryExpression, ɵUpdateQuery, ɵValidationUtilities, ɵWindowFunctionColumn, ɵWindowFunctionExpression, ɵencodeDate, ɵgenerateGuid, ɵgetColumnPlainObj, ɵgetFilterPlainObj, ɵisEmptyGuid, ɵisGuid, ɵparserMock, ɵtoLocalISOString };
2273
+ export { LookupMode, ɵAggregationEvalType, ɵAggregationFunction, ɵAggregationFunctionColumn, ɵAggregationFunctionExpression, ɵAggregationSubQueryColumn, ɵAggregationSubQueryExpression, ɵAggregationType, ɵArgumentEmptyException, ɵArgumentFunctionExpression, ɵArgumentOutOfRangeException, ɵArithmeticExpression, ɵArithmeticOperation, ɵArithmeticQueryColumn, ɵBaseExpression, ɵBaseExpressionParser, ɵBaseFilter, ɵBaseFilterParser, ɵBaseFilterableQuery, ɵBaseQuery, ɵBaseQueryColumn, ɵBaseRequest, ɵBetweenFilter, ɵColumnExpression, ɵCompareFilter, ɵComparisonType, ɵDEFAULT_COLUMN_PLAIN_OBJ, ɵDEFAULT_FILTER_PLAIN_OBJ, ɵDataSchemaAttributeType, ɵDataSchemaAttributeUsageType, ɵDataSchemaType, ɵDataSourceScope, ɵDataValueType, ɵDatePartFunctionColumn, ɵDatePartFunctionExpression, ɵDatePartType, ɵDefaultValueSource, ɵDeleteQuery, ɵEMPTY_GUID, ɵEXPRESSION_TYPE_MOCK, ɵEntityQueryColumn, ɵEntitySchemaQuery, ɵExistsFilter, ɵExpressionMock, ɵExpressionParser, ɵExpressionResolver, ɵExpressionType, ɵFilterGroup, ɵFilterMock, ɵFilterParser, ɵFilterResolver, ɵFilterType, ɵFunctionExpression, ɵFunctionType, ɵInFilter, ɵInsertQuery, ɵIsNullFilter, ɵItemNotFoundException, ɵLengthFunctionColumn, ɵLengthFunctionExpression, ɵLogicalOperatorType, ɵMacrosFunctionColumn, ɵMacrosFunctionExpression, ɵModelInPageAction, ɵModelParameterType, ɵNextHandlerAlreadySpecifiedException, ɵOrderDirection, ɵParameterExpression, ɵParameterQueryColumn, ɵQueryMacrosType, ɵQueryOperationType, ɵSchemaViewMaskRequest, ɵSchemaViewMaskRequestAction, ɵSelectLocalizationQuery, ɵSingleFilter, ɵSubQueryColumn, ɵSubQueryExpression, ɵUpdateQuery, ɵValidationUtilities, ɵWindowFunctionColumn, ɵWindowFunctionExpression, ɵencodeDate, ɵgenerateGuid, ɵgetColumnPlainObj, ɵgetFilterPlainObj, ɵisEmptyGuid, ɵisGuid, ɵparserMock, ɵtoLocalISOString };
2071
2274
  //# sourceMappingURL=creatio-base.mjs.map