@creatio-devkit/common 0.808.0 → 0.8010.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 +9 -5
- package/esm2020/lib/base-exports.mjs +2 -0
- package/esm2020/lib/external/functions/aggregation-adapter.mjs +4 -4
- package/esm2020/lib/external/functions/date-part-type-adapter.mjs +2 -2
- package/esm2020/lib/external/functions/function-type-adapter.mjs +2 -2
- package/esm2020/lib/external/functions/order-direction-adapter.mjs +2 -2
- package/esm2020/lib/external/models/attribute-value-config.mjs +1 -1
- package/esm2020/lib/external/models/date-time/grouped-date-value.mjs +1 -1
- package/esm2020/lib/external/models/file-value.model.mjs +1 -1
- package/esm2020/lib/index.mjs +2 -8
- package/esm2020/lib/internal/decorators/design-time-view-element/design-time-view-element.decorator.mjs +1 -1
- package/esm2020/lib/internal/decorators/request/request.decorator.mjs +1 -1
- package/esm2020/lib/internal/enums/index.mjs +3 -6
- package/esm2020/lib/internal/models/converter/converter-registry-item.mjs +1 -1
- package/esm2020/lib/internal/models/design-time-view-element-registry-item.mjs +1 -1
- package/esm2020/lib/internal/models/handler-chain-service-registry-item.mjs +1 -1
- package/esm2020/lib/internal/models/index.mjs +1 -2
- package/esm2020/lib/internal/models/interface-designer-item/base-interface-designer-item-registration-config.mjs +1 -1
- package/esm2020/lib/internal/models/interface-designer-item/interface-designer-item-registration-config.model.mjs +1 -1
- package/esm2020/lib/internal/models/interface-designer-item/toolbar-view-element-config.mjs +1 -1
- package/esm2020/lib/internal/models/internal-interface-designer-item-registration-config.model.mjs +1 -1
- package/esm2020/lib/internal/models/request/method-invoke-request.mjs +4 -4
- package/esm2020/lib/internal/models/request-handler/handler-source.mjs +1 -1
- package/esm2020/lib/internal/models/request-handler/request-handler-factory.mjs +1 -1
- package/esm2020/lib/internal/models/request-handler/request-handler-registration-config.model.mjs +1 -1
- package/esm2020/lib/internal/models/validator/validator-registry-item.mjs +1 -1
- package/esm2020/lib/internal/models/view-element/angular-view-element-registration-config.model.mjs +1 -1
- package/esm2020/lib/internal/services/base-registry/base-registry.mjs +6 -4
- package/esm2020/lib/internal/services/bootstrap-notifier/bootstrap-notifier.mjs +5 -4
- package/esm2020/lib/internal/services/design-time-view-element-registry/design-time-view-element-registry.mjs +3 -3
- package/esm2020/lib/internal/services/element-registration-checker/element-registration-checker.mjs +8 -1
- package/esm2020/lib/internal/services/global-converters-registry/converter-registry.mjs +3 -3
- package/esm2020/lib/internal/services/handler-chain-services-registry/handler-chain-services-registry.mjs +4 -3
- package/esm2020/lib/internal/services/interface-designer-item-registry/interface-designer-item-registry.mjs +4 -3
- package/esm2020/lib/internal/services/pkg-topology-registry/pkg-topology-registry.mjs +3 -3
- package/esm2020/lib/internal/services/remote-entries-registry/remote-entries-registry.mjs +3 -3
- package/esm2020/lib/internal/services/request-handler-registry/request-handler-registry.service.mjs +1 -1
- package/esm2020/lib/internal/services/request-registry/request-registry.service.mjs +1 -1
- package/esm2020/lib/internal/services/validator-registry/validator-registry.mjs +3 -3
- package/esm2020/lib/internal/services/view-element-registry/view-element-registry.mjs +3 -3
- package/esm2020/lib/internal/utils/handlers-order-comparer.mjs +2 -2
- package/esm2020/lib/internal/utils/instantiate.mjs +8 -1
- package/esm2020/lib/internal/utils/localization-utils.mjs +1 -1
- package/esm2020/lib/internal/utils/metadata-utils.mjs +1 -1
- package/esm2020/lib/public/decorators/converter/converter.decorator.mjs +1 -1
- package/esm2020/lib/public/decorators/interface-designer-item/interface-designer-item.decorator.mjs +1 -2
- package/esm2020/lib/public/decorators/module/module.decorator.mjs +1 -1
- package/esm2020/lib/public/decorators/request-handler/request-handler.decorator.mjs +6 -2
- package/esm2020/lib/public/decorators/validator/validator.decorator.mjs +6 -2
- package/esm2020/lib/public/decorators/view-element/view-element.decorator.mjs +1 -1
- package/esm2020/lib/public/functions/bootstrap-crt-module-handler-chain-services.mjs +1 -1
- package/esm2020/lib/public/functions/bootstrap-crt-module.mjs +27 -7
- package/esm2020/lib/public/functions/register-angular-view-element.mjs +1 -1
- package/esm2020/lib/public/handlers/base-request-handler.mjs +5 -5
- package/esm2020/lib/public/models/converter.model.mjs +1 -1
- package/esm2020/lib/public/models/entity.model.mjs +1 -1
- package/esm2020/lib/public/models/image-value.model.mjs +1 -1
- package/esm2020/lib/public/models/index.mjs +1 -4
- package/esm2020/lib/public/models/interface-designer-item/interface-designer-item-definition.mjs +1 -1
- package/esm2020/lib/public/models/module-definition.mjs +1 -1
- package/esm2020/lib/public/models/request/data-source-request.mjs +4 -4
- package/esm2020/lib/public/models/request/index.mjs +1 -2
- package/esm2020/lib/public/models/request-handler/index.mjs +1 -2
- package/esm2020/lib/public/models/validation/crt-validator-fn.mjs +1 -1
- package/esm2020/lib/public/services/handler-chain/handler-chain.service.mjs +7 -7
- package/esm2020/lib/public/services/handler-chain/internal-handler-chain.mjs +5 -4
- package/esm2020/lib/public/services/http-client/http-client.service.mjs +16 -6
- package/esm2020/lib/public/services/mask-service/mask.service.mjs +1 -1
- package/esm2020/lib/public/services/mask-service/schema-view-mask.request.mjs +2 -2
- package/esm2020/lib/public/services/model/index.mjs +1 -12
- package/esm2020/lib/public/services/model/model.mjs +1 -1
- package/esm2020/lib/public/services/sys-settings/sys-setting.model.mjs +3 -3
- package/esm2020/lib/public/services/sys-values/sys-values.mjs +1 -1
- package/fesm2015/creatio-devkit-common.mjs +870 -2137
- package/fesm2015/creatio-devkit-common.mjs.map +1 -1
- package/fesm2020/creatio-devkit-common.mjs +868 -2151
- package/fesm2020/creatio-devkit-common.mjs.map +1 -1
- package/index.d.ts +345 -936
- package/package.json +6 -6
- package/esm2020/lib/external/utils/date-utils.mjs +0 -29
- package/esm2020/lib/external/utils/index.mjs +0 -2
- package/esm2020/lib/internal/enums/data-schema-attribute-type.enum.mjs +0 -21
- package/esm2020/lib/internal/enums/data-source-scope.enum.mjs +0 -9
- package/esm2020/lib/internal/enums/default-value-source.enum.mjs +0 -12
- package/esm2020/lib/internal/esq/data-model/index.mjs +0 -3
- package/esm2020/lib/internal/esq/data-model/metadata-provider/metadata-provider.mjs +0 -2
- package/esm2020/lib/internal/esq/data-model/queries/base-filterable-query.mjs +0 -15
- package/esm2020/lib/internal/esq/data-model/queries/base-query.mjs +0 -20
- package/esm2020/lib/internal/esq/data-model/queries/delete-query.mjs +0 -12
- package/esm2020/lib/internal/esq/data-model/queries/entity-schema-query.mjs +0 -211
- package/esm2020/lib/internal/esq/data-model/queries/index.mjs +0 -9
- package/esm2020/lib/internal/esq/data-model/queries/insert-query.mjs +0 -37
- package/esm2020/lib/internal/esq/data-model/queries/query-operation-type.mjs +0 -15
- package/esm2020/lib/internal/esq/data-model/queries/select-localization-query.mjs +0 -7
- package/esm2020/lib/internal/esq/data-model/queries/update-query.mjs +0 -43
- package/esm2020/lib/internal/esq/index.mjs +0 -2
- package/esm2020/lib/internal/model/data-schema/data-schema-attribute-aggregation-config.model.mjs +0 -2
- package/esm2020/lib/internal/model/data-schema/data-schema-attribute-function-config.model.mjs +0 -2
- package/esm2020/lib/internal/model/data-schema/data-schema-validator-config.model.mjs +0 -2
- package/esm2020/lib/internal/model/data-schema/index.mjs +0 -4
- package/esm2020/lib/internal/model/data-source-config.mjs +0 -2
- package/esm2020/lib/internal/model/index.mjs +0 -3
- package/esm2020/lib/internal/models/default-value-schema.mjs +0 -2
- package/esm2020/lib/public/enums/aggregation-function.enum.mjs +0 -18
- package/esm2020/lib/public/enums/aggregation-type.enum.mjs +0 -18
- package/esm2020/lib/public/enums/data-value-type.enum.mjs +0 -48
- package/esm2020/lib/public/enums/index.mjs +0 -4
- package/esm2020/lib/public/esq/data-model/columns/arithmetic/arithmetic-query-column.mjs +0 -9
- package/esm2020/lib/public/esq/data-model/columns/base-query-column.mjs +0 -45
- package/esm2020/lib/public/esq/data-model/columns/entity-column/entity-query-column.mjs +0 -9
- package/esm2020/lib/public/esq/data-model/columns/functions/aggregation-function-column.mjs +0 -13
- package/esm2020/lib/public/esq/data-model/columns/functions/date-part-function-column.mjs +0 -17
- package/esm2020/lib/public/esq/data-model/columns/functions/length-function-column.mjs +0 -9
- package/esm2020/lib/public/esq/data-model/columns/functions/macros-function-column.mjs +0 -9
- package/esm2020/lib/public/esq/data-model/columns/functions/window-function-column.mjs +0 -9
- package/esm2020/lib/public/esq/data-model/columns/index.mjs +0 -12
- package/esm2020/lib/public/esq/data-model/columns/parameters/parameter-query-column.mjs +0 -9
- package/esm2020/lib/public/esq/data-model/columns/sub-queries/aggregation-sub-query-column.mjs +0 -15
- package/esm2020/lib/public/esq/data-model/columns/sub-queries/sub-query-column.mjs +0 -9
- package/esm2020/lib/public/esq/data-model/enums/aggregation-eval-type.enum.mjs +0 -10
- package/esm2020/lib/public/esq/data-model/enums/arithmetic-operation.enum.mjs +0 -12
- package/esm2020/lib/public/esq/data-model/enums/comparison-type.enum.mjs +0 -21
- package/esm2020/lib/public/esq/data-model/enums/date-part-type.enum.mjs +0 -20
- package/esm2020/lib/public/esq/data-model/enums/expression-type.enum.mjs +0 -9
- package/esm2020/lib/public/esq/data-model/enums/filter-type.enum.mjs +0 -11
- package/esm2020/lib/public/esq/data-model/enums/function-type.enum.mjs +0 -15
- package/esm2020/lib/public/esq/data-model/enums/index.mjs +0 -12
- package/esm2020/lib/public/esq/data-model/enums/logical-operator-type.enum.mjs +0 -6
- package/esm2020/lib/public/esq/data-model/enums/order-direction.enum.mjs +0 -7
- package/esm2020/lib/public/esq/data-model/enums/query-macros-type.enum.mjs +0 -76
- package/esm2020/lib/public/esq/data-model/expressions/arithmetic/arithmetic-expression.mjs +0 -15
- package/esm2020/lib/public/esq/data-model/expressions/arithmetic/index.mjs +0 -2
- package/esm2020/lib/public/esq/data-model/expressions/base-expression.mjs +0 -7
- package/esm2020/lib/public/esq/data-model/expressions/columns/column-expression.mjs +0 -13
- package/esm2020/lib/public/esq/data-model/expressions/columns/index.mjs +0 -2
- package/esm2020/lib/public/esq/data-model/expressions/functions/aggregation-function-expression.mjs +0 -14
- package/esm2020/lib/public/esq/data-model/expressions/functions/argument-function-expression.mjs +0 -8
- package/esm2020/lib/public/esq/data-model/expressions/functions/date-part-function-expression.mjs +0 -13
- package/esm2020/lib/public/esq/data-model/expressions/functions/function-expression.mjs +0 -9
- package/esm2020/lib/public/esq/data-model/expressions/functions/index.mjs +0 -8
- package/esm2020/lib/public/esq/data-model/expressions/functions/length-function-expression.mjs +0 -12
- package/esm2020/lib/public/esq/data-model/expressions/functions/macros-function-expression.mjs +0 -13
- package/esm2020/lib/public/esq/data-model/expressions/functions/window-function-expression.mjs +0 -12
- package/esm2020/lib/public/esq/data-model/expressions/index.mjs +0 -8
- package/esm2020/lib/public/esq/data-model/expressions/mocks/expression.mock.mjs +0 -17
- package/esm2020/lib/public/esq/data-model/expressions/mocks/index.mjs +0 -2
- package/esm2020/lib/public/esq/data-model/expressions/parameters/index.mjs +0 -2
- package/esm2020/lib/public/esq/data-model/expressions/parameters/parameter-expression.mjs +0 -87
- package/esm2020/lib/public/esq/data-model/expressions/sub-queries/aggregation-sub-query-expression.mjs +0 -11
- package/esm2020/lib/public/esq/data-model/expressions/sub-queries/index.mjs +0 -3
- package/esm2020/lib/public/esq/data-model/expressions/sub-queries/sub-query-expression.mjs +0 -17
- package/esm2020/lib/public/esq/data-model/filters/base-filter.mjs +0 -8
- package/esm2020/lib/public/esq/data-model/filters/between-filter.mjs +0 -13
- package/esm2020/lib/public/esq/data-model/filters/compare-filter.mjs +0 -12
- package/esm2020/lib/public/esq/data-model/filters/exists-filter.mjs +0 -13
- package/esm2020/lib/public/esq/data-model/filters/filter-group.mjs +0 -105
- package/esm2020/lib/public/esq/data-model/filters/in-filter.mjs +0 -12
- package/esm2020/lib/public/esq/data-model/filters/index.mjs +0 -10
- package/esm2020/lib/public/esq/data-model/filters/isnull-filter.mjs +0 -21
- package/esm2020/lib/public/esq/data-model/filters/mocks/filter.mock.mjs +0 -16
- package/esm2020/lib/public/esq/data-model/filters/mocks/index.mjs +0 -2
- package/esm2020/lib/public/esq/data-model/filters/single-filter.mjs +0 -9
- package/esm2020/lib/public/esq/data-model/index.mjs +0 -5
- package/esm2020/lib/public/esq/index.mjs +0 -2
- package/esm2020/lib/public/exceptions/argument-empty-exception.mjs +0 -7
- package/esm2020/lib/public/exceptions/argument-out-of-range-exception.mjs +0 -7
- package/esm2020/lib/public/exceptions/index.mjs +0 -6
- package/esm2020/lib/public/exceptions/item-not-found-exception.mjs +0 -7
- package/esm2020/lib/public/exceptions/next-handler-already-specified-exception.mjs +0 -9
- package/esm2020/lib/public/exceptions/validation-utilities.mjs +0 -32
- package/esm2020/lib/public/models/data-source/data-source-insert-result.model.mjs +0 -2
- package/esm2020/lib/public/models/data-source/data-source-save-result.model.mjs +0 -2
- package/esm2020/lib/public/models/data-source/index.mjs +0 -3
- package/esm2020/lib/public/models/lookup-value.model.mjs +0 -2
- package/esm2020/lib/public/models/request/base-request.mjs +0 -9
- package/esm2020/lib/public/models/request-handler/request-handler.mjs +0 -2
- package/esm2020/lib/public/models/view-model-context.mjs +0 -2
- package/esm2020/lib/public/services/model/data-schema-attribute.mjs +0 -2
- package/esm2020/lib/public/services/model/data-schema.mjs +0 -2
- package/esm2020/lib/public/services/model/data-source-aggregation-config.mjs +0 -2
- package/esm2020/lib/public/services/model/data-source-attribute.mjs +0 -2
- package/esm2020/lib/public/services/model/data-source-can-execute-operation.mjs +0 -2
- package/esm2020/lib/public/services/model/data-source-function-config.mjs +0 -2
- package/esm2020/lib/public/services/model/data-source-paging-config.mjs +0 -2
- package/esm2020/lib/public/services/model/data-source-parameter.mjs +0 -12
- package/esm2020/lib/public/services/model/data-source-sorting-config.mjs +0 -2
- package/esm2020/lib/public/services/model/model-load-options.mjs +0 -2
- package/esm2020/lib/public/types/abstract-type.mjs +0 -2
- package/esm2020/lib/public/types/aggregation-eval.type.mjs +0 -2
- package/esm2020/lib/public/types/date-part.type.mjs +0 -2
- package/esm2020/lib/public/types/entity-column-value.mjs +0 -2
- package/esm2020/lib/public/types/function.type.mjs +0 -2
- package/esm2020/lib/public/types/guid.type.mjs +0 -53
- package/esm2020/lib/public/types/index.mjs +0 -13
- package/esm2020/lib/public/types/json-data.type.mjs +0 -2
- package/esm2020/lib/public/types/localizable-string.type.mjs +0 -2
- package/esm2020/lib/public/types/localize-fn.type.mjs +0 -2
- package/esm2020/lib/public/types/resolve-dependency-fn.type.mjs +0 -2
- package/esm2020/lib/public/types/sort-direction.type.mjs +0 -2
- package/esm2020/lib/public/types/type.mjs +0 -2
|
@@ -1,969 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import { ɵAggregationType, ɵAggregationFunction, ɵAggregationEvalType, ɵDatePartType, ɵFunctionType, ɵOrderDirection, ɵNextHandlerAlreadySpecifiedException, ɵBaseRequest } from '@creatio/base';
|
|
2
|
+
export { ɵAggregationEvalType as AggregationEvalType, ɵAggregationFunction as AggregationFunction, ɵAggregationFunctionColumn as AggregationFunctionColumn, ɵAggregationFunctionExpression as AggregationFunctionExpression, ɵAggregationSubQueryColumn as AggregationSubQueryColumn, ɵAggregationSubQueryExpression as AggregationSubQueryExpression, ɵAggregationType as AggregationType, ɵArgumentEmptyException as ArgumentEmptyException, ɵArgumentFunctionExpression as ArgumentFunctionExpression, ɵArgumentOutOfRangeException as ArgumentOutOfRangeException, ɵArithmeticExpression as ArithmeticExpression, ɵArithmeticOperation as ArithmeticOperation, ɵArithmeticQueryColumn as ArithmeticQueryColumn, ɵBaseExpression as BaseExpression, ɵBaseExpressionParser as BaseExpressionParser, ɵBaseFilter as BaseFilter, ɵBaseFilterParser as BaseFilterParser, ɵBaseFilterableQuery as BaseFilterableQuery, ɵBaseQuery as BaseQuery, ɵBaseQueryColumn as BaseQueryColumn, ɵBaseRequest as BaseRequest, ɵBetweenFilter as BetweenFilter, ɵColumnExpression as ColumnExpression, ɵCompareFilter as CompareFilter, ɵComparisonType as ComparisonType, ɵDEFAULT_COLUMN_PLAIN_OBJ as DEFAULT_COLUMN_PLAIN_OBJ, ɵDEFAULT_FILTER_PLAIN_OBJ as DEFAULT_FILTER_PLAIN_OBJ, ɵDataSchemaAttributeType as DataSchemaAttributeType, ɵDataSchemaAttributeUsageType as DataSchemaAttributeUsageType, ɵDataSchemaType as DataSchemaType, ɵDataSourceScope as DataSourceScope, ɵDataValueType as DataValueType, ɵDatePartFunctionColumn as DatePartFunctionColumn, ɵDatePartFunctionExpression as DatePartFunctionExpression, ɵDatePartType as DatePartType, ɵDefaultValueSource as DefaultValueSource, ɵDeleteQuery as DeleteQuery, ɵEMPTY_GUID as EMPTY_GUID, ɵEntityQueryColumn as EntityQueryColumn, ɵEntitySchemaQuery as EntitySchemaQuery, ɵExistsFilter as ExistsFilter, ɵExpressionMock as ExpressionMock, ɵExpressionParser as ExpressionParser, ɵExpressionResolver as ExpressionResolver, ɵExpressionType as ExpressionType, ɵFilterGroup as FilterGroup, ɵFilterMock as FilterMock, ɵFilterParser as FilterParser, ɵFilterResolver as FilterResolver, ɵFilterType as FilterType, ɵFunctionExpression as FunctionExpression, ɵFunctionType as FunctionType, ɵInFilter as InFilter, ɵInsertQuery as InsertQuery, ɵIsNullFilter as IsNullFilter, ɵItemNotFoundException as ItemNotFoundException, ɵLengthFunctionColumn as LengthFunctionColumn, ɵLengthFunctionExpression as LengthFunctionExpression, ɵLogicalOperatorType as LogicalOperatorType, ɵMacrosFunctionColumn as MacrosFunctionColumn, ɵMacrosFunctionExpression as MacrosFunctionExpression, ɵModelParameterType as ModelParameterType, ɵNextHandlerAlreadySpecifiedException as NextHandlerAlreadySpecifiedException, ɵOrderDirection as OrderDirection, ɵParameterExpression as ParameterExpression, ɵParameterQueryColumn as ParameterQueryColumn, ɵQueryMacrosType as QueryMacrosType, ɵQueryOperationType as QueryOperationType, ɵSelectLocalizationQuery as SelectLocalizationQuery, ɵSingleFilter as SingleFilter, ɵSubQueryColumn as SubQueryColumn, ɵSubQueryExpression as SubQueryExpression, ɵUpdateQuery as UpdateQuery, ɵValidationUtilities as ValidationUtilities, ɵWindowFunctionColumn as WindowFunctionColumn, ɵWindowFunctionExpression as WindowFunctionExpression, ɵencodeDate as encodeDate, ɵgenerateGuid as generateGuid, ɵgetColumnPlainObj as getColumnPlainObj, ɵgetFilterPlainObj as getFilterPlainObj, ɵisEmptyGuid as isEmptyGuid, ɵisGuid as isGuid, ɵparserMock as parserMock, ɵtoLocalISOString as toLocalISOString } from '@creatio/base';
|
|
3
|
+
import { __awaiter, __decorate, __metadata } from 'tslib';
|
|
4
|
+
import { get, set, upperFirst, camelCase, isEqual, cloneDeep } from 'lodash';
|
|
4
5
|
import 'reflect-metadata';
|
|
5
6
|
|
|
6
|
-
var DataValueType;
|
|
7
|
-
(function (DataValueType) {
|
|
8
|
-
DataValueType[DataValueType["Guid"] = 0] = "Guid";
|
|
9
|
-
DataValueType[DataValueType["Text"] = 1] = "Text";
|
|
10
|
-
DataValueType[DataValueType["Integer"] = 4] = "Integer";
|
|
11
|
-
DataValueType[DataValueType["Float"] = 5] = "Float";
|
|
12
|
-
DataValueType[DataValueType["Money"] = 6] = "Money";
|
|
13
|
-
DataValueType[DataValueType["DateTime"] = 7] = "DateTime";
|
|
14
|
-
DataValueType[DataValueType["Date"] = 8] = "Date";
|
|
15
|
-
DataValueType[DataValueType["Time"] = 9] = "Time";
|
|
16
|
-
DataValueType[DataValueType["Lookup"] = 10] = "Lookup";
|
|
17
|
-
DataValueType[DataValueType["Enum"] = 11] = "Enum";
|
|
18
|
-
DataValueType[DataValueType["Boolean"] = 12] = "Boolean";
|
|
19
|
-
DataValueType[DataValueType["Blob"] = 13] = "Blob";
|
|
20
|
-
DataValueType[DataValueType["Image"] = 14] = "Image";
|
|
21
|
-
DataValueType[DataValueType["CUSTOM_OBJECT"] = 15] = "CUSTOM_OBJECT";
|
|
22
|
-
DataValueType[DataValueType["IMAGELOOKUP"] = 16] = "IMAGELOOKUP";
|
|
23
|
-
DataValueType[DataValueType["COLLECTION"] = 17] = "COLLECTION";
|
|
24
|
-
DataValueType[DataValueType["Color"] = 18] = "Color";
|
|
25
|
-
DataValueType[DataValueType["LOCALIZABLE_STRING"] = 19] = "LOCALIZABLE_STRING";
|
|
26
|
-
DataValueType[DataValueType["ENTITY"] = 20] = "ENTITY";
|
|
27
|
-
DataValueType[DataValueType["ENTITY_COLLECTION"] = 21] = "ENTITY_COLLECTION";
|
|
28
|
-
DataValueType[DataValueType["ENTITY_COLUMN_MAPPING_COLLECTION"] = 22] = "ENTITY_COLUMN_MAPPING_COLLECTION";
|
|
29
|
-
DataValueType[DataValueType["HASH_TEXT"] = 23] = "HASH_TEXT";
|
|
30
|
-
DataValueType[DataValueType["SECURE_TEXT"] = 24] = "SECURE_TEXT";
|
|
31
|
-
DataValueType[DataValueType["FILE"] = 25] = "FILE";
|
|
32
|
-
DataValueType[DataValueType["MAPPING"] = 26] = "MAPPING";
|
|
33
|
-
DataValueType[DataValueType["SHORT_TEXT"] = 27] = "SHORT_TEXT";
|
|
34
|
-
DataValueType[DataValueType["MEDIUM_TEXT"] = 28] = "MEDIUM_TEXT";
|
|
35
|
-
DataValueType[DataValueType["MAXSIZE_TEXT"] = 29] = "MAXSIZE_TEXT";
|
|
36
|
-
DataValueType[DataValueType["LONG_TEXT"] = 30] = "LONG_TEXT";
|
|
37
|
-
DataValueType[DataValueType["FLOAT1"] = 31] = "FLOAT1";
|
|
38
|
-
DataValueType[DataValueType["FLOAT2"] = 32] = "FLOAT2";
|
|
39
|
-
DataValueType[DataValueType["FLOAT3"] = 33] = "FLOAT3";
|
|
40
|
-
DataValueType[DataValueType["FLOAT4"] = 34] = "FLOAT4";
|
|
41
|
-
DataValueType[DataValueType["LOCALIZABLE_PARAMETER_VALUES_LIST"] = 35] = "LOCALIZABLE_PARAMETER_VALUES_LIST";
|
|
42
|
-
DataValueType[DataValueType["METADATA_TEXT"] = 36] = "METADATA_TEXT";
|
|
43
|
-
DataValueType[DataValueType["STAGE_INDICATOR"] = 37] = "STAGE_INDICATOR";
|
|
44
|
-
DataValueType[DataValueType["OBJECT_LIST"] = 38] = "OBJECT_LIST";
|
|
45
|
-
DataValueType[DataValueType["COMPOSITE_OBJECT_LIST"] = 39] = "COMPOSITE_OBJECT_LIST";
|
|
46
|
-
DataValueType[DataValueType["FLOAT8"] = 40] = "FLOAT8";
|
|
47
|
-
DataValueType[DataValueType["FILE_LOCATOR"] = 41] = "FILE_LOCATOR";
|
|
48
|
-
DataValueType[DataValueType["PHONE_TEXT"] = 42] = "PHONE_TEXT";
|
|
49
|
-
DataValueType[DataValueType["RICH_TEXT"] = 43] = "RICH_TEXT";
|
|
50
|
-
DataValueType[DataValueType["WEB_TEXT"] = 44] = "WEB_TEXT";
|
|
51
|
-
DataValueType[DataValueType["EMAIL_TEXT"] = 45] = "EMAIL_TEXT";
|
|
52
|
-
})(DataValueType || (DataValueType = {}));
|
|
53
|
-
|
|
54
|
-
var AggregationType;
|
|
55
|
-
(function (AggregationType) {
|
|
56
|
-
/** Aggregation function type not defined. */
|
|
57
|
-
AggregationType[AggregationType["None"] = 0] = "None";
|
|
58
|
-
/** Aggregation function type not defined. */
|
|
59
|
-
AggregationType[AggregationType["Count"] = 1] = "Count";
|
|
60
|
-
/** Sum of values of all elements. */
|
|
61
|
-
AggregationType[AggregationType["Sum"] = 2] = "Sum";
|
|
62
|
-
/** Average value for all elements. */
|
|
63
|
-
AggregationType[AggregationType["Avg"] = 3] = "Avg";
|
|
64
|
-
/** The minimum value among all elements. */
|
|
65
|
-
AggregationType[AggregationType["Min"] = 4] = "Min";
|
|
66
|
-
/** The maximum value among all elements. */
|
|
67
|
-
AggregationType[AggregationType["Max"] = 5] = "Max";
|
|
68
|
-
/** Top one record from collection. */
|
|
69
|
-
AggregationType[AggregationType["TopOne"] = 6] = "TopOne";
|
|
70
|
-
})(AggregationType || (AggregationType = {}));
|
|
71
|
-
|
|
72
|
-
var AggregationFunction;
|
|
73
|
-
(function (AggregationFunction) {
|
|
74
|
-
/** Aggregation function type not defined. */
|
|
75
|
-
AggregationFunction["None"] = "";
|
|
76
|
-
/** Aggregation function type not defined. */
|
|
77
|
-
AggregationFunction["Count"] = "Count";
|
|
78
|
-
/** Sum of values of all elements. */
|
|
79
|
-
AggregationFunction["Sum"] = "Sum";
|
|
80
|
-
/** Average value for all elements. */
|
|
81
|
-
AggregationFunction["Avg"] = "Avg";
|
|
82
|
-
/** The minimum value among all elements. */
|
|
83
|
-
AggregationFunction["Min"] = "Min";
|
|
84
|
-
/** The maximum value among all elements. */
|
|
85
|
-
AggregationFunction["Max"] = "Max";
|
|
86
|
-
/** Top one record from collection. */
|
|
87
|
-
AggregationFunction["TopOne"] = "TopOne";
|
|
88
|
-
})(AggregationFunction || (AggregationFunction = {}));
|
|
89
|
-
|
|
90
|
-
var LogicalOperatorType;
|
|
91
|
-
(function (LogicalOperatorType) {
|
|
92
|
-
LogicalOperatorType[LogicalOperatorType["And"] = 0] = "And";
|
|
93
|
-
LogicalOperatorType[LogicalOperatorType["Or"] = 1] = "Or";
|
|
94
|
-
})(LogicalOperatorType || (LogicalOperatorType = {}));
|
|
95
|
-
|
|
96
|
-
var AggregationEvalType;
|
|
97
|
-
(function (AggregationEvalType) {
|
|
98
|
-
/** The scope of the aggregating function is not defined. */
|
|
99
|
-
AggregationEvalType[AggregationEvalType["None"] = 0] = "None";
|
|
100
|
-
/** Applies to all elements. */
|
|
101
|
-
AggregationEvalType[AggregationEvalType["All"] = 1] = "All";
|
|
102
|
-
/** Applies to unique values. */
|
|
103
|
-
AggregationEvalType[AggregationEvalType["Distinct"] = 2] = "Distinct";
|
|
104
|
-
})(AggregationEvalType || (AggregationEvalType = {}));
|
|
105
|
-
|
|
106
|
-
var ArithmeticOperation;
|
|
107
|
-
(function (ArithmeticOperation) {
|
|
108
|
-
/** Addition. */
|
|
109
|
-
ArithmeticOperation[ArithmeticOperation["Addition"] = 0] = "Addition";
|
|
110
|
-
/** Subtraction. */
|
|
111
|
-
ArithmeticOperation[ArithmeticOperation["Subtraction"] = 1] = "Subtraction";
|
|
112
|
-
/** Multiplication. */
|
|
113
|
-
ArithmeticOperation[ArithmeticOperation["Multiplication"] = 2] = "Multiplication";
|
|
114
|
-
/** Division. */
|
|
115
|
-
ArithmeticOperation[ArithmeticOperation["Division"] = 3] = "Division";
|
|
116
|
-
})(ArithmeticOperation || (ArithmeticOperation = {}));
|
|
117
|
-
|
|
118
|
-
var ComparisonType;
|
|
119
|
-
(function (ComparisonType) {
|
|
120
|
-
ComparisonType[ComparisonType["Between"] = 0] = "Between";
|
|
121
|
-
ComparisonType[ComparisonType["Contain"] = 11] = "Contain";
|
|
122
|
-
ComparisonType[ComparisonType["End_with"] = 13] = "End_with";
|
|
123
|
-
ComparisonType[ComparisonType["Equal"] = 3] = "Equal";
|
|
124
|
-
ComparisonType[ComparisonType["Exists"] = 15] = "Exists";
|
|
125
|
-
ComparisonType[ComparisonType["Greater"] = 7] = "Greater";
|
|
126
|
-
ComparisonType[ComparisonType["Greater_or_equal"] = 8] = "Greater_or_equal";
|
|
127
|
-
ComparisonType[ComparisonType["Is_not_null"] = 2] = "Is_not_null";
|
|
128
|
-
ComparisonType[ComparisonType["Is_null"] = 1] = "Is_null";
|
|
129
|
-
ComparisonType[ComparisonType["Less"] = 5] = "Less";
|
|
130
|
-
ComparisonType[ComparisonType["Less_or_equal"] = 6] = "Less_or_equal";
|
|
131
|
-
ComparisonType[ComparisonType["Not_contain"] = 12] = "Not_contain";
|
|
132
|
-
ComparisonType[ComparisonType["Not_end_with"] = 14] = "Not_end_with";
|
|
133
|
-
ComparisonType[ComparisonType["Not_equal"] = 4] = "Not_equal";
|
|
134
|
-
ComparisonType[ComparisonType["Not_exists"] = 16] = "Not_exists";
|
|
135
|
-
ComparisonType[ComparisonType["Not_start_with"] = 10] = "Not_start_with";
|
|
136
|
-
ComparisonType[ComparisonType["Start_with"] = 9] = "Start_with";
|
|
137
|
-
})(ComparisonType || (ComparisonType = {}));
|
|
138
|
-
|
|
139
|
-
var DatePartType;
|
|
140
|
-
(function (DatePartType) {
|
|
141
|
-
/** Empty value. */
|
|
142
|
-
DatePartType[DatePartType["None"] = 0] = "None";
|
|
143
|
-
/** Day. */
|
|
144
|
-
DatePartType[DatePartType["Day"] = 1] = "Day";
|
|
145
|
-
/** Week. */
|
|
146
|
-
DatePartType[DatePartType["Week"] = 2] = "Week";
|
|
147
|
-
/** Month. */
|
|
148
|
-
DatePartType[DatePartType["Month"] = 3] = "Month";
|
|
149
|
-
/** Year. */
|
|
150
|
-
DatePartType[DatePartType["Year"] = 4] = "Year";
|
|
151
|
-
/** Day of the week. */
|
|
152
|
-
DatePartType[DatePartType["WeekDay"] = 5] = "WeekDay";
|
|
153
|
-
/** Hour. */
|
|
154
|
-
DatePartType[DatePartType["Hour"] = 6] = "Hour";
|
|
155
|
-
/** Minute. */
|
|
156
|
-
DatePartType[DatePartType["HourMinute"] = 7] = "HourMinute";
|
|
157
|
-
})(DatePartType || (DatePartType = {}));
|
|
158
|
-
|
|
159
|
-
var ExpressionType;
|
|
160
|
-
(function (ExpressionType) {
|
|
161
|
-
ExpressionType[ExpressionType["SchemaColumn"] = 0] = "SchemaColumn";
|
|
162
|
-
ExpressionType[ExpressionType["Function"] = 1] = "Function";
|
|
163
|
-
ExpressionType[ExpressionType["Parameter"] = 2] = "Parameter";
|
|
164
|
-
ExpressionType[ExpressionType["SubQuery"] = 3] = "SubQuery";
|
|
165
|
-
ExpressionType[ExpressionType["ArithmeticOperation"] = 4] = "ArithmeticOperation";
|
|
166
|
-
})(ExpressionType || (ExpressionType = {}));
|
|
167
|
-
|
|
168
|
-
var FilterType;
|
|
169
|
-
(function (FilterType) {
|
|
170
|
-
FilterType[FilterType["None"] = 0] = "None";
|
|
171
|
-
FilterType[FilterType["Compare"] = 1] = "Compare";
|
|
172
|
-
FilterType[FilterType["IsNull"] = 2] = "IsNull";
|
|
173
|
-
FilterType[FilterType["Between"] = 3] = "Between";
|
|
174
|
-
FilterType[FilterType["In"] = 4] = "In";
|
|
175
|
-
FilterType[FilterType["Exists"] = 5] = "Exists";
|
|
176
|
-
FilterType[FilterType["FilterGroup"] = 6] = "FilterGroup";
|
|
177
|
-
})(FilterType || (FilterType = {}));
|
|
178
|
-
|
|
179
|
-
var FunctionType;
|
|
180
|
-
(function (FunctionType) {
|
|
181
|
-
FunctionType[FunctionType["None"] = 0] = "None";
|
|
182
|
-
/** Substitution by macro. */
|
|
183
|
-
FunctionType[FunctionType["Macros"] = 1] = "Macros";
|
|
184
|
-
/** Aggregating function. */
|
|
185
|
-
FunctionType[FunctionType["Aggregation"] = 2] = "Aggregation";
|
|
186
|
-
/** Date fragment. */
|
|
187
|
-
FunctionType[FunctionType["DatePart"] = 3] = "DatePart";
|
|
188
|
-
/** The size of the value in bytes, used for binary data. */
|
|
189
|
-
FunctionType[FunctionType["Length"] = 4] = "Length";
|
|
190
|
-
/** Window query function */
|
|
191
|
-
FunctionType[FunctionType["Window"] = 5] = "Window";
|
|
192
|
-
})(FunctionType || (FunctionType = {}));
|
|
193
|
-
|
|
194
|
-
var OrderDirection;
|
|
195
|
-
(function (OrderDirection) {
|
|
196
|
-
OrderDirection[OrderDirection["None"] = 0] = "None";
|
|
197
|
-
OrderDirection[OrderDirection["Asc"] = 1] = "Asc";
|
|
198
|
-
OrderDirection[OrderDirection["Desc"] = 2] = "Desc";
|
|
199
|
-
})(OrderDirection || (OrderDirection = {}));
|
|
200
|
-
|
|
201
|
-
var QueryMacrosType;
|
|
202
|
-
(function (QueryMacrosType) {
|
|
203
|
-
/** Macro type not defined. */
|
|
204
|
-
QueryMacrosType[QueryMacrosType["None"] = 0] = "None";
|
|
205
|
-
/** Current user. */
|
|
206
|
-
QueryMacrosType[QueryMacrosType["CurrentUser"] = 1] = "CurrentUser";
|
|
207
|
-
/** Current user contact. */
|
|
208
|
-
QueryMacrosType[QueryMacrosType["CurrentUserContact"] = 2] = "CurrentUserContact";
|
|
209
|
-
/** Yesterday. */
|
|
210
|
-
QueryMacrosType[QueryMacrosType["Yesterday"] = 3] = "Yesterday";
|
|
211
|
-
/** Today. */
|
|
212
|
-
QueryMacrosType[QueryMacrosType["Today"] = 4] = "Today";
|
|
213
|
-
/** Tomorrow. */
|
|
214
|
-
QueryMacrosType[QueryMacrosType["Tomorrow"] = 5] = "Tomorrow";
|
|
215
|
-
/** Previous week. */
|
|
216
|
-
QueryMacrosType[QueryMacrosType["PreviousWeek"] = 6] = "PreviousWeek";
|
|
217
|
-
/** This week. */
|
|
218
|
-
QueryMacrosType[QueryMacrosType["CurrentWeek"] = 7] = "CurrentWeek";
|
|
219
|
-
/** Next week. */
|
|
220
|
-
QueryMacrosType[QueryMacrosType["NextWeek"] = 8] = "NextWeek";
|
|
221
|
-
/** Previous month. */
|
|
222
|
-
QueryMacrosType[QueryMacrosType["PreviousMonth"] = 9] = "PreviousMonth";
|
|
223
|
-
/** Current month. */
|
|
224
|
-
QueryMacrosType[QueryMacrosType["CurrentMonth"] = 10] = "CurrentMonth";
|
|
225
|
-
/** Next month. */
|
|
226
|
-
QueryMacrosType[QueryMacrosType["NextMonth"] = 11] = "NextMonth";
|
|
227
|
-
/** Previous quarter. */
|
|
228
|
-
QueryMacrosType[QueryMacrosType["PreviousQuarter"] = 12] = "PreviousQuarter";
|
|
229
|
-
/** Current quarter. */
|
|
230
|
-
QueryMacrosType[QueryMacrosType["CurrentQuarter"] = 13] = "CurrentQuarter";
|
|
231
|
-
/** Next quarter. */
|
|
232
|
-
QueryMacrosType[QueryMacrosType["NextQuarter"] = 14] = "NextQuarter";
|
|
233
|
-
/** Previous half of the year. */
|
|
234
|
-
QueryMacrosType[QueryMacrosType["PreviousHalfYear"] = 15] = "PreviousHalfYear";
|
|
235
|
-
/** Current half-year. */
|
|
236
|
-
QueryMacrosType[QueryMacrosType["CurrentHalfYear"] = 16] = "CurrentHalfYear";
|
|
237
|
-
/** Next half-year. */
|
|
238
|
-
QueryMacrosType[QueryMacrosType["NextHalfYear"] = 17] = "NextHalfYear";
|
|
239
|
-
/** Last year. */
|
|
240
|
-
QueryMacrosType[QueryMacrosType["PreviousYear"] = 18] = "PreviousYear";
|
|
241
|
-
/** This year. */
|
|
242
|
-
QueryMacrosType[QueryMacrosType["CurrentYear"] = 19] = "CurrentYear";
|
|
243
|
-
/** Previous hour. */
|
|
244
|
-
QueryMacrosType[QueryMacrosType["PreviousHour"] = 20] = "PreviousHour";
|
|
245
|
-
/** Current hour. */
|
|
246
|
-
QueryMacrosType[QueryMacrosType["CurrentHour"] = 21] = "CurrentHour";
|
|
247
|
-
/** Next hour. */
|
|
248
|
-
QueryMacrosType[QueryMacrosType["NextHour"] = 22] = "NextHour";
|
|
249
|
-
/** Next year. */
|
|
250
|
-
QueryMacrosType[QueryMacrosType["NextYear"] = 23] = "NextYear";
|
|
251
|
-
/** Next N Days. */
|
|
252
|
-
QueryMacrosType[QueryMacrosType["NextNDays"] = 24] = "NextNDays";
|
|
253
|
-
/** Previous N days. */
|
|
254
|
-
QueryMacrosType[QueryMacrosType["PreviousNDays"] = 25] = "PreviousNDays";
|
|
255
|
-
/** Next N hours. */
|
|
256
|
-
QueryMacrosType[QueryMacrosType["NextNHours"] = 26] = "NextNHours";
|
|
257
|
-
/** Previous N hours. */
|
|
258
|
-
QueryMacrosType[QueryMacrosType["PreviousNHours"] = 27] = "PreviousNHours";
|
|
259
|
-
/** Primary column. */
|
|
260
|
-
QueryMacrosType[QueryMacrosType["PrimaryColumn"] = 34] = "PrimaryColumn";
|
|
261
|
-
/** Primary displayed column. */
|
|
262
|
-
QueryMacrosType[QueryMacrosType["PrimaryDisplayColumn"] = 35] = "PrimaryDisplayColumn";
|
|
263
|
-
/** Primary image display column. */
|
|
264
|
-
QueryMacrosType[QueryMacrosType["PrimaryImageColumn"] = 36] = "PrimaryImageColumn";
|
|
265
|
-
/** Anniversary today. */
|
|
266
|
-
QueryMacrosType[QueryMacrosType["DayOfYearToday"] = 37] = "DayOfYearToday";
|
|
267
|
-
/** Anniversary on the date computed as today plus days offset. */
|
|
268
|
-
QueryMacrosType[QueryMacrosType["DayOfYearTodayPlusDaysOffset"] = 38] = "DayOfYearTodayPlusDaysOffset";
|
|
269
|
-
/** Anniversary on the next several days. */
|
|
270
|
-
QueryMacrosType[QueryMacrosType["NextNDaysOfYear"] = 39] = "NextNDaysOfYear";
|
|
271
|
-
/** Anniversary on the previous several days. */
|
|
272
|
-
QueryMacrosType[QueryMacrosType["PreviousNDaysOfYear"] = 40] = "PreviousNDaysOfYear";
|
|
273
|
-
/** Primary color display column. */
|
|
274
|
-
QueryMacrosType[QueryMacrosType["PrimaryColorColumn"] = 41] = "PrimaryColorColumn";
|
|
275
|
-
})(QueryMacrosType || (QueryMacrosType = {}));
|
|
276
|
-
|
|
277
|
-
class BaseExpression {
|
|
278
|
-
constructor(config) {
|
|
279
|
-
this.isBlock = false;
|
|
280
|
-
this.isBlock = config === null || config === void 0 ? void 0 : config.isBlock;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
class ArithmeticExpression extends BaseExpression {
|
|
285
|
-
constructor(config) {
|
|
286
|
-
super(config);
|
|
287
|
-
this.expressionType = ExpressionType.ArithmeticOperation;
|
|
288
|
-
this.arithmeticOperation = config === null || config === void 0 ? void 0 : config.arithmeticOperation;
|
|
289
|
-
this.leftArithmeticOperand = config === null || config === void 0 ? void 0 : config.leftArithmeticOperand.clone();
|
|
290
|
-
this.rightArithmeticOperand = config === null || config === void 0 ? void 0 : config.rightArithmeticOperand.clone();
|
|
291
|
-
}
|
|
292
|
-
clone() {
|
|
293
|
-
return new ArithmeticExpression(this);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
class ColumnExpression extends BaseExpression {
|
|
298
|
-
constructor(config) {
|
|
299
|
-
super(config);
|
|
300
|
-
this.expressionType = ExpressionType.SchemaColumn;
|
|
301
|
-
this.columnPath = config === null || config === void 0 ? void 0 : config.columnPath;
|
|
302
|
-
}
|
|
303
|
-
clone() {
|
|
304
|
-
return new ColumnExpression(this);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
class FunctionExpression extends BaseExpression {
|
|
309
|
-
constructor(config) {
|
|
310
|
-
super(config);
|
|
311
|
-
this.expressionType = ExpressionType.Function;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
class ArgumentFunctionExpression extends FunctionExpression {
|
|
316
|
-
constructor(config) {
|
|
317
|
-
super(config);
|
|
318
|
-
this.functionArgument = config === null || config === void 0 ? void 0 : config.functionArgument.clone();
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
class AggregationFunctionExpression extends ArgumentFunctionExpression {
|
|
323
|
-
constructor(config) {
|
|
324
|
-
super(config);
|
|
325
|
-
this.functionType = FunctionType.Aggregation;
|
|
326
|
-
this.aggregationType = config === null || config === void 0 ? void 0 : config.aggregationType;
|
|
327
|
-
this.aggregationEvalType = config === null || config === void 0 ? void 0 : config.aggregationEvalType;
|
|
328
|
-
}
|
|
329
|
-
clone() {
|
|
330
|
-
return new AggregationFunctionExpression(this);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
class DatePartFunctionExpression extends ArgumentFunctionExpression {
|
|
335
|
-
constructor(config) {
|
|
336
|
-
super(config);
|
|
337
|
-
this.functionType = FunctionType.DatePart;
|
|
338
|
-
this.datePartType = config === null || config === void 0 ? void 0 : config.datePartType;
|
|
339
|
-
}
|
|
340
|
-
clone() {
|
|
341
|
-
return new DatePartFunctionExpression(this);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
class LengthFunctionExpression extends ArgumentFunctionExpression {
|
|
346
|
-
constructor(config) {
|
|
347
|
-
super(config);
|
|
348
|
-
this.functionType = FunctionType.Length;
|
|
349
|
-
}
|
|
350
|
-
clone() {
|
|
351
|
-
return new LengthFunctionExpression(this);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
class MacrosFunctionExpression extends FunctionExpression {
|
|
356
|
-
constructor(config) {
|
|
357
|
-
super(config);
|
|
358
|
-
this.functionType = FunctionType.Macros;
|
|
359
|
-
this.macrosType = config === null || config === void 0 ? void 0 : config.macrosType;
|
|
360
|
-
}
|
|
361
|
-
clone() {
|
|
362
|
-
return new MacrosFunctionExpression(this);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
class WindowFunctionExpression extends ArgumentFunctionExpression {
|
|
367
|
-
constructor(config) {
|
|
368
|
-
super(config);
|
|
369
|
-
this.functionType = FunctionType.Window;
|
|
370
|
-
}
|
|
371
|
-
clone() {
|
|
372
|
-
return new WindowFunctionExpression(this);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* @internal
|
|
378
|
-
* Returns a string represent of date in ISO 8601 without time zone specification(doesn't convert it
|
|
379
|
-
* using local timezone).
|
|
380
|
-
*
|
|
381
|
-
* Example:
|
|
382
|
-
*
|
|
383
|
-
* const date = new Date(2018, 01, 20, 15, 10, 30);
|
|
384
|
-
* const result = toLocalISOString(date);
|
|
385
|
-
* //result: '2018-02-20T15:10:30'
|
|
386
|
-
*
|
|
387
|
-
* @param date Date value.
|
|
388
|
-
*/
|
|
389
|
-
function toLocalISOString(date) {
|
|
390
|
-
if (!(date instanceof Date)) {
|
|
391
|
-
throw new TypeError();
|
|
392
|
-
}
|
|
393
|
-
const timeZoneOffset = date.getTimezoneOffset() * 60000;
|
|
394
|
-
return new Date(date.getTime() - timeZoneOffset).toISOString().slice(0, -1);
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* @internal
|
|
398
|
-
* Returns encoded date in string value.
|
|
399
|
-
* @param date Date value.
|
|
400
|
-
*/
|
|
401
|
-
function encodeDate(date) {
|
|
402
|
-
return `"${toLocalISOString(date)}"`;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
class ParameterExpression extends BaseExpression {
|
|
406
|
-
constructor(config) {
|
|
407
|
-
var _a;
|
|
408
|
-
super(config);
|
|
409
|
-
this.expressionType = ExpressionType.Parameter;
|
|
410
|
-
const value = config === null || config === void 0 ? void 0 : config.value;
|
|
411
|
-
if (value instanceof Date) {
|
|
412
|
-
const cloneDate = new Date();
|
|
413
|
-
cloneDate.setTime(value.getTime());
|
|
414
|
-
this.value = cloneDate;
|
|
415
|
-
}
|
|
416
|
-
else if (!value) {
|
|
417
|
-
this.value = value;
|
|
418
|
-
}
|
|
419
|
-
else {
|
|
420
|
-
this.value = typeof value === 'object' ? Object.assign({}, value) : value;
|
|
421
|
-
}
|
|
422
|
-
this.dataValueType = (_a = config === null || config === void 0 ? void 0 : config.dataValueType) !== null && _a !== void 0 ? _a : DataValueType.Text;
|
|
423
|
-
}
|
|
424
|
-
get parameter() {
|
|
425
|
-
return Object.assign({ dataValueType: this.dataValueType }, this._getParameterValueMetadata());
|
|
426
|
-
}
|
|
427
|
-
_convertStringToBlobArray(str) {
|
|
428
|
-
const out = [];
|
|
429
|
-
let position = 0;
|
|
430
|
-
for (let i = 0; i < str.length; i++) {
|
|
431
|
-
const code = str.charCodeAt(i);
|
|
432
|
-
if (code < 128) {
|
|
433
|
-
out[position++] = String.fromCharCode(code);
|
|
434
|
-
}
|
|
435
|
-
else if (code < 2048) {
|
|
436
|
-
/* eslint-disable no-bitwise */
|
|
437
|
-
out[position++] = String.fromCharCode((code >> 6) | 192);
|
|
438
|
-
out[position++] = String.fromCharCode((code & 63) | 128);
|
|
439
|
-
}
|
|
440
|
-
else {
|
|
441
|
-
out[position++] = String.fromCharCode((code >> 12) | 224);
|
|
442
|
-
out[position++] = String.fromCharCode(((code >> 6) & 63) | 128);
|
|
443
|
-
out[position++] = String.fromCharCode((code & 63) | 128);
|
|
444
|
-
/* eslint-enable no-bitwise */
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
return out;
|
|
448
|
-
}
|
|
449
|
-
_getParameterValueMetadata() {
|
|
450
|
-
if (this.dataValueType === DataValueType.Blob) {
|
|
451
|
-
return {
|
|
452
|
-
arrayValue: !this.value ? [] : this._convertStringToBlobArray(this.value),
|
|
453
|
-
};
|
|
454
|
-
}
|
|
455
|
-
else if (this.value instanceof Date) {
|
|
456
|
-
return {
|
|
457
|
-
value: encodeDate(this.value),
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
else {
|
|
461
|
-
return {
|
|
462
|
-
value: this.value,
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
clone() {
|
|
467
|
-
return new ParameterExpression(this);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
__decorate([
|
|
471
|
-
Exclude(),
|
|
472
|
-
__metadata("design:type", Object)
|
|
473
|
-
], ParameterExpression.prototype, "value", void 0);
|
|
474
|
-
__decorate([
|
|
475
|
-
Exclude(),
|
|
476
|
-
__metadata("design:type", Number)
|
|
477
|
-
], ParameterExpression.prototype, "dataValueType", void 0);
|
|
478
|
-
__decorate([
|
|
479
|
-
Expose(),
|
|
480
|
-
__metadata("design:type", Object),
|
|
481
|
-
__metadata("design:paramtypes", [])
|
|
482
|
-
], ParameterExpression.prototype, "parameter", null);
|
|
483
|
-
|
|
484
|
-
class SubQueryExpression extends BaseExpression {
|
|
485
|
-
constructor(config) {
|
|
486
|
-
super(config);
|
|
487
|
-
this.expressionType = ExpressionType.SubQuery;
|
|
488
|
-
this.columnPath = config === null || config === void 0 ? void 0 : config.columnPath;
|
|
489
|
-
const subFilter = config === null || config === void 0 ? void 0 : config.subFilters;
|
|
490
|
-
this.subFilters = typeof (subFilter === null || subFilter === void 0 ? void 0 : subFilter.clone) === 'function' ? subFilter.clone() : subFilter;
|
|
491
|
-
this.subOrderDirection = config.subOrderDirection;
|
|
492
|
-
this.subOrderColumn = config.subOrderColumn;
|
|
493
|
-
}
|
|
494
|
-
clone() {
|
|
495
|
-
return new SubQueryExpression(this);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
class AggregationSubQueryExpression extends SubQueryExpression {
|
|
500
|
-
constructor(config) {
|
|
501
|
-
super(config);
|
|
502
|
-
this.aggregationType = config === null || config === void 0 ? void 0 : config.aggregationType;
|
|
503
|
-
}
|
|
504
|
-
clone() {
|
|
505
|
-
return new AggregationSubQueryExpression(this);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
const EXPRESSION_TYPE_MOCK = -1;
|
|
510
|
-
class ExpressionMock extends BaseExpression {
|
|
511
|
-
constructor(config) {
|
|
512
|
-
super(config || {});
|
|
513
|
-
this.expressionType = EXPRESSION_TYPE_MOCK;
|
|
514
|
-
}
|
|
515
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
516
|
-
get plainObject() {
|
|
517
|
-
return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
|
|
518
|
-
}
|
|
519
|
-
clone() {
|
|
520
|
-
return new ExpressionMock(this);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
class BaseFilter {
|
|
525
|
-
constructor(filterType) {
|
|
526
|
-
this.isEnabled = true;
|
|
527
|
-
this.trimDateTimeParameterToDate = false;
|
|
528
|
-
this.filterType = filterType;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
class FilterMock extends BaseFilter {
|
|
533
|
-
constructor(filterType = FilterType.None) {
|
|
534
|
-
super(filterType);
|
|
535
|
-
}
|
|
536
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
537
|
-
get plainObject() {
|
|
538
|
-
return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
|
|
539
|
-
}
|
|
540
|
-
clone() {
|
|
541
|
-
return new FilterMock(this.filterType);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
class SingleFilter extends BaseFilter {
|
|
546
|
-
constructor(filterType, comparisonType, leftExpression) {
|
|
547
|
-
super(filterType);
|
|
548
|
-
this.comparisonType = comparisonType;
|
|
549
|
-
this.leftExpression = leftExpression.clone();
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
class CompareFilter extends SingleFilter {
|
|
554
|
-
constructor(comparisonType, leftExpression, rightExpression) {
|
|
555
|
-
super(FilterType.Compare, comparisonType, leftExpression);
|
|
556
|
-
this.rightExpression = rightExpression.clone();
|
|
557
|
-
}
|
|
558
|
-
clone() {
|
|
559
|
-
return new CompareFilter(this.comparisonType, this.leftExpression, this.rightExpression);
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
class BetweenFilter extends SingleFilter {
|
|
564
|
-
constructor(leftExpression, rightLessExpression, rightGreaterExpression) {
|
|
565
|
-
super(FilterType.Between, ComparisonType.Between, leftExpression);
|
|
566
|
-
this.rightLessExpression = rightLessExpression.clone();
|
|
567
|
-
this.rightGreaterExpression = rightGreaterExpression.clone();
|
|
568
|
-
}
|
|
569
|
-
clone() {
|
|
570
|
-
return new BetweenFilter(this.leftExpression, this.rightLessExpression, this.rightGreaterExpression);
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
class ExistsFilter extends SingleFilter {
|
|
575
|
-
constructor(leftExpression, subFilters, comparisonType = ComparisonType.Exists, isAggregative = true) {
|
|
576
|
-
super(FilterType.Exists, comparisonType, leftExpression);
|
|
577
|
-
this.subFilters = subFilters === null || subFilters === void 0 ? void 0 : subFilters.clone();
|
|
578
|
-
this.isAggregative = isAggregative;
|
|
579
|
-
}
|
|
580
|
-
clone() {
|
|
581
|
-
return new ExistsFilter(this.leftExpression, this.subFilters, this.comparisonType, this.isAggregative);
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
class InFilter extends SingleFilter {
|
|
586
|
-
constructor(comparisonType, leftExpression, rightExpressions) {
|
|
587
|
-
super(FilterType.In, comparisonType, leftExpression);
|
|
588
|
-
this.rightExpressions = rightExpressions.map((expression) => expression.clone());
|
|
589
|
-
}
|
|
590
|
-
clone() {
|
|
591
|
-
return new InFilter(this.comparisonType, this.leftExpression, this.rightExpressions);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
class IsNullFilter extends SingleFilter {
|
|
596
|
-
constructor(comparisonType, leftExpression) {
|
|
597
|
-
super(FilterType.IsNull, comparisonType, leftExpression);
|
|
598
|
-
}
|
|
599
|
-
get isNull() {
|
|
600
|
-
return this.comparisonType === ComparisonType.Is_null;
|
|
601
|
-
}
|
|
602
|
-
clone() {
|
|
603
|
-
return new IsNullFilter(this.comparisonType, this.leftExpression);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
__decorate([
|
|
607
|
-
Expose(),
|
|
608
|
-
__metadata("design:type", Boolean),
|
|
609
|
-
__metadata("design:paramtypes", [])
|
|
610
|
-
], IsNullFilter.prototype, "isNull", null);
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
* Empty Guid constant.
|
|
614
|
-
* @internal
|
|
615
|
-
*/
|
|
616
|
-
const EMPTY_GUID = '00000000-0000-0000-0000-000000000000';
|
|
617
|
-
/**
|
|
618
|
-
* Regular expression for Guid validation.
|
|
619
|
-
* @internal
|
|
620
|
-
*/
|
|
621
|
-
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');
|
|
622
|
-
/**
|
|
623
|
-
* Generates guid part.
|
|
624
|
-
* @param length Part length.
|
|
625
|
-
* @internal
|
|
626
|
-
*/
|
|
627
|
-
function generateGuidPart(length) {
|
|
628
|
-
let out = '';
|
|
629
|
-
for (let i = 0; i < length; i++) {
|
|
630
|
-
// eslint-disable-next-line no-bitwise
|
|
631
|
-
out += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
|
632
|
-
}
|
|
633
|
-
return out;
|
|
634
|
-
}
|
|
635
|
-
/**
|
|
636
|
-
* Generates new Guid.
|
|
637
|
-
* @internal
|
|
638
|
-
*/
|
|
639
|
-
function generateGuid() {
|
|
640
|
-
return [
|
|
641
|
-
generateGuidPart(2),
|
|
642
|
-
generateGuidPart(1),
|
|
643
|
-
generateGuidPart(1),
|
|
644
|
-
generateGuidPart(1),
|
|
645
|
-
generateGuidPart(3),
|
|
646
|
-
].join('-');
|
|
647
|
-
}
|
|
648
|
-
/**
|
|
649
|
-
* Checks if value is Guid.
|
|
650
|
-
* @param value Value for check.
|
|
651
|
-
* @internal
|
|
652
|
-
*/
|
|
653
|
-
function isGuid(value) {
|
|
654
|
-
return Boolean(value) && validator.test(value);
|
|
655
|
-
}
|
|
656
|
-
/**
|
|
657
|
-
* Checks if Guid is empty value or equal to EMPTY_GUID.
|
|
658
|
-
* @param guid Guid for check.
|
|
659
|
-
* @internal
|
|
660
|
-
*/
|
|
661
|
-
function isEmptyGuid(guid) {
|
|
662
|
-
return !guid || guid === EMPTY_GUID;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
/**
|
|
666
|
-
* @internal
|
|
667
|
-
*/
|
|
668
|
-
class NextHandlerAlreadySpecifiedException extends Error {
|
|
669
|
-
constructor() {
|
|
670
|
-
super('Next handler already specified');
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
class ArgumentEmptyException extends Error {
|
|
675
|
-
// region Constructors: Public
|
|
676
|
-
constructor(argumentName) {
|
|
677
|
-
super(`Argument with name '${argumentName}' is empty.`);
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
class ArgumentOutOfRangeException extends Error {
|
|
682
|
-
// region Constructors: Public
|
|
683
|
-
constructor(argumentName) {
|
|
684
|
-
super(`Argument with name '${argumentName}' is out of range.`);
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
class ItemNotFoundException extends Error {
|
|
689
|
-
// region Constructors: Public
|
|
690
|
-
constructor(key) {
|
|
691
|
-
super(`Item with key '${key}' does not exist.`);
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
class ValidationUtilities {
|
|
696
|
-
// region Methods: Public
|
|
697
|
-
static checkArgumentEmpty(argumentName, argumentValue) {
|
|
698
|
-
if (argumentValue === undefined || argumentValue === null) {
|
|
699
|
-
throw new ArgumentEmptyException(argumentName);
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
static checkArrayEmpty(argumentName, argumentValue) {
|
|
703
|
-
ValidationUtilities.checkArgumentEmpty(argumentName, argumentValue);
|
|
704
|
-
if (argumentValue.length === 0) {
|
|
705
|
-
throw new ArgumentEmptyException(argumentName);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
static checkStringIsNotEmpty(argumentName, argumentValue) {
|
|
709
|
-
this.checkArgumentEmpty(argumentName, argumentValue);
|
|
710
|
-
if (argumentValue === '') {
|
|
711
|
-
throw new ArgumentEmptyException(argumentName);
|
|
712
|
-
}
|
|
713
|
-
return argumentValue;
|
|
714
|
-
}
|
|
715
|
-
static checkArgumentOutOfRange(argumentName, argumentValue, range) {
|
|
716
|
-
if (range.begin && argumentValue < range.begin) {
|
|
717
|
-
throw new ArgumentOutOfRangeException(argumentName);
|
|
718
|
-
}
|
|
719
|
-
if (range.end && argumentValue > range.end) {
|
|
720
|
-
throw new ArgumentOutOfRangeException(argumentName);
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
class FilterGroup extends BaseFilter {
|
|
726
|
-
constructor(logicalOperation = LogicalOperatorType.And) {
|
|
727
|
-
super(FilterType.FilterGroup);
|
|
728
|
-
this.filters = new Map();
|
|
729
|
-
this.logicalOperation = logicalOperation;
|
|
730
|
-
}
|
|
731
|
-
get items() {
|
|
732
|
-
return classToPlain(this.filters, {
|
|
733
|
-
exposeUnsetFields: false,
|
|
734
|
-
excludePrefixes: ['_'],
|
|
735
|
-
});
|
|
736
|
-
}
|
|
737
|
-
/**
|
|
738
|
-
* Returns filter item by index.
|
|
739
|
-
* @param index Item index.
|
|
740
|
-
* @returns Filter.
|
|
741
|
-
*/
|
|
742
|
-
getItemByIndex(index) {
|
|
743
|
-
return this.items[Object.keys(this.items)[index]];
|
|
744
|
-
}
|
|
745
|
-
addSchemaColumnFilterWithParameter(comparisonType, columnPath, parameterValue) {
|
|
746
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
747
|
-
const rightExpression = new ParameterExpression({ value: parameterValue });
|
|
748
|
-
const filter = new CompareFilter(comparisonType, leftExpression, rightExpression);
|
|
749
|
-
this.add(filter);
|
|
750
|
-
}
|
|
751
|
-
addSchemaColumnInFilterWithParameters(comparisonType, columnPath, parameterValues) {
|
|
752
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
753
|
-
const expressions = parameterValues.map((singleParameterValue) => new ParameterExpression({
|
|
754
|
-
value: singleParameterValue,
|
|
755
|
-
}));
|
|
756
|
-
const filter = new InFilter(comparisonType, leftExpression, expressions);
|
|
757
|
-
this.add(filter);
|
|
758
|
-
}
|
|
759
|
-
addSchemaColumnIsNullFilter(columnPath) {
|
|
760
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
761
|
-
const filter = new IsNullFilter(ComparisonType.Is_null, leftExpression);
|
|
762
|
-
this.add(filter);
|
|
763
|
-
}
|
|
764
|
-
addSchemaColumnIsNotNullFilter(columnPath) {
|
|
765
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
766
|
-
const filter = new IsNullFilter(ComparisonType.Is_not_null, leftExpression);
|
|
767
|
-
this.add(filter);
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
* Creates and adds filter between less value and greater value.
|
|
771
|
-
* @param columnPath Column path.
|
|
772
|
-
* @param lessParamValue Less parameter value.
|
|
773
|
-
* @param greaterParamValue Greater parameter value.
|
|
774
|
-
*/
|
|
775
|
-
addSchemaColumnBetweenFilterWithParameters(columnPath, lessParamValue, greaterParamValue) {
|
|
776
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
777
|
-
const rightLessExpression = new ParameterExpression({ value: lessParamValue });
|
|
778
|
-
const rightGreaterExpression = new ParameterExpression({ value: greaterParamValue });
|
|
779
|
-
const filter = new BetweenFilter(leftExpression, rightLessExpression, rightGreaterExpression);
|
|
780
|
-
this.add(filter);
|
|
781
|
-
}
|
|
782
|
-
addExistsFilter(columnPath, subFilters) {
|
|
783
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
784
|
-
const filter = new ExistsFilter(leftExpression, subFilters);
|
|
785
|
-
this.add(filter);
|
|
786
|
-
}
|
|
787
|
-
addNotExistsFilter(columnPath, subFilters) {
|
|
788
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
789
|
-
const filter = new ExistsFilter(leftExpression, subFilters, ComparisonType.Not_exists);
|
|
790
|
-
this.add(filter);
|
|
791
|
-
}
|
|
792
|
-
add(filter, filterKey) {
|
|
793
|
-
ValidationUtilities.checkArgumentEmpty('filter', filter);
|
|
794
|
-
const key = filterKey || generateGuid();
|
|
795
|
-
this.filters.set(key, filter);
|
|
796
|
-
}
|
|
797
|
-
clone() {
|
|
798
|
-
const filterGroup = new FilterGroup(this.logicalOperation);
|
|
799
|
-
this.filters.forEach((filter, filterKey) => {
|
|
800
|
-
filterGroup.filters.set(filterKey, filter.clone());
|
|
801
|
-
});
|
|
802
|
-
return filterGroup;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
__decorate([
|
|
806
|
-
Exclude(),
|
|
807
|
-
__metadata("design:type", Object)
|
|
808
|
-
], FilterGroup.prototype, "filters", void 0);
|
|
809
|
-
__decorate([
|
|
810
|
-
Expose(),
|
|
811
|
-
__metadata("design:type", Object),
|
|
812
|
-
__metadata("design:paramtypes", [])
|
|
813
|
-
], FilterGroup.prototype, "items", null);
|
|
814
|
-
|
|
815
|
-
class BaseQueryColumn {
|
|
816
|
-
constructor(expression) {
|
|
817
|
-
this.orderDirection = OrderDirection.None;
|
|
818
|
-
this.orderPosition = -1;
|
|
819
|
-
this.isVisible = true;
|
|
820
|
-
this.expression = expression;
|
|
821
|
-
}
|
|
822
|
-
/**
|
|
823
|
-
* Adds ordering options.
|
|
824
|
-
* @param orderDirection Direction.
|
|
825
|
-
* @param orderPosition Position.
|
|
826
|
-
* @returns Self.
|
|
827
|
-
*/
|
|
828
|
-
withOrdering(orderDirection, orderPosition) {
|
|
829
|
-
ValidationUtilities.checkArgumentEmpty('orderDirection', orderDirection);
|
|
830
|
-
ValidationUtilities.checkArgumentEmpty('orderPosition', orderPosition);
|
|
831
|
-
ValidationUtilities.checkArgumentOutOfRange('orderPosition', orderPosition, { begin: -1 });
|
|
832
|
-
this.orderDirection = orderDirection;
|
|
833
|
-
this.orderPosition = orderPosition;
|
|
834
|
-
return this;
|
|
835
|
-
}
|
|
836
|
-
/**
|
|
837
|
-
* Adds options.
|
|
838
|
-
* @param options Options.
|
|
839
|
-
* @returns Self.
|
|
840
|
-
*/
|
|
841
|
-
withOptions(options) {
|
|
842
|
-
var _a;
|
|
843
|
-
ValidationUtilities.checkArgumentEmpty('options', options);
|
|
844
|
-
this.isVisible = (_a = options.isVisible) !== null && _a !== void 0 ? _a : true;
|
|
845
|
-
return this;
|
|
846
|
-
}
|
|
847
|
-
/**
|
|
848
|
-
* Adds caption.
|
|
849
|
-
* @param caption Caption.
|
|
850
|
-
* @returns Self.
|
|
851
|
-
*/
|
|
852
|
-
withCaption(caption) {
|
|
853
|
-
ValidationUtilities.checkArgumentEmpty('caption', caption);
|
|
854
|
-
this.caption = caption;
|
|
855
|
-
return this;
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
class ArithmeticQueryColumn extends BaseQueryColumn {
|
|
860
|
-
// region Constructors: Public
|
|
861
|
-
constructor(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand) {
|
|
862
|
-
super(new ArithmeticExpression({ arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand }));
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
class EntityQueryColumn extends BaseQueryColumn {
|
|
867
|
-
// region Constructors: Public
|
|
868
|
-
constructor(columnPath) {
|
|
869
|
-
super(new ColumnExpression({ columnPath }));
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
class ParameterQueryColumn extends BaseQueryColumn {
|
|
874
|
-
// region Constructors: Public
|
|
875
|
-
constructor(value, dataValueType) {
|
|
876
|
-
super(new ParameterExpression({ value, dataValueType }));
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
class AggregationSubQueryColumn extends BaseQueryColumn {
|
|
881
|
-
// region Constructors: Public
|
|
882
|
-
constructor(columnPath, aggregationType, subFilters, subOrderDirection, subOrderColumn) {
|
|
883
|
-
super(new AggregationSubQueryExpression({
|
|
884
|
-
aggregationType,
|
|
885
|
-
columnPath,
|
|
886
|
-
subFilters,
|
|
887
|
-
subOrderDirection,
|
|
888
|
-
subOrderColumn,
|
|
889
|
-
}));
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
class SubQueryColumn extends BaseQueryColumn {
|
|
894
|
-
// region Constructors: Public
|
|
895
|
-
constructor(columnPath, subFilters) {
|
|
896
|
-
super(new SubQueryExpression({ columnPath, subFilters }));
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
class AggregationFunctionColumn extends BaseQueryColumn {
|
|
901
|
-
// region Constructors: Public
|
|
902
|
-
constructor(aggregationType, aggregationEvalType, functionArgument) {
|
|
903
|
-
super(new AggregationFunctionExpression({
|
|
904
|
-
aggregationType,
|
|
905
|
-
aggregationEvalType,
|
|
906
|
-
functionArgument,
|
|
907
|
-
}));
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
class DatePartFunctionColumn extends BaseQueryColumn {
|
|
912
|
-
// region Constructors: Public
|
|
913
|
-
constructor(datePartType, functionArgument) {
|
|
914
|
-
super(new DatePartFunctionExpression({
|
|
915
|
-
datePartType,
|
|
916
|
-
functionArgument,
|
|
917
|
-
}));
|
|
918
|
-
}
|
|
919
|
-
// endregion
|
|
920
|
-
// region Properties: Public
|
|
921
|
-
get datePartType() {
|
|
922
|
-
var _a;
|
|
923
|
-
return (_a = this.expression) === null || _a === void 0 ? void 0 : _a.datePartType;
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
class LengthFunctionColumn extends BaseQueryColumn {
|
|
928
|
-
// region Constructors: Public
|
|
929
|
-
constructor(functionArgument) {
|
|
930
|
-
super(new LengthFunctionExpression({ functionArgument }));
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
class MacrosFunctionColumn extends BaseQueryColumn {
|
|
935
|
-
// region Constructors: Public
|
|
936
|
-
constructor(macrosType) {
|
|
937
|
-
super(new MacrosFunctionExpression({ macrosType }));
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
class WindowFunctionColumn extends BaseQueryColumn {
|
|
942
|
-
// region Constructors: Public
|
|
943
|
-
constructor(functionArgument) {
|
|
944
|
-
super(new WindowFunctionExpression({ functionArgument }));
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
|
|
948
7
|
/**
|
|
949
8
|
* @internal
|
|
950
9
|
*/
|
|
951
10
|
function toAggregationType(aggregationFunction) {
|
|
952
11
|
switch (aggregationFunction) {
|
|
953
|
-
case
|
|
954
|
-
return
|
|
955
|
-
case
|
|
956
|
-
return
|
|
957
|
-
case
|
|
958
|
-
return
|
|
959
|
-
case
|
|
960
|
-
return
|
|
961
|
-
case
|
|
962
|
-
return
|
|
963
|
-
case
|
|
964
|
-
return
|
|
12
|
+
case ɵAggregationFunction.Count:
|
|
13
|
+
return ɵAggregationType.Count;
|
|
14
|
+
case ɵAggregationFunction.Sum:
|
|
15
|
+
return ɵAggregationType.Sum;
|
|
16
|
+
case ɵAggregationFunction.Avg:
|
|
17
|
+
return ɵAggregationType.Avg;
|
|
18
|
+
case ɵAggregationFunction.Min:
|
|
19
|
+
return ɵAggregationType.Min;
|
|
20
|
+
case ɵAggregationFunction.Max:
|
|
21
|
+
return ɵAggregationType.Max;
|
|
22
|
+
case ɵAggregationFunction.TopOne:
|
|
23
|
+
return ɵAggregationType.TopOne;
|
|
965
24
|
default:
|
|
966
|
-
return
|
|
25
|
+
return ɵAggregationType.None;
|
|
967
26
|
}
|
|
968
27
|
}
|
|
969
28
|
/**
|
|
@@ -971,20 +30,20 @@ function toAggregationType(aggregationFunction) {
|
|
|
971
30
|
*/
|
|
972
31
|
function toAggregationFunction(aggregationType) {
|
|
973
32
|
switch (aggregationType) {
|
|
974
|
-
case
|
|
975
|
-
return
|
|
976
|
-
case
|
|
977
|
-
return
|
|
978
|
-
case
|
|
979
|
-
return
|
|
980
|
-
case
|
|
981
|
-
return
|
|
982
|
-
case
|
|
983
|
-
return
|
|
984
|
-
case
|
|
985
|
-
return
|
|
33
|
+
case ɵAggregationType.Count:
|
|
34
|
+
return ɵAggregationFunction.Count;
|
|
35
|
+
case ɵAggregationType.Sum:
|
|
36
|
+
return ɵAggregationFunction.Sum;
|
|
37
|
+
case ɵAggregationType.Avg:
|
|
38
|
+
return ɵAggregationFunction.Avg;
|
|
39
|
+
case ɵAggregationType.Min:
|
|
40
|
+
return ɵAggregationFunction.Min;
|
|
41
|
+
case ɵAggregationType.Max:
|
|
42
|
+
return ɵAggregationFunction.Max;
|
|
43
|
+
case ɵAggregationType.TopOne:
|
|
44
|
+
return ɵAggregationFunction.TopOne;
|
|
986
45
|
default:
|
|
987
|
-
return
|
|
46
|
+
return ɵAggregationFunction.None;
|
|
988
47
|
}
|
|
989
48
|
}
|
|
990
49
|
/**
|
|
@@ -993,11 +52,11 @@ function toAggregationFunction(aggregationType) {
|
|
|
993
52
|
function toAggregationEvalType(aggregationEval) {
|
|
994
53
|
switch (aggregationEval) {
|
|
995
54
|
case 'all':
|
|
996
|
-
return
|
|
55
|
+
return ɵAggregationEvalType.All;
|
|
997
56
|
case 'distinct':
|
|
998
|
-
return
|
|
57
|
+
return ɵAggregationEvalType.Distinct;
|
|
999
58
|
default:
|
|
1000
|
-
return
|
|
59
|
+
return ɵAggregationEvalType.None;
|
|
1001
60
|
}
|
|
1002
61
|
}
|
|
1003
62
|
/**
|
|
@@ -1005,9 +64,9 @@ function toAggregationEvalType(aggregationEval) {
|
|
|
1005
64
|
*/
|
|
1006
65
|
function toAggregationEval(aggregationEvalType) {
|
|
1007
66
|
switch (aggregationEvalType) {
|
|
1008
|
-
case
|
|
67
|
+
case ɵAggregationEvalType.All:
|
|
1009
68
|
return 'all';
|
|
1010
|
-
case
|
|
69
|
+
case ɵAggregationEvalType.Distinct:
|
|
1011
70
|
return 'distinct';
|
|
1012
71
|
default:
|
|
1013
72
|
return 'none';
|
|
@@ -1020,21 +79,21 @@ function toAggregationEval(aggregationEvalType) {
|
|
|
1020
79
|
function toDatePartType(aggregationFunction) {
|
|
1021
80
|
switch (aggregationFunction) {
|
|
1022
81
|
case 'minute':
|
|
1023
|
-
return
|
|
82
|
+
return ɵDatePartType.HourMinute;
|
|
1024
83
|
case 'hour':
|
|
1025
|
-
return
|
|
84
|
+
return ɵDatePartType.Hour;
|
|
1026
85
|
case 'day':
|
|
1027
|
-
return
|
|
86
|
+
return ɵDatePartType.Day;
|
|
1028
87
|
case 'weekday':
|
|
1029
|
-
return
|
|
88
|
+
return ɵDatePartType.WeekDay;
|
|
1030
89
|
case 'week':
|
|
1031
|
-
return
|
|
90
|
+
return ɵDatePartType.Week;
|
|
1032
91
|
case 'month':
|
|
1033
|
-
return
|
|
92
|
+
return ɵDatePartType.Month;
|
|
1034
93
|
case 'year':
|
|
1035
|
-
return
|
|
94
|
+
return ɵDatePartType.Year;
|
|
1036
95
|
default:
|
|
1037
|
-
return
|
|
96
|
+
return ɵDatePartType.None;
|
|
1038
97
|
}
|
|
1039
98
|
}
|
|
1040
99
|
/**
|
|
@@ -1042,19 +101,19 @@ function toDatePartType(aggregationFunction) {
|
|
|
1042
101
|
*/
|
|
1043
102
|
function toDatePart(aggregationType) {
|
|
1044
103
|
switch (aggregationType) {
|
|
1045
|
-
case
|
|
104
|
+
case ɵDatePartType.HourMinute:
|
|
1046
105
|
return 'minute';
|
|
1047
|
-
case
|
|
106
|
+
case ɵDatePartType.Hour:
|
|
1048
107
|
return 'hour';
|
|
1049
|
-
case
|
|
108
|
+
case ɵDatePartType.Day:
|
|
1050
109
|
return 'day';
|
|
1051
|
-
case
|
|
110
|
+
case ɵDatePartType.WeekDay:
|
|
1052
111
|
return 'weekday';
|
|
1053
|
-
case
|
|
112
|
+
case ɵDatePartType.Week:
|
|
1054
113
|
return 'week';
|
|
1055
|
-
case
|
|
114
|
+
case ɵDatePartType.Month:
|
|
1056
115
|
return 'month';
|
|
1057
|
-
case
|
|
116
|
+
case ɵDatePartType.Year:
|
|
1058
117
|
return 'year';
|
|
1059
118
|
default:
|
|
1060
119
|
return 'none';
|
|
@@ -1066,9 +125,9 @@ function toDatePart(aggregationType) {
|
|
|
1066
125
|
*/
|
|
1067
126
|
function toStringFunctionType(functionType) {
|
|
1068
127
|
switch (functionType) {
|
|
1069
|
-
case
|
|
128
|
+
case ɵFunctionType.Aggregation:
|
|
1070
129
|
return 'aggregation';
|
|
1071
|
-
case
|
|
130
|
+
case ɵFunctionType.DatePart:
|
|
1072
131
|
return 'datePart';
|
|
1073
132
|
default:
|
|
1074
133
|
return 'none';
|
|
@@ -1080,11 +139,11 @@ function toStringFunctionType(functionType) {
|
|
|
1080
139
|
function toNumericFunctionType(functionType) {
|
|
1081
140
|
switch (functionType) {
|
|
1082
141
|
case 'aggregation':
|
|
1083
|
-
return
|
|
142
|
+
return ɵFunctionType.Aggregation;
|
|
1084
143
|
case 'datePart':
|
|
1085
|
-
return
|
|
144
|
+
return ɵFunctionType.DatePart;
|
|
1086
145
|
default:
|
|
1087
|
-
return
|
|
146
|
+
return ɵFunctionType.None;
|
|
1088
147
|
}
|
|
1089
148
|
}
|
|
1090
149
|
|
|
@@ -1094,11 +153,11 @@ function toNumericFunctionType(functionType) {
|
|
|
1094
153
|
function toOrderDirection(sortDirection) {
|
|
1095
154
|
switch (sortDirection) {
|
|
1096
155
|
case 'asc':
|
|
1097
|
-
return
|
|
156
|
+
return ɵOrderDirection.Asc;
|
|
1098
157
|
case 'desc':
|
|
1099
|
-
return
|
|
158
|
+
return ɵOrderDirection.Desc;
|
|
1100
159
|
default:
|
|
1101
|
-
return
|
|
160
|
+
return ɵOrderDirection.None;
|
|
1102
161
|
}
|
|
1103
162
|
}
|
|
1104
163
|
/**
|
|
@@ -1106,9 +165,9 @@ function toOrderDirection(sortDirection) {
|
|
|
1106
165
|
*/
|
|
1107
166
|
function toSortDirection(orderDirection) {
|
|
1108
167
|
switch (orderDirection) {
|
|
1109
|
-
case
|
|
168
|
+
case ɵOrderDirection.Asc:
|
|
1110
169
|
return 'asc';
|
|
1111
|
-
case
|
|
170
|
+
case ɵOrderDirection.Desc:
|
|
1112
171
|
return 'desc';
|
|
1113
172
|
default:
|
|
1114
173
|
return 'none';
|
|
@@ -1135,183 +194,56 @@ const crtInjectPrefix = 'crtInject:';
|
|
|
1135
194
|
/**
|
|
1136
195
|
* @internal
|
|
1137
196
|
*/
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
}
|
|
197
|
+
var ViewElementGroupType;
|
|
198
|
+
(function (ViewElementGroupType) {
|
|
199
|
+
ViewElementGroupType["Charts"] = "Charts";
|
|
200
|
+
ViewElementGroupType["Components"] = "Components";
|
|
201
|
+
ViewElementGroupType["LayoutElements"] = "LayoutElements";
|
|
202
|
+
ViewElementGroupType["Inputs"] = "Inputs";
|
|
203
|
+
ViewElementGroupType["CustomElements"] = "CustomElements";
|
|
204
|
+
})(ViewElementGroupType || (ViewElementGroupType = {}));
|
|
1147
205
|
|
|
1148
206
|
/**
|
|
1149
207
|
* @internal
|
|
1150
208
|
*/
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
209
|
+
var ViewElementDataGroupType;
|
|
210
|
+
(function (ViewElementDataGroupType) {
|
|
211
|
+
ViewElementDataGroupType["Data"] = "Data";
|
|
212
|
+
})(ViewElementDataGroupType || (ViewElementDataGroupType = {}));
|
|
1157
213
|
/**
|
|
1158
214
|
* @internal
|
|
1159
215
|
*/
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
if (!vendor || pascalTypeName !== typeName) {
|
|
1164
|
-
throw new Error(`Error when register ${type}. Type property should have Pascal case, e.g. ${vendor + '.' + pascalTypeName}. ` + 'The first letter of each word in a compound word should be capitalized');
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
216
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
217
|
+
const DesignerToolGroupType = Object.assign(Object.assign({}, ViewElementDataGroupType), ViewElementGroupType);
|
|
218
|
+
|
|
1167
219
|
/**
|
|
220
|
+
* Handler source types in order of call priority.
|
|
1168
221
|
* @internal
|
|
1169
222
|
*/
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
}
|
|
1177
|
-
/**
|
|
1178
|
-
* @internal
|
|
1179
|
-
*/
|
|
1180
|
-
function toPascalCase(source) {
|
|
1181
|
-
return upperFirst(camelCase(source));
|
|
1182
|
-
}
|
|
1183
|
-
/**
|
|
1184
|
-
* @internal
|
|
1185
|
-
*/
|
|
1186
|
-
function checkIfTypeRegistered(type, item) {
|
|
1187
|
-
if (!item) {
|
|
1188
|
-
throw new Error(`Error when resolve ${type}. Type was not registered.`);
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
/**
|
|
1192
|
-
* @internal
|
|
1193
|
-
*/
|
|
1194
|
-
function checkOnlyOneRegistration(type, item, map) {
|
|
1195
|
-
if (map.has(type) && !isEqual(map.get(type), item)) {
|
|
1196
|
-
throw new Error(`Error when register ${type}. Element with this type has already exist`);
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
223
|
+
var HandlerSourceType;
|
|
224
|
+
(function (HandlerSourceType) {
|
|
225
|
+
HandlerSourceType[HandlerSourceType["Schema"] = 0] = "Schema";
|
|
226
|
+
HandlerSourceType[HandlerSourceType["Remote"] = 1] = "Remote";
|
|
227
|
+
HandlerSourceType[HandlerSourceType["Host"] = 2] = "Host";
|
|
228
|
+
})(HandlerSourceType || (HandlerSourceType = {}));
|
|
1199
229
|
|
|
1200
|
-
var _a;
|
|
1201
230
|
/**
|
|
1202
231
|
* @internal
|
|
1203
232
|
*/
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
this._addItemListeners.splice(this._addItemListeners.indexOf(handler), 1);
|
|
1212
|
-
};
|
|
1213
|
-
}
|
|
1214
|
-
static onRemoveRequestHandler(handler) {
|
|
1215
|
-
this._removeItemListeners.push(handler);
|
|
1216
|
-
return () => {
|
|
1217
|
-
this._removeItemListeners.splice(this._removeItemListeners.indexOf(handler), 1);
|
|
1218
|
-
};
|
|
1219
|
-
}
|
|
1220
|
-
static addRequestHandler(handlerType, config) {
|
|
1221
|
-
if (!this._requestHandlersMap.has(handlerType)) {
|
|
1222
|
-
this._requestHandlersMap.set(handlerType, config);
|
|
1223
|
-
for (const listener of this._addItemListeners) {
|
|
1224
|
-
listener(handlerType, config);
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1228
|
-
static removeRequestHandler(handlerType) {
|
|
1229
|
-
const config = this._requestHandlersMap.get(handlerType);
|
|
1230
|
-
if (config) {
|
|
1231
|
-
this._requestHandlersMap.delete(handlerType);
|
|
1232
|
-
for (const listener of this._removeItemListeners) {
|
|
1233
|
-
listener(handlerType, config);
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
InternalRequestHandlerRegistryType._addItemListeners = [];
|
|
1239
|
-
InternalRequestHandlerRegistryType._removeItemListeners = [];
|
|
1240
|
-
InternalRequestHandlerRegistryType._requestHandlersMap = new Map();
|
|
233
|
+
var ModelInPageAction;
|
|
234
|
+
(function (ModelInPageAction) {
|
|
235
|
+
ModelInPageAction["Edit"] = "edit";
|
|
236
|
+
ModelInPageAction["Add"] = "add";
|
|
237
|
+
ModelInPageAction["Copy"] = "copy";
|
|
238
|
+
})(ModelInPageAction || (ModelInPageAction = {}));
|
|
239
|
+
|
|
1241
240
|
const global$3 = window;
|
|
1242
|
-
(_a = global$3.creatio) !== null && _a !== void 0 ? _a : (global$3.creatio = {});
|
|
1243
|
-
if (!global$3.creatio.requestHandlerRegistry) {
|
|
1244
|
-
Object.defineProperty(global$3.creatio, 'requestHandlerRegistry', {
|
|
1245
|
-
get: () => InternalRequestHandlerRegistryType,
|
|
1246
|
-
configurable: false,
|
|
1247
|
-
});
|
|
1248
|
-
}
|
|
1249
241
|
/**
|
|
1250
|
-
* @
|
|
242
|
+
* @public
|
|
243
|
+
* @description For internal use only.
|
|
1251
244
|
*/
|
|
1252
245
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1253
|
-
|
|
1254
|
-
/**
|
|
1255
|
-
* @internal
|
|
1256
|
-
*/
|
|
1257
|
-
class RequestHandlerRegistryService {
|
|
1258
|
-
/**
|
|
1259
|
-
* Register request handler class.
|
|
1260
|
-
* @param config Request handler registration config.
|
|
1261
|
-
* @param type Request handler type.
|
|
1262
|
-
*/
|
|
1263
|
-
static register(config, type) {
|
|
1264
|
-
const requestType = config.requestType;
|
|
1265
|
-
const requestHandlerType = config.type;
|
|
1266
|
-
if (!requestType) {
|
|
1267
|
-
throw new Error(`Error when register ${requestHandlerType}. Request type not specified.`);
|
|
1268
|
-
}
|
|
1269
|
-
const requestHandlerMapValue = {
|
|
1270
|
-
instanceType: type,
|
|
1271
|
-
instanceConfig: config,
|
|
1272
|
-
};
|
|
1273
|
-
RequestHandlerRegistryService._internalRegistry.addRequestHandler(requestHandlerType, requestHandlerMapValue);
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
RequestHandlerRegistryService._internalRegistry = global$3.creatio.requestHandlerRegistry;
|
|
1277
|
-
|
|
1278
|
-
/**
|
|
1279
|
-
* @internal
|
|
1280
|
-
*/
|
|
1281
|
-
class RequestRegistryService {
|
|
1282
|
-
static get requestsRegistrationInfos() {
|
|
1283
|
-
return this._requestsRegistrationInfos;
|
|
1284
|
-
}
|
|
1285
|
-
/**
|
|
1286
|
-
* Registers a specified request class.
|
|
1287
|
-
* @param config Request registration config.
|
|
1288
|
-
* @param type Request type.
|
|
1289
|
-
*/
|
|
1290
|
-
static register(config, type) {
|
|
1291
|
-
const requestType = config.type;
|
|
1292
|
-
// TODO RND-21723
|
|
1293
|
-
RequestRegistryService._requestsMap.set(requestType, type);
|
|
1294
|
-
RequestRegistryService._requestsRegistrationInfos.set(requestType, config);
|
|
1295
|
-
}
|
|
1296
|
-
/**
|
|
1297
|
-
* Creates request instance by specified registered request type.
|
|
1298
|
-
* @param type Request type.
|
|
1299
|
-
* @returns The instance of registered request.
|
|
1300
|
-
*/
|
|
1301
|
-
static get(type) {
|
|
1302
|
-
const requestInstanceConstructor = RequestRegistryService._requestsMap.get(type);
|
|
1303
|
-
checkIfTypeRegistered(type, requestInstanceConstructor);
|
|
1304
|
-
return requestInstanceConstructor && new requestInstanceConstructor();
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
RequestRegistryService._requestsMap = new Map();
|
|
1308
|
-
RequestRegistryService._requestsRegistrationInfos = new Map();
|
|
1309
|
-
|
|
1310
|
-
const global$2 = window;
|
|
1311
|
-
/**
|
|
1312
|
-
* @internal
|
|
1313
|
-
*/
|
|
1314
|
-
class BaseRegistry {
|
|
246
|
+
class ɵBaseRegistry {
|
|
1315
247
|
constructor() {
|
|
1316
248
|
this.store = {
|
|
1317
249
|
typeInfos: new Map(),
|
|
@@ -1319,1241 +251,1017 @@ class BaseRegistry {
|
|
|
1319
251
|
}
|
|
1320
252
|
static get store() {
|
|
1321
253
|
if (!this._instance) {
|
|
1322
|
-
let globalInstance = get(global$
|
|
254
|
+
let globalInstance = get(global$3, this._prefix + this.registryKey);
|
|
1323
255
|
if (!globalInstance) {
|
|
1324
256
|
globalInstance = new this();
|
|
1325
|
-
set(global$
|
|
257
|
+
set(global$3, this._prefix + this.registryKey, globalInstance);
|
|
1326
258
|
}
|
|
1327
259
|
this._instance = globalInstance;
|
|
1328
260
|
}
|
|
1329
261
|
return this._instance.store;
|
|
1330
262
|
}
|
|
1331
263
|
}
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
/**
|
|
1335
|
-
* @internal
|
|
1336
|
-
*/
|
|
1337
|
-
class ConverterRegistry extends BaseRegistry {
|
|
1338
|
-
static get(type) {
|
|
1339
|
-
if (!this.store.typeInfos.has(type)) {
|
|
1340
|
-
throw new Error(`'${type}' converter doesn't exist`);
|
|
1341
|
-
}
|
|
1342
|
-
return this.store.typeInfos.get(type);
|
|
1343
|
-
}
|
|
1344
|
-
static register(item) {
|
|
1345
|
-
checkTypeNameFormat(item.type, 'ConverterTypeName');
|
|
1346
|
-
checkCrtTypeNamePascalCase(item.type);
|
|
1347
|
-
// TODO RND-21723
|
|
1348
|
-
this.store.typeInfos.set(item.type, item);
|
|
1349
|
-
}
|
|
1350
|
-
static clear() {
|
|
1351
|
-
this.store.typeInfos.clear();
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
ConverterRegistry.registryKey = 'ConverterRegistry';
|
|
264
|
+
ɵBaseRegistry._prefix = 'creatio.registry.';
|
|
1355
265
|
|
|
1356
266
|
/**
|
|
1357
267
|
* @internal
|
|
1358
268
|
*/
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
* @internal
|
|
1362
|
-
*/
|
|
1363
|
-
class ViewElementRegistry extends BaseRegistry {
|
|
1364
|
-
static validate(config) {
|
|
1365
|
-
checkTypeNameFormat(config.type, 'ViewElementTypeName');
|
|
1366
|
-
checkOnlyOneRegistration(config.type, config, ViewElementRegistry.viewElements);
|
|
1367
|
-
}
|
|
1368
|
-
static get viewElements() {
|
|
269
|
+
class PkgTopology extends ɵBaseRegistry {
|
|
270
|
+
static get items() {
|
|
1369
271
|
return this.store.typeInfos;
|
|
1370
272
|
}
|
|
1371
|
-
static
|
|
1372
|
-
this.
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
return (config && 'formControlConfig' in config && ((_a = config.formControlConfig) === null || _a === void 0 ? void 0 : _a.relatesTo)) || null;
|
|
273
|
+
static get(pkgName) {
|
|
274
|
+
const order = this.items.get(pkgName);
|
|
275
|
+
if (order === undefined) {
|
|
276
|
+
throw new Error(`Package with name ${pkgName} not found in topology`);
|
|
277
|
+
}
|
|
278
|
+
return order;
|
|
1378
279
|
}
|
|
1379
280
|
}
|
|
1380
|
-
|
|
281
|
+
PkgTopology.registryKey = 'pkgTopology';
|
|
1381
282
|
|
|
1382
283
|
/**
|
|
1383
284
|
* @internal
|
|
1384
285
|
*/
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
checkTypeNameFormat(config.type, 'InterfaceDesignerItemTypeName');
|
|
1392
|
-
checkCrtTypeNamePascalCase(config.type);
|
|
1393
|
-
checkOnlyOneRegistration(config.type, config, this.interfaceDesignerItemRegistrationInfos);
|
|
286
|
+
class HandlersOrderComparer {
|
|
287
|
+
constructor(_request) {
|
|
288
|
+
var _a;
|
|
289
|
+
this._request = _request;
|
|
290
|
+
const scopesOrderEntries = [...((_a = this._request.scopes) !== null && _a !== void 0 ? _a : [])].reverse().map((scope, index) => [scope, index]);
|
|
291
|
+
this._scopesOrder = Object.fromEntries(scopesOrderEntries);
|
|
1394
292
|
}
|
|
1395
|
-
|
|
1396
|
-
|
|
293
|
+
_getOrderByScopes(handler) {
|
|
294
|
+
if (!handler.scopes) {
|
|
295
|
+
return Number.MAX_VALUE;
|
|
296
|
+
}
|
|
297
|
+
const scopesOrder = handler.scopes.filter((s) => s in this._scopesOrder).map((s) => this._scopesOrder[s]);
|
|
298
|
+
return Math.min(...scopesOrder);
|
|
1397
299
|
}
|
|
1398
|
-
|
|
1399
|
-
|
|
300
|
+
_getOrderByPkgTopology(handler) {
|
|
301
|
+
if (handler.source.type === HandlerSourceType.Host) {
|
|
302
|
+
return Number.MAX_VALUE;
|
|
303
|
+
}
|
|
304
|
+
return PkgTopology.get(handler.source.packageName);
|
|
1400
305
|
}
|
|
1401
|
-
|
|
1402
|
-
|
|
306
|
+
compare(a, b) {
|
|
307
|
+
const aScopeOrder = this._getOrderByScopes(a);
|
|
308
|
+
const bScopeOrder = this._getOrderByScopes(b);
|
|
309
|
+
let diff = aScopeOrder - bScopeOrder;
|
|
310
|
+
if (diff) {
|
|
311
|
+
return diff;
|
|
312
|
+
}
|
|
313
|
+
const aPkgTopologyOrder = this._getOrderByPkgTopology(a);
|
|
314
|
+
const bPkgTopologyOrder = this._getOrderByPkgTopology(b);
|
|
315
|
+
diff = aPkgTopologyOrder - bPkgTopologyOrder;
|
|
316
|
+
if (diff) {
|
|
317
|
+
return diff;
|
|
318
|
+
}
|
|
319
|
+
diff = a.source.type - b.source.type;
|
|
320
|
+
return diff;
|
|
1403
321
|
}
|
|
1404
322
|
}
|
|
1405
|
-
InterfaceDesignerItemRegistry.registryKey = interfaceDesignerItemRegistryKey;
|
|
1406
323
|
|
|
1407
|
-
const global$1 = window;
|
|
1408
324
|
/**
|
|
1409
325
|
* @internal
|
|
1410
326
|
*/
|
|
1411
|
-
class
|
|
327
|
+
class InternalHandlerChain {
|
|
1412
328
|
constructor() {
|
|
1413
|
-
this.
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
*/
|
|
1437
|
-
class HandlerChainServicesRegistry extends BaseRegistry {
|
|
1438
|
-
static validate({ requestType }) {
|
|
1439
|
-
checkTypeNameFormat(requestType, this.registryKey);
|
|
1440
|
-
checkCrtTypeNamePascalCase(requestType);
|
|
1441
|
-
this.checkUniqueRequestType(requestType);
|
|
329
|
+
this._handlers = [];
|
|
330
|
+
this._handlersCache = new Map();
|
|
331
|
+
this._handlersScopesByContextId = new Map();
|
|
332
|
+
this.handlerChain$ = {
|
|
333
|
+
process: (request) => __awaiter(this, void 0, void 0, function* () {
|
|
334
|
+
const handler = this._getHandler(request);
|
|
335
|
+
return handler === null || handler === void 0 ? void 0 : handler.handle(request);
|
|
336
|
+
}),
|
|
337
|
+
register: (info) => {
|
|
338
|
+
this._handlersCache.delete(info.requestType);
|
|
339
|
+
this._handlers.push(info);
|
|
340
|
+
return () => {
|
|
341
|
+
const index = this._handlers.indexOf(info);
|
|
342
|
+
if (index > -1) {
|
|
343
|
+
this._handlers.splice(index, 1);
|
|
344
|
+
this._handlersCache.delete(info.requestType);
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
console.warn(`${info === null || info === void 0 ? void 0 : info.requestType} not found to unsubscribe`);
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
},
|
|
351
|
+
};
|
|
1442
352
|
}
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
353
|
+
clearContextedHandlersCache(contextId) {
|
|
354
|
+
var _a;
|
|
355
|
+
const configs = (_a = this._handlersScopesByContextId.get(contextId)) !== null && _a !== void 0 ? _a : [];
|
|
356
|
+
return configs.every(({ requestType, scope }) => { var _a; return (_a = this._handlersCache.get(requestType)) === null || _a === void 0 ? void 0 : _a.delete(scope); });
|
|
357
|
+
}
|
|
358
|
+
_getHandler(request) {
|
|
359
|
+
return this._hasCacheHandler(request) ? this._getCacheHandler(request) : this._buildHandlersChain(request);
|
|
360
|
+
}
|
|
361
|
+
_getCacheHandler(request) {
|
|
362
|
+
const map = this._handlersCache.get(request.type);
|
|
363
|
+
const key = this._getCacheScopesKey(request);
|
|
364
|
+
return map.get(key);
|
|
365
|
+
}
|
|
366
|
+
_hasCacheHandler(request) {
|
|
367
|
+
const map = this._handlersCache.get(request.type);
|
|
368
|
+
const key = this._getCacheScopesKey(request);
|
|
369
|
+
return map && map.has(key);
|
|
370
|
+
}
|
|
371
|
+
_getCacheScopesKey(request) {
|
|
372
|
+
var _a, _b;
|
|
373
|
+
const injectionContextKey = (_b = (_a = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context)) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '';
|
|
374
|
+
return (request.scopes || ['']).join('_').concat(injectionContextKey);
|
|
375
|
+
}
|
|
376
|
+
_getInjectionContext(viewModel) {
|
|
377
|
+
return ((viewModel === null || viewModel === void 0 ? void 0 : viewModel['_injectionContext']) ||
|
|
378
|
+
((viewModel === null || viewModel === void 0 ? void 0 : viewModel['parent']) && this._getInjectionContext(viewModel['parent'])));
|
|
379
|
+
}
|
|
380
|
+
_setContextedScopes(request, scope) {
|
|
381
|
+
var _a;
|
|
382
|
+
const injectionContext = (_a = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context)) === null || _a === void 0 ? void 0 : _a.id;
|
|
383
|
+
const configs = this._handlersScopesByContextId.has(injectionContext)
|
|
384
|
+
? this._handlersScopesByContextId.get(injectionContext)
|
|
385
|
+
: [];
|
|
386
|
+
configs.push({ requestType: request.type, scope });
|
|
387
|
+
this._handlersScopesByContextId.set(injectionContext, configs);
|
|
388
|
+
}
|
|
389
|
+
_setCacheHandler(request, handler) {
|
|
390
|
+
var _a;
|
|
391
|
+
const map = this._handlersCache.has(request.type)
|
|
392
|
+
? this._handlersCache.get(request.type)
|
|
393
|
+
: new Map();
|
|
394
|
+
const key = this._getCacheScopesKey(request);
|
|
395
|
+
map.set(key, handler);
|
|
396
|
+
if ((_a = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context)) === null || _a === void 0 ? void 0 : _a.id) {
|
|
397
|
+
this._setContextedScopes(request, key);
|
|
1446
398
|
}
|
|
399
|
+
this._handlersCache.set(request.type, map);
|
|
1447
400
|
}
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
401
|
+
_isRequestHandler(handler) {
|
|
402
|
+
return (typeof handler.handle === 'function' &&
|
|
403
|
+
typeof handler.setNext === 'function');
|
|
1451
404
|
}
|
|
1452
|
-
|
|
1453
|
-
|
|
405
|
+
_checkHandlerInstanceOf(handler) {
|
|
406
|
+
if (!this._isRequestHandler(handler)) {
|
|
407
|
+
throw new Error('Handler should implement "BaseRequestHandler"');
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
_buildHandlersChain(request) {
|
|
411
|
+
const handlers = this._handlers.filter((h) => {
|
|
412
|
+
var _a;
|
|
413
|
+
if (h.requestType !== request.type) {
|
|
414
|
+
return false;
|
|
415
|
+
}
|
|
416
|
+
if (!((_a = h.scopes) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
417
|
+
return true;
|
|
418
|
+
}
|
|
419
|
+
return h.scopes.some((s) => { var _a; return (_a = request.scopes) === null || _a === void 0 ? void 0 : _a.includes(s); });
|
|
420
|
+
});
|
|
421
|
+
const comparer = new HandlersOrderComparer(request);
|
|
422
|
+
handlers.sort((a, b) => comparer.compare(a, b));
|
|
423
|
+
const handlerInstances = handlers.map((handlerConfig) => {
|
|
424
|
+
const injectionContext = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context);
|
|
425
|
+
return handlerConfig.createHandler(injectionContext);
|
|
426
|
+
});
|
|
427
|
+
handlerInstances.forEach((handler) => this._checkHandlerInstanceOf(handler));
|
|
428
|
+
this._joinHandlersInChain(handlerInstances);
|
|
429
|
+
const result = handlerInstances[0];
|
|
430
|
+
this._setCacheHandler(request, result);
|
|
431
|
+
return result;
|
|
432
|
+
}
|
|
433
|
+
_joinHandlersInChain(handlers) {
|
|
434
|
+
for (let index = 0; index < handlers.length - 1; index++) {
|
|
435
|
+
try {
|
|
436
|
+
handlers[index].setNext(handlers[index + 1]);
|
|
437
|
+
}
|
|
438
|
+
catch (error) {
|
|
439
|
+
if (error instanceof ɵNextHandlerAlreadySpecifiedException) {
|
|
440
|
+
throw new Error('Handler factory should return new instance of ' +
|
|
441
|
+
'BaseRequestHandler class or its subclass ' +
|
|
442
|
+
'(next handler should not be specified)');
|
|
443
|
+
}
|
|
444
|
+
throw error;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
1454
447
|
}
|
|
1455
448
|
}
|
|
1456
|
-
HandlerChainServicesRegistry.registryKey = 'HandlerChainServicesRegistry';
|
|
1457
449
|
|
|
450
|
+
const global$2 = window;
|
|
1458
451
|
/**
|
|
1459
|
-
* @
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
/**
|
|
1463
|
-
* @internal
|
|
452
|
+
* @public
|
|
453
|
+
* @class HandlerChainService
|
|
454
|
+
* @classdesc Service to design handlers in chain.
|
|
1464
455
|
*/
|
|
1465
|
-
class
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
checkCrtTypeNamePascalCase(config.type);
|
|
1469
|
-
checkOnlyOneRegistration(config.type, config, this.infos);
|
|
456
|
+
class HandlerChainService {
|
|
457
|
+
get _chain() {
|
|
458
|
+
return global$2.handlerChain;
|
|
1470
459
|
}
|
|
1471
|
-
|
|
1472
|
-
|
|
460
|
+
set _chain(value) {
|
|
461
|
+
global$2.handlerChain = value;
|
|
1473
462
|
}
|
|
1474
|
-
static
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
463
|
+
static get instance() {
|
|
464
|
+
return HandlerChainService._instance || (HandlerChainService._instance = new HandlerChainService());
|
|
465
|
+
}
|
|
466
|
+
constructor() {
|
|
467
|
+
if (!this._chain) {
|
|
468
|
+
this._createGlobalHandlerChain();
|
|
1478
469
|
}
|
|
1479
|
-
return null;
|
|
1480
470
|
}
|
|
1481
|
-
|
|
1482
|
-
|
|
471
|
+
_createGlobalHandlerChain() {
|
|
472
|
+
this._chain = new InternalHandlerChain();
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* @internal
|
|
476
|
+
*/
|
|
477
|
+
clearContextedHandlersCache(contextId) {
|
|
478
|
+
return this._chain.clearContextedHandlersCache(contextId);
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* @internal
|
|
482
|
+
*/
|
|
483
|
+
register(handlerConfig) {
|
|
484
|
+
return this._chain.handlerChain$.register(handlerConfig);
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* @description Method to process passed request
|
|
488
|
+
* @param request - {@link ɵBaseRequest}
|
|
489
|
+
* @return `Promise<unknown>`
|
|
490
|
+
*/
|
|
491
|
+
process(request) {
|
|
492
|
+
return this._chain.handlerChain$.process(request);
|
|
1483
493
|
}
|
|
1484
494
|
}
|
|
1485
|
-
DesignTimeViewElementRegistry.registryKey = designTimeViewElementRegistryKey;
|
|
1486
495
|
|
|
1487
496
|
/**
|
|
1488
497
|
* @internal
|
|
1489
498
|
*/
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
}
|
|
1504
|
-
static validate(config) {
|
|
1505
|
-
checkTypeNameFormat(config.type, 'ValidatorTypeName');
|
|
1506
|
-
if (ValidatorRegistry._has(config.type, config.typeRef)) {
|
|
1507
|
-
throw new Error(`Error when register ${config.type}. Element with this type has already exist`);
|
|
499
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
500
|
+
function ImplementUsingHandlerChain(config) {
|
|
501
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
502
|
+
return function (target, method, descriptor) {
|
|
503
|
+
const methodImplementation = function (...args) {
|
|
504
|
+
return HandlerChainService.instance.process({
|
|
505
|
+
type: (config === null || config === void 0 ? void 0 : config.requestType) ? config.requestType : this.requestType,
|
|
506
|
+
method: (config === null || config === void 0 ? void 0 : config.methodName) ? config.methodName : method,
|
|
507
|
+
args,
|
|
508
|
+
});
|
|
509
|
+
};
|
|
510
|
+
if (descriptor) {
|
|
511
|
+
descriptor.value = methodImplementation;
|
|
1508
512
|
}
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
}
|
|
1513
|
-
static register(config) {
|
|
1514
|
-
this.items.set(config.type, config);
|
|
1515
|
-
}
|
|
513
|
+
else {
|
|
514
|
+
target[method] = methodImplementation;
|
|
515
|
+
}
|
|
516
|
+
};
|
|
1516
517
|
}
|
|
1517
|
-
ValidatorRegistry.registryKey = validatorRegistryKey;
|
|
1518
518
|
|
|
1519
519
|
/**
|
|
1520
520
|
* @internal
|
|
1521
521
|
*/
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
return
|
|
1525
|
-
}
|
|
1526
|
-
static get(pkgName) {
|
|
1527
|
-
const order = this.items.get(pkgName);
|
|
1528
|
-
if (order === undefined) {
|
|
1529
|
-
throw new Error(`Package with name ${pkgName} not found in topology`);
|
|
1530
|
-
}
|
|
1531
|
-
return order;
|
|
522
|
+
function objectDeepKeys(obj) {
|
|
523
|
+
if (obj === null || typeof obj !== 'object') {
|
|
524
|
+
return [];
|
|
1532
525
|
}
|
|
526
|
+
return Object.keys(obj)
|
|
527
|
+
.filter((key) => obj[key] instanceof Object)
|
|
528
|
+
.map((key) => objectDeepKeys(obj[key]).map((k) => [key, ...k]))
|
|
529
|
+
.reduce((x, y) => [...x, ...y], Object.keys(obj).map((x) => [x]));
|
|
1533
530
|
}
|
|
1534
|
-
PkgTopology.registryKey = 'pkgTopology';
|
|
1535
531
|
|
|
1536
532
|
/**
|
|
1537
533
|
* @internal
|
|
1538
|
-
* @dontChange
|
|
1539
534
|
*/
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
static get items() {
|
|
1545
|
-
return this.store.typeInfos;
|
|
535
|
+
function checkTypeNameFormat(type, element) {
|
|
536
|
+
const typeParts = type.split('.');
|
|
537
|
+
if (typeParts.length < 2) {
|
|
538
|
+
throw new Error(`Error when register ${type}. Type property should have format "VendorPrefix.${element}"`);
|
|
1546
539
|
}
|
|
1547
540
|
}
|
|
1548
541
|
/**
|
|
1549
|
-
* @
|
|
542
|
+
* @public
|
|
543
|
+
* @description For internal use only.
|
|
1550
544
|
*/
|
|
1551
|
-
|
|
1552
|
-
|
|
545
|
+
function ɵcheckTypeNameFormat(type, element) {
|
|
546
|
+
return checkTypeNameFormat(type, element);
|
|
547
|
+
}
|
|
1553
548
|
/**
|
|
1554
549
|
* @internal
|
|
1555
550
|
*/
|
|
1556
|
-
function
|
|
1557
|
-
|
|
1558
|
-
const
|
|
1559
|
-
if (!
|
|
1560
|
-
|
|
551
|
+
function checkTypeNamePascalCase(type) {
|
|
552
|
+
const [vendor, typeName] = type.split('.');
|
|
553
|
+
const pascalTypeName = toPascalCase(typeName);
|
|
554
|
+
if (!vendor || pascalTypeName !== typeName) {
|
|
555
|
+
throw new Error(`Error when register ${type}. Type property should have Pascal case, e.g. ${vendor + '.' + pascalTypeName}. ` + 'The first letter of each word in a compound word should be capitalized');
|
|
1561
556
|
}
|
|
1562
|
-
return !!((_a = componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.inputs[componentProperty]) === null || _a === void 0 ? void 0 : _a.propertyBindable);
|
|
1563
557
|
}
|
|
1564
|
-
|
|
1565
|
-
/**
|
|
1566
|
-
* @internal
|
|
1567
|
-
*/
|
|
1568
|
-
var ViewElementGroupType;
|
|
1569
|
-
(function (ViewElementGroupType) {
|
|
1570
|
-
ViewElementGroupType["Charts"] = "Charts";
|
|
1571
|
-
ViewElementGroupType["Components"] = "Components";
|
|
1572
|
-
ViewElementGroupType["LayoutElements"] = "LayoutElements";
|
|
1573
|
-
ViewElementGroupType["Inputs"] = "Inputs";
|
|
1574
|
-
ViewElementGroupType["CustomElements"] = "CustomElements";
|
|
1575
|
-
})(ViewElementGroupType || (ViewElementGroupType = {}));
|
|
1576
|
-
|
|
1577
558
|
/**
|
|
1578
559
|
* @internal
|
|
1579
560
|
*/
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
561
|
+
function checkCrtTypeNamePascalCase(type) {
|
|
562
|
+
const [vendor, typeName] = type.split('.');
|
|
563
|
+
const pascalTypeName = toPascalCase(typeName);
|
|
564
|
+
if (vendor.toLowerCase() === 'crt' && pascalTypeName !== typeName) {
|
|
565
|
+
throw new Error(`Error when register ${type}. Type property should have Pascal case, e.g. ${vendor + '.' + pascalTypeName}. ` + 'The first letter of each word in a compound word should be capitalized');
|
|
566
|
+
}
|
|
567
|
+
}
|
|
1584
568
|
/**
|
|
1585
569
|
* @internal
|
|
1586
570
|
*/
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
571
|
+
function toPascalCase(source) {
|
|
572
|
+
return upperFirst(camelCase(source));
|
|
573
|
+
}
|
|
1590
574
|
/**
|
|
1591
575
|
* @internal
|
|
1592
576
|
*/
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
}
|
|
1598
|
-
|
|
577
|
+
function checkIfTypeRegistered(type, item) {
|
|
578
|
+
if (!item) {
|
|
579
|
+
throw new Error(`Error when resolve ${type}. Type was not registered.`);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
1599
582
|
/**
|
|
1600
583
|
* @internal
|
|
1601
584
|
*/
|
|
1602
|
-
|
|
1603
|
-
(
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
})(ModelInPageAction || (ModelInPageAction = {}));
|
|
585
|
+
function checkOnlyOneRegistration(type, item, map) {
|
|
586
|
+
if (map.has(type) && !isEqual(map.get(type), item)) {
|
|
587
|
+
throw new Error(`Error when register ${type}. Element with this type has already exist`);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
1608
590
|
|
|
591
|
+
var _a;
|
|
1609
592
|
/**
|
|
1610
|
-
* Handler source types in order of call priority.
|
|
1611
593
|
* @internal
|
|
1612
594
|
*/
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
595
|
+
class InternalRequestHandlerRegistryType {
|
|
596
|
+
static get requestHandlersMap() {
|
|
597
|
+
return this._requestHandlersMap;
|
|
598
|
+
}
|
|
599
|
+
static onAddRequestHandler(handler) {
|
|
600
|
+
this._addItemListeners.push(handler);
|
|
601
|
+
return () => {
|
|
602
|
+
this._addItemListeners.splice(this._addItemListeners.indexOf(handler), 1);
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
static onRemoveRequestHandler(handler) {
|
|
606
|
+
this._removeItemListeners.push(handler);
|
|
607
|
+
return () => {
|
|
608
|
+
this._removeItemListeners.splice(this._removeItemListeners.indexOf(handler), 1);
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
static addRequestHandler(handlerType, config) {
|
|
612
|
+
if (!this._requestHandlersMap.has(handlerType)) {
|
|
613
|
+
this._requestHandlersMap.set(handlerType, config);
|
|
614
|
+
for (const listener of this._addItemListeners) {
|
|
615
|
+
listener(handlerType, config);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
static removeRequestHandler(handlerType) {
|
|
620
|
+
const config = this._requestHandlersMap.get(handlerType);
|
|
621
|
+
if (config) {
|
|
622
|
+
this._requestHandlersMap.delete(handlerType);
|
|
623
|
+
for (const listener of this._removeItemListeners) {
|
|
624
|
+
listener(handlerType, config);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
InternalRequestHandlerRegistryType._addItemListeners = [];
|
|
630
|
+
InternalRequestHandlerRegistryType._removeItemListeners = [];
|
|
631
|
+
InternalRequestHandlerRegistryType._requestHandlersMap = new Map();
|
|
632
|
+
const global$1 = window;
|
|
633
|
+
(_a = global$1.creatio) !== null && _a !== void 0 ? _a : (global$1.creatio = {});
|
|
634
|
+
if (!global$1.creatio.requestHandlerRegistry) {
|
|
635
|
+
Object.defineProperty(global$1.creatio, 'requestHandlerRegistry', {
|
|
636
|
+
get: () => InternalRequestHandlerRegistryType,
|
|
637
|
+
configurable: false,
|
|
638
|
+
});
|
|
639
|
+
}
|
|
1620
640
|
/**
|
|
1621
641
|
* @internal
|
|
1622
642
|
*/
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
DataSchemaAttributeType["OwnAttribute"] = "Own";
|
|
1626
|
-
DataSchemaAttributeType["ForwardReferenceAttribute"] = "ForwardReference";
|
|
1627
|
-
DataSchemaAttributeType["BackReferenceAttribute"] = "BackReference";
|
|
1628
|
-
DataSchemaAttributeType["AggregationAttribute"] = "Aggregation";
|
|
1629
|
-
DataSchemaAttributeType["FunctionAttribute"] = "Function";
|
|
1630
|
-
})(DataSchemaAttributeType || (DataSchemaAttributeType = {}));
|
|
643
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
644
|
+
const InternalRequestHandlerRegistry = InternalRequestHandlerRegistryType;
|
|
1631
645
|
/**
|
|
1632
646
|
* @internal
|
|
1633
647
|
*/
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
648
|
+
class RequestHandlerRegistryService {
|
|
649
|
+
/**
|
|
650
|
+
* Register request handler class.
|
|
651
|
+
* @param config Request handler registration config.
|
|
652
|
+
* @param type Request handler type.
|
|
653
|
+
*/
|
|
654
|
+
static register(config, type) {
|
|
655
|
+
const requestType = config.requestType;
|
|
656
|
+
const requestHandlerType = config.type;
|
|
657
|
+
if (!requestType) {
|
|
658
|
+
throw new Error(`Error when register ${requestHandlerType}. Request type not specified.`);
|
|
659
|
+
}
|
|
660
|
+
const requestHandlerMapValue = {
|
|
661
|
+
instanceType: type,
|
|
662
|
+
instanceConfig: config,
|
|
663
|
+
};
|
|
664
|
+
RequestHandlerRegistryService._internalRegistry.addRequestHandler(requestHandlerType, requestHandlerMapValue);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
RequestHandlerRegistryService._internalRegistry = global$1.creatio.requestHandlerRegistry;
|
|
1640
668
|
|
|
1641
669
|
/**
|
|
1642
670
|
* @internal
|
|
1643
671
|
*/
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
672
|
+
class RequestRegistryService {
|
|
673
|
+
static get requestsRegistrationInfos() {
|
|
674
|
+
return this._requestsRegistrationInfos;
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Registers a specified request class.
|
|
678
|
+
* @param config Request registration config.
|
|
679
|
+
* @param type Request type.
|
|
680
|
+
*/
|
|
681
|
+
static register(config, type) {
|
|
682
|
+
const requestType = config.type;
|
|
683
|
+
// TODO RND-21723
|
|
684
|
+
RequestRegistryService._requestsMap.set(requestType, type);
|
|
685
|
+
RequestRegistryService._requestsRegistrationInfos.set(requestType, config);
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Creates request instance by specified registered request type.
|
|
689
|
+
* @param type Request type.
|
|
690
|
+
* @returns The instance of registered request.
|
|
691
|
+
*/
|
|
692
|
+
static get(type) {
|
|
693
|
+
const requestInstanceConstructor = RequestRegistryService._requestsMap.get(type);
|
|
694
|
+
checkIfTypeRegistered(type, requestInstanceConstructor);
|
|
695
|
+
return requestInstanceConstructor && new requestInstanceConstructor();
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
RequestRegistryService._requestsMap = new Map();
|
|
699
|
+
RequestRegistryService._requestsRegistrationInfos = new Map();
|
|
1652
700
|
|
|
1653
701
|
/**
|
|
1654
702
|
* @internal
|
|
1655
703
|
*/
|
|
1656
|
-
class
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
const scopesOrderEntries = [...((_a = this._request.scopes) !== null && _a !== void 0 ? _a : [])].reverse().map((scope, index) => [scope, index]);
|
|
1661
|
-
this._scopesOrder = Object.fromEntries(scopesOrderEntries);
|
|
1662
|
-
}
|
|
1663
|
-
_getOrderByScopes(handler) {
|
|
1664
|
-
if (!handler.scopes) {
|
|
1665
|
-
return Number.MAX_VALUE;
|
|
704
|
+
class ConverterRegistry extends ɵBaseRegistry {
|
|
705
|
+
static get(type) {
|
|
706
|
+
if (!this.store.typeInfos.has(type)) {
|
|
707
|
+
throw new Error(`'${type}' converter doesn't exist`);
|
|
1666
708
|
}
|
|
1667
|
-
|
|
1668
|
-
return Math.min(...scopesOrder);
|
|
709
|
+
return this.store.typeInfos.get(type);
|
|
1669
710
|
}
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
711
|
+
static register(item) {
|
|
712
|
+
checkTypeNameFormat(item.type, 'ConverterTypeName');
|
|
713
|
+
checkCrtTypeNamePascalCase(item.type);
|
|
714
|
+
// TODO RND-21723
|
|
715
|
+
this.store.typeInfos.set(item.type, item);
|
|
1675
716
|
}
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
const bScopeOrder = this._getOrderByScopes(b);
|
|
1679
|
-
let diff = aScopeOrder - bScopeOrder;
|
|
1680
|
-
if (diff) {
|
|
1681
|
-
return diff;
|
|
1682
|
-
}
|
|
1683
|
-
const aPkgTopologyOrder = this._getOrderByPkgTopology(a);
|
|
1684
|
-
const bPkgTopologyOrder = this._getOrderByPkgTopology(b);
|
|
1685
|
-
diff = aPkgTopologyOrder - bPkgTopologyOrder;
|
|
1686
|
-
if (diff) {
|
|
1687
|
-
return diff;
|
|
1688
|
-
}
|
|
1689
|
-
diff = a.source.type - b.source.type;
|
|
1690
|
-
return diff;
|
|
717
|
+
static clear() {
|
|
718
|
+
this.store.typeInfos.clear();
|
|
1691
719
|
}
|
|
1692
720
|
}
|
|
721
|
+
ConverterRegistry.registryKey = 'ConverterRegistry';
|
|
1693
722
|
|
|
1694
|
-
const moduleMetadataKey = 'module';
|
|
1695
|
-
const viewElementMetadataKey = 'viewElement';
|
|
1696
|
-
const interfaceDesignerItemMetadataKey = 'interfaceDesignerItem';
|
|
1697
|
-
const requestHandlerMetadataKey = 'requestHandler';
|
|
1698
|
-
const designTimeViewElementMetadataKey = 'designTimeViewElement';
|
|
1699
|
-
const validatorMetadataKey = 'validator';
|
|
1700
|
-
const converterMetadataKey = 'converter';
|
|
1701
723
|
/**
|
|
1702
724
|
* @internal
|
|
1703
725
|
*/
|
|
1704
|
-
|
|
1705
|
-
Reflect.defineMetadata(moduleMetadataKey, metadata, type);
|
|
1706
|
-
}
|
|
726
|
+
const viewElementRegistryKey = 'ViewElementRegistry';
|
|
1707
727
|
/**
|
|
1708
728
|
* @internal
|
|
1709
729
|
*/
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
730
|
+
class ViewElementRegistry extends ɵBaseRegistry {
|
|
731
|
+
static validate(config) {
|
|
732
|
+
checkTypeNameFormat(config.type, 'ViewElementTypeName');
|
|
733
|
+
checkOnlyOneRegistration(config.type, config, ViewElementRegistry.viewElements);
|
|
734
|
+
}
|
|
735
|
+
static get viewElements() {
|
|
736
|
+
return this.store.typeInfos;
|
|
737
|
+
}
|
|
738
|
+
static register(config) {
|
|
739
|
+
this.viewElements.set(config.type, config);
|
|
740
|
+
}
|
|
741
|
+
static getFormControlRelatesAttribute(type) {
|
|
742
|
+
var _a;
|
|
743
|
+
const config = this.store.typeInfos.get(type);
|
|
744
|
+
return (config && 'formControlConfig' in config && ((_a = config.formControlConfig) === null || _a === void 0 ? void 0 : _a.relatesTo)) || null;
|
|
1714
745
|
}
|
|
1715
|
-
return metadata;
|
|
1716
746
|
}
|
|
747
|
+
ViewElementRegistry.registryKey = viewElementRegistryKey;
|
|
748
|
+
|
|
1717
749
|
/**
|
|
1718
750
|
* @internal
|
|
1719
751
|
*/
|
|
1720
|
-
|
|
1721
|
-
Reflect.defineMetadata(viewElementMetadataKey, metadata, type);
|
|
1722
|
-
}
|
|
752
|
+
const interfaceDesignerItemRegistryKey = 'InterfaceDesignerItemRegistry';
|
|
1723
753
|
/**
|
|
1724
754
|
* @internal
|
|
1725
755
|
*/
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
756
|
+
class InterfaceDesignerItemRegistry extends ɵBaseRegistry {
|
|
757
|
+
static validate(config) {
|
|
758
|
+
checkTypeNameFormat(config.type, 'InterfaceDesignerItemTypeName');
|
|
759
|
+
checkCrtTypeNamePascalCase(config.type);
|
|
760
|
+
checkOnlyOneRegistration(config.type, config, this.interfaceDesignerItemRegistrationInfos);
|
|
761
|
+
}
|
|
762
|
+
static register(config) {
|
|
763
|
+
this.interfaceDesignerItemRegistrationInfos.set(config.type, config);
|
|
764
|
+
}
|
|
765
|
+
static get interfaceDesignerItemRegistrationInfos() {
|
|
766
|
+
return this.store.typeInfos;
|
|
767
|
+
}
|
|
768
|
+
static get(type) {
|
|
769
|
+
return this.interfaceDesignerItemRegistrationInfos.get(type);
|
|
1730
770
|
}
|
|
1731
|
-
return metadata;
|
|
1732
771
|
}
|
|
772
|
+
InterfaceDesignerItemRegistry.registryKey = interfaceDesignerItemRegistryKey;
|
|
773
|
+
|
|
774
|
+
const global = window;
|
|
1733
775
|
/**
|
|
1734
776
|
* @internal
|
|
1735
777
|
*/
|
|
1736
|
-
|
|
1737
|
-
|
|
778
|
+
class BootstrapNotifier {
|
|
779
|
+
static get instance() {
|
|
780
|
+
if (!global.__crtModuleBootstrapNotifier) {
|
|
781
|
+
global.__crtModuleBootstrapNotifier = new BootstrapNotifier();
|
|
782
|
+
}
|
|
783
|
+
return global.__crtModuleBootstrapNotifier;
|
|
784
|
+
}
|
|
785
|
+
constructor() {
|
|
786
|
+
this._subscribers = new Set();
|
|
787
|
+
// private constructor prevent instantiation via 'new' keyword
|
|
788
|
+
}
|
|
789
|
+
notify(moduleType) {
|
|
790
|
+
for (const subscriber of this._subscribers.values()) {
|
|
791
|
+
subscriber(moduleType);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
subscribe(subscriber) {
|
|
795
|
+
this._subscribers.add(subscriber);
|
|
796
|
+
return {
|
|
797
|
+
unsubscribe: () => this._subscribers.delete(subscriber),
|
|
798
|
+
};
|
|
799
|
+
}
|
|
1738
800
|
}
|
|
801
|
+
|
|
1739
802
|
/**
|
|
1740
803
|
* @internal
|
|
1741
804
|
*/
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
805
|
+
class HandlerChainServicesRegistry extends ɵBaseRegistry {
|
|
806
|
+
static validate({ requestType }) {
|
|
807
|
+
checkTypeNameFormat(requestType, this.registryKey);
|
|
808
|
+
checkCrtTypeNamePascalCase(requestType);
|
|
809
|
+
this.checkUniqueRequestType(requestType);
|
|
810
|
+
}
|
|
811
|
+
static checkUniqueRequestType(requestType) {
|
|
812
|
+
if (this.services.get(requestType)) {
|
|
813
|
+
throw new Error(`${requestType} already registered`);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
static register(config) {
|
|
817
|
+
this.validate(config);
|
|
818
|
+
this.services.set(config.requestType, config);
|
|
819
|
+
}
|
|
820
|
+
static get services() {
|
|
821
|
+
return this.store.typeInfos;
|
|
1746
822
|
}
|
|
1747
|
-
return metadata;
|
|
1748
823
|
}
|
|
824
|
+
HandlerChainServicesRegistry.registryKey = 'HandlerChainServicesRegistry';
|
|
825
|
+
|
|
1749
826
|
/**
|
|
1750
827
|
* @internal
|
|
1751
828
|
*/
|
|
1752
|
-
|
|
1753
|
-
Reflect.defineMetadata(converterMetadataKey, metadata, type);
|
|
1754
|
-
}
|
|
829
|
+
const designTimeViewElementRegistryKey = 'DesignTimeViewElementRegistry';
|
|
1755
830
|
/**
|
|
1756
831
|
* @internal
|
|
1757
832
|
*/
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
833
|
+
class DesignTimeViewElementRegistry extends ɵBaseRegistry {
|
|
834
|
+
static validate(config) {
|
|
835
|
+
checkTypeNameFormat(config.type, 'DesignTimeViewElementRegistryItemTypeName');
|
|
836
|
+
checkCrtTypeNamePascalCase(config.type);
|
|
837
|
+
checkOnlyOneRegistration(config.type, config, this.infos);
|
|
838
|
+
}
|
|
839
|
+
static register(config) {
|
|
840
|
+
this.infos.set(config.type, config);
|
|
841
|
+
}
|
|
842
|
+
static getByOverriddenType(type) {
|
|
843
|
+
const item = Array.from(this.infos).find(([_, info]) => info.overrideType === type);
|
|
844
|
+
if (item) {
|
|
845
|
+
return item[1];
|
|
846
|
+
}
|
|
847
|
+
return null;
|
|
848
|
+
}
|
|
849
|
+
static get infos() {
|
|
850
|
+
return this.store.typeInfos;
|
|
1762
851
|
}
|
|
1763
|
-
return metadata;
|
|
1764
852
|
}
|
|
853
|
+
DesignTimeViewElementRegistry.registryKey = designTimeViewElementRegistryKey;
|
|
854
|
+
|
|
1765
855
|
/**
|
|
1766
856
|
* @internal
|
|
1767
857
|
*/
|
|
1768
|
-
|
|
1769
|
-
Reflect.defineMetadata(interfaceDesignerItemMetadataKey, metadata, type);
|
|
858
|
+
class ValidatorMapValue {
|
|
1770
859
|
}
|
|
1771
860
|
/**
|
|
1772
861
|
* @internal
|
|
1773
862
|
*/
|
|
1774
|
-
|
|
1775
|
-
const metadata = Reflect.getOwnMetadata(interfaceDesignerItemMetadataKey, type);
|
|
1776
|
-
if (!metadata) {
|
|
1777
|
-
throw new Error(`Interface designer item metadata was not found on '${type.name}' class`);
|
|
1778
|
-
}
|
|
1779
|
-
return metadata;
|
|
1780
|
-
}
|
|
863
|
+
const validatorRegistryKey = 'ValidatorRegistry';
|
|
1781
864
|
/**
|
|
1782
865
|
* @internal
|
|
1783
866
|
*/
|
|
1784
|
-
|
|
1785
|
-
|
|
867
|
+
class ValidatorRegistry extends ɵBaseRegistry {
|
|
868
|
+
static _has(configType, type) {
|
|
869
|
+
var _a;
|
|
870
|
+
return ValidatorRegistry.items.has(configType) && ((_a = ValidatorRegistry.items.get(configType)) === null || _a === void 0 ? void 0 : _a.typeRef) !== type;
|
|
871
|
+
}
|
|
872
|
+
static validate(config) {
|
|
873
|
+
checkTypeNameFormat(config.type, 'ValidatorTypeName');
|
|
874
|
+
if (ValidatorRegistry._has(config.type, config.typeRef)) {
|
|
875
|
+
throw new Error(`Error when register ${config.type}. Element with this type has already exist`);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
static get items() {
|
|
879
|
+
return this.store.typeInfos;
|
|
880
|
+
}
|
|
881
|
+
static register(config) {
|
|
882
|
+
this.items.set(config.type, config);
|
|
883
|
+
}
|
|
1786
884
|
}
|
|
885
|
+
ValidatorRegistry.registryKey = validatorRegistryKey;
|
|
886
|
+
|
|
1787
887
|
/**
|
|
1788
888
|
* @internal
|
|
889
|
+
* @dontChange
|
|
1789
890
|
*/
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
891
|
+
class RemoteEntriesRegistry extends ɵBaseRegistry {
|
|
892
|
+
/**
|
|
893
|
+
* @dontChange
|
|
894
|
+
*/
|
|
895
|
+
static get items() {
|
|
896
|
+
return this.store.typeInfos;
|
|
1794
897
|
}
|
|
1795
|
-
return metadata;
|
|
1796
898
|
}
|
|
899
|
+
/**
|
|
900
|
+
* @dontChange
|
|
901
|
+
*/
|
|
902
|
+
RemoteEntriesRegistry.registryKey = 'remotes';
|
|
903
|
+
|
|
1797
904
|
/**
|
|
1798
905
|
* @internal
|
|
1799
906
|
*/
|
|
1800
|
-
function
|
|
1801
|
-
|
|
907
|
+
function isComponentPropertyBindable(viewConfigType, componentProperty) {
|
|
908
|
+
var _a;
|
|
909
|
+
const componentConfig = ViewElementRegistry.viewElements.get(viewConfigType);
|
|
910
|
+
if (!(componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.inputs)) {
|
|
911
|
+
return false;
|
|
912
|
+
}
|
|
913
|
+
return !!((_a = componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.inputs[componentProperty]) === null || _a === void 0 ? void 0 : _a.propertyBindable);
|
|
1802
914
|
}
|
|
915
|
+
|
|
916
|
+
const moduleMetadataKey = 'module';
|
|
917
|
+
const viewElementMetadataKey = 'viewElement';
|
|
918
|
+
const interfaceDesignerItemMetadataKey = 'interfaceDesignerItem';
|
|
919
|
+
const requestHandlerMetadataKey = 'requestHandler';
|
|
920
|
+
const designTimeViewElementMetadataKey = 'designTimeViewElement';
|
|
921
|
+
const validatorMetadataKey = 'validator';
|
|
922
|
+
const converterMetadataKey = 'converter';
|
|
1803
923
|
/**
|
|
1804
924
|
* @internal
|
|
1805
925
|
*/
|
|
1806
|
-
function
|
|
1807
|
-
Reflect.defineMetadata(
|
|
926
|
+
function setModuleMetadata(metadata, type) {
|
|
927
|
+
Reflect.defineMetadata(moduleMetadataKey, metadata, type);
|
|
1808
928
|
}
|
|
1809
929
|
/**
|
|
1810
930
|
* @internal
|
|
1811
931
|
*/
|
|
1812
|
-
function
|
|
1813
|
-
const metadata = Reflect.getMetadata(
|
|
932
|
+
function getModuleMetadata(type) {
|
|
933
|
+
const metadata = Reflect.getMetadata(moduleMetadataKey, type);
|
|
1814
934
|
if (!metadata) {
|
|
1815
|
-
throw new Error(`
|
|
935
|
+
throw new Error(`Module metadata was not found on '${type.name}' class`);
|
|
1816
936
|
}
|
|
1817
937
|
return metadata;
|
|
1818
938
|
}
|
|
1819
939
|
/**
|
|
1820
940
|
* @internal
|
|
1821
941
|
*/
|
|
1822
|
-
function
|
|
1823
|
-
|
|
1824
|
-
if (!requestType) {
|
|
1825
|
-
throw new Error(`requestType was not found on '${typeRef.name}' class`);
|
|
1826
|
-
}
|
|
1827
|
-
return { requestType, typeRef };
|
|
942
|
+
function setViewElementMetadata(metadata, type) {
|
|
943
|
+
Reflect.defineMetadata(viewElementMetadataKey, metadata, type);
|
|
1828
944
|
}
|
|
1829
945
|
/**
|
|
1830
946
|
* @internal
|
|
1831
947
|
*/
|
|
1832
|
-
function
|
|
1833
|
-
const
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
}));
|
|
948
|
+
function getViewElementMetadata(type) {
|
|
949
|
+
const metadata = Reflect.getMetadata(viewElementMetadataKey, type);
|
|
950
|
+
if (!metadata) {
|
|
951
|
+
throw new Error(`View element metadata was not found on '${type.name}' class`);
|
|
952
|
+
}
|
|
953
|
+
return metadata;
|
|
1839
954
|
}
|
|
1840
955
|
/**
|
|
1841
956
|
* @internal
|
|
1842
957
|
*/
|
|
1843
|
-
function
|
|
1844
|
-
|
|
1845
|
-
const crtOutputKeys = keys.filter((x) => x.startsWith(crtOutputPrefix));
|
|
1846
|
-
return Object.fromEntries(crtOutputKeys.map((key) => {
|
|
1847
|
-
const data = Reflect.getMetadata(key, type);
|
|
1848
|
-
return [key.replace(crtOutputPrefix, ''), data];
|
|
1849
|
-
}));
|
|
958
|
+
function setValidatorMetadata(metadata, type) {
|
|
959
|
+
Reflect.defineMetadata(validatorMetadataKey, metadata, type);
|
|
1850
960
|
}
|
|
1851
961
|
/**
|
|
1852
962
|
* @internal
|
|
1853
963
|
*/
|
|
1854
|
-
function
|
|
1855
|
-
const
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
}));
|
|
964
|
+
function getValidatorMetadata(type) {
|
|
965
|
+
const metadata = Reflect.getOwnMetadata(validatorMetadataKey, type);
|
|
966
|
+
if (!metadata) {
|
|
967
|
+
throw new Error(`Validator metadata was not found on '${type.name}' class`);
|
|
968
|
+
}
|
|
969
|
+
return metadata;
|
|
1861
970
|
}
|
|
1862
971
|
/**
|
|
1863
972
|
* @internal
|
|
1864
973
|
*/
|
|
1865
|
-
function
|
|
1866
|
-
|
|
1867
|
-
const crtInjectKeys = keys.filter((x) => x.startsWith(crtInjectPrefix));
|
|
1868
|
-
return Object.fromEntries(crtInjectKeys.map((key) => {
|
|
1869
|
-
const index = Number(key.replace(crtInjectPrefix, ''));
|
|
1870
|
-
const data = Reflect.getMetadata(key, type);
|
|
1871
|
-
return [index, data];
|
|
1872
|
-
}));
|
|
974
|
+
function setConverterMetadata(metadata, type) {
|
|
975
|
+
Reflect.defineMetadata(converterMetadataKey, metadata, type);
|
|
1873
976
|
}
|
|
1874
977
|
/**
|
|
1875
978
|
* @internal
|
|
1876
979
|
*/
|
|
1877
|
-
function
|
|
1878
|
-
const
|
|
1879
|
-
|
|
980
|
+
function getConverterMetadata(type) {
|
|
981
|
+
const metadata = Reflect.getOwnMetadata(converterMetadataKey, type);
|
|
982
|
+
if (!metadata) {
|
|
983
|
+
throw new Error(`Converter metadata was not found on '${type.name}' class`);
|
|
984
|
+
}
|
|
985
|
+
return metadata;
|
|
1880
986
|
}
|
|
1881
987
|
/**
|
|
1882
988
|
* @internal
|
|
1883
989
|
*/
|
|
1884
|
-
function
|
|
1885
|
-
|
|
1886
|
-
if (!paramTypes) {
|
|
1887
|
-
if (type.length > 0) {
|
|
1888
|
-
throw new Error(`Dependency Injection error. Cannot read dependencies of class '${type.name}'. ` +
|
|
1889
|
-
`Please make sure class '${type.name}' has decorator and ` +
|
|
1890
|
-
"'emitDecoratorMetadata' option is enabled in your 'tsconfig.json' file.");
|
|
1891
|
-
}
|
|
1892
|
-
const parentType = getParentType(type);
|
|
1893
|
-
return parentType && parentType !== Object ? getTypeDependencies(parentType) : [];
|
|
1894
|
-
}
|
|
1895
|
-
const crtInjectMetadata = getCrtInjectMetadata(type);
|
|
1896
|
-
Object.entries(crtInjectMetadata).forEach(([index, token]) => (paramTypes[index] = token));
|
|
1897
|
-
return paramTypes;
|
|
990
|
+
function setInterfaceDesignerItemMetadata(metadata, type) {
|
|
991
|
+
Reflect.defineMetadata(interfaceDesignerItemMetadataKey, metadata, type);
|
|
1898
992
|
}
|
|
1899
|
-
|
|
1900
993
|
/**
|
|
1901
994
|
* @internal
|
|
1902
995
|
*/
|
|
1903
|
-
function
|
|
1904
|
-
const
|
|
1905
|
-
if (
|
|
1906
|
-
|
|
1907
|
-
throw new Error(`Cannot resolve dependencies for ${type.name}. ` +
|
|
1908
|
-
"Please provide 'resolveDependency' bootstrap option");
|
|
1909
|
-
}
|
|
1910
|
-
const depInstances = deps.map(resolveDependency);
|
|
1911
|
-
return new type(...depInstances);
|
|
996
|
+
function getInterfaceDesignerItemMetadata(type) {
|
|
997
|
+
const metadata = Reflect.getOwnMetadata(interfaceDesignerItemMetadataKey, type);
|
|
998
|
+
if (!metadata) {
|
|
999
|
+
throw new Error(`Interface designer item metadata was not found on '${type.name}' class`);
|
|
1912
1000
|
}
|
|
1913
|
-
return
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
/**
|
|
1917
|
-
* @public
|
|
1918
|
-
*/
|
|
1919
|
-
class CrtInputRegistrationConfig {
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1922
|
-
/**
|
|
1923
|
-
* @public
|
|
1924
|
-
* @class BaseRequest
|
|
1925
|
-
* @describe Base definition of request.
|
|
1926
|
-
* @template TEvent
|
|
1927
|
-
*/
|
|
1928
|
-
class BaseRequest {
|
|
1001
|
+
return metadata;
|
|
1929
1002
|
}
|
|
1930
|
-
|
|
1931
1003
|
/**
|
|
1932
|
-
* @
|
|
1933
|
-
* @class DataRequest
|
|
1934
|
-
* @description Definition of data source request.
|
|
1935
|
-
* @extends {BaseRequest} {@link BaseRequest}
|
|
1936
|
-
* @property {string} dataSourceName - name of assigned data source.
|
|
1004
|
+
* @internal
|
|
1937
1005
|
*/
|
|
1938
|
-
|
|
1006
|
+
function setDesignTimeViewElementMetadata(metadata, type) {
|
|
1007
|
+
Reflect.defineMetadata(designTimeViewElementMetadataKey, metadata, type);
|
|
1939
1008
|
}
|
|
1940
|
-
|
|
1941
1009
|
/**
|
|
1942
|
-
* @
|
|
1943
|
-
* @description Abstract Base Validator class for designing custom validators.
|
|
1944
|
-
* @example
|
|
1945
|
-
* @CrtValidator({
|
|
1946
|
-
* type: 'crt.Required',
|
|
1947
|
-
* })
|
|
1948
|
-
* export class RequiredValidator extends BaseValidator {
|
|
1949
|
-
* protected override async = false;
|
|
1950
|
-
* public validate(controlState: CrtControlState, params?: ValidatorParametersValues): CrtValidationErrors | null {
|
|
1951
|
-
* Implementation here...
|
|
1952
|
-
* }
|
|
1953
|
-
* }
|
|
1010
|
+
* @internal
|
|
1954
1011
|
*/
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
get isAsync() {
|
|
1960
|
-
return this.async;
|
|
1961
|
-
}
|
|
1962
|
-
/**
|
|
1963
|
-
* @description Function used for validation
|
|
1964
|
-
*/
|
|
1965
|
-
get validateFn() {
|
|
1966
|
-
return this.validate.bind(this);
|
|
1967
|
-
}
|
|
1968
|
-
/**
|
|
1969
|
-
* @internal
|
|
1970
|
-
*/
|
|
1971
|
-
static [Symbol.hasInstance](instance) {
|
|
1972
|
-
var _a;
|
|
1973
|
-
return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === BaseValidator._instanceOfKey;
|
|
1012
|
+
function getDesignTimeViewElementMetadata(type) {
|
|
1013
|
+
const metadata = Reflect.getOwnMetadata(designTimeViewElementMetadataKey, type);
|
|
1014
|
+
if (!metadata) {
|
|
1015
|
+
throw new Error(`Design time view element metadata was not found on '${type.name}' class`);
|
|
1974
1016
|
}
|
|
1017
|
+
return metadata;
|
|
1975
1018
|
}
|
|
1976
1019
|
/**
|
|
1977
1020
|
* @internal
|
|
1978
|
-
* @dontChange
|
|
1979
|
-
*/
|
|
1980
|
-
BaseValidator._instanceOfKey = 'devkit_BaseValidator';
|
|
1981
|
-
|
|
1982
|
-
/**
|
|
1983
|
-
* @public
|
|
1984
1021
|
*/
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
this.key = key;
|
|
1988
|
-
}
|
|
1989
|
-
/**
|
|
1990
|
-
* @internal
|
|
1991
|
-
*/
|
|
1992
|
-
static [Symbol.hasInstance](instance) {
|
|
1993
|
-
var _a;
|
|
1994
|
-
return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === LocalizableValue._instanceOfKey;
|
|
1995
|
-
}
|
|
1022
|
+
function hasInterfaceDesignerItemMetadata(type) {
|
|
1023
|
+
return Reflect.hasOwnMetadata(interfaceDesignerItemMetadataKey, type);
|
|
1996
1024
|
}
|
|
1997
1025
|
/**
|
|
1998
1026
|
* @internal
|
|
1999
|
-
* @dontChange
|
|
2000
1027
|
*/
|
|
2001
|
-
|
|
2002
|
-
|
|
1028
|
+
function setRequestHandlerMetadata(metadata, type) {
|
|
1029
|
+
Reflect.defineMetadata(requestHandlerMetadataKey, metadata, type);
|
|
1030
|
+
}
|
|
2003
1031
|
/**
|
|
2004
1032
|
* @internal
|
|
2005
1033
|
*/
|
|
2006
|
-
function
|
|
2007
|
-
const
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
if (localizableEntries.length === 0) {
|
|
2011
|
-
return obj;
|
|
2012
|
-
}
|
|
2013
|
-
const localized = cloneDeep(obj);
|
|
2014
|
-
if (!localizeMetadata) {
|
|
2015
|
-
console.error("Unable to localize metadata. 'localizeMetadata' bootstrap option was not provided.");
|
|
1034
|
+
function getRequestHandlerMetadata(type) {
|
|
1035
|
+
const metadata = Reflect.getMetadata(requestHandlerMetadataKey, type);
|
|
1036
|
+
if (!metadata) {
|
|
1037
|
+
throw new Error(`Request handler metadata was not found on '${type.name}' class`);
|
|
2016
1038
|
}
|
|
2017
|
-
|
|
2018
|
-
var _a;
|
|
2019
|
-
const localizedValue = (_a = localizeMetadata === null || localizeMetadata === void 0 ? void 0 : localizeMetadata(value.key)) !== null && _a !== void 0 ? _a : value.key;
|
|
2020
|
-
set(localized, path, localizedValue);
|
|
2021
|
-
});
|
|
2022
|
-
return localized;
|
|
1039
|
+
return metadata;
|
|
2023
1040
|
}
|
|
2024
|
-
|
|
2025
1041
|
/**
|
|
2026
1042
|
* @internal
|
|
2027
1043
|
*/
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
this._handlersScopesByContextId = new Map();
|
|
2033
|
-
this.handlerChain$ = {
|
|
2034
|
-
process: (request) => __awaiter(this, void 0, void 0, function* () {
|
|
2035
|
-
const handler = this._getHandler(request);
|
|
2036
|
-
return handler === null || handler === void 0 ? void 0 : handler.handle(request);
|
|
2037
|
-
}),
|
|
2038
|
-
register: (info) => {
|
|
2039
|
-
this._handlersCache.delete(info.requestType);
|
|
2040
|
-
this._handlers.push(info);
|
|
2041
|
-
return () => {
|
|
2042
|
-
const index = this._handlers.indexOf(info);
|
|
2043
|
-
if (index > -1) {
|
|
2044
|
-
this._handlers.splice(index, 1);
|
|
2045
|
-
this._handlersCache.delete(info.requestType);
|
|
2046
|
-
}
|
|
2047
|
-
else {
|
|
2048
|
-
console.warn(`${info === null || info === void 0 ? void 0 : info.requestType} not found to unsubscribe`);
|
|
2049
|
-
}
|
|
2050
|
-
};
|
|
2051
|
-
},
|
|
2052
|
-
};
|
|
2053
|
-
}
|
|
2054
|
-
clearContextedHandlersCache(contextId) {
|
|
2055
|
-
var _a;
|
|
2056
|
-
const configs = (_a = this._handlersScopesByContextId.get(contextId)) !== null && _a !== void 0 ? _a : [];
|
|
2057
|
-
return configs.every(({ requestType, scope }) => { var _a; return (_a = this._handlersCache.get(requestType)) === null || _a === void 0 ? void 0 : _a.delete(scope); });
|
|
2058
|
-
}
|
|
2059
|
-
_getHandler(request) {
|
|
2060
|
-
return this._hasCacheHandler(request) ? this._getCacheHandler(request) : this._buildHandlersChain(request);
|
|
2061
|
-
}
|
|
2062
|
-
_getCacheHandler(request) {
|
|
2063
|
-
const map = this._handlersCache.get(request.type);
|
|
2064
|
-
const key = this._getCacheScopesKey(request);
|
|
2065
|
-
return map.get(key);
|
|
2066
|
-
}
|
|
2067
|
-
_hasCacheHandler(request) {
|
|
2068
|
-
const map = this._handlersCache.get(request.type);
|
|
2069
|
-
const key = this._getCacheScopesKey(request);
|
|
2070
|
-
return map && map.has(key);
|
|
2071
|
-
}
|
|
2072
|
-
_getCacheScopesKey(request) {
|
|
2073
|
-
var _a, _b;
|
|
2074
|
-
const injectionContextKey = (_b = (_a = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context)) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '';
|
|
2075
|
-
return (request.scopes || ['']).join('_').concat(injectionContextKey);
|
|
2076
|
-
}
|
|
2077
|
-
_getInjectionContext(viewModel) {
|
|
2078
|
-
return (viewModel === null || viewModel === void 0 ? void 0 : viewModel['_injectionContext']) || ((viewModel === null || viewModel === void 0 ? void 0 : viewModel.parent) && this._getInjectionContext(viewModel.parent));
|
|
2079
|
-
}
|
|
2080
|
-
_setContextedScopes(request, scope) {
|
|
2081
|
-
var _a;
|
|
2082
|
-
const injectionContext = (_a = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context)) === null || _a === void 0 ? void 0 : _a.id;
|
|
2083
|
-
const configs = this._handlersScopesByContextId.has(injectionContext)
|
|
2084
|
-
? this._handlersScopesByContextId.get(injectionContext)
|
|
2085
|
-
: [];
|
|
2086
|
-
configs.push({ requestType: request.type, scope });
|
|
2087
|
-
this._handlersScopesByContextId.set(injectionContext, configs);
|
|
2088
|
-
}
|
|
2089
|
-
_setCacheHandler(request, handler) {
|
|
2090
|
-
var _a;
|
|
2091
|
-
const map = this._handlersCache.has(request.type)
|
|
2092
|
-
? this._handlersCache.get(request.type)
|
|
2093
|
-
: new Map();
|
|
2094
|
-
const key = this._getCacheScopesKey(request);
|
|
2095
|
-
map.set(key, handler);
|
|
2096
|
-
if ((_a = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context)) === null || _a === void 0 ? void 0 : _a.id) {
|
|
2097
|
-
this._setContextedScopes(request, key);
|
|
2098
|
-
}
|
|
2099
|
-
this._handlersCache.set(request.type, map);
|
|
2100
|
-
}
|
|
2101
|
-
_isRequestHandler(handler) {
|
|
2102
|
-
return (typeof handler.handle === 'function' &&
|
|
2103
|
-
typeof handler.setNext === 'function');
|
|
2104
|
-
}
|
|
2105
|
-
_checkHandlerInstanceOf(handler) {
|
|
2106
|
-
if (!this._isRequestHandler(handler)) {
|
|
2107
|
-
throw new Error('Handler should implement "BaseRequestHandler"');
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
_buildHandlersChain(request) {
|
|
2111
|
-
const handlers = this._handlers.filter((h) => {
|
|
2112
|
-
var _a;
|
|
2113
|
-
if (h.requestType !== request.type) {
|
|
2114
|
-
return false;
|
|
2115
|
-
}
|
|
2116
|
-
if (!((_a = h.scopes) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
2117
|
-
return true;
|
|
2118
|
-
}
|
|
2119
|
-
return h.scopes.some((s) => { var _a; return (_a = request.scopes) === null || _a === void 0 ? void 0 : _a.includes(s); });
|
|
2120
|
-
});
|
|
2121
|
-
const comparer = new HandlersOrderComparer(request);
|
|
2122
|
-
handlers.sort((a, b) => comparer.compare(a, b));
|
|
2123
|
-
const handlerInstances = handlers.map((handlerConfig) => {
|
|
2124
|
-
const injectionContext = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context);
|
|
2125
|
-
return handlerConfig.createHandler(injectionContext);
|
|
2126
|
-
});
|
|
2127
|
-
handlerInstances.forEach((handler) => this._checkHandlerInstanceOf(handler));
|
|
2128
|
-
this._joinHandlersInChain(handlerInstances);
|
|
2129
|
-
const result = handlerInstances[0];
|
|
2130
|
-
this._setCacheHandler(request, result);
|
|
2131
|
-
return result;
|
|
2132
|
-
}
|
|
2133
|
-
_joinHandlersInChain(handlers) {
|
|
2134
|
-
for (let index = 0; index < handlers.length - 1; index++) {
|
|
2135
|
-
try {
|
|
2136
|
-
handlers[index].setNext(handlers[index + 1]);
|
|
2137
|
-
}
|
|
2138
|
-
catch (error) {
|
|
2139
|
-
if (error instanceof NextHandlerAlreadySpecifiedException) {
|
|
2140
|
-
throw new Error('Handler factory should return new instance of ' +
|
|
2141
|
-
'BaseRequestHandler class or its subclass ' +
|
|
2142
|
-
'(next handler should not be specified)');
|
|
2143
|
-
}
|
|
2144
|
-
throw error;
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
1044
|
+
function getHandlerChainServiceMetadata(typeRef) {
|
|
1045
|
+
const requestType = Reflect.getMetadata('requestType', typeRef);
|
|
1046
|
+
if (!requestType) {
|
|
1047
|
+
throw new Error(`requestType was not found on '${typeRef.name}' class`);
|
|
2147
1048
|
}
|
|
1049
|
+
return { requestType, typeRef };
|
|
2148
1050
|
}
|
|
2149
|
-
|
|
2150
|
-
const global = window;
|
|
2151
1051
|
/**
|
|
2152
|
-
* @
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
}
|
|
2162
|
-
get _chain() {
|
|
2163
|
-
return global.handlerChain;
|
|
2164
|
-
}
|
|
2165
|
-
set _chain(value) {
|
|
2166
|
-
global.handlerChain = value;
|
|
2167
|
-
}
|
|
2168
|
-
static get instance() {
|
|
2169
|
-
return HandlerChainService._instance || (HandlerChainService._instance = new HandlerChainService());
|
|
2170
|
-
}
|
|
2171
|
-
_createGlobalHandlerChain() {
|
|
2172
|
-
this._chain = new InternalHandlerChain();
|
|
2173
|
-
}
|
|
2174
|
-
/**
|
|
2175
|
-
* @internal
|
|
2176
|
-
*/
|
|
2177
|
-
clearContextedHandlersCache(contextId) {
|
|
2178
|
-
return this._chain.clearContextedHandlersCache(contextId);
|
|
2179
|
-
}
|
|
2180
|
-
/**
|
|
2181
|
-
* @internal
|
|
2182
|
-
*/
|
|
2183
|
-
register(handlerConfig) {
|
|
2184
|
-
return this._chain.handlerChain$.register(handlerConfig);
|
|
2185
|
-
}
|
|
2186
|
-
/**
|
|
2187
|
-
* @description Method to process passed request
|
|
2188
|
-
* @param request - {@link BaseRequest}
|
|
2189
|
-
* @return `Promise<unknown>`
|
|
2190
|
-
*/
|
|
2191
|
-
process(request) {
|
|
2192
|
-
return this._chain.handlerChain$.process(request);
|
|
2193
|
-
}
|
|
1052
|
+
* @internal
|
|
1053
|
+
*/
|
|
1054
|
+
function getCrtInputsMetadata(type) {
|
|
1055
|
+
const keys = Reflect.getMetadataKeys(type);
|
|
1056
|
+
const crtInputKeys = keys.filter((x) => x.startsWith(crtInputPrefix));
|
|
1057
|
+
return Object.fromEntries(crtInputKeys.map((key) => {
|
|
1058
|
+
const data = Reflect.getMetadata(key, type);
|
|
1059
|
+
return [key.replace(crtInputPrefix, ''), data];
|
|
1060
|
+
}));
|
|
2194
1061
|
}
|
|
2195
|
-
|
|
2196
1062
|
/**
|
|
2197
1063
|
* @internal
|
|
2198
1064
|
*/
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
return
|
|
2203
|
-
const
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
method: (config === null || config === void 0 ? void 0 : config.methodName) ? config.methodName : method,
|
|
2207
|
-
args,
|
|
2208
|
-
});
|
|
2209
|
-
};
|
|
2210
|
-
if (descriptor) {
|
|
2211
|
-
descriptor.value = methodImplementation;
|
|
2212
|
-
}
|
|
2213
|
-
else {
|
|
2214
|
-
target[method] = methodImplementation;
|
|
2215
|
-
}
|
|
2216
|
-
};
|
|
1065
|
+
function getCrtOutputsMetadata(type) {
|
|
1066
|
+
const keys = Reflect.getMetadataKeys(type);
|
|
1067
|
+
const crtOutputKeys = keys.filter((x) => x.startsWith(crtOutputPrefix));
|
|
1068
|
+
return Object.fromEntries(crtOutputKeys.map((key) => {
|
|
1069
|
+
const data = Reflect.getMetadata(key, type);
|
|
1070
|
+
return [key.replace(crtOutputPrefix, ''), data];
|
|
1071
|
+
}));
|
|
2217
1072
|
}
|
|
2218
|
-
|
|
2219
1073
|
/**
|
|
2220
1074
|
* @internal
|
|
2221
1075
|
*/
|
|
2222
|
-
function
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
1076
|
+
function getCrtValidationInputsMetadata(type) {
|
|
1077
|
+
const keys = Reflect.getMetadataKeys(type);
|
|
1078
|
+
const crtValidationInputKeys = keys.filter((x) => x.startsWith(crtValidationInputPrefix));
|
|
1079
|
+
return Object.fromEntries(crtValidationInputKeys.map((key) => {
|
|
1080
|
+
const data = Reflect.getMetadata(key, type);
|
|
1081
|
+
return [key.replace(crtValidationInputPrefix, ''), data];
|
|
1082
|
+
}));
|
|
2227
1083
|
}
|
|
2228
|
-
|
|
2229
1084
|
/**
|
|
2230
1085
|
* @internal
|
|
2231
1086
|
*/
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
1087
|
+
function getCrtInjectMetadata(type) {
|
|
1088
|
+
const keys = Reflect.getOwnMetadataKeys(type);
|
|
1089
|
+
const crtInjectKeys = keys.filter((x) => x.startsWith(crtInjectPrefix));
|
|
1090
|
+
return Object.fromEntries(crtInjectKeys.map((key) => {
|
|
1091
|
+
const index = Number(key.replace(crtInjectPrefix, ''));
|
|
1092
|
+
const data = Reflect.getMetadata(key, type);
|
|
1093
|
+
return [index, data];
|
|
1094
|
+
}));
|
|
2239
1095
|
}
|
|
2240
|
-
|
|
2241
1096
|
/**
|
|
2242
1097
|
* @internal
|
|
2243
1098
|
*/
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
constructor
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
1099
|
+
function getParentType(type) {
|
|
1100
|
+
const parentProto = type.prototype ? Object.getPrototypeOf(type.prototype) : null;
|
|
1101
|
+
return parentProto ? parentProto.constructor : null;
|
|
1102
|
+
}
|
|
1103
|
+
/**
|
|
1104
|
+
* @internal
|
|
1105
|
+
*/
|
|
1106
|
+
function getTypeDependencies(type) {
|
|
1107
|
+
const paramTypes = Reflect.getOwnMetadata('design:paramtypes', type);
|
|
1108
|
+
if (!paramTypes) {
|
|
1109
|
+
if (type.length > 0) {
|
|
1110
|
+
throw new Error(`Dependency Injection error. Cannot read dependencies of class '${type.name}'. ` +
|
|
1111
|
+
`Please make sure class '${type.name}' has decorator and ` +
|
|
1112
|
+
"'emitDecoratorMetadata' option is enabled in your 'tsconfig.json' file.");
|
|
1113
|
+
}
|
|
1114
|
+
const parentType = getParentType(type);
|
|
1115
|
+
return parentType && parentType !== Object ? getTypeDependencies(parentType) : [];
|
|
2256
1116
|
}
|
|
1117
|
+
const crtInjectMetadata = getCrtInjectMetadata(type);
|
|
1118
|
+
Object.entries(crtInjectMetadata).forEach(([index, token]) => (paramTypes[index] = token));
|
|
1119
|
+
return paramTypes;
|
|
2257
1120
|
}
|
|
2258
1121
|
|
|
2259
1122
|
/**
|
|
2260
1123
|
* @internal
|
|
2261
1124
|
*/
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
1125
|
+
function instantiate(type, resolveDependency) {
|
|
1126
|
+
const deps = getTypeDependencies(type);
|
|
1127
|
+
if (deps.length > 0) {
|
|
1128
|
+
if (!resolveDependency) {
|
|
1129
|
+
throw new Error(`Cannot resolve dependencies for ${type.name}. ` +
|
|
1130
|
+
"Please provide 'resolveDependency' bootstrap option");
|
|
1131
|
+
}
|
|
1132
|
+
const depInstances = deps.map(resolveDependency);
|
|
1133
|
+
return new type(...depInstances);
|
|
2269
1134
|
}
|
|
1135
|
+
return new type();
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
* @public
|
|
1139
|
+
* @description For internal use only.
|
|
1140
|
+
*/
|
|
1141
|
+
function ɵinstantiate(type, resolveDependency) {
|
|
1142
|
+
return instantiate(type, resolveDependency);
|
|
2270
1143
|
}
|
|
2271
1144
|
|
|
2272
1145
|
/**
|
|
2273
|
-
* @
|
|
1146
|
+
* @public
|
|
2274
1147
|
*/
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
QueryOperationType[QueryOperationType["Select"] = 0] = "Select";
|
|
2278
|
-
QueryOperationType[QueryOperationType["Insert"] = 1] = "Insert";
|
|
2279
|
-
QueryOperationType[QueryOperationType["Update"] = 2] = "Update";
|
|
2280
|
-
QueryOperationType[QueryOperationType["Delete"] = 3] = "Delete";
|
|
2281
|
-
// Batch,
|
|
2282
|
-
// ListSelect,
|
|
2283
|
-
// FilteredSelect,
|
|
2284
|
-
// LookupSelect
|
|
2285
|
-
})(QueryOperationType || (QueryOperationType = {}));
|
|
1148
|
+
class CrtInputRegistrationConfig {
|
|
1149
|
+
}
|
|
2286
1150
|
|
|
2287
1151
|
/**
|
|
2288
|
-
* @
|
|
1152
|
+
* @public
|
|
1153
|
+
* @class DataRequest
|
|
1154
|
+
* @description Definition of data source request.
|
|
1155
|
+
* @extends {ɵBaseRequest} {@link ɵBaseRequest}
|
|
1156
|
+
* @property {string} dataSourceName - name of assigned data source.
|
|
2289
1157
|
*/
|
|
2290
|
-
class
|
|
2291
|
-
// region Constructors: Public
|
|
2292
|
-
constructor(rootSchemaName) {
|
|
2293
|
-
super(QueryOperationType.Delete, rootSchemaName);
|
|
2294
|
-
}
|
|
1158
|
+
class DataRequest extends ɵBaseRequest {
|
|
2295
1159
|
}
|
|
2296
1160
|
|
|
2297
1161
|
/**
|
|
2298
|
-
* @
|
|
1162
|
+
* @public
|
|
1163
|
+
* @description Abstract Base Validator class for designing custom validators.
|
|
1164
|
+
* @example
|
|
1165
|
+
* @CrtValidator({
|
|
1166
|
+
* type: 'crt.Required',
|
|
1167
|
+
* })
|
|
1168
|
+
* export class RequiredValidator extends BaseValidator {
|
|
1169
|
+
* protected override async = false;
|
|
1170
|
+
* public validate(controlState: CrtControlState, params?: ValidatorParametersValues): CrtValidationErrors | null {
|
|
1171
|
+
* Implementation here...
|
|
1172
|
+
* }
|
|
1173
|
+
* }
|
|
2299
1174
|
*/
|
|
2300
|
-
class
|
|
2301
|
-
// endregion
|
|
2302
|
-
// region Constructors: Public
|
|
2303
|
-
constructor(rootSchemaName) {
|
|
2304
|
-
super(QueryOperationType.Select, rootSchemaName);
|
|
2305
|
-
// region Properties: Private
|
|
2306
|
-
this._columns = new Map();
|
|
2307
|
-
// endregion
|
|
2308
|
-
// region Properties: Public
|
|
2309
|
-
this.isDistinct = false;
|
|
2310
|
-
/**
|
|
2311
|
-
* Number of rows to select.
|
|
2312
|
-
*/
|
|
2313
|
-
this.rowCount = -1;
|
|
2314
|
-
/**
|
|
2315
|
-
* Rows count to skip.
|
|
2316
|
-
*/
|
|
2317
|
-
this.rowsOffset = -1;
|
|
2318
|
-
this.useLocalization = true;
|
|
2319
|
-
this._getIsPageable = () => this.rowCount > 0 && this.rowsOffset > -1;
|
|
2320
|
-
}
|
|
2321
|
-
// endregion
|
|
2322
|
-
// region Methods: Private
|
|
2323
|
-
_internalAddColumn(key, column) {
|
|
2324
|
-
if (!this._columns.has(key)) {
|
|
2325
|
-
this._columns.set(key, column);
|
|
2326
|
-
}
|
|
2327
|
-
}
|
|
2328
|
-
// endregion
|
|
2329
|
-
// region Methods: Public
|
|
2330
|
-
/**
|
|
2331
|
-
* Returns column instance by column alias.
|
|
2332
|
-
* @param columnAlias Column alias.
|
|
2333
|
-
* @returns [BaseQueryColumn] Column instance.
|
|
2334
|
-
*/
|
|
2335
|
-
getColumn(columnAlias) {
|
|
2336
|
-
if (!this._columns.has(columnAlias)) {
|
|
2337
|
-
throw new ItemNotFoundException(columnAlias);
|
|
2338
|
-
}
|
|
2339
|
-
return this.findColumn(columnAlias);
|
|
2340
|
-
}
|
|
2341
|
-
/**
|
|
2342
|
-
* Returns column instance by column alias if not found returns null.
|
|
2343
|
-
*/
|
|
2344
|
-
findColumn(columnAlias) {
|
|
2345
|
-
return this._columns.get(columnAlias);
|
|
2346
|
-
}
|
|
2347
|
-
/**
|
|
2348
|
-
* @inheritDoc
|
|
2349
|
-
*/
|
|
2350
|
-
getMetadata() {
|
|
2351
|
-
return Object.assign(Object.assign({}, super.getMetadata()), { columns: {
|
|
2352
|
-
items: classToPlain(this._columns, { exposeUnsetFields: false, excludePrefixes: ['_'] }),
|
|
2353
|
-
}, allColumns: false, isDistinct: this.isDistinct, ignoreDisplayValues: false, rowCount: this.rowCount, rowsOffset: this.rowsOffset, isPageable: this._getIsPageable(), conditionalValues: this.conditionalValues ? this.conditionalValues : null, isHierarchical: false, hierarchicalMaxDepth: 0, hierarchicalColumnName: null, hierarchicalColumnValue: null, useLocalization: this.useLocalization, useRecordDeactivation: false });
|
|
2354
|
-
}
|
|
2355
|
-
/**
|
|
2356
|
-
* Add column.
|
|
2357
|
-
* @param column Column path.
|
|
2358
|
-
* @param columnAlias Column alias.
|
|
2359
|
-
* @returns [BaseQueryColumn] Column instance.
|
|
2360
|
-
*/
|
|
2361
|
-
addColumn(column, columnAlias) {
|
|
2362
|
-
this._internalAddColumn(columnAlias, column);
|
|
2363
|
-
return column;
|
|
2364
|
-
}
|
|
2365
|
-
/**
|
|
2366
|
-
* Add column by column path.
|
|
2367
|
-
* @param columnPath Column path.
|
|
2368
|
-
* @param columnAlias Column alias.
|
|
2369
|
-
* @returns [EntityQueryColumn] Column instance.
|
|
2370
|
-
*/
|
|
2371
|
-
addSchemaColumn(columnPath, columnAlias) {
|
|
2372
|
-
ValidationUtilities.checkArgumentEmpty('columnPath', columnPath);
|
|
2373
|
-
const column = new EntityQueryColumn(columnPath);
|
|
2374
|
-
this._internalAddColumn(columnAlias || columnPath, column);
|
|
2375
|
-
return column;
|
|
2376
|
-
}
|
|
2377
|
-
/**
|
|
2378
|
-
* Add aggregation sub query column.
|
|
2379
|
-
* @param columnPath Column path.
|
|
2380
|
-
* @param aggregationType Aggregation type.
|
|
2381
|
-
* @param subFilters Sub query filters.
|
|
2382
|
-
* @param columnAlias Column alias.
|
|
2383
|
-
* @returns [AggregationSubQueryColumn] Column instance.
|
|
2384
|
-
*/
|
|
2385
|
-
addAggregationSubQueryColumn(columnPath, aggregationType, aggregationConfig, columnAlias) {
|
|
2386
|
-
const column = new AggregationSubQueryColumn(columnPath, aggregationType, aggregationConfig.filter, aggregationConfig.sortByDirection, aggregationConfig.sortByColumn);
|
|
2387
|
-
this._internalAddColumn(columnAlias || columnPath, column);
|
|
2388
|
-
return column;
|
|
2389
|
-
}
|
|
2390
|
-
/**
|
|
2391
|
-
* Add parameter column.
|
|
2392
|
-
* @param value Parameter value.
|
|
2393
|
-
* @param dataValueType Parameter data value type.
|
|
2394
|
-
* @param columnAlias Column alias.
|
|
2395
|
-
* @returns [ParameterQueryColumn] Column instance.
|
|
2396
|
-
*/
|
|
2397
|
-
addParameterColumn(value, dataValueType, columnAlias) {
|
|
2398
|
-
const column = new ParameterQueryColumn(value, dataValueType);
|
|
2399
|
-
this._internalAddColumn(columnAlias, column);
|
|
2400
|
-
return column;
|
|
2401
|
-
}
|
|
2402
|
-
/**
|
|
2403
|
-
* Add arithmetic column.
|
|
2404
|
-
* @param arithmeticOperation Arithmetic operation.
|
|
2405
|
-
* @param leftArithmeticOperand Left arithmetic operand expression.
|
|
2406
|
-
* @param rightArithmeticOperand Right arithmetic operand expression.
|
|
2407
|
-
* @param columnAlias Column alias.
|
|
2408
|
-
* @returns [ArithmeticQueryColumn] Column instance.
|
|
2409
|
-
*/
|
|
2410
|
-
addArithmeticColumn(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand, columnAlias) {
|
|
2411
|
-
const column = new ArithmeticQueryColumn(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand);
|
|
2412
|
-
this._internalAddColumn(columnAlias, column);
|
|
2413
|
-
return column;
|
|
2414
|
-
}
|
|
1175
|
+
class BaseValidator {
|
|
2415
1176
|
/**
|
|
2416
|
-
*
|
|
2417
|
-
* @param queryMacrosType Macros type.
|
|
2418
|
-
* @param columnAlias Column alias.
|
|
2419
|
-
* @returns [MacrosFunctionColumn] Column instance.
|
|
1177
|
+
* @description getter for async/sync indicator
|
|
2420
1178
|
*/
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
this._internalAddColumn(columnAlias, column);
|
|
2424
|
-
return column;
|
|
1179
|
+
get isAsync() {
|
|
1180
|
+
return this.async;
|
|
2425
1181
|
}
|
|
2426
1182
|
/**
|
|
2427
|
-
*
|
|
2428
|
-
* @param columnPath Column path.
|
|
2429
|
-
* @param datePartType Date part type.
|
|
2430
|
-
* @param columnAlias Column alias.
|
|
2431
|
-
* @returns [DatePartFunctionColumn] Column instance.
|
|
1183
|
+
* @description Function used for validation
|
|
2432
1184
|
*/
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
const column = new DatePartFunctionColumn(datePartType, functionArgument);
|
|
2436
|
-
this._internalAddColumn(columnAlias, column);
|
|
2437
|
-
return column;
|
|
1185
|
+
get validateFn() {
|
|
1186
|
+
return this.validate.bind(this);
|
|
2438
1187
|
}
|
|
2439
1188
|
/**
|
|
2440
|
-
*
|
|
2441
|
-
* @param columnPath Column path.
|
|
2442
|
-
* @param aggregationType Aggregation type.
|
|
2443
|
-
* @param columnAlias Column alias.
|
|
2444
|
-
* @param aggregationEvalType Aggregation eval type.
|
|
2445
|
-
* @returns [AggregationFunctionColumn] Column instance.
|
|
1189
|
+
* @internal
|
|
2446
1190
|
*/
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
this._internalAddColumn(columnAlias, column);
|
|
2451
|
-
return column;
|
|
1191
|
+
static [Symbol.hasInstance](instance) {
|
|
1192
|
+
var _a;
|
|
1193
|
+
return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === BaseValidator._instanceOfKey;
|
|
2452
1194
|
}
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
1195
|
+
}
|
|
1196
|
+
/**
|
|
1197
|
+
* @internal
|
|
1198
|
+
* @dontChange
|
|
1199
|
+
*/
|
|
1200
|
+
BaseValidator._instanceOfKey = 'devkit_BaseValidator';
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* @public
|
|
1204
|
+
*/
|
|
1205
|
+
class LocalizableValue {
|
|
1206
|
+
constructor(key) {
|
|
1207
|
+
this.key = key;
|
|
2464
1208
|
}
|
|
2465
1209
|
/**
|
|
2466
|
-
*
|
|
2467
|
-
* @param columnPath Column path.
|
|
2468
|
-
* @param aggregationType Aggregation type.
|
|
2469
|
-
* @param columnAlias Column alias.
|
|
2470
|
-
* @param aggregationEvalType Aggregation eval type.
|
|
2471
|
-
* @returns [WindowFunctionColumn] Column instance.
|
|
1210
|
+
* @internal
|
|
2472
1211
|
*/
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
aggregationEvalType,
|
|
2477
|
-
functionArgument: new ColumnExpression({ columnPath }),
|
|
2478
|
-
});
|
|
2479
|
-
const column = new WindowFunctionColumn(functionArgument);
|
|
2480
|
-
this._internalAddColumn(columnAlias, column);
|
|
2481
|
-
return column;
|
|
1212
|
+
static [Symbol.hasInstance](instance) {
|
|
1213
|
+
var _a;
|
|
1214
|
+
return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === LocalizableValue._instanceOfKey;
|
|
2482
1215
|
}
|
|
2483
1216
|
}
|
|
1217
|
+
/**
|
|
1218
|
+
* @internal
|
|
1219
|
+
* @dontChange
|
|
1220
|
+
*/
|
|
1221
|
+
LocalizableValue._instanceOfKey = 'devkit_LocalizableValue';
|
|
2484
1222
|
|
|
2485
1223
|
/**
|
|
2486
1224
|
* @internal
|
|
2487
1225
|
*/
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
this._columnValues = new Map();
|
|
2495
|
-
}
|
|
2496
|
-
// endregion
|
|
2497
|
-
// region Properties: Public
|
|
2498
|
-
get columnValues() {
|
|
2499
|
-
return {
|
|
2500
|
-
items: classToPlain(this._columnValues),
|
|
2501
|
-
};
|
|
1226
|
+
function applyLocalizeMetadataFn(obj, localizeMetadata) {
|
|
1227
|
+
const localizableEntries = objectDeepKeys(obj)
|
|
1228
|
+
.map((path) => ({ path, value: get(obj, path) }))
|
|
1229
|
+
.filter(({ value }) => value instanceof LocalizableValue);
|
|
1230
|
+
if (localizableEntries.length === 0) {
|
|
1231
|
+
return obj;
|
|
2502
1232
|
}
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
ValidationUtilities.checkArgumentEmpty('columnName', columnName);
|
|
2507
|
-
this._columnValues.set(columnName, new ParameterExpression({ value: columnValue, dataValueType }));
|
|
1233
|
+
const localized = cloneDeep(obj);
|
|
1234
|
+
if (!localizeMetadata) {
|
|
1235
|
+
console.error("Unable to localize metadata. 'localizeMetadata' bootstrap option was not provided.");
|
|
2508
1236
|
}
|
|
1237
|
+
localizableEntries.forEach(({ path, value }) => {
|
|
1238
|
+
var _a;
|
|
1239
|
+
const localizedValue = (_a = localizeMetadata === null || localizeMetadata === void 0 ? void 0 : localizeMetadata(value.key)) !== null && _a !== void 0 ? _a : value.key;
|
|
1240
|
+
set(localized, path, localizedValue);
|
|
1241
|
+
});
|
|
1242
|
+
return localized;
|
|
2509
1243
|
}
|
|
2510
|
-
__decorate([
|
|
2511
|
-
Expose(),
|
|
2512
|
-
__metadata("design:type", Object),
|
|
2513
|
-
__metadata("design:paramtypes", [])
|
|
2514
|
-
], InsertQuery.prototype, "columnValues", null);
|
|
2515
1244
|
|
|
2516
1245
|
/**
|
|
2517
1246
|
* @internal
|
|
2518
1247
|
*/
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
// region Fields: Private
|
|
2525
|
-
this._columnValues = new Map();
|
|
2526
|
-
// endregion
|
|
2527
|
-
// region Fields: Public
|
|
2528
|
-
/**
|
|
2529
|
-
* Flag that indicates whether to force save data.
|
|
2530
|
-
*/
|
|
2531
|
-
this.isForceUpdate = false;
|
|
2532
|
-
}
|
|
2533
|
-
// endregion
|
|
2534
|
-
// region Properties: Public
|
|
2535
|
-
get columnValues() {
|
|
2536
|
-
return {
|
|
2537
|
-
items: classToPlain(this._columnValues),
|
|
2538
|
-
};
|
|
2539
|
-
}
|
|
2540
|
-
// endregion
|
|
2541
|
-
// region Methods: Public
|
|
2542
|
-
addColumn(columnName, columnValue, dataValueType) {
|
|
2543
|
-
ValidationUtilities.checkArgumentEmpty('columnName', columnName);
|
|
2544
|
-
this._columnValues.set(columnName, new ParameterExpression({ value: columnValue, dataValueType }));
|
|
2545
|
-
}
|
|
1248
|
+
function CrtDesignTimeViewElement(config) {
|
|
1249
|
+
return function (type) {
|
|
1250
|
+
const registrationConfig = Object.assign(Object.assign({}, config), { typeRef: type });
|
|
1251
|
+
setDesignTimeViewElementMetadata(registrationConfig, type);
|
|
1252
|
+
};
|
|
2546
1253
|
}
|
|
2547
|
-
__decorate([
|
|
2548
|
-
Expose(),
|
|
2549
|
-
__metadata("design:type", Object),
|
|
2550
|
-
__metadata("design:paramtypes", [])
|
|
2551
|
-
], UpdateQuery.prototype, "columnValues", null);
|
|
2552
1254
|
|
|
2553
1255
|
/**
|
|
2554
1256
|
* @internal
|
|
2555
1257
|
*/
|
|
2556
|
-
|
|
1258
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1259
|
+
function CrtRequest(config) {
|
|
1260
|
+
return function (type) {
|
|
1261
|
+
checkTypeNameFormat(config.type, 'RequestTypeName');
|
|
1262
|
+
checkCrtTypeNamePascalCase(config.type);
|
|
1263
|
+
RequestRegistryService.register(config, type);
|
|
1264
|
+
};
|
|
2557
1265
|
}
|
|
2558
1266
|
|
|
2559
1267
|
/**
|
|
@@ -2566,11 +1274,11 @@ class InterfaceDesignerItemRegistrationConfig {
|
|
|
2566
1274
|
* @internal
|
|
2567
1275
|
* @class MethodInvokeRequest
|
|
2568
1276
|
* @description Definition of invoke method request.
|
|
2569
|
-
* @extends {
|
|
1277
|
+
* @extends {ɵBaseRequest} {@link ɵBaseRequest}
|
|
2570
1278
|
* @property {string} method - method name.
|
|
2571
1279
|
* @property {unknown[]} args - arguments passing to the method.
|
|
2572
1280
|
*/
|
|
2573
|
-
class MethodInvokeRequest extends
|
|
1281
|
+
class MethodInvokeRequest extends ɵBaseRequest {
|
|
2574
1282
|
}
|
|
2575
1283
|
|
|
2576
1284
|
/**
|
|
@@ -2689,7 +1397,6 @@ function CrtModule(moduleDefinition) {
|
|
|
2689
1397
|
return (type) => setModuleMetadata(moduleDefinition, type);
|
|
2690
1398
|
}
|
|
2691
1399
|
|
|
2692
|
-
// noinspection ES6PreferShortImport
|
|
2693
1400
|
/**
|
|
2694
1401
|
* @internal
|
|
2695
1402
|
*/
|
|
@@ -2735,7 +1442,11 @@ function CrtInject(token) {
|
|
|
2735
1442
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2736
1443
|
function CrtValidator(config) {
|
|
2737
1444
|
if (!config) {
|
|
2738
|
-
return (type) => {
|
|
1445
|
+
return (type) => {
|
|
1446
|
+
// the decorator won't do anything by itself,
|
|
1447
|
+
// but will be used by the compiler to generate class metadata,
|
|
1448
|
+
// which is required for DI
|
|
1449
|
+
};
|
|
2739
1450
|
}
|
|
2740
1451
|
return function (type) {
|
|
2741
1452
|
checkTypeNameFormat(config.type, 'ValidatorTypeName');
|
|
@@ -2750,7 +1461,11 @@ function CrtValidator(config) {
|
|
|
2750
1461
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2751
1462
|
function CrtRequestHandler(config) {
|
|
2752
1463
|
if (!config) {
|
|
2753
|
-
return (type) => {
|
|
1464
|
+
return (type) => {
|
|
1465
|
+
// the decorator won't do anything by itself,
|
|
1466
|
+
// but will be used by the compiler to generate class metadata,
|
|
1467
|
+
// which is required for DI
|
|
1468
|
+
};
|
|
2754
1469
|
}
|
|
2755
1470
|
return function (type) {
|
|
2756
1471
|
checkTypeNameFormat(config.type, 'RequestHandlerTypeName');
|
|
@@ -2922,10 +1637,7 @@ function registerRequestHandlers(types, options, remoteName) {
|
|
|
2922
1637
|
RequestHandlerRegistryService.register(registrationConfig, type);
|
|
2923
1638
|
});
|
|
2924
1639
|
}
|
|
2925
|
-
|
|
2926
|
-
* @internal
|
|
2927
|
-
*/
|
|
2928
|
-
function _bootstrapCrtModule(name, type, options) {
|
|
1640
|
+
function bootstrapDefaultCrtModule(name, type, options) {
|
|
2929
1641
|
var _a;
|
|
2930
1642
|
try {
|
|
2931
1643
|
const moduleDefinition = getModuleMetadata(type);
|
|
@@ -2945,12 +1657,34 @@ function _bootstrapCrtModule(name, type, options) {
|
|
|
2945
1657
|
if (moduleDefinition.converters) {
|
|
2946
1658
|
registerConverters(moduleDefinition.converters, options);
|
|
2947
1659
|
}
|
|
2948
|
-
(_a = moduleDefinition.includes) === null || _a === void 0 ? void 0 : _a.forEach((t) =>
|
|
1660
|
+
(_a = moduleDefinition.includes) === null || _a === void 0 ? void 0 : _a.forEach((t) => {
|
|
1661
|
+
bootstrapDefaultCrtModule(name, t, options);
|
|
1662
|
+
bootstrapPredefinedModules(name, t, options);
|
|
1663
|
+
});
|
|
2949
1664
|
}
|
|
2950
1665
|
catch (error) {
|
|
2951
1666
|
console.error(error);
|
|
2952
1667
|
}
|
|
2953
1668
|
}
|
|
1669
|
+
/**
|
|
1670
|
+
* @internal
|
|
1671
|
+
*/
|
|
1672
|
+
function bootstrapPredefinedModules(name, type, options) {
|
|
1673
|
+
const modulePrefix = 'module:';
|
|
1674
|
+
const metadataKeys = Reflect.getOwnMetadataKeys(type);
|
|
1675
|
+
for (const key of metadataKeys) {
|
|
1676
|
+
if (typeof key === 'string' && key.startsWith(modulePrefix)) {
|
|
1677
|
+
const moduleType = key.substring(modulePrefix.length);
|
|
1678
|
+
const predefinedBootstrapper = Reflect.getOwnMetadata('moduleBootstrapper:' + moduleType, type);
|
|
1679
|
+
try {
|
|
1680
|
+
predefinedBootstrapper(name, type, options);
|
|
1681
|
+
}
|
|
1682
|
+
catch (error) {
|
|
1683
|
+
console.error(error);
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
2954
1688
|
/**
|
|
2955
1689
|
* @internal
|
|
2956
1690
|
*/
|
|
@@ -2968,7 +1702,8 @@ function bootstrapCrtModule(...args) {
|
|
|
2968
1702
|
throw new Error('Host module cannot have name');
|
|
2969
1703
|
}
|
|
2970
1704
|
}
|
|
2971
|
-
|
|
1705
|
+
bootstrapDefaultCrtModule(name, type, options);
|
|
1706
|
+
bootstrapPredefinedModules(name, type, options);
|
|
2972
1707
|
if (options.moduleType === 'remote') {
|
|
2973
1708
|
BootstrapNotifier.instance.notify(type);
|
|
2974
1709
|
}
|
|
@@ -3050,11 +1785,11 @@ class BaseRequestHandler {
|
|
|
3050
1785
|
}
|
|
3051
1786
|
/**
|
|
3052
1787
|
* @description Method to set request handler to handler chain.
|
|
3053
|
-
* @param next - link for next request handler - {@link
|
|
1788
|
+
* @param next - link for next request handler - {@link ɵRequestHandler}
|
|
3054
1789
|
*/
|
|
3055
1790
|
setNext(next) {
|
|
3056
1791
|
if (this._next) {
|
|
3057
|
-
throw new
|
|
1792
|
+
throw new ɵNextHandlerAlreadySpecifiedException();
|
|
3058
1793
|
}
|
|
3059
1794
|
this._next = next;
|
|
3060
1795
|
}
|
|
@@ -3150,13 +1885,13 @@ __decorate([
|
|
|
3150
1885
|
* @public
|
|
3151
1886
|
* @class SysSetting
|
|
3152
1887
|
* @classdesc Class contains info related system setting
|
|
3153
|
-
* @property {
|
|
1888
|
+
* @property {ɵGuid} id - id of system setting.
|
|
3154
1889
|
* @property {string} name - name of system setting.
|
|
3155
1890
|
* @property {string} code - code of system setting.
|
|
3156
1891
|
* @property {isCacheable} boolean - indicator whether system setting is cacheable
|
|
3157
1892
|
* @property {any} value - value of system setting
|
|
3158
1893
|
* @property {string} displayValue - display value of system setting
|
|
3159
|
-
* @property {
|
|
1894
|
+
* @property {ɵDataValueType} ɵDataValueType - system setting {@link ɵDataValueType}
|
|
3160
1895
|
*/
|
|
3161
1896
|
class SysSetting {
|
|
3162
1897
|
}
|
|
@@ -3207,27 +1942,37 @@ class HttpClientService extends BaseHandlerChainService {
|
|
|
3207
1942
|
* @description HTTP GET request.
|
|
3208
1943
|
* @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
|
|
3209
1944
|
*/
|
|
3210
|
-
get() {
|
|
1945
|
+
get() {
|
|
1946
|
+
// the method will be implemented dynamically by the decorator
|
|
1947
|
+
}
|
|
3211
1948
|
/**
|
|
3212
1949
|
* @description HTTP POST request.
|
|
3213
1950
|
* @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
|
|
3214
1951
|
*/
|
|
3215
|
-
post() {
|
|
1952
|
+
post() {
|
|
1953
|
+
// the method will be implemented dynamically by the decorator
|
|
1954
|
+
}
|
|
3216
1955
|
/**
|
|
3217
1956
|
* @description HTTP DELETE request.
|
|
3218
1957
|
* @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
|
|
3219
1958
|
*/
|
|
3220
|
-
delete() {
|
|
1959
|
+
delete() {
|
|
1960
|
+
// the method will be implemented dynamically by the decorator
|
|
1961
|
+
}
|
|
3221
1962
|
/**
|
|
3222
1963
|
* @description HTTP PUT request.
|
|
3223
1964
|
* @return `Promise<HttpResponse> | void`` {(Promise<HttpResponse> | void)}
|
|
3224
1965
|
*/
|
|
3225
|
-
put() {
|
|
1966
|
+
put() {
|
|
1967
|
+
// the method will be implemented dynamically by the decorator
|
|
1968
|
+
}
|
|
3226
1969
|
/**
|
|
3227
1970
|
* @description HTTP PATCH request.
|
|
3228
1971
|
* @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
|
|
3229
1972
|
*/
|
|
3230
|
-
patch() {
|
|
1973
|
+
patch() {
|
|
1974
|
+
// the method will be implemented dynamically by the decorator
|
|
1975
|
+
}
|
|
3231
1976
|
}
|
|
3232
1977
|
__decorate([
|
|
3233
1978
|
ImplementUsingHandlerChain(),
|
|
@@ -3271,7 +2016,7 @@ var SchemaViewMaskRequestAction;
|
|
|
3271
2016
|
/**
|
|
3272
2017
|
* @internal
|
|
3273
2018
|
*/
|
|
3274
|
-
class SchemaViewMaskRequest extends
|
|
2019
|
+
class SchemaViewMaskRequest extends ɵBaseRequest {
|
|
3275
2020
|
constructor(action, taskName, $context) {
|
|
3276
2021
|
super();
|
|
3277
2022
|
this.action = action;
|
|
@@ -3390,21 +2135,9 @@ __decorate([
|
|
|
3390
2135
|
__metadata("design:type", Function)
|
|
3391
2136
|
], Model.prototype, "_create", void 0);
|
|
3392
2137
|
|
|
3393
|
-
/**
|
|
3394
|
-
* @public
|
|
3395
|
-
*/
|
|
3396
|
-
var ModelParameterType;
|
|
3397
|
-
(function (ModelParameterType) {
|
|
3398
|
-
ModelParameterType["PrimaryColumnValue"] = "primaryColumnValue";
|
|
3399
|
-
ModelParameterType["Filter"] = "filter";
|
|
3400
|
-
ModelParameterType["PrimaryDisplayValueFilter"] = "primaryDisplayValueFilter";
|
|
3401
|
-
ModelParameterType["Empty"] = "empty";
|
|
3402
|
-
ModelParameterType["Never"] = "never";
|
|
3403
|
-
})(ModelParameterType || (ModelParameterType = {}));
|
|
3404
|
-
|
|
3405
2138
|
/**
|
|
3406
2139
|
* Generated bundle index. Do not edit.
|
|
3407
2140
|
*/
|
|
3408
2141
|
|
|
3409
|
-
export {
|
|
2142
|
+
export { BaseRequestHandler, BaseValidator, BootstrapNotifier, ConverterRegistry, CrtConverter, CrtDesignTimeViewElement, CrtInject, CrtInput, CrtInputRegistrationConfig, CrtInterfaceDesignerItem, CrtModule, CrtOutput, CrtRequest, CrtRequestHandler, CrtValidationInput, CrtValidator, CrtViewElement, DataRequest, DesignTimeViewElementRegistry, DesignerToolGroupType, FeatureService, HandlerChainService, HandlerChainServicesRegistry, HandlerSourceType, HandlersOrderComparer, HttpClientService, ImplementUsingHandlerChain, InterfaceDesignerItemRegistrationConfig, InterfaceDesignerItemRegistry, InternalRequestHandlerRegistry, InternalRequestHandlerRegistryType, LocalizableValue, MaskService, MethodInvokeRequest, Model, ModelInPageAction, PkgTopology, RemoteEntriesRegistry, RemoteEntryType, RequestHandlerRegistryService, RequestRegistryService, RightsService, SchemaViewMaskRequest, SchemaViewMaskRequestAction, SysSetting, SysSettingValue, SysSettingsService, SysValuesService, ValidatorMapValue, ValidatorRegistry, ViewElementDataGroupType, ViewElementGroupType, ViewElementRegistry, applyLocalizeMetadataFn, bootstrapCrtModule, bootstrapCrtModuleHandlerChainServices, checkCrtTypeNamePascalCase, checkIfTypeRegistered, checkOnlyOneRegistration, checkTypeNameFormat, checkTypeNamePascalCase, crtInjectPrefix, crtInputPrefix, crtOutputPrefix, crtValidationInputPrefix, designTimeViewElementRegistryKey, getConverterMetadata, getCrtInputsMetadata, getCrtOutputsMetadata, getCrtValidationInputsMetadata, getDesignTimeViewElementMetadata, getHandlerChainServiceMetadata, getInterfaceDesignerItemMetadata, getModuleMetadata, getRequestHandlerMetadata, getTypeDependencies, getValidatorMetadata, getViewElementMetadata, hasInterfaceDesignerItemMetadata, instantiate, interfaceDesignerItemRegistryKey, isComponentPropertyBindable, localize, objectDeepKeys, registerAngularViewElement, registerViewElement, setConverterMetadata, setDesignTimeViewElementMetadata, setInterfaceDesignerItemMetadata, setModuleMetadata, setRequestHandlerMetadata, setValidatorMetadata, setViewElementMetadata, toAggregationEval, toAggregationEvalType, toAggregationFunction, toAggregationType, toDatePart, toDatePartType, toNumericFunctionType, toOrderDirection, toPascalCase, toSortDirection, toStringFunctionType, validatorRegistryKey, viewElementRegistryKey, ɵBaseRegistry, ɵcheckTypeNameFormat, ɵinstantiate };
|
|
3410
2143
|
//# sourceMappingURL=creatio-devkit-common.mjs.map
|