@creatio/base 0.810.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.
- package/CHANGELOG.md +4 -0
- package/LICENSE.md +6 -0
- package/README.md +19 -0
- package/esm2020/creatio-base.mjs +5 -0
- package/esm2020/index.mjs +2 -0
- package/esm2020/lib/external/utils/date-utils.mjs +29 -0
- package/esm2020/lib/external/utils/index.mjs +2 -0
- package/esm2020/lib/index.mjs +11 -0
- package/esm2020/lib/internal/enums/data-schema-attribute-type.enum.mjs +21 -0
- package/esm2020/lib/internal/enums/data-source-scope.enum.mjs +9 -0
- package/esm2020/lib/internal/enums/default-value-source.enum.mjs +12 -0
- package/esm2020/lib/internal/enums/index.mjs +5 -0
- package/esm2020/lib/internal/enums/lookup-mode.mjs +10 -0
- package/esm2020/lib/internal/model/data-schema/data-schema-attribute-aggregation-config.model.mjs +2 -0
- package/esm2020/lib/internal/model/data-schema/data-schema-attribute-function-config.model.mjs +2 -0
- package/esm2020/lib/internal/model/data-schema/data-schema-validator-config.model.mjs +2 -0
- package/esm2020/lib/internal/model/data-schema/index.mjs +4 -0
- package/esm2020/lib/internal/model/data-source-config.mjs +2 -0
- package/esm2020/lib/internal/model/index.mjs +3 -0
- package/esm2020/lib/internal/models/default-value-schema.mjs +2 -0
- package/esm2020/lib/internal/models/index.mjs +2 -0
- package/esm2020/lib/public/enums/aggregation-function.enum.mjs +18 -0
- package/esm2020/lib/public/enums/aggregation-type.enum.mjs +18 -0
- package/esm2020/lib/public/enums/data-schema-type.enum.mjs +9 -0
- package/esm2020/lib/public/enums/data-value-type.enum.mjs +48 -0
- package/esm2020/lib/public/enums/index.mjs +5 -0
- package/esm2020/lib/public/esq/data-model/columns/arithmetic/arithmetic-query-column.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/columns/base-query-column.mjs +45 -0
- package/esm2020/lib/public/esq/data-model/columns/entity-column/entity-query-column.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/columns/functions/aggregation-function-column.mjs +13 -0
- package/esm2020/lib/public/esq/data-model/columns/functions/date-part-function-column.mjs +17 -0
- package/esm2020/lib/public/esq/data-model/columns/functions/length-function-column.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/columns/functions/macros-function-column.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/columns/functions/window-function-column.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/columns/index.mjs +13 -0
- package/esm2020/lib/public/esq/data-model/columns/parameters/parameter-query-column.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/columns/query-column-test-utils.mjs +13 -0
- package/esm2020/lib/public/esq/data-model/columns/sub-queries/aggregation-sub-query-column.mjs +15 -0
- package/esm2020/lib/public/esq/data-model/columns/sub-queries/sub-query-column.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/enums/aggregation-eval-type.enum.mjs +10 -0
- package/esm2020/lib/public/esq/data-model/enums/arithmetic-operation.enum.mjs +12 -0
- package/esm2020/lib/public/esq/data-model/enums/comparison-type.enum.mjs +21 -0
- package/esm2020/lib/public/esq/data-model/enums/date-part-type.enum.mjs +20 -0
- package/esm2020/lib/public/esq/data-model/enums/expression-type.enum.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/enums/filter-type.enum.mjs +11 -0
- package/esm2020/lib/public/esq/data-model/enums/function-type.enum.mjs +19 -0
- package/esm2020/lib/public/esq/data-model/enums/index.mjs +12 -0
- package/esm2020/lib/public/esq/data-model/enums/logical-operator-type.enum.mjs +6 -0
- package/esm2020/lib/public/esq/data-model/enums/order-direction.enum.mjs +7 -0
- package/esm2020/lib/public/esq/data-model/enums/query-macros-type.enum.mjs +76 -0
- package/esm2020/lib/public/esq/data-model/expressions/arithmetic/arithmetic-expression.mjs +30 -0
- package/esm2020/lib/public/esq/data-model/expressions/arithmetic/index.mjs +2 -0
- package/esm2020/lib/public/esq/data-model/expressions/base-expression.mjs +14 -0
- package/esm2020/lib/public/esq/data-model/expressions/columns/column-expression.mjs +21 -0
- package/esm2020/lib/public/esq/data-model/expressions/columns/index.mjs +2 -0
- package/esm2020/lib/public/esq/data-model/expressions/expression-parser/base-expression-parser.mjs +10 -0
- package/esm2020/lib/public/esq/data-model/expressions/expression-parser/expression-parser.mjs +17 -0
- package/esm2020/lib/public/esq/data-model/expressions/expression-parser/expression-resolver.mjs +41 -0
- package/esm2020/lib/public/esq/data-model/expressions/expression-parser/index.mjs +4 -0
- package/esm2020/lib/public/esq/data-model/expressions/functions/aggregation-function-expression.mjs +29 -0
- package/esm2020/lib/public/esq/data-model/expressions/functions/argument-function-expression.mjs +8 -0
- package/esm2020/lib/public/esq/data-model/expressions/functions/date-part-function-expression.mjs +22 -0
- package/esm2020/lib/public/esq/data-model/expressions/functions/function-expression.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/expressions/functions/index.mjs +8 -0
- package/esm2020/lib/public/esq/data-model/expressions/functions/length-function-expression.mjs +20 -0
- package/esm2020/lib/public/esq/data-model/expressions/functions/macros-function-expression.mjs +21 -0
- package/esm2020/lib/public/esq/data-model/expressions/functions/window-function-expression.mjs +20 -0
- package/esm2020/lib/public/esq/data-model/expressions/index.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/expressions/mocks/expression.mock.mjs +17 -0
- package/esm2020/lib/public/esq/data-model/expressions/mocks/index.mjs +2 -0
- package/esm2020/lib/public/esq/data-model/expressions/parameters/index.mjs +2 -0
- package/esm2020/lib/public/esq/data-model/expressions/parameters/parameter-expression.mjs +88 -0
- package/esm2020/lib/public/esq/data-model/expressions/sub-queries/aggregation-sub-query-expression.mjs +25 -0
- package/esm2020/lib/public/esq/data-model/expressions/sub-queries/index.mjs +3 -0
- package/esm2020/lib/public/esq/data-model/expressions/sub-queries/sub-query-expression.mjs +30 -0
- package/esm2020/lib/public/esq/data-model/filters/base-filter.mjs +15 -0
- package/esm2020/lib/public/esq/data-model/filters/between-filter.mjs +21 -0
- package/esm2020/lib/public/esq/data-model/filters/compare-filter.mjs +20 -0
- package/esm2020/lib/public/esq/data-model/filters/exists-filter.mjs +22 -0
- package/esm2020/lib/public/esq/data-model/filters/filter-group.mjs +129 -0
- package/esm2020/lib/public/esq/data-model/filters/filter-parser/base-filter-parser.mjs +10 -0
- package/esm2020/lib/public/esq/data-model/filters/filter-parser/filter-parser.mjs +14 -0
- package/esm2020/lib/public/esq/data-model/filters/filter-parser/filter-resolver.mjs +25 -0
- package/esm2020/lib/public/esq/data-model/filters/filter-parser/index.mjs +4 -0
- package/esm2020/lib/public/esq/data-model/filters/filter-test-utils.mjs +11 -0
- package/esm2020/lib/public/esq/data-model/filters/in-filter.mjs +20 -0
- package/esm2020/lib/public/esq/data-model/filters/index.mjs +12 -0
- package/esm2020/lib/public/esq/data-model/filters/isnull-filter.mjs +28 -0
- package/esm2020/lib/public/esq/data-model/filters/mocks/filter.mock.mjs +16 -0
- package/esm2020/lib/public/esq/data-model/filters/mocks/index.mjs +3 -0
- package/esm2020/lib/public/esq/data-model/filters/mocks/parser.mock.mjs +8 -0
- package/esm2020/lib/public/esq/data-model/filters/single-filter.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/index.mjs +7 -0
- package/esm2020/lib/public/esq/data-model/metadata-provider/metadata-provider.mjs +2 -0
- package/esm2020/lib/public/esq/data-model/queries/base-filterable-query.mjs +15 -0
- package/esm2020/lib/public/esq/data-model/queries/base-query.mjs +20 -0
- package/esm2020/lib/public/esq/data-model/queries/delete-query.mjs +12 -0
- package/esm2020/lib/public/esq/data-model/queries/entity-schema-query.mjs +205 -0
- package/esm2020/lib/public/esq/data-model/queries/index.mjs +9 -0
- package/esm2020/lib/public/esq/data-model/queries/insert-query.mjs +37 -0
- package/esm2020/lib/public/esq/data-model/queries/query-operation-type.mjs +15 -0
- package/esm2020/lib/public/esq/data-model/queries/select-localization-query.mjs +7 -0
- package/esm2020/lib/public/esq/data-model/queries/update-query.mjs +43 -0
- package/esm2020/lib/public/esq/index.mjs +2 -0
- package/esm2020/lib/public/exceptions/argument-empty-exception.mjs +7 -0
- package/esm2020/lib/public/exceptions/argument-out-of-range-exception.mjs +7 -0
- package/esm2020/lib/public/exceptions/index.mjs +6 -0
- package/esm2020/lib/public/exceptions/item-not-found-exception.mjs +7 -0
- package/esm2020/lib/public/exceptions/next-handler-already-specified-exception.mjs +9 -0
- package/esm2020/lib/public/exceptions/validation-utilities.mjs +32 -0
- package/esm2020/lib/public/models/data-source/data-source-insert-result.model.mjs +2 -0
- package/esm2020/lib/public/models/data-source/data-source-save-result.model.mjs +2 -0
- package/esm2020/lib/public/models/data-source/index.mjs +3 -0
- package/esm2020/lib/public/models/index.mjs +6 -0
- package/esm2020/lib/public/models/lookup-value.model.mjs +2 -0
- package/esm2020/lib/public/models/request/base-request.mjs +9 -0
- package/esm2020/lib/public/models/request/index.mjs +2 -0
- package/esm2020/lib/public/models/request-handler/index.mjs +2 -0
- package/esm2020/lib/public/models/request-handler/request-handler.mjs +2 -0
- package/esm2020/lib/public/models/view-model-context.mjs +3 -0
- package/esm2020/lib/public/services/index.mjs +3 -0
- package/esm2020/lib/public/services/model/base-model.mjs +2 -0
- package/esm2020/lib/public/services/model/data-schema-attribute.mjs +2 -0
- package/esm2020/lib/public/services/model/data-schema.mjs +2 -0
- package/esm2020/lib/public/services/model/data-source-aggregation-config.mjs +2 -0
- package/esm2020/lib/public/services/model/data-source-attribute.mjs +2 -0
- package/esm2020/lib/public/services/model/data-source-can-execute-operation.mjs +2 -0
- package/esm2020/lib/public/services/model/data-source-function-config.mjs +2 -0
- package/esm2020/lib/public/services/model/data-source-paging-config.mjs +2 -0
- package/esm2020/lib/public/services/model/data-source-parameter.mjs +12 -0
- package/esm2020/lib/public/services/model/data-source-sorting-config.mjs +2 -0
- package/esm2020/lib/public/services/model/index.mjs +13 -0
- package/esm2020/lib/public/services/model/model-load-options.mjs +2 -0
- package/esm2020/lib/public/services/sys-settings/base-sys-settings.service.mjs +2 -0
- package/esm2020/lib/public/services/sys-settings/index.mjs +2 -0
- package/esm2020/lib/public/types/abstract-type.mjs +2 -0
- package/esm2020/lib/public/types/aggregation-eval.type.mjs +2 -0
- package/esm2020/lib/public/types/date-part.type.mjs +2 -0
- package/esm2020/lib/public/types/entity-column-value.mjs +2 -0
- package/esm2020/lib/public/types/function.type.mjs +2 -0
- package/esm2020/lib/public/types/guid.type.mjs +53 -0
- package/esm2020/lib/public/types/index.mjs +13 -0
- package/esm2020/lib/public/types/json-data.type.mjs +2 -0
- package/esm2020/lib/public/types/localizable-string.type.mjs +2 -0
- package/esm2020/lib/public/types/localize-fn.type.mjs +2 -0
- package/esm2020/lib/public/types/resolve-dependency-fn.type.mjs +2 -0
- package/esm2020/lib/public/types/sort-direction.type.mjs +2 -0
- package/esm2020/lib/public/types/type.mjs +2 -0
- package/fesm2015/creatio-base.mjs +1643 -0
- package/fesm2015/creatio-base.mjs.map +1 -0
- package/fesm2020/creatio-base.mjs +1673 -0
- package/fesm2020/creatio-base.mjs.map +1 -0
- package/index.d.ts +1622 -0
- package/package.json +37 -0
|
@@ -0,0 +1,1673 @@
|
|
|
1
|
+
import { __decorate, __metadata } from 'tslib';
|
|
2
|
+
import { Exclude, classToPlain, Expose } from 'class-transformer';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
* Returns a string represent of date in ISO 8601 without time zone specification(doesn't convert it
|
|
7
|
+
* using local timezone).
|
|
8
|
+
*
|
|
9
|
+
* Example:
|
|
10
|
+
*
|
|
11
|
+
* const date = new Date(2018, 01, 20, 15, 10, 30);
|
|
12
|
+
* const result = toLocalISOString(date);
|
|
13
|
+
* //result: '2018-02-20T15:10:30'
|
|
14
|
+
*
|
|
15
|
+
* @param date Date value.
|
|
16
|
+
*/
|
|
17
|
+
function ɵtoLocalISOString(date) {
|
|
18
|
+
if (!(date instanceof Date)) {
|
|
19
|
+
throw new TypeError();
|
|
20
|
+
}
|
|
21
|
+
const timeZoneOffset = date.getTimezoneOffset() * 60000;
|
|
22
|
+
return new Date(date.getTime() - timeZoneOffset).toISOString().slice(0, -1);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
* Returns encoded date in string value.
|
|
27
|
+
* @param date Date value.
|
|
28
|
+
*/
|
|
29
|
+
function ɵencodeDate(date) {
|
|
30
|
+
return `"${ɵtoLocalISOString(date)}"`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
var ɵDataSourceScope;
|
|
37
|
+
(function (ɵDataSourceScope) {
|
|
38
|
+
ɵDataSourceScope["ViewElement"] = "viewElement";
|
|
39
|
+
ɵDataSourceScope["Page"] = "page";
|
|
40
|
+
})(ɵDataSourceScope || (ɵDataSourceScope = {}));
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
var ɵDataSchemaAttributeType;
|
|
46
|
+
(function (ɵDataSchemaAttributeType) {
|
|
47
|
+
ɵDataSchemaAttributeType["OwnAttribute"] = "Own";
|
|
48
|
+
ɵDataSchemaAttributeType["ForwardReferenceAttribute"] = "ForwardReference";
|
|
49
|
+
ɵDataSchemaAttributeType["BackReferenceAttribute"] = "BackReference";
|
|
50
|
+
ɵDataSchemaAttributeType["AggregationAttribute"] = "Aggregation";
|
|
51
|
+
ɵDataSchemaAttributeType["FunctionAttribute"] = "Function";
|
|
52
|
+
})(ɵDataSchemaAttributeType || (ɵDataSchemaAttributeType = {}));
|
|
53
|
+
/**
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
var ɵDataSchemaAttributeUsageType;
|
|
57
|
+
(function (ɵDataSchemaAttributeUsageType) {
|
|
58
|
+
ɵDataSchemaAttributeUsageType[ɵDataSchemaAttributeUsageType["General"] = 0] = "General";
|
|
59
|
+
ɵDataSchemaAttributeUsageType[ɵDataSchemaAttributeUsageType["Advanced"] = 1] = "Advanced";
|
|
60
|
+
ɵDataSchemaAttributeUsageType[ɵDataSchemaAttributeUsageType["None"] = 2] = "None";
|
|
61
|
+
})(ɵDataSchemaAttributeUsageType || (ɵDataSchemaAttributeUsageType = {}));
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
var ɵDefaultValueSource;
|
|
67
|
+
(function (ɵDefaultValueSource) {
|
|
68
|
+
ɵDefaultValueSource[ɵDefaultValueSource["None"] = 0] = "None";
|
|
69
|
+
ɵDefaultValueSource[ɵDefaultValueSource["Const"] = 1] = "Const";
|
|
70
|
+
ɵDefaultValueSource[ɵDefaultValueSource["Settings"] = 2] = "Settings";
|
|
71
|
+
ɵDefaultValueSource[ɵDefaultValueSource["SystemValue"] = 3] = "SystemValue";
|
|
72
|
+
ɵDefaultValueSource[ɵDefaultValueSource["Sequence"] = 4] = "Sequence";
|
|
73
|
+
})(ɵDefaultValueSource || (ɵDefaultValueSource = {}));
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Lookup mode
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
var LookupMode;
|
|
80
|
+
(function (LookupMode) {
|
|
81
|
+
LookupMode["List"] = "List";
|
|
82
|
+
LookupMode["SelectionWindow"] = "SelectionWindow";
|
|
83
|
+
})(LookupMode || (LookupMode = {}));
|
|
84
|
+
|
|
85
|
+
var ɵDataValueType;
|
|
86
|
+
(function (ɵDataValueType) {
|
|
87
|
+
ɵDataValueType[ɵDataValueType["Guid"] = 0] = "Guid";
|
|
88
|
+
ɵDataValueType[ɵDataValueType["Text"] = 1] = "Text";
|
|
89
|
+
ɵDataValueType[ɵDataValueType["Integer"] = 4] = "Integer";
|
|
90
|
+
ɵDataValueType[ɵDataValueType["Float"] = 5] = "Float";
|
|
91
|
+
ɵDataValueType[ɵDataValueType["Money"] = 6] = "Money";
|
|
92
|
+
ɵDataValueType[ɵDataValueType["DateTime"] = 7] = "DateTime";
|
|
93
|
+
ɵDataValueType[ɵDataValueType["Date"] = 8] = "Date";
|
|
94
|
+
ɵDataValueType[ɵDataValueType["Time"] = 9] = "Time";
|
|
95
|
+
ɵDataValueType[ɵDataValueType["Lookup"] = 10] = "Lookup";
|
|
96
|
+
ɵDataValueType[ɵDataValueType["Enum"] = 11] = "Enum";
|
|
97
|
+
ɵDataValueType[ɵDataValueType["Boolean"] = 12] = "Boolean";
|
|
98
|
+
ɵDataValueType[ɵDataValueType["Blob"] = 13] = "Blob";
|
|
99
|
+
ɵDataValueType[ɵDataValueType["Image"] = 14] = "Image";
|
|
100
|
+
ɵDataValueType[ɵDataValueType["CUSTOM_OBJECT"] = 15] = "CUSTOM_OBJECT";
|
|
101
|
+
ɵDataValueType[ɵDataValueType["IMAGELOOKUP"] = 16] = "IMAGELOOKUP";
|
|
102
|
+
ɵDataValueType[ɵDataValueType["COLLECTION"] = 17] = "COLLECTION";
|
|
103
|
+
ɵDataValueType[ɵDataValueType["Color"] = 18] = "Color";
|
|
104
|
+
ɵDataValueType[ɵDataValueType["LOCALIZABLE_STRING"] = 19] = "LOCALIZABLE_STRING";
|
|
105
|
+
ɵDataValueType[ɵDataValueType["ENTITY"] = 20] = "ENTITY";
|
|
106
|
+
ɵDataValueType[ɵDataValueType["ENTITY_COLLECTION"] = 21] = "ENTITY_COLLECTION";
|
|
107
|
+
ɵDataValueType[ɵDataValueType["ENTITY_COLUMN_MAPPING_COLLECTION"] = 22] = "ENTITY_COLUMN_MAPPING_COLLECTION";
|
|
108
|
+
ɵDataValueType[ɵDataValueType["HASH_TEXT"] = 23] = "HASH_TEXT";
|
|
109
|
+
ɵDataValueType[ɵDataValueType["SECURE_TEXT"] = 24] = "SECURE_TEXT";
|
|
110
|
+
ɵDataValueType[ɵDataValueType["FILE"] = 25] = "FILE";
|
|
111
|
+
ɵDataValueType[ɵDataValueType["MAPPING"] = 26] = "MAPPING";
|
|
112
|
+
ɵDataValueType[ɵDataValueType["SHORT_TEXT"] = 27] = "SHORT_TEXT";
|
|
113
|
+
ɵDataValueType[ɵDataValueType["MEDIUM_TEXT"] = 28] = "MEDIUM_TEXT";
|
|
114
|
+
ɵDataValueType[ɵDataValueType["MAXSIZE_TEXT"] = 29] = "MAXSIZE_TEXT";
|
|
115
|
+
ɵDataValueType[ɵDataValueType["LONG_TEXT"] = 30] = "LONG_TEXT";
|
|
116
|
+
ɵDataValueType[ɵDataValueType["FLOAT1"] = 31] = "FLOAT1";
|
|
117
|
+
ɵDataValueType[ɵDataValueType["FLOAT2"] = 32] = "FLOAT2";
|
|
118
|
+
ɵDataValueType[ɵDataValueType["FLOAT3"] = 33] = "FLOAT3";
|
|
119
|
+
ɵDataValueType[ɵDataValueType["FLOAT4"] = 34] = "FLOAT4";
|
|
120
|
+
ɵDataValueType[ɵDataValueType["LOCALIZABLE_PARAMETER_VALUES_LIST"] = 35] = "LOCALIZABLE_PARAMETER_VALUES_LIST";
|
|
121
|
+
ɵDataValueType[ɵDataValueType["METADATA_TEXT"] = 36] = "METADATA_TEXT";
|
|
122
|
+
ɵDataValueType[ɵDataValueType["STAGE_INDICATOR"] = 37] = "STAGE_INDICATOR";
|
|
123
|
+
ɵDataValueType[ɵDataValueType["OBJECT_LIST"] = 38] = "OBJECT_LIST";
|
|
124
|
+
ɵDataValueType[ɵDataValueType["COMPOSITE_OBJECT_LIST"] = 39] = "COMPOSITE_OBJECT_LIST";
|
|
125
|
+
ɵDataValueType[ɵDataValueType["FLOAT8"] = 40] = "FLOAT8";
|
|
126
|
+
ɵDataValueType[ɵDataValueType["FILE_LOCATOR"] = 41] = "FILE_LOCATOR";
|
|
127
|
+
ɵDataValueType[ɵDataValueType["PHONE_TEXT"] = 42] = "PHONE_TEXT";
|
|
128
|
+
ɵDataValueType[ɵDataValueType["RICH_TEXT"] = 43] = "RICH_TEXT";
|
|
129
|
+
ɵDataValueType[ɵDataValueType["WEB_TEXT"] = 44] = "WEB_TEXT";
|
|
130
|
+
ɵDataValueType[ɵDataValueType["EMAIL_TEXT"] = 45] = "EMAIL_TEXT";
|
|
131
|
+
})(ɵDataValueType || (ɵDataValueType = {}));
|
|
132
|
+
|
|
133
|
+
var ɵAggregationType;
|
|
134
|
+
(function (ɵAggregationType) {
|
|
135
|
+
/** Aggregation function type not defined. */
|
|
136
|
+
ɵAggregationType[ɵAggregationType["None"] = 0] = "None";
|
|
137
|
+
/** Aggregation function type not defined. */
|
|
138
|
+
ɵAggregationType[ɵAggregationType["Count"] = 1] = "Count";
|
|
139
|
+
/** Sum of values of all elements. */
|
|
140
|
+
ɵAggregationType[ɵAggregationType["Sum"] = 2] = "Sum";
|
|
141
|
+
/** Average value for all elements. */
|
|
142
|
+
ɵAggregationType[ɵAggregationType["Avg"] = 3] = "Avg";
|
|
143
|
+
/** The minimum value among all elements. */
|
|
144
|
+
ɵAggregationType[ɵAggregationType["Min"] = 4] = "Min";
|
|
145
|
+
/** The maximum value among all elements. */
|
|
146
|
+
ɵAggregationType[ɵAggregationType["Max"] = 5] = "Max";
|
|
147
|
+
/** Top one record from collection. */
|
|
148
|
+
ɵAggregationType[ɵAggregationType["TopOne"] = 6] = "TopOne";
|
|
149
|
+
})(ɵAggregationType || (ɵAggregationType = {}));
|
|
150
|
+
|
|
151
|
+
var ɵAggregationFunction;
|
|
152
|
+
(function (ɵAggregationFunction) {
|
|
153
|
+
/** Aggregation function type not defined. */
|
|
154
|
+
ɵAggregationFunction["None"] = "";
|
|
155
|
+
/** Aggregation function type not defined. */
|
|
156
|
+
ɵAggregationFunction["Count"] = "Count";
|
|
157
|
+
/** Sum of values of all elements. */
|
|
158
|
+
ɵAggregationFunction["Sum"] = "Sum";
|
|
159
|
+
/** Average value for all elements. */
|
|
160
|
+
ɵAggregationFunction["Avg"] = "Avg";
|
|
161
|
+
/** The minimum value among all elements. */
|
|
162
|
+
ɵAggregationFunction["Min"] = "Min";
|
|
163
|
+
/** The maximum value among all elements. */
|
|
164
|
+
ɵAggregationFunction["Max"] = "Max";
|
|
165
|
+
/** Top one record from collection. */
|
|
166
|
+
ɵAggregationFunction["TopOne"] = "TopOne";
|
|
167
|
+
})(ɵAggregationFunction || (ɵAggregationFunction = {}));
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Type of DataSchema. In combination with the name is used for unique identification of {@link DataSchema}.
|
|
171
|
+
*/
|
|
172
|
+
var ɵDataSchemaType;
|
|
173
|
+
(function (ɵDataSchemaType) {
|
|
174
|
+
ɵDataSchemaType["Entity"] = "Entity";
|
|
175
|
+
ɵDataSchemaType["ClientUnit"] = "ClientUnit";
|
|
176
|
+
})(ɵDataSchemaType || (ɵDataSchemaType = {}));
|
|
177
|
+
|
|
178
|
+
var ɵLogicalOperatorType;
|
|
179
|
+
(function (ɵLogicalOperatorType) {
|
|
180
|
+
ɵLogicalOperatorType[ɵLogicalOperatorType["And"] = 0] = "And";
|
|
181
|
+
ɵLogicalOperatorType[ɵLogicalOperatorType["Or"] = 1] = "Or";
|
|
182
|
+
})(ɵLogicalOperatorType || (ɵLogicalOperatorType = {}));
|
|
183
|
+
|
|
184
|
+
var ɵAggregationEvalType;
|
|
185
|
+
(function (ɵAggregationEvalType) {
|
|
186
|
+
/** The scope of the aggregating function is not defined. */
|
|
187
|
+
ɵAggregationEvalType[ɵAggregationEvalType["None"] = 0] = "None";
|
|
188
|
+
/** Applies to all elements. */
|
|
189
|
+
ɵAggregationEvalType[ɵAggregationEvalType["All"] = 1] = "All";
|
|
190
|
+
/** Applies to unique values. */
|
|
191
|
+
ɵAggregationEvalType[ɵAggregationEvalType["Distinct"] = 2] = "Distinct";
|
|
192
|
+
})(ɵAggregationEvalType || (ɵAggregationEvalType = {}));
|
|
193
|
+
|
|
194
|
+
var ɵArithmeticOperation;
|
|
195
|
+
(function (ɵArithmeticOperation) {
|
|
196
|
+
/** Addition. */
|
|
197
|
+
ɵArithmeticOperation[ɵArithmeticOperation["Addition"] = 0] = "Addition";
|
|
198
|
+
/** Subtraction. */
|
|
199
|
+
ɵArithmeticOperation[ɵArithmeticOperation["Subtraction"] = 1] = "Subtraction";
|
|
200
|
+
/** Multiplication. */
|
|
201
|
+
ɵArithmeticOperation[ɵArithmeticOperation["Multiplication"] = 2] = "Multiplication";
|
|
202
|
+
/** Division. */
|
|
203
|
+
ɵArithmeticOperation[ɵArithmeticOperation["Division"] = 3] = "Division";
|
|
204
|
+
})(ɵArithmeticOperation || (ɵArithmeticOperation = {}));
|
|
205
|
+
|
|
206
|
+
var ɵComparisonType;
|
|
207
|
+
(function (ɵComparisonType) {
|
|
208
|
+
ɵComparisonType[ɵComparisonType["Between"] = 0] = "Between";
|
|
209
|
+
ɵComparisonType[ɵComparisonType["Contain"] = 11] = "Contain";
|
|
210
|
+
ɵComparisonType[ɵComparisonType["End_with"] = 13] = "End_with";
|
|
211
|
+
ɵComparisonType[ɵComparisonType["Equal"] = 3] = "Equal";
|
|
212
|
+
ɵComparisonType[ɵComparisonType["Exists"] = 15] = "Exists";
|
|
213
|
+
ɵComparisonType[ɵComparisonType["Greater"] = 7] = "Greater";
|
|
214
|
+
ɵComparisonType[ɵComparisonType["Greater_or_equal"] = 8] = "Greater_or_equal";
|
|
215
|
+
ɵComparisonType[ɵComparisonType["Is_not_null"] = 2] = "Is_not_null";
|
|
216
|
+
ɵComparisonType[ɵComparisonType["Is_null"] = 1] = "Is_null";
|
|
217
|
+
ɵComparisonType[ɵComparisonType["Less"] = 5] = "Less";
|
|
218
|
+
ɵComparisonType[ɵComparisonType["Less_or_equal"] = 6] = "Less_or_equal";
|
|
219
|
+
ɵComparisonType[ɵComparisonType["Not_contain"] = 12] = "Not_contain";
|
|
220
|
+
ɵComparisonType[ɵComparisonType["Not_end_with"] = 14] = "Not_end_with";
|
|
221
|
+
ɵComparisonType[ɵComparisonType["Not_equal"] = 4] = "Not_equal";
|
|
222
|
+
ɵComparisonType[ɵComparisonType["Not_exists"] = 16] = "Not_exists";
|
|
223
|
+
ɵComparisonType[ɵComparisonType["Not_start_with"] = 10] = "Not_start_with";
|
|
224
|
+
ɵComparisonType[ɵComparisonType["Start_with"] = 9] = "Start_with";
|
|
225
|
+
})(ɵComparisonType || (ɵComparisonType = {}));
|
|
226
|
+
|
|
227
|
+
var ɵDatePartType;
|
|
228
|
+
(function (ɵDatePartType) {
|
|
229
|
+
/** Empty value. */
|
|
230
|
+
ɵDatePartType[ɵDatePartType["None"] = 0] = "None";
|
|
231
|
+
/** Day. */
|
|
232
|
+
ɵDatePartType[ɵDatePartType["Day"] = 1] = "Day";
|
|
233
|
+
/** Week. */
|
|
234
|
+
ɵDatePartType[ɵDatePartType["Week"] = 2] = "Week";
|
|
235
|
+
/** Month. */
|
|
236
|
+
ɵDatePartType[ɵDatePartType["Month"] = 3] = "Month";
|
|
237
|
+
/** Year. */
|
|
238
|
+
ɵDatePartType[ɵDatePartType["Year"] = 4] = "Year";
|
|
239
|
+
/** Day of the week. */
|
|
240
|
+
ɵDatePartType[ɵDatePartType["WeekDay"] = 5] = "WeekDay";
|
|
241
|
+
/** Hour. */
|
|
242
|
+
ɵDatePartType[ɵDatePartType["Hour"] = 6] = "Hour";
|
|
243
|
+
/** Minute. */
|
|
244
|
+
ɵDatePartType[ɵDatePartType["HourMinute"] = 7] = "HourMinute";
|
|
245
|
+
})(ɵDatePartType || (ɵDatePartType = {}));
|
|
246
|
+
|
|
247
|
+
var ɵExpressionType;
|
|
248
|
+
(function (ɵExpressionType) {
|
|
249
|
+
ɵExpressionType[ɵExpressionType["SchemaColumn"] = 0] = "SchemaColumn";
|
|
250
|
+
ɵExpressionType[ɵExpressionType["Function"] = 1] = "Function";
|
|
251
|
+
ɵExpressionType[ɵExpressionType["Parameter"] = 2] = "Parameter";
|
|
252
|
+
ɵExpressionType[ɵExpressionType["SubQuery"] = 3] = "SubQuery";
|
|
253
|
+
ɵExpressionType[ɵExpressionType["ArithmeticOperation"] = 4] = "ArithmeticOperation";
|
|
254
|
+
})(ɵExpressionType || (ɵExpressionType = {}));
|
|
255
|
+
|
|
256
|
+
var ɵFilterType;
|
|
257
|
+
(function (ɵFilterType) {
|
|
258
|
+
ɵFilterType[ɵFilterType["None"] = 0] = "None";
|
|
259
|
+
ɵFilterType[ɵFilterType["Compare"] = 1] = "Compare";
|
|
260
|
+
ɵFilterType[ɵFilterType["IsNull"] = 2] = "IsNull";
|
|
261
|
+
ɵFilterType[ɵFilterType["Between"] = 3] = "Between";
|
|
262
|
+
ɵFilterType[ɵFilterType["In"] = 4] = "In";
|
|
263
|
+
ɵFilterType[ɵFilterType["Exists"] = 5] = "Exists";
|
|
264
|
+
ɵFilterType[ɵFilterType["FilterGroup"] = 6] = "FilterGroup";
|
|
265
|
+
})(ɵFilterType || (ɵFilterType = {}));
|
|
266
|
+
|
|
267
|
+
var ɵFunctionType;
|
|
268
|
+
(function (ɵFunctionType) {
|
|
269
|
+
ɵFunctionType[ɵFunctionType["None"] = 0] = "None";
|
|
270
|
+
/** Substitution by macro. */
|
|
271
|
+
ɵFunctionType[ɵFunctionType["Macros"] = 1] = "Macros";
|
|
272
|
+
/** Aggregating function. */
|
|
273
|
+
ɵFunctionType[ɵFunctionType["Aggregation"] = 2] = "Aggregation";
|
|
274
|
+
/** Date fragment. */
|
|
275
|
+
ɵFunctionType[ɵFunctionType["DatePart"] = 3] = "DatePart";
|
|
276
|
+
/** The size of the value in bytes, used for binary data. */
|
|
277
|
+
ɵFunctionType[ɵFunctionType["Length"] = 4] = "Length";
|
|
278
|
+
/** Window query function */
|
|
279
|
+
ɵFunctionType[ɵFunctionType["Window"] = 5] = "Window";
|
|
280
|
+
/** Date add. */
|
|
281
|
+
ɵFunctionType[ɵFunctionType["DateAdd"] = 6] = "DateAdd";
|
|
282
|
+
/** Date diff. */
|
|
283
|
+
ɵFunctionType[ɵFunctionType["DateDiff"] = 7] = "DateDiff";
|
|
284
|
+
})(ɵFunctionType || (ɵFunctionType = {}));
|
|
285
|
+
|
|
286
|
+
var ɵOrderDirection;
|
|
287
|
+
(function (ɵOrderDirection) {
|
|
288
|
+
ɵOrderDirection[ɵOrderDirection["None"] = 0] = "None";
|
|
289
|
+
ɵOrderDirection[ɵOrderDirection["Asc"] = 1] = "Asc";
|
|
290
|
+
ɵOrderDirection[ɵOrderDirection["Desc"] = 2] = "Desc";
|
|
291
|
+
})(ɵOrderDirection || (ɵOrderDirection = {}));
|
|
292
|
+
|
|
293
|
+
var ɵQueryMacrosType;
|
|
294
|
+
(function (ɵQueryMacrosType) {
|
|
295
|
+
/** Macro type not defined. */
|
|
296
|
+
ɵQueryMacrosType[ɵQueryMacrosType["None"] = 0] = "None";
|
|
297
|
+
/** Current user. */
|
|
298
|
+
ɵQueryMacrosType[ɵQueryMacrosType["CurrentUser"] = 1] = "CurrentUser";
|
|
299
|
+
/** Current user contact. */
|
|
300
|
+
ɵQueryMacrosType[ɵQueryMacrosType["CurrentUserContact"] = 2] = "CurrentUserContact";
|
|
301
|
+
/** Yesterday. */
|
|
302
|
+
ɵQueryMacrosType[ɵQueryMacrosType["Yesterday"] = 3] = "Yesterday";
|
|
303
|
+
/** Today. */
|
|
304
|
+
ɵQueryMacrosType[ɵQueryMacrosType["Today"] = 4] = "Today";
|
|
305
|
+
/** Tomorrow. */
|
|
306
|
+
ɵQueryMacrosType[ɵQueryMacrosType["Tomorrow"] = 5] = "Tomorrow";
|
|
307
|
+
/** Previous week. */
|
|
308
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PreviousWeek"] = 6] = "PreviousWeek";
|
|
309
|
+
/** This week. */
|
|
310
|
+
ɵQueryMacrosType[ɵQueryMacrosType["CurrentWeek"] = 7] = "CurrentWeek";
|
|
311
|
+
/** Next week. */
|
|
312
|
+
ɵQueryMacrosType[ɵQueryMacrosType["NextWeek"] = 8] = "NextWeek";
|
|
313
|
+
/** Previous month. */
|
|
314
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PreviousMonth"] = 9] = "PreviousMonth";
|
|
315
|
+
/** Current month. */
|
|
316
|
+
ɵQueryMacrosType[ɵQueryMacrosType["CurrentMonth"] = 10] = "CurrentMonth";
|
|
317
|
+
/** Next month. */
|
|
318
|
+
ɵQueryMacrosType[ɵQueryMacrosType["NextMonth"] = 11] = "NextMonth";
|
|
319
|
+
/** Previous quarter. */
|
|
320
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PreviousQuarter"] = 12] = "PreviousQuarter";
|
|
321
|
+
/** Current quarter. */
|
|
322
|
+
ɵQueryMacrosType[ɵQueryMacrosType["CurrentQuarter"] = 13] = "CurrentQuarter";
|
|
323
|
+
/** Next quarter. */
|
|
324
|
+
ɵQueryMacrosType[ɵQueryMacrosType["NextQuarter"] = 14] = "NextQuarter";
|
|
325
|
+
/** Previous half of the year. */
|
|
326
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PreviousHalfYear"] = 15] = "PreviousHalfYear";
|
|
327
|
+
/** Current half-year. */
|
|
328
|
+
ɵQueryMacrosType[ɵQueryMacrosType["CurrentHalfYear"] = 16] = "CurrentHalfYear";
|
|
329
|
+
/** Next half-year. */
|
|
330
|
+
ɵQueryMacrosType[ɵQueryMacrosType["NextHalfYear"] = 17] = "NextHalfYear";
|
|
331
|
+
/** Last year. */
|
|
332
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PreviousYear"] = 18] = "PreviousYear";
|
|
333
|
+
/** This year. */
|
|
334
|
+
ɵQueryMacrosType[ɵQueryMacrosType["CurrentYear"] = 19] = "CurrentYear";
|
|
335
|
+
/** Previous hour. */
|
|
336
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PreviousHour"] = 20] = "PreviousHour";
|
|
337
|
+
/** Current hour. */
|
|
338
|
+
ɵQueryMacrosType[ɵQueryMacrosType["CurrentHour"] = 21] = "CurrentHour";
|
|
339
|
+
/** Next hour. */
|
|
340
|
+
ɵQueryMacrosType[ɵQueryMacrosType["NextHour"] = 22] = "NextHour";
|
|
341
|
+
/** Next year. */
|
|
342
|
+
ɵQueryMacrosType[ɵQueryMacrosType["NextYear"] = 23] = "NextYear";
|
|
343
|
+
/** Next N Days. */
|
|
344
|
+
ɵQueryMacrosType[ɵQueryMacrosType["NextNDays"] = 24] = "NextNDays";
|
|
345
|
+
/** Previous N days. */
|
|
346
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PreviousNDays"] = 25] = "PreviousNDays";
|
|
347
|
+
/** Next N hours. */
|
|
348
|
+
ɵQueryMacrosType[ɵQueryMacrosType["NextNHours"] = 26] = "NextNHours";
|
|
349
|
+
/** Previous N hours. */
|
|
350
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PreviousNHours"] = 27] = "PreviousNHours";
|
|
351
|
+
/** Primary column. */
|
|
352
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PrimaryColumn"] = 34] = "PrimaryColumn";
|
|
353
|
+
/** Primary displayed column. */
|
|
354
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PrimaryDisplayColumn"] = 35] = "PrimaryDisplayColumn";
|
|
355
|
+
/** Primary image display column. */
|
|
356
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PrimaryImageColumn"] = 36] = "PrimaryImageColumn";
|
|
357
|
+
/** Anniversary today. */
|
|
358
|
+
ɵQueryMacrosType[ɵQueryMacrosType["DayOfYearToday"] = 37] = "DayOfYearToday";
|
|
359
|
+
/** Anniversary on the date computed as today plus days offset. */
|
|
360
|
+
ɵQueryMacrosType[ɵQueryMacrosType["DayOfYearTodayPlusDaysOffset"] = 38] = "DayOfYearTodayPlusDaysOffset";
|
|
361
|
+
/** Anniversary on the next several days. */
|
|
362
|
+
ɵQueryMacrosType[ɵQueryMacrosType["NextNDaysOfYear"] = 39] = "NextNDaysOfYear";
|
|
363
|
+
/** Anniversary on the previous several days. */
|
|
364
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PreviousNDaysOfYear"] = 40] = "PreviousNDaysOfYear";
|
|
365
|
+
/** Primary color display column. */
|
|
366
|
+
ɵQueryMacrosType[ɵQueryMacrosType["PrimaryColorColumn"] = 41] = "PrimaryColorColumn";
|
|
367
|
+
})(ɵQueryMacrosType || (ɵQueryMacrosType = {}));
|
|
368
|
+
|
|
369
|
+
class ɵBaseExpression {
|
|
370
|
+
constructor(config) {
|
|
371
|
+
this.isBlock = false;
|
|
372
|
+
this.isBlock = config?.isBlock;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Parses expression from json.
|
|
376
|
+
* @public
|
|
377
|
+
*/
|
|
378
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
379
|
+
throw new Error(`fromJson not supported on expression type ${this.constructor.name}`);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
class ɵArithmeticExpression extends ɵBaseExpression {
|
|
384
|
+
constructor(config) {
|
|
385
|
+
super(config);
|
|
386
|
+
this.expressionType = ɵExpressionType.ArithmeticOperation;
|
|
387
|
+
this.arithmeticOperation = config?.arithmeticOperation;
|
|
388
|
+
this.leftArithmeticOperand = config?.leftArithmeticOperand.clone();
|
|
389
|
+
this.rightArithmeticOperand = config?.rightArithmeticOperand.clone();
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Parses expression from json.
|
|
393
|
+
* @public
|
|
394
|
+
*/
|
|
395
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
396
|
+
const leftArithmeticOperand = expressionParser?.fromJson(dto['leftArithmeticOperand'], filterParser);
|
|
397
|
+
const rightArithmeticOperand = expressionParser?.fromJson(dto['rightArithmeticOperand'], filterParser);
|
|
398
|
+
const config = {
|
|
399
|
+
leftArithmeticOperand,
|
|
400
|
+
rightArithmeticOperand,
|
|
401
|
+
arithmeticOperation: dto['arithmeticOperation'],
|
|
402
|
+
isBlock: dto['isBlock'],
|
|
403
|
+
};
|
|
404
|
+
return new ɵArithmeticExpression(config);
|
|
405
|
+
}
|
|
406
|
+
clone() {
|
|
407
|
+
return new ɵArithmeticExpression(this);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
class ɵColumnExpression extends ɵBaseExpression {
|
|
412
|
+
constructor(config) {
|
|
413
|
+
super(config);
|
|
414
|
+
this.expressionType = ɵExpressionType.SchemaColumn;
|
|
415
|
+
this.columnPath = config?.columnPath;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Parses expression from json.
|
|
419
|
+
* @public
|
|
420
|
+
*/
|
|
421
|
+
static fromJson(dto) {
|
|
422
|
+
const expression = new ɵColumnExpression({ columnPath: dto['columnPath'] });
|
|
423
|
+
return expression;
|
|
424
|
+
}
|
|
425
|
+
clone() {
|
|
426
|
+
return new ɵColumnExpression(this);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Expression parser interface
|
|
432
|
+
* @public
|
|
433
|
+
*/
|
|
434
|
+
class ɵBaseExpressionParser {
|
|
435
|
+
static fromJson(dto, filterParser) {
|
|
436
|
+
throw new Error('not implemented');
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
class ɵFunctionExpression extends ɵBaseExpression {
|
|
441
|
+
constructor(config) {
|
|
442
|
+
super(config);
|
|
443
|
+
this.expressionType = ɵExpressionType.Function;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
class ɵArgumentFunctionExpression extends ɵFunctionExpression {
|
|
448
|
+
constructor(config) {
|
|
449
|
+
super(config);
|
|
450
|
+
this.functionArgument = config?.functionArgument.clone();
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
class ɵAggregationFunctionExpression extends ɵArgumentFunctionExpression {
|
|
455
|
+
constructor(config) {
|
|
456
|
+
super(config);
|
|
457
|
+
this.functionType = ɵFunctionType.Aggregation;
|
|
458
|
+
this.aggregationType = config?.aggregationType;
|
|
459
|
+
this.aggregationEvalType = config?.aggregationEvalType;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Parses expression from json.
|
|
463
|
+
* @public
|
|
464
|
+
*/
|
|
465
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
466
|
+
const functionArgument = expressionParser?.fromJson(dto['functionArgument'], filterParser);
|
|
467
|
+
const aggregationType = dto['aggregationType'];
|
|
468
|
+
const aggregationEvalType = dto['aggregationEvalType'];
|
|
469
|
+
return new ɵAggregationFunctionExpression({
|
|
470
|
+
functionArgument,
|
|
471
|
+
aggregationType,
|
|
472
|
+
aggregationEvalType,
|
|
473
|
+
isBlock: dto['isBlock'],
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
clone() {
|
|
477
|
+
return new ɵAggregationFunctionExpression(this);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
class ɵDatePartFunctionExpression extends ɵArgumentFunctionExpression {
|
|
482
|
+
constructor(config) {
|
|
483
|
+
super(config);
|
|
484
|
+
this.functionType = ɵFunctionType.DatePart;
|
|
485
|
+
this.datePartType = config?.datePartType;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Parses expression from json.
|
|
489
|
+
* @public
|
|
490
|
+
*/
|
|
491
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
492
|
+
const functionArgument = expressionParser?.fromJson(dto['functionArgument'], filterParser);
|
|
493
|
+
const datePartType = dto['datePartType'];
|
|
494
|
+
return new ɵDatePartFunctionExpression({ functionArgument, datePartType, isBlock: dto['isBlock'] });
|
|
495
|
+
}
|
|
496
|
+
clone() {
|
|
497
|
+
return new ɵDatePartFunctionExpression(this);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
class ɵLengthFunctionExpression extends ɵArgumentFunctionExpression {
|
|
502
|
+
constructor(config) {
|
|
503
|
+
super(config);
|
|
504
|
+
this.functionType = ɵFunctionType.Length;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Parses expression from json.
|
|
508
|
+
* @public
|
|
509
|
+
*/
|
|
510
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
511
|
+
const functionArgument = expressionParser?.fromJson(dto['functionArgument'], filterParser);
|
|
512
|
+
return new ɵLengthFunctionExpression({ functionArgument, isBlock: dto['isBlock'] });
|
|
513
|
+
}
|
|
514
|
+
clone() {
|
|
515
|
+
return new ɵLengthFunctionExpression(this);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
class ɵMacrosFunctionExpression extends ɵFunctionExpression {
|
|
520
|
+
constructor(config) {
|
|
521
|
+
super(config);
|
|
522
|
+
this.functionType = ɵFunctionType.Macros;
|
|
523
|
+
this.macrosType = config?.macrosType;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Parses expression from json.
|
|
527
|
+
* @public
|
|
528
|
+
*/
|
|
529
|
+
static fromJson(dto) {
|
|
530
|
+
const expression = new ɵMacrosFunctionExpression({ macrosType: dto['macrosType'] });
|
|
531
|
+
return expression;
|
|
532
|
+
}
|
|
533
|
+
clone() {
|
|
534
|
+
return new ɵMacrosFunctionExpression(this);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
class ɵWindowFunctionExpression extends ɵArgumentFunctionExpression {
|
|
539
|
+
constructor(config) {
|
|
540
|
+
super(config);
|
|
541
|
+
this.functionType = ɵFunctionType.Window;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Parses expression from json.
|
|
545
|
+
* @public
|
|
546
|
+
*/
|
|
547
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
548
|
+
const functionArgument = expressionParser?.fromJson(dto['functionArgument'], filterParser);
|
|
549
|
+
return new ɵWindowFunctionExpression({ functionArgument, isBlock: dto['isBlock'] });
|
|
550
|
+
}
|
|
551
|
+
clone() {
|
|
552
|
+
return new ɵWindowFunctionExpression(this);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
class ɵParameterExpression extends ɵBaseExpression {
|
|
557
|
+
constructor(config) {
|
|
558
|
+
super(config);
|
|
559
|
+
this.expressionType = ɵExpressionType.Parameter;
|
|
560
|
+
const value = config?.value;
|
|
561
|
+
if (value instanceof Date) {
|
|
562
|
+
const cloneDate = new Date();
|
|
563
|
+
cloneDate.setTime(value.getTime());
|
|
564
|
+
this.value = cloneDate;
|
|
565
|
+
}
|
|
566
|
+
else if (!value) {
|
|
567
|
+
this.value = value;
|
|
568
|
+
}
|
|
569
|
+
else {
|
|
570
|
+
this.value = typeof value === 'object' ? { ...value } : value;
|
|
571
|
+
}
|
|
572
|
+
this.dataValueType = config?.dataValueType ?? ɵDataValueType.Text;
|
|
573
|
+
this.parameter = {
|
|
574
|
+
dataValueType: this.dataValueType,
|
|
575
|
+
...this._getParameterValueMetadata(),
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Parses expression from json.
|
|
580
|
+
* @public
|
|
581
|
+
*/
|
|
582
|
+
static fromJson(dto) {
|
|
583
|
+
const expression = new ɵParameterExpression(dto['parameter']);
|
|
584
|
+
return expression;
|
|
585
|
+
}
|
|
586
|
+
_convertStringToBlobArray(str) {
|
|
587
|
+
const out = [];
|
|
588
|
+
let position = 0;
|
|
589
|
+
for (let i = 0; i < str.length; i++) {
|
|
590
|
+
const code = str.charCodeAt(i);
|
|
591
|
+
if (code < 128) {
|
|
592
|
+
out[position++] = String.fromCharCode(code);
|
|
593
|
+
}
|
|
594
|
+
else if (code < 2048) {
|
|
595
|
+
/* eslint-disable no-bitwise */
|
|
596
|
+
out[position++] = String.fromCharCode((code >> 6) | 192);
|
|
597
|
+
out[position++] = String.fromCharCode((code & 63) | 128);
|
|
598
|
+
}
|
|
599
|
+
else {
|
|
600
|
+
out[position++] = String.fromCharCode((code >> 12) | 224);
|
|
601
|
+
out[position++] = String.fromCharCode(((code >> 6) & 63) | 128);
|
|
602
|
+
out[position++] = String.fromCharCode((code & 63) | 128);
|
|
603
|
+
/* eslint-enable no-bitwise */
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
return out;
|
|
607
|
+
}
|
|
608
|
+
_getParameterValueMetadata() {
|
|
609
|
+
if (this.dataValueType === ɵDataValueType.Blob) {
|
|
610
|
+
return {
|
|
611
|
+
arrayValue: !this.value ? [] : this._convertStringToBlobArray(this.value),
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
else if (this.value instanceof Date) {
|
|
615
|
+
return {
|
|
616
|
+
value: ɵencodeDate(this.value),
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
return {
|
|
621
|
+
value: this.value,
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
clone() {
|
|
626
|
+
return new ɵParameterExpression(this);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
__decorate([
|
|
630
|
+
Exclude(),
|
|
631
|
+
__metadata("design:type", Object)
|
|
632
|
+
], ɵParameterExpression.prototype, "value", void 0);
|
|
633
|
+
__decorate([
|
|
634
|
+
Exclude(),
|
|
635
|
+
__metadata("design:type", Number)
|
|
636
|
+
], ɵParameterExpression.prototype, "dataValueType", void 0);
|
|
637
|
+
|
|
638
|
+
class ɵSubQueryExpression extends ɵBaseExpression {
|
|
639
|
+
constructor(config) {
|
|
640
|
+
super(config);
|
|
641
|
+
this.expressionType = ɵExpressionType.SubQuery;
|
|
642
|
+
this.columnPath = config?.columnPath;
|
|
643
|
+
const subFilter = config?.subFilters;
|
|
644
|
+
this.subFilters = typeof subFilter?.clone === 'function' ? subFilter.clone() : subFilter;
|
|
645
|
+
this.subOrderDirection = config.subOrderDirection;
|
|
646
|
+
this.subOrderColumn = config.subOrderColumn;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Parses expression from json.
|
|
650
|
+
* @public
|
|
651
|
+
*/
|
|
652
|
+
static fromJson(dto, filterParser) {
|
|
653
|
+
const expression = new ɵSubQueryExpression({
|
|
654
|
+
columnPath: dto['columnPath'],
|
|
655
|
+
subFilters: filterParser.fromJson(dto['subFilters']),
|
|
656
|
+
subOrderDirection: dto['subOrderDirection'],
|
|
657
|
+
subOrderColumn: dto['subOrderColumn'],
|
|
658
|
+
});
|
|
659
|
+
return expression;
|
|
660
|
+
}
|
|
661
|
+
clone() {
|
|
662
|
+
return new ɵSubQueryExpression(this);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
class ɵAggregationSubQueryExpression extends ɵSubQueryExpression {
|
|
667
|
+
constructor(config) {
|
|
668
|
+
super(config);
|
|
669
|
+
this.aggregationType = config?.aggregationType;
|
|
670
|
+
this.functionType = config?.functionType;
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Parses expression from json.
|
|
674
|
+
* @public
|
|
675
|
+
*/
|
|
676
|
+
static fromJson(dto, filterParser) {
|
|
677
|
+
const subQueryExpression = super.fromJson(dto, filterParser);
|
|
678
|
+
const expression = new ɵAggregationSubQueryExpression({
|
|
679
|
+
aggregationType: dto['aggregationType'],
|
|
680
|
+
functionType: dto['functionType'],
|
|
681
|
+
...subQueryExpression,
|
|
682
|
+
});
|
|
683
|
+
return expression;
|
|
684
|
+
}
|
|
685
|
+
clone() {
|
|
686
|
+
return new ɵAggregationSubQueryExpression(this);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Function expression resolver.
|
|
692
|
+
* @public
|
|
693
|
+
*/
|
|
694
|
+
class FunctionExpressionResolver {
|
|
695
|
+
static resolve(dto) {
|
|
696
|
+
const expressionClass = {
|
|
697
|
+
[ɵFunctionType.Macros]: ɵMacrosFunctionExpression,
|
|
698
|
+
[ɵFunctionType.Length]: ɵLengthFunctionExpression,
|
|
699
|
+
[ɵFunctionType.Window]: ɵWindowFunctionExpression,
|
|
700
|
+
[ɵFunctionType.DatePart]: ɵDatePartFunctionExpression,
|
|
701
|
+
[ɵFunctionType.DateAdd]: ɵDatePartFunctionExpression,
|
|
702
|
+
[ɵFunctionType.DateDiff]: ɵDatePartFunctionExpression,
|
|
703
|
+
};
|
|
704
|
+
return expressionClass[dto['functionType']];
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Expression resolver.
|
|
709
|
+
* @public
|
|
710
|
+
*/
|
|
711
|
+
class ɵExpressionResolver {
|
|
712
|
+
static resolve(expressionType, dto) {
|
|
713
|
+
const expressionClass = {
|
|
714
|
+
[ɵExpressionType.SchemaColumn]: ɵColumnExpression,
|
|
715
|
+
[ɵExpressionType.Parameter]: ɵParameterExpression,
|
|
716
|
+
[ɵExpressionType.SubQuery]: ɵAggregationSubQueryExpression,
|
|
717
|
+
[ɵExpressionType.ArithmeticOperation]: ɵArithmeticExpression,
|
|
718
|
+
[ɵExpressionType.Function]: FunctionExpressionResolver.resolve(dto),
|
|
719
|
+
};
|
|
720
|
+
return expressionClass[expressionType];
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Expression parser.
|
|
726
|
+
* @public
|
|
727
|
+
*/
|
|
728
|
+
class ɵExpressionParser extends ɵBaseExpressionParser {
|
|
729
|
+
/**
|
|
730
|
+
* Parses expression from json.
|
|
731
|
+
* @public
|
|
732
|
+
*/
|
|
733
|
+
static fromJson(dto, filterParser) {
|
|
734
|
+
const expressionType = dto['expressionType'];
|
|
735
|
+
return ɵExpressionResolver.resolve(expressionType, dto).fromJson(dto, filterParser, ɵExpressionParser);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
const ɵEXPRESSION_TYPE_MOCK = -1;
|
|
740
|
+
class ɵExpressionMock extends ɵBaseExpression {
|
|
741
|
+
constructor(config) {
|
|
742
|
+
super(config || {});
|
|
743
|
+
this.expressionType = ɵEXPRESSION_TYPE_MOCK;
|
|
744
|
+
}
|
|
745
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
746
|
+
get plainObject() {
|
|
747
|
+
return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
|
|
748
|
+
}
|
|
749
|
+
clone() {
|
|
750
|
+
return new ɵExpressionMock(this);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
class ɵBaseFilter {
|
|
755
|
+
constructor(filterType) {
|
|
756
|
+
this.isEnabled = true;
|
|
757
|
+
this.trimDateTimeParameterToDate = false;
|
|
758
|
+
this.filterType = filterType;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Parses filter from json.
|
|
762
|
+
* @public
|
|
763
|
+
*/
|
|
764
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
765
|
+
throw new Error(`fromJson not supported on filter type ${this.constructor.name}`);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
class ɵFilterMock extends ɵBaseFilter {
|
|
770
|
+
constructor(filterType = ɵFilterType.None) {
|
|
771
|
+
super(filterType);
|
|
772
|
+
}
|
|
773
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
774
|
+
get plainObject() {
|
|
775
|
+
return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
|
|
776
|
+
}
|
|
777
|
+
clone() {
|
|
778
|
+
return new ɵFilterMock(this.filterType);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
const ɵparserMock = {
|
|
783
|
+
fromJson: (data) => ({
|
|
784
|
+
...data,
|
|
785
|
+
clone: () => data,
|
|
786
|
+
}),
|
|
787
|
+
clone: () => this,
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
class ɵSingleFilter extends ɵBaseFilter {
|
|
791
|
+
constructor(filterType, comparisonType, leftExpression) {
|
|
792
|
+
super(filterType);
|
|
793
|
+
this.comparisonType = comparisonType;
|
|
794
|
+
this.leftExpression = leftExpression.clone();
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
class ɵCompareFilter extends ɵSingleFilter {
|
|
799
|
+
constructor(comparisonType, leftExpression, rightExpression) {
|
|
800
|
+
super(ɵFilterType.Compare, comparisonType, leftExpression);
|
|
801
|
+
this.rightExpression = rightExpression.clone();
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Parses filter from json.
|
|
805
|
+
* @public
|
|
806
|
+
*/
|
|
807
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
808
|
+
const filter = new ɵCompareFilter(dto['comparisonType'], expressionParser.fromJson(dto['leftExpression'], filterParser), expressionParser.fromJson(dto['rightExpression'], filterParser));
|
|
809
|
+
return filter;
|
|
810
|
+
}
|
|
811
|
+
clone() {
|
|
812
|
+
return new ɵCompareFilter(this.comparisonType, this.leftExpression, this.rightExpression);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
class ɵBetweenFilter extends ɵSingleFilter {
|
|
817
|
+
constructor(leftExpression, rightLessExpression, rightGreaterExpression) {
|
|
818
|
+
super(ɵFilterType.Between, ɵComparisonType.Between, leftExpression);
|
|
819
|
+
this.rightLessExpression = rightLessExpression.clone();
|
|
820
|
+
this.rightGreaterExpression = rightGreaterExpression.clone();
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Parses filter from json.
|
|
824
|
+
* @public
|
|
825
|
+
*/
|
|
826
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
827
|
+
const filter = new ɵBetweenFilter(expressionParser.fromJson(dto['leftExpression'], filterParser), expressionParser.fromJson(dto['rightLessExpression'], filterParser), expressionParser.fromJson(dto['rightGreaterExpression'], filterParser));
|
|
828
|
+
return filter;
|
|
829
|
+
}
|
|
830
|
+
clone() {
|
|
831
|
+
return new ɵBetweenFilter(this.leftExpression, this.rightLessExpression, this.rightGreaterExpression);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
class ɵExistsFilter extends ɵSingleFilter {
|
|
836
|
+
constructor(leftExpression, subFilters, comparisonType = ɵComparisonType.Exists, isAggregative = true) {
|
|
837
|
+
super(ɵFilterType.Exists, comparisonType, leftExpression);
|
|
838
|
+
this.subFilters = subFilters?.clone();
|
|
839
|
+
this.isAggregative = isAggregative;
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* Parses filter from json.
|
|
843
|
+
* @public
|
|
844
|
+
*/
|
|
845
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
846
|
+
const leftExpression = expressionParser.fromJson(dto['leftExpression'], filterParser);
|
|
847
|
+
const subFilters = filterParser.fromJson(dto['subFilters']);
|
|
848
|
+
return new ɵExistsFilter(leftExpression, subFilters, dto['comparisonType'], dto['isAggregative']);
|
|
849
|
+
}
|
|
850
|
+
clone() {
|
|
851
|
+
return new ɵExistsFilter(this.leftExpression, this.subFilters, this.comparisonType, this.isAggregative);
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
class ɵInFilter extends ɵSingleFilter {
|
|
856
|
+
constructor(comparisonType, leftExpression, rightExpressions) {
|
|
857
|
+
super(ɵFilterType.In, comparisonType, leftExpression);
|
|
858
|
+
this.rightExpressions = rightExpressions.map((expression) => expression.clone());
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Parses in filter from json.
|
|
862
|
+
* @public
|
|
863
|
+
*/
|
|
864
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
865
|
+
const dtoRightExpressions = (dto['rightExpressions'] ?? []);
|
|
866
|
+
return new ɵInFilter(dto['comparisonType'], expressionParser.fromJson(dto['leftExpression'], filterParser), dtoRightExpressions.map((expression) => expressionParser.fromJson(expression, filterParser)));
|
|
867
|
+
}
|
|
868
|
+
clone() {
|
|
869
|
+
return new ɵInFilter(this.comparisonType, this.leftExpression, this.rightExpressions);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
class ɵIsNullFilter extends ɵSingleFilter {
|
|
874
|
+
constructor(comparisonType, leftExpression) {
|
|
875
|
+
super(ɵFilterType.IsNull, comparisonType, leftExpression);
|
|
876
|
+
}
|
|
877
|
+
get isNull() {
|
|
878
|
+
return this.comparisonType === ɵComparisonType.Is_null;
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* Parses isNull filter from json.
|
|
882
|
+
* @public
|
|
883
|
+
*/
|
|
884
|
+
static fromJson(dto, filterParser, expressionParser) {
|
|
885
|
+
return new ɵIsNullFilter(dto['comparisonType'], expressionParser.fromJson(dto['leftExpression'], filterParser));
|
|
886
|
+
}
|
|
887
|
+
clone() {
|
|
888
|
+
return new ɵIsNullFilter(this.comparisonType, this.leftExpression);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
__decorate([
|
|
892
|
+
Expose(),
|
|
893
|
+
__metadata("design:type", Boolean),
|
|
894
|
+
__metadata("design:paramtypes", [])
|
|
895
|
+
], ɵIsNullFilter.prototype, "isNull", null);
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* Empty Guid constant.
|
|
899
|
+
* @public
|
|
900
|
+
*/
|
|
901
|
+
const ɵEMPTY_GUID = '00000000-0000-0000-0000-000000000000';
|
|
902
|
+
/**
|
|
903
|
+
* Regular expression for Guid validation.
|
|
904
|
+
* @public
|
|
905
|
+
*/
|
|
906
|
+
const validator = new RegExp('^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$', 'i');
|
|
907
|
+
/**
|
|
908
|
+
* Generates guid part.
|
|
909
|
+
* @param length Part length.
|
|
910
|
+
* @public
|
|
911
|
+
*/
|
|
912
|
+
function generateGuidPart(length) {
|
|
913
|
+
let out = '';
|
|
914
|
+
for (let i = 0; i < length; i++) {
|
|
915
|
+
// eslint-disable-next-line no-bitwise
|
|
916
|
+
out += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
|
917
|
+
}
|
|
918
|
+
return out;
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Generates new Guid.
|
|
922
|
+
* @public
|
|
923
|
+
*/
|
|
924
|
+
function ɵgenerateGuid() {
|
|
925
|
+
return [
|
|
926
|
+
generateGuidPart(2),
|
|
927
|
+
generateGuidPart(1),
|
|
928
|
+
generateGuidPart(1),
|
|
929
|
+
generateGuidPart(1),
|
|
930
|
+
generateGuidPart(3),
|
|
931
|
+
].join('-');
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* Checks if value is Guid.
|
|
935
|
+
* @param value Value for check.
|
|
936
|
+
* @public
|
|
937
|
+
*/
|
|
938
|
+
function ɵisGuid(value) {
|
|
939
|
+
return Boolean(value) && validator.test(value);
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Checks if Guid is empty value or equal to EMPTY_GUID.
|
|
943
|
+
* @param guid Guid for check.
|
|
944
|
+
* @public
|
|
945
|
+
*/
|
|
946
|
+
function ɵisEmptyGuid(guid) {
|
|
947
|
+
return !guid || guid === ɵEMPTY_GUID;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* @public
|
|
952
|
+
*/
|
|
953
|
+
class ɵNextHandlerAlreadySpecifiedException extends Error {
|
|
954
|
+
constructor() {
|
|
955
|
+
super('Next handler already specified');
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
class ɵArgumentEmptyException extends Error {
|
|
960
|
+
// region Constructors: Public
|
|
961
|
+
constructor(argumentName) {
|
|
962
|
+
super(`Argument with name '${argumentName}' is empty.`);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
class ɵArgumentOutOfRangeException extends Error {
|
|
967
|
+
// region Constructors: Public
|
|
968
|
+
constructor(argumentName) {
|
|
969
|
+
super(`Argument with name '${argumentName}' is out of range.`);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
class ɵItemNotFoundException extends Error {
|
|
974
|
+
// region Constructors: Public
|
|
975
|
+
constructor(key) {
|
|
976
|
+
super(`Item with key '${key}' does not exist.`);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
class ɵValidationUtilities {
|
|
981
|
+
// region Methods: Public
|
|
982
|
+
static checkArgumentEmpty(argumentName, argumentValue) {
|
|
983
|
+
if (argumentValue === undefined || argumentValue === null) {
|
|
984
|
+
throw new ɵArgumentEmptyException(argumentName);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
static checkArrayEmpty(argumentName, argumentValue) {
|
|
988
|
+
ɵValidationUtilities.checkArgumentEmpty(argumentName, argumentValue);
|
|
989
|
+
if (argumentValue.length === 0) {
|
|
990
|
+
throw new ɵArgumentEmptyException(argumentName);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
static checkStringIsNotEmpty(argumentName, argumentValue) {
|
|
994
|
+
this.checkArgumentEmpty(argumentName, argumentValue);
|
|
995
|
+
if (argumentValue === '') {
|
|
996
|
+
throw new ɵArgumentEmptyException(argumentName);
|
|
997
|
+
}
|
|
998
|
+
return argumentValue;
|
|
999
|
+
}
|
|
1000
|
+
static checkArgumentOutOfRange(argumentName, argumentValue, range) {
|
|
1001
|
+
if (range.begin && argumentValue < range.begin) {
|
|
1002
|
+
throw new ɵArgumentOutOfRangeException(argumentName);
|
|
1003
|
+
}
|
|
1004
|
+
if (range.end && argumentValue > range.end) {
|
|
1005
|
+
throw new ɵArgumentOutOfRangeException(argumentName);
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
class ɵFilterGroup extends ɵBaseFilter {
|
|
1011
|
+
get items() {
|
|
1012
|
+
return classToPlain(this.filters, {
|
|
1013
|
+
exposeUnsetFields: false,
|
|
1014
|
+
excludePrefixes: ['_'],
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
constructor(logicalOperation = ɵLogicalOperatorType.And) {
|
|
1018
|
+
super(ɵFilterType.FilterGroup);
|
|
1019
|
+
this.filters = new Map();
|
|
1020
|
+
this.logicalOperation = logicalOperation;
|
|
1021
|
+
}
|
|
1022
|
+
/**
|
|
1023
|
+
* Parses filter group from json.
|
|
1024
|
+
* @public
|
|
1025
|
+
*/
|
|
1026
|
+
static fromJson(dto, filterParser) {
|
|
1027
|
+
const logicalOperation = dto['logicalOperation'];
|
|
1028
|
+
const group = new ɵFilterGroup(logicalOperation || ɵLogicalOperatorType.And);
|
|
1029
|
+
Object.entries(dto['items']).forEach(([key, filterDTO]) => {
|
|
1030
|
+
group.add(filterParser.fromJson(filterDTO), key);
|
|
1031
|
+
});
|
|
1032
|
+
return group;
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Returns filter item by index.
|
|
1036
|
+
* @param index Item index.
|
|
1037
|
+
* @returns Filter.
|
|
1038
|
+
*/
|
|
1039
|
+
getItemByIndex(index) {
|
|
1040
|
+
return this.items[Object.keys(this.items)[index]];
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Creates and adds compare filter by value.
|
|
1044
|
+
* @param comparisonType Comparison type.
|
|
1045
|
+
* @param columnPath Column path.
|
|
1046
|
+
* @param parameterValue Parameter value.
|
|
1047
|
+
* @param filterKey Filter key.
|
|
1048
|
+
*/
|
|
1049
|
+
addSchemaColumnFilterWithParameter(comparisonType, columnPath, parameterValue, filterKey) {
|
|
1050
|
+
const leftExpression = new ɵColumnExpression({ columnPath });
|
|
1051
|
+
const rightExpression = new ɵParameterExpression({ value: parameterValue });
|
|
1052
|
+
const filter = new ɵCompareFilter(comparisonType, leftExpression, rightExpression);
|
|
1053
|
+
this.add(filter, filterKey);
|
|
1054
|
+
}
|
|
1055
|
+
addSchemaColumnInFilterWithParameters(comparisonType, columnPath, parameterValues) {
|
|
1056
|
+
const leftExpression = new ɵColumnExpression({ columnPath });
|
|
1057
|
+
const expressions = parameterValues.map((singleParameterValue) => new ɵParameterExpression({
|
|
1058
|
+
value: singleParameterValue,
|
|
1059
|
+
}));
|
|
1060
|
+
const filter = new ɵInFilter(comparisonType, leftExpression, expressions);
|
|
1061
|
+
this.add(filter);
|
|
1062
|
+
}
|
|
1063
|
+
addSchemaColumnIsNullFilter(columnPath) {
|
|
1064
|
+
const leftExpression = new ɵColumnExpression({ columnPath });
|
|
1065
|
+
const filter = new ɵIsNullFilter(ɵComparisonType.Is_null, leftExpression);
|
|
1066
|
+
this.add(filter);
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* Creates and adds not null filter.
|
|
1070
|
+
* @param columnPath Column path.
|
|
1071
|
+
* @param filterKey Filter key.
|
|
1072
|
+
*/
|
|
1073
|
+
addSchemaColumnIsNotNullFilter(columnPath, filterKey) {
|
|
1074
|
+
const leftExpression = new ɵColumnExpression({ columnPath });
|
|
1075
|
+
const filter = new ɵIsNullFilter(ɵComparisonType.Is_not_null, leftExpression);
|
|
1076
|
+
this.add(filter, filterKey);
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* Creates and adds filter between less value and greater value.
|
|
1080
|
+
* @param columnPath Column path.
|
|
1081
|
+
* @param lessParamValue Less parameter value.
|
|
1082
|
+
* @param greaterParamValue Greater parameter value.
|
|
1083
|
+
*/
|
|
1084
|
+
addSchemaColumnBetweenFilterWithParameters(columnPath, lessParamValue, greaterParamValue) {
|
|
1085
|
+
const leftExpression = new ɵColumnExpression({ columnPath });
|
|
1086
|
+
const rightLessExpression = new ɵParameterExpression({ value: lessParamValue });
|
|
1087
|
+
const rightGreaterExpression = new ɵParameterExpression({ value: greaterParamValue });
|
|
1088
|
+
const filter = new ɵBetweenFilter(leftExpression, rightLessExpression, rightGreaterExpression);
|
|
1089
|
+
this.add(filter);
|
|
1090
|
+
}
|
|
1091
|
+
addExistsFilter(columnPath, subFilters) {
|
|
1092
|
+
const leftExpression = new ɵColumnExpression({ columnPath });
|
|
1093
|
+
const filter = new ɵExistsFilter(leftExpression, subFilters);
|
|
1094
|
+
this.add(filter);
|
|
1095
|
+
}
|
|
1096
|
+
addNotExistsFilter(columnPath, subFilters) {
|
|
1097
|
+
const leftExpression = new ɵColumnExpression({ columnPath });
|
|
1098
|
+
const filter = new ɵExistsFilter(leftExpression, subFilters, ɵComparisonType.Not_exists);
|
|
1099
|
+
this.add(filter);
|
|
1100
|
+
}
|
|
1101
|
+
add(filter, filterKey) {
|
|
1102
|
+
ɵValidationUtilities.checkArgumentEmpty('filter', filter);
|
|
1103
|
+
const key = filterKey || ɵgenerateGuid();
|
|
1104
|
+
this.filters.set(key, filter);
|
|
1105
|
+
}
|
|
1106
|
+
clone() {
|
|
1107
|
+
const filterGroup = new ɵFilterGroup(this.logicalOperation);
|
|
1108
|
+
this.filters.forEach((filter, filterKey) => {
|
|
1109
|
+
filterGroup.filters.set(filterKey, filter.clone());
|
|
1110
|
+
});
|
|
1111
|
+
return filterGroup;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
__decorate([
|
|
1115
|
+
Exclude(),
|
|
1116
|
+
__metadata("design:type", Object)
|
|
1117
|
+
], ɵFilterGroup.prototype, "filters", void 0);
|
|
1118
|
+
__decorate([
|
|
1119
|
+
Expose(),
|
|
1120
|
+
__metadata("design:type", Object),
|
|
1121
|
+
__metadata("design:paramtypes", [])
|
|
1122
|
+
], ɵFilterGroup.prototype, "items", null);
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* Filter parser interface
|
|
1126
|
+
* @public
|
|
1127
|
+
*/
|
|
1128
|
+
class ɵBaseFilterParser {
|
|
1129
|
+
static fromJson(dto) {
|
|
1130
|
+
throw new Error('not implemented');
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* Filter resolver.
|
|
1136
|
+
* @public
|
|
1137
|
+
*/
|
|
1138
|
+
class ɵFilterResolver {
|
|
1139
|
+
static resolve(filterType) {
|
|
1140
|
+
const filterClass = {
|
|
1141
|
+
[ɵFilterType.Compare]: ɵCompareFilter,
|
|
1142
|
+
[ɵFilterType.FilterGroup]: ɵFilterGroup,
|
|
1143
|
+
[ɵFilterType.In]: ɵInFilter,
|
|
1144
|
+
[ɵFilterType.IsNull]: ɵIsNullFilter,
|
|
1145
|
+
[ɵFilterType.Exists]: ɵExistsFilter,
|
|
1146
|
+
[ɵFilterType.Between]: ɵBetweenFilter,
|
|
1147
|
+
};
|
|
1148
|
+
return filterClass[filterType];
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* Filter parser.
|
|
1154
|
+
* @public
|
|
1155
|
+
*/
|
|
1156
|
+
class ɵFilterParser extends ɵBaseFilterParser {
|
|
1157
|
+
static fromJson(dto) {
|
|
1158
|
+
const filterType = dto['filterType'];
|
|
1159
|
+
return ɵFilterResolver.resolve(filterType).fromJson(dto, ɵFilterParser, ɵExpressionParser);
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
const ɵDEFAULT_FILTER_PLAIN_OBJ = {
|
|
1164
|
+
isEnabled: true,
|
|
1165
|
+
trimDateTimeParameterToDate: false,
|
|
1166
|
+
};
|
|
1167
|
+
function ɵgetFilterPlainObj(filterPlainObj) {
|
|
1168
|
+
return {
|
|
1169
|
+
...ɵDEFAULT_FILTER_PLAIN_OBJ,
|
|
1170
|
+
...filterPlainObj,
|
|
1171
|
+
};
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
class ɵBaseQueryColumn {
|
|
1175
|
+
constructor(expression) {
|
|
1176
|
+
this.orderDirection = ɵOrderDirection.None;
|
|
1177
|
+
this.orderPosition = -1;
|
|
1178
|
+
this.isVisible = true;
|
|
1179
|
+
this.expression = expression;
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Adds ordering options.
|
|
1183
|
+
* @param orderDirection Direction.
|
|
1184
|
+
* @param orderPosition Position.
|
|
1185
|
+
* @returns Self.
|
|
1186
|
+
*/
|
|
1187
|
+
withOrdering(orderDirection, orderPosition) {
|
|
1188
|
+
ɵValidationUtilities.checkArgumentEmpty('orderDirection', orderDirection);
|
|
1189
|
+
ɵValidationUtilities.checkArgumentEmpty('orderPosition', orderPosition);
|
|
1190
|
+
ɵValidationUtilities.checkArgumentOutOfRange('orderPosition', orderPosition, { begin: -1 });
|
|
1191
|
+
this.orderDirection = orderDirection;
|
|
1192
|
+
this.orderPosition = orderPosition;
|
|
1193
|
+
return this;
|
|
1194
|
+
}
|
|
1195
|
+
/**
|
|
1196
|
+
* Adds options.
|
|
1197
|
+
* @param options Options.
|
|
1198
|
+
* @returns Self.
|
|
1199
|
+
*/
|
|
1200
|
+
withOptions(options) {
|
|
1201
|
+
ɵValidationUtilities.checkArgumentEmpty('options', options);
|
|
1202
|
+
this.isVisible = options.isVisible ?? true;
|
|
1203
|
+
return this;
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Adds caption.
|
|
1207
|
+
* @param caption Caption.
|
|
1208
|
+
* @returns Self.
|
|
1209
|
+
*/
|
|
1210
|
+
withCaption(caption) {
|
|
1211
|
+
ɵValidationUtilities.checkArgumentEmpty('caption', caption);
|
|
1212
|
+
this.caption = caption;
|
|
1213
|
+
return this;
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
class ɵArithmeticQueryColumn extends ɵBaseQueryColumn {
|
|
1218
|
+
// region Constructors: Public
|
|
1219
|
+
constructor(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand) {
|
|
1220
|
+
super(new ɵArithmeticExpression({ arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand }));
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
class ɵEntityQueryColumn extends ɵBaseQueryColumn {
|
|
1225
|
+
// region Constructors: Public
|
|
1226
|
+
constructor(columnPath) {
|
|
1227
|
+
super(new ɵColumnExpression({ columnPath }));
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
class ɵParameterQueryColumn extends ɵBaseQueryColumn {
|
|
1232
|
+
// region Constructors: Public
|
|
1233
|
+
constructor(value, dataValueType) {
|
|
1234
|
+
super(new ɵParameterExpression({ value, dataValueType }));
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
class ɵAggregationSubQueryColumn extends ɵBaseQueryColumn {
|
|
1239
|
+
// region Constructors: Public
|
|
1240
|
+
constructor(columnPath, aggregationType, subFilters, subOrderDirection, subOrderColumn) {
|
|
1241
|
+
super(new ɵAggregationSubQueryExpression({
|
|
1242
|
+
aggregationType,
|
|
1243
|
+
columnPath,
|
|
1244
|
+
subFilters,
|
|
1245
|
+
subOrderDirection,
|
|
1246
|
+
subOrderColumn,
|
|
1247
|
+
}));
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
class ɵSubQueryColumn extends ɵBaseQueryColumn {
|
|
1252
|
+
// region Constructors: Public
|
|
1253
|
+
constructor(columnPath, subFilters) {
|
|
1254
|
+
super(new ɵSubQueryExpression({ columnPath, subFilters }));
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
class ɵAggregationFunctionColumn extends ɵBaseQueryColumn {
|
|
1259
|
+
// region Constructors: Public
|
|
1260
|
+
constructor(aggregationType, aggregationEvalType, functionArgument) {
|
|
1261
|
+
super(new ɵAggregationFunctionExpression({
|
|
1262
|
+
aggregationType,
|
|
1263
|
+
aggregationEvalType,
|
|
1264
|
+
functionArgument,
|
|
1265
|
+
}));
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
class ɵDatePartFunctionColumn extends ɵBaseQueryColumn {
|
|
1270
|
+
// region Constructors: Public
|
|
1271
|
+
constructor(datePartType, functionArgument) {
|
|
1272
|
+
super(new ɵDatePartFunctionExpression({
|
|
1273
|
+
datePartType,
|
|
1274
|
+
functionArgument,
|
|
1275
|
+
}));
|
|
1276
|
+
}
|
|
1277
|
+
// endregion
|
|
1278
|
+
// region Properties: Public
|
|
1279
|
+
get datePartType() {
|
|
1280
|
+
return this.expression?.datePartType;
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
class ɵLengthFunctionColumn extends ɵBaseQueryColumn {
|
|
1285
|
+
// region Constructors: Public
|
|
1286
|
+
constructor(functionArgument) {
|
|
1287
|
+
super(new ɵLengthFunctionExpression({ functionArgument }));
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
class ɵMacrosFunctionColumn extends ɵBaseQueryColumn {
|
|
1292
|
+
// region Constructors: Public
|
|
1293
|
+
constructor(macrosType) {
|
|
1294
|
+
super(new ɵMacrosFunctionExpression({ macrosType }));
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
class ɵWindowFunctionColumn extends ɵBaseQueryColumn {
|
|
1299
|
+
// region Constructors: Public
|
|
1300
|
+
constructor(functionArgument) {
|
|
1301
|
+
super(new ɵWindowFunctionExpression({ functionArgument }));
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
const ɵDEFAULT_COLUMN_PLAIN_OBJ = {
|
|
1306
|
+
isVisible: true,
|
|
1307
|
+
orderPosition: -1,
|
|
1308
|
+
orderDirection: ɵOrderDirection.None,
|
|
1309
|
+
};
|
|
1310
|
+
function ɵgetColumnPlainObj(expressionPlainObj) {
|
|
1311
|
+
return {
|
|
1312
|
+
...ɵDEFAULT_COLUMN_PLAIN_OBJ,
|
|
1313
|
+
expression: expressionPlainObj,
|
|
1314
|
+
};
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* @public
|
|
1319
|
+
*/
|
|
1320
|
+
class ɵBaseQuery {
|
|
1321
|
+
// region Constructors: Protected
|
|
1322
|
+
constructor(operationType, rootSchemaName) {
|
|
1323
|
+
this.operationType = operationType;
|
|
1324
|
+
this.rootSchemaName = rootSchemaName;
|
|
1325
|
+
ɵValidationUtilities.checkArgumentEmpty('_operationType', operationType);
|
|
1326
|
+
ɵValidationUtilities.checkArgumentEmpty('_rootSchemaName', rootSchemaName);
|
|
1327
|
+
}
|
|
1328
|
+
// endregion
|
|
1329
|
+
// region Methods: Public
|
|
1330
|
+
getMetadata() {
|
|
1331
|
+
return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* @public
|
|
1337
|
+
*/
|
|
1338
|
+
class ɵBaseFilterableQuery extends ɵBaseQuery {
|
|
1339
|
+
constructor(operationType, rootSchemaName) {
|
|
1340
|
+
super(operationType, rootSchemaName);
|
|
1341
|
+
this.filters = new ɵFilterGroup();
|
|
1342
|
+
}
|
|
1343
|
+
clearFilters() {
|
|
1344
|
+
this.filters.filters.clear();
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* @public
|
|
1350
|
+
*/
|
|
1351
|
+
var ɵQueryOperationType;
|
|
1352
|
+
(function (ɵQueryOperationType) {
|
|
1353
|
+
ɵQueryOperationType[ɵQueryOperationType["Select"] = 0] = "Select";
|
|
1354
|
+
ɵQueryOperationType[ɵQueryOperationType["Insert"] = 1] = "Insert";
|
|
1355
|
+
ɵQueryOperationType[ɵQueryOperationType["Update"] = 2] = "Update";
|
|
1356
|
+
ɵQueryOperationType[ɵQueryOperationType["Delete"] = 3] = "Delete";
|
|
1357
|
+
// Batch,
|
|
1358
|
+
// ListSelect,
|
|
1359
|
+
// FilteredSelect,
|
|
1360
|
+
// LookupSelect
|
|
1361
|
+
})(ɵQueryOperationType || (ɵQueryOperationType = {}));
|
|
1362
|
+
|
|
1363
|
+
/**
|
|
1364
|
+
* @public
|
|
1365
|
+
*/
|
|
1366
|
+
class ɵDeleteQuery extends ɵBaseFilterableQuery {
|
|
1367
|
+
// region Constructors: Public
|
|
1368
|
+
constructor(rootSchemaName) {
|
|
1369
|
+
super(ɵQueryOperationType.Delete, rootSchemaName);
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
/**
|
|
1374
|
+
* @public
|
|
1375
|
+
*/
|
|
1376
|
+
class ɵEntitySchemaQuery extends ɵBaseFilterableQuery {
|
|
1377
|
+
constructor(rootSchemaName) {
|
|
1378
|
+
super(ɵQueryOperationType.Select, rootSchemaName);
|
|
1379
|
+
this._columns = new Map();
|
|
1380
|
+
this.isDistinct = false;
|
|
1381
|
+
/**
|
|
1382
|
+
* Number of rows to select.
|
|
1383
|
+
*/
|
|
1384
|
+
this.rowCount = -1;
|
|
1385
|
+
/**
|
|
1386
|
+
* Rows count to skip.
|
|
1387
|
+
*/
|
|
1388
|
+
this.rowsOffset = -1;
|
|
1389
|
+
this.useLocalization = true;
|
|
1390
|
+
this.useRecordDeactivation = false;
|
|
1391
|
+
this._getIsPageable = () => this.rowCount > 0 && this.rowsOffset > -1;
|
|
1392
|
+
}
|
|
1393
|
+
_internalAddColumn(key, column) {
|
|
1394
|
+
if (!this._columns.has(key)) {
|
|
1395
|
+
this._columns.set(key, column);
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
// endregion
|
|
1399
|
+
// region Methods: Public
|
|
1400
|
+
/**
|
|
1401
|
+
* Returns column instance by column alias.
|
|
1402
|
+
* @param columnAlias Column alias.
|
|
1403
|
+
* @returns [BaseQueryColumn] Column instance.
|
|
1404
|
+
*/
|
|
1405
|
+
getColumn(columnAlias) {
|
|
1406
|
+
if (!this._columns.has(columnAlias)) {
|
|
1407
|
+
throw new ɵItemNotFoundException(columnAlias);
|
|
1408
|
+
}
|
|
1409
|
+
return this.findColumn(columnAlias);
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Returns column instance by column alias if not found returns null.
|
|
1413
|
+
*/
|
|
1414
|
+
findColumn(columnAlias) {
|
|
1415
|
+
return this._columns.get(columnAlias);
|
|
1416
|
+
}
|
|
1417
|
+
/**
|
|
1418
|
+
* @inheritDoc
|
|
1419
|
+
*/
|
|
1420
|
+
getMetadata() {
|
|
1421
|
+
return {
|
|
1422
|
+
...super.getMetadata(),
|
|
1423
|
+
columns: {
|
|
1424
|
+
items: classToPlain(this._columns, { exposeUnsetFields: false, excludePrefixes: ['_'] }),
|
|
1425
|
+
},
|
|
1426
|
+
allColumns: false,
|
|
1427
|
+
isDistinct: this.isDistinct,
|
|
1428
|
+
ignoreDisplayValues: false,
|
|
1429
|
+
rowCount: this.rowCount,
|
|
1430
|
+
rowsOffset: this.rowsOffset,
|
|
1431
|
+
isPageable: this._getIsPageable(),
|
|
1432
|
+
conditionalValues: this.conditionalValues ? this.conditionalValues : null,
|
|
1433
|
+
isHierarchical: false,
|
|
1434
|
+
hierarchicalMaxDepth: 0,
|
|
1435
|
+
hierarchicalColumnName: null,
|
|
1436
|
+
hierarchicalColumnValue: null,
|
|
1437
|
+
useLocalization: this.useLocalization,
|
|
1438
|
+
useRecordDeactivation: this.useRecordDeactivation,
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Add column.
|
|
1443
|
+
* @param column Column path.
|
|
1444
|
+
* @param columnAlias Column alias.
|
|
1445
|
+
* @returns [BaseQueryColumn] Column instance.
|
|
1446
|
+
*/
|
|
1447
|
+
addColumn(column, columnAlias) {
|
|
1448
|
+
this._internalAddColumn(columnAlias, column);
|
|
1449
|
+
return column;
|
|
1450
|
+
}
|
|
1451
|
+
/**
|
|
1452
|
+
* Add column by column path.
|
|
1453
|
+
* @param columnPath Column path.
|
|
1454
|
+
* @param columnAlias Column alias.
|
|
1455
|
+
* @returns [EntityQueryColumn] Column instance.
|
|
1456
|
+
*/
|
|
1457
|
+
addSchemaColumn(columnPath, columnAlias) {
|
|
1458
|
+
ɵValidationUtilities.checkArgumentEmpty('columnPath', columnPath);
|
|
1459
|
+
const column = new ɵEntityQueryColumn(columnPath);
|
|
1460
|
+
this._internalAddColumn(columnAlias || columnPath, column);
|
|
1461
|
+
return column;
|
|
1462
|
+
}
|
|
1463
|
+
/**
|
|
1464
|
+
* Add aggregation sub query column.
|
|
1465
|
+
* @param columnPath Column path.
|
|
1466
|
+
* @param aggregationType Aggregation type.
|
|
1467
|
+
* @param subFilters Sub query filters.
|
|
1468
|
+
* @param columnAlias Column alias.
|
|
1469
|
+
* @returns [AggregationSubQueryColumn] Column instance.
|
|
1470
|
+
*/
|
|
1471
|
+
addAggregationSubQueryColumn(columnPath, aggregationType, aggregationConfig, columnAlias) {
|
|
1472
|
+
const column = new ɵAggregationSubQueryColumn(columnPath, aggregationType, aggregationConfig.filter, aggregationConfig.sortByDirection, aggregationConfig.sortByColumn);
|
|
1473
|
+
this._internalAddColumn(columnAlias || columnPath, column);
|
|
1474
|
+
return column;
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* Add parameter column.
|
|
1478
|
+
* @param value Parameter value.
|
|
1479
|
+
* @param dataValueType Parameter data value type.
|
|
1480
|
+
* @param columnAlias Column alias.
|
|
1481
|
+
* @returns [ParameterQueryColumn] Column instance.
|
|
1482
|
+
*/
|
|
1483
|
+
addParameterColumn(value, dataValueType, columnAlias) {
|
|
1484
|
+
const column = new ɵParameterQueryColumn(value, dataValueType);
|
|
1485
|
+
this._internalAddColumn(columnAlias, column);
|
|
1486
|
+
return column;
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* Add arithmetic column.
|
|
1490
|
+
* @param arithmeticOperation Arithmetic operation.
|
|
1491
|
+
* @param leftArithmeticOperand Left arithmetic operand expression.
|
|
1492
|
+
* @param rightArithmeticOperand Right arithmetic operand expression.
|
|
1493
|
+
* @param columnAlias Column alias.
|
|
1494
|
+
* @returns [ArithmeticQueryColumn] Column instance.
|
|
1495
|
+
*/
|
|
1496
|
+
addArithmeticColumn(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand, columnAlias) {
|
|
1497
|
+
const column = new ɵArithmeticQueryColumn(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand);
|
|
1498
|
+
this._internalAddColumn(columnAlias, column);
|
|
1499
|
+
return column;
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* Add macros function column.
|
|
1503
|
+
* @param queryMacrosType Macros type.
|
|
1504
|
+
* @param columnAlias Column alias.
|
|
1505
|
+
* @returns [MacrosFunctionColumn] Column instance.
|
|
1506
|
+
*/
|
|
1507
|
+
addMacrosFunctionColumn(queryMacrosType, columnAlias) {
|
|
1508
|
+
const column = new ɵMacrosFunctionColumn(queryMacrosType);
|
|
1509
|
+
this._internalAddColumn(columnAlias, column);
|
|
1510
|
+
return column;
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Add date part function column.
|
|
1514
|
+
* @param columnPath Column path.
|
|
1515
|
+
* @param datePartType Date part type.
|
|
1516
|
+
* @param columnAlias Column alias.
|
|
1517
|
+
* @returns [DatePartFunctionColumn] Column instance.
|
|
1518
|
+
*/
|
|
1519
|
+
addDatePartFunctionColumn(columnPath, datePartType, columnAlias) {
|
|
1520
|
+
const functionArgument = new ɵColumnExpression({ columnPath });
|
|
1521
|
+
const column = new ɵDatePartFunctionColumn(datePartType, functionArgument);
|
|
1522
|
+
this._internalAddColumn(columnAlias, column);
|
|
1523
|
+
return column;
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Add aggregation function column.
|
|
1527
|
+
* @param columnPath Column path.
|
|
1528
|
+
* @param aggregationType Aggregation type.
|
|
1529
|
+
* @param columnAlias Column alias.
|
|
1530
|
+
* @param aggregationEvalType Aggregation eval type.
|
|
1531
|
+
* @returns [AggregationFunctionColumn] Column instance.
|
|
1532
|
+
*/
|
|
1533
|
+
addAggregationFunctionColumn(columnPath, aggregationType, columnAlias, aggregationEvalType = ɵAggregationEvalType.None) {
|
|
1534
|
+
const functionArgument = new ɵColumnExpression({ columnPath });
|
|
1535
|
+
const column = new ɵAggregationFunctionColumn(aggregationType, aggregationEvalType, functionArgument);
|
|
1536
|
+
this._internalAddColumn(columnAlias, column);
|
|
1537
|
+
return column;
|
|
1538
|
+
}
|
|
1539
|
+
/**
|
|
1540
|
+
* Add length function column.
|
|
1541
|
+
* @param columnPath Column path.
|
|
1542
|
+
* @param columnAlias Column alias.
|
|
1543
|
+
* @returns [LengthFunctionColumn] Column instance.
|
|
1544
|
+
*/
|
|
1545
|
+
addLengthFunctionColumn(columnPath, columnAlias) {
|
|
1546
|
+
const functionArgument = new ɵColumnExpression({ columnPath });
|
|
1547
|
+
const column = new ɵLengthFunctionColumn(functionArgument);
|
|
1548
|
+
this._internalAddColumn(columnAlias, column);
|
|
1549
|
+
return column;
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* Add window function column.
|
|
1553
|
+
* @param columnPath Column path.
|
|
1554
|
+
* @param aggregationType Aggregation type.
|
|
1555
|
+
* @param columnAlias Column alias.
|
|
1556
|
+
* @param aggregationEvalType Aggregation eval type.
|
|
1557
|
+
* @returns [WindowFunctionColumn] Column instance.
|
|
1558
|
+
*/
|
|
1559
|
+
addWindowFunctionColumn(columnPath, aggregationType, columnAlias, aggregationEvalType = ɵAggregationEvalType.None) {
|
|
1560
|
+
const functionArgument = new ɵAggregationFunctionExpression({
|
|
1561
|
+
aggregationType,
|
|
1562
|
+
aggregationEvalType,
|
|
1563
|
+
functionArgument: new ɵColumnExpression({ columnPath }),
|
|
1564
|
+
});
|
|
1565
|
+
const column = new ɵWindowFunctionColumn(functionArgument);
|
|
1566
|
+
this._internalAddColumn(columnAlias, column);
|
|
1567
|
+
return column;
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
/**
|
|
1572
|
+
* @public
|
|
1573
|
+
*/
|
|
1574
|
+
class ɵInsertQuery extends ɵBaseQuery {
|
|
1575
|
+
// endregion
|
|
1576
|
+
// region Constructors: Public
|
|
1577
|
+
constructor(rootSchemaName) {
|
|
1578
|
+
super(ɵQueryOperationType.Insert, rootSchemaName);
|
|
1579
|
+
// region Fields: Private
|
|
1580
|
+
this._columnValues = new Map();
|
|
1581
|
+
}
|
|
1582
|
+
// endregion
|
|
1583
|
+
// region Properties: Public
|
|
1584
|
+
get columnValues() {
|
|
1585
|
+
return {
|
|
1586
|
+
items: classToPlain(this._columnValues),
|
|
1587
|
+
};
|
|
1588
|
+
}
|
|
1589
|
+
// endregion
|
|
1590
|
+
// region Methods: Public
|
|
1591
|
+
addColumn(columnName, columnValue, dataValueType) {
|
|
1592
|
+
ɵValidationUtilities.checkArgumentEmpty('columnName', columnName);
|
|
1593
|
+
this._columnValues.set(columnName, new ɵParameterExpression({ value: columnValue, dataValueType }));
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
__decorate([
|
|
1597
|
+
Expose(),
|
|
1598
|
+
__metadata("design:type", Object),
|
|
1599
|
+
__metadata("design:paramtypes", [])
|
|
1600
|
+
], ɵInsertQuery.prototype, "columnValues", null);
|
|
1601
|
+
|
|
1602
|
+
/**
|
|
1603
|
+
* @public
|
|
1604
|
+
*/
|
|
1605
|
+
class ɵUpdateQuery extends ɵBaseFilterableQuery {
|
|
1606
|
+
// endregion
|
|
1607
|
+
// region Constructors: Public
|
|
1608
|
+
constructor(rootSchemaName) {
|
|
1609
|
+
super(ɵQueryOperationType.Update, rootSchemaName);
|
|
1610
|
+
// region Fields: Private
|
|
1611
|
+
this._columnValues = new Map();
|
|
1612
|
+
// endregion
|
|
1613
|
+
// region Fields: Public
|
|
1614
|
+
/**
|
|
1615
|
+
* Flag that indicates whether to force save data.
|
|
1616
|
+
*/
|
|
1617
|
+
this.isForceUpdate = false;
|
|
1618
|
+
}
|
|
1619
|
+
// endregion
|
|
1620
|
+
// region Properties: Public
|
|
1621
|
+
get columnValues() {
|
|
1622
|
+
return {
|
|
1623
|
+
items: classToPlain(this._columnValues),
|
|
1624
|
+
};
|
|
1625
|
+
}
|
|
1626
|
+
// endregion
|
|
1627
|
+
// region Methods: Public
|
|
1628
|
+
addColumn(columnName, columnValue, dataValueType) {
|
|
1629
|
+
ɵValidationUtilities.checkArgumentEmpty('columnName', columnName);
|
|
1630
|
+
this._columnValues.set(columnName, new ɵParameterExpression({ value: columnValue, dataValueType }));
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
__decorate([
|
|
1634
|
+
Expose(),
|
|
1635
|
+
__metadata("design:type", Object),
|
|
1636
|
+
__metadata("design:paramtypes", [])
|
|
1637
|
+
], ɵUpdateQuery.prototype, "columnValues", null);
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* @public
|
|
1641
|
+
*/
|
|
1642
|
+
class ɵSelectLocalizationQuery extends ɵEntitySchemaQuery {
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
/**
|
|
1646
|
+
* @public
|
|
1647
|
+
* @class ɵBaseRequest
|
|
1648
|
+
* @describe Base definition of request.
|
|
1649
|
+
* @template TEvent
|
|
1650
|
+
*/
|
|
1651
|
+
class ɵBaseRequest {
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1655
|
+
|
|
1656
|
+
/**
|
|
1657
|
+
* @public
|
|
1658
|
+
*/
|
|
1659
|
+
var ɵModelParameterType;
|
|
1660
|
+
(function (ɵModelParameterType) {
|
|
1661
|
+
ɵModelParameterType["PrimaryColumnValue"] = "primaryColumnValue";
|
|
1662
|
+
ɵModelParameterType["Filter"] = "filter";
|
|
1663
|
+
ɵModelParameterType["PrimaryDisplayValueFilter"] = "primaryDisplayValueFilter";
|
|
1664
|
+
ɵModelParameterType["Empty"] = "empty";
|
|
1665
|
+
ɵModelParameterType["Never"] = "never";
|
|
1666
|
+
})(ɵModelParameterType || (ɵModelParameterType = {}));
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* Generated bundle index. Do not edit.
|
|
1670
|
+
*/
|
|
1671
|
+
|
|
1672
|
+
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, ɵModelParameterType, ɵNextHandlerAlreadySpecifiedException, ɵOrderDirection, ɵParameterExpression, ɵParameterQueryColumn, ɵQueryMacrosType, ɵQueryOperationType, ɵSelectLocalizationQuery, ɵSingleFilter, ɵSubQueryColumn, ɵSubQueryExpression, ɵUpdateQuery, ɵValidationUtilities, ɵWindowFunctionColumn, ɵWindowFunctionExpression, ɵencodeDate, ɵgenerateGuid, ɵgetColumnPlainObj, ɵgetFilterPlainObj, ɵisEmptyGuid, ɵisGuid, ɵparserMock, ɵtoLocalISOString };
|
|
1673
|
+
//# sourceMappingURL=creatio-base.mjs.map
|