@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 { get, set, upperFirst, camelCase, isEqual, cloneDeep } from 'lodash';
|
|
4
4
|
import 'reflect-metadata';
|
|
5
|
-
|
|
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?.isBlock;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
class ArithmeticExpression extends BaseExpression {
|
|
285
|
-
constructor(config) {
|
|
286
|
-
super(config);
|
|
287
|
-
this.expressionType = ExpressionType.ArithmeticOperation;
|
|
288
|
-
this.arithmeticOperation = config?.arithmeticOperation;
|
|
289
|
-
this.leftArithmeticOperand = config?.leftArithmeticOperand.clone();
|
|
290
|
-
this.rightArithmeticOperand = 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?.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?.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?.aggregationType;
|
|
327
|
-
this.aggregationEvalType = 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?.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?.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
|
-
super(config);
|
|
408
|
-
this.expressionType = ExpressionType.Parameter;
|
|
409
|
-
const value = config?.value;
|
|
410
|
-
if (value instanceof Date) {
|
|
411
|
-
const cloneDate = new Date();
|
|
412
|
-
cloneDate.setTime(value.getTime());
|
|
413
|
-
this.value = cloneDate;
|
|
414
|
-
}
|
|
415
|
-
else if (!value) {
|
|
416
|
-
this.value = value;
|
|
417
|
-
}
|
|
418
|
-
else {
|
|
419
|
-
this.value = typeof value === 'object' ? { ...value } : value;
|
|
420
|
-
}
|
|
421
|
-
this.dataValueType = config?.dataValueType ?? DataValueType.Text;
|
|
422
|
-
}
|
|
423
|
-
get parameter() {
|
|
424
|
-
return {
|
|
425
|
-
dataValueType: this.dataValueType,
|
|
426
|
-
...this._getParameterValueMetadata(),
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
_convertStringToBlobArray(str) {
|
|
430
|
-
const out = [];
|
|
431
|
-
let position = 0;
|
|
432
|
-
for (let i = 0; i < str.length; i++) {
|
|
433
|
-
const code = str.charCodeAt(i);
|
|
434
|
-
if (code < 128) {
|
|
435
|
-
out[position++] = String.fromCharCode(code);
|
|
436
|
-
}
|
|
437
|
-
else if (code < 2048) {
|
|
438
|
-
/* eslint-disable no-bitwise */
|
|
439
|
-
out[position++] = String.fromCharCode((code >> 6) | 192);
|
|
440
|
-
out[position++] = String.fromCharCode((code & 63) | 128);
|
|
441
|
-
}
|
|
442
|
-
else {
|
|
443
|
-
out[position++] = String.fromCharCode((code >> 12) | 224);
|
|
444
|
-
out[position++] = String.fromCharCode(((code >> 6) & 63) | 128);
|
|
445
|
-
out[position++] = String.fromCharCode((code & 63) | 128);
|
|
446
|
-
/* eslint-enable no-bitwise */
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
return out;
|
|
450
|
-
}
|
|
451
|
-
_getParameterValueMetadata() {
|
|
452
|
-
if (this.dataValueType === DataValueType.Blob) {
|
|
453
|
-
return {
|
|
454
|
-
arrayValue: !this.value ? [] : this._convertStringToBlobArray(this.value),
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
else if (this.value instanceof Date) {
|
|
458
|
-
return {
|
|
459
|
-
value: encodeDate(this.value),
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
else {
|
|
463
|
-
return {
|
|
464
|
-
value: this.value,
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
clone() {
|
|
469
|
-
return new ParameterExpression(this);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
__decorate([
|
|
473
|
-
Exclude(),
|
|
474
|
-
__metadata("design:type", Object)
|
|
475
|
-
], ParameterExpression.prototype, "value", void 0);
|
|
476
|
-
__decorate([
|
|
477
|
-
Exclude(),
|
|
478
|
-
__metadata("design:type", Number)
|
|
479
|
-
], ParameterExpression.prototype, "dataValueType", void 0);
|
|
480
|
-
__decorate([
|
|
481
|
-
Expose(),
|
|
482
|
-
__metadata("design:type", Object),
|
|
483
|
-
__metadata("design:paramtypes", [])
|
|
484
|
-
], ParameterExpression.prototype, "parameter", null);
|
|
485
|
-
|
|
486
|
-
class SubQueryExpression extends BaseExpression {
|
|
487
|
-
constructor(config) {
|
|
488
|
-
super(config);
|
|
489
|
-
this.expressionType = ExpressionType.SubQuery;
|
|
490
|
-
this.columnPath = config?.columnPath;
|
|
491
|
-
const subFilter = config?.subFilters;
|
|
492
|
-
this.subFilters = typeof subFilter?.clone === 'function' ? subFilter.clone() : subFilter;
|
|
493
|
-
this.subOrderDirection = config.subOrderDirection;
|
|
494
|
-
this.subOrderColumn = config.subOrderColumn;
|
|
495
|
-
}
|
|
496
|
-
clone() {
|
|
497
|
-
return new SubQueryExpression(this);
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
class AggregationSubQueryExpression extends SubQueryExpression {
|
|
502
|
-
constructor(config) {
|
|
503
|
-
super(config);
|
|
504
|
-
this.aggregationType = config?.aggregationType;
|
|
505
|
-
}
|
|
506
|
-
clone() {
|
|
507
|
-
return new AggregationSubQueryExpression(this);
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
const EXPRESSION_TYPE_MOCK = -1;
|
|
512
|
-
class ExpressionMock extends BaseExpression {
|
|
513
|
-
constructor(config) {
|
|
514
|
-
super(config || {});
|
|
515
|
-
this.expressionType = EXPRESSION_TYPE_MOCK;
|
|
516
|
-
}
|
|
517
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
518
|
-
get plainObject() {
|
|
519
|
-
return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
|
|
520
|
-
}
|
|
521
|
-
clone() {
|
|
522
|
-
return new ExpressionMock(this);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
class BaseFilter {
|
|
527
|
-
constructor(filterType) {
|
|
528
|
-
this.isEnabled = true;
|
|
529
|
-
this.trimDateTimeParameterToDate = false;
|
|
530
|
-
this.filterType = filterType;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
class FilterMock extends BaseFilter {
|
|
535
|
-
constructor(filterType = FilterType.None) {
|
|
536
|
-
super(filterType);
|
|
537
|
-
}
|
|
538
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
539
|
-
get plainObject() {
|
|
540
|
-
return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
|
|
541
|
-
}
|
|
542
|
-
clone() {
|
|
543
|
-
return new FilterMock(this.filterType);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
class SingleFilter extends BaseFilter {
|
|
548
|
-
constructor(filterType, comparisonType, leftExpression) {
|
|
549
|
-
super(filterType);
|
|
550
|
-
this.comparisonType = comparisonType;
|
|
551
|
-
this.leftExpression = leftExpression.clone();
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
class CompareFilter extends SingleFilter {
|
|
556
|
-
constructor(comparisonType, leftExpression, rightExpression) {
|
|
557
|
-
super(FilterType.Compare, comparisonType, leftExpression);
|
|
558
|
-
this.rightExpression = rightExpression.clone();
|
|
559
|
-
}
|
|
560
|
-
clone() {
|
|
561
|
-
return new CompareFilter(this.comparisonType, this.leftExpression, this.rightExpression);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
class BetweenFilter extends SingleFilter {
|
|
566
|
-
constructor(leftExpression, rightLessExpression, rightGreaterExpression) {
|
|
567
|
-
super(FilterType.Between, ComparisonType.Between, leftExpression);
|
|
568
|
-
this.rightLessExpression = rightLessExpression.clone();
|
|
569
|
-
this.rightGreaterExpression = rightGreaterExpression.clone();
|
|
570
|
-
}
|
|
571
|
-
clone() {
|
|
572
|
-
return new BetweenFilter(this.leftExpression, this.rightLessExpression, this.rightGreaterExpression);
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
class ExistsFilter extends SingleFilter {
|
|
577
|
-
constructor(leftExpression, subFilters, comparisonType = ComparisonType.Exists, isAggregative = true) {
|
|
578
|
-
super(FilterType.Exists, comparisonType, leftExpression);
|
|
579
|
-
this.subFilters = subFilters?.clone();
|
|
580
|
-
this.isAggregative = isAggregative;
|
|
581
|
-
}
|
|
582
|
-
clone() {
|
|
583
|
-
return new ExistsFilter(this.leftExpression, this.subFilters, this.comparisonType, this.isAggregative);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
class InFilter extends SingleFilter {
|
|
588
|
-
constructor(comparisonType, leftExpression, rightExpressions) {
|
|
589
|
-
super(FilterType.In, comparisonType, leftExpression);
|
|
590
|
-
this.rightExpressions = rightExpressions.map((expression) => expression.clone());
|
|
591
|
-
}
|
|
592
|
-
clone() {
|
|
593
|
-
return new InFilter(this.comparisonType, this.leftExpression, this.rightExpressions);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
class IsNullFilter extends SingleFilter {
|
|
598
|
-
constructor(comparisonType, leftExpression) {
|
|
599
|
-
super(FilterType.IsNull, comparisonType, leftExpression);
|
|
600
|
-
}
|
|
601
|
-
get isNull() {
|
|
602
|
-
return this.comparisonType === ComparisonType.Is_null;
|
|
603
|
-
}
|
|
604
|
-
clone() {
|
|
605
|
-
return new IsNullFilter(this.comparisonType, this.leftExpression);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
__decorate([
|
|
609
|
-
Expose(),
|
|
610
|
-
__metadata("design:type", Boolean),
|
|
611
|
-
__metadata("design:paramtypes", [])
|
|
612
|
-
], IsNullFilter.prototype, "isNull", null);
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* Empty Guid constant.
|
|
616
|
-
* @internal
|
|
617
|
-
*/
|
|
618
|
-
const EMPTY_GUID = '00000000-0000-0000-0000-000000000000';
|
|
619
|
-
/**
|
|
620
|
-
* Regular expression for Guid validation.
|
|
621
|
-
* @internal
|
|
622
|
-
*/
|
|
623
|
-
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');
|
|
624
|
-
/**
|
|
625
|
-
* Generates guid part.
|
|
626
|
-
* @param length Part length.
|
|
627
|
-
* @internal
|
|
628
|
-
*/
|
|
629
|
-
function generateGuidPart(length) {
|
|
630
|
-
let out = '';
|
|
631
|
-
for (let i = 0; i < length; i++) {
|
|
632
|
-
// eslint-disable-next-line no-bitwise
|
|
633
|
-
out += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
|
634
|
-
}
|
|
635
|
-
return out;
|
|
636
|
-
}
|
|
637
|
-
/**
|
|
638
|
-
* Generates new Guid.
|
|
639
|
-
* @internal
|
|
640
|
-
*/
|
|
641
|
-
function generateGuid() {
|
|
642
|
-
return [
|
|
643
|
-
generateGuidPart(2),
|
|
644
|
-
generateGuidPart(1),
|
|
645
|
-
generateGuidPart(1),
|
|
646
|
-
generateGuidPart(1),
|
|
647
|
-
generateGuidPart(3),
|
|
648
|
-
].join('-');
|
|
649
|
-
}
|
|
650
|
-
/**
|
|
651
|
-
* Checks if value is Guid.
|
|
652
|
-
* @param value Value for check.
|
|
653
|
-
* @internal
|
|
654
|
-
*/
|
|
655
|
-
function isGuid(value) {
|
|
656
|
-
return Boolean(value) && validator.test(value);
|
|
657
|
-
}
|
|
658
|
-
/**
|
|
659
|
-
* Checks if Guid is empty value or equal to EMPTY_GUID.
|
|
660
|
-
* @param guid Guid for check.
|
|
661
|
-
* @internal
|
|
662
|
-
*/
|
|
663
|
-
function isEmptyGuid(guid) {
|
|
664
|
-
return !guid || guid === EMPTY_GUID;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* @internal
|
|
669
|
-
*/
|
|
670
|
-
class NextHandlerAlreadySpecifiedException extends Error {
|
|
671
|
-
constructor() {
|
|
672
|
-
super('Next handler already specified');
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
class ArgumentEmptyException extends Error {
|
|
677
|
-
// region Constructors: Public
|
|
678
|
-
constructor(argumentName) {
|
|
679
|
-
super(`Argument with name '${argumentName}' is empty.`);
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
class ArgumentOutOfRangeException extends Error {
|
|
684
|
-
// region Constructors: Public
|
|
685
|
-
constructor(argumentName) {
|
|
686
|
-
super(`Argument with name '${argumentName}' is out of range.`);
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
class ItemNotFoundException extends Error {
|
|
691
|
-
// region Constructors: Public
|
|
692
|
-
constructor(key) {
|
|
693
|
-
super(`Item with key '${key}' does not exist.`);
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
class ValidationUtilities {
|
|
698
|
-
// region Methods: Public
|
|
699
|
-
static checkArgumentEmpty(argumentName, argumentValue) {
|
|
700
|
-
if (argumentValue === undefined || argumentValue === null) {
|
|
701
|
-
throw new ArgumentEmptyException(argumentName);
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
static checkArrayEmpty(argumentName, argumentValue) {
|
|
705
|
-
ValidationUtilities.checkArgumentEmpty(argumentName, argumentValue);
|
|
706
|
-
if (argumentValue.length === 0) {
|
|
707
|
-
throw new ArgumentEmptyException(argumentName);
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
static checkStringIsNotEmpty(argumentName, argumentValue) {
|
|
711
|
-
this.checkArgumentEmpty(argumentName, argumentValue);
|
|
712
|
-
if (argumentValue === '') {
|
|
713
|
-
throw new ArgumentEmptyException(argumentName);
|
|
714
|
-
}
|
|
715
|
-
return argumentValue;
|
|
716
|
-
}
|
|
717
|
-
static checkArgumentOutOfRange(argumentName, argumentValue, range) {
|
|
718
|
-
if (range.begin && argumentValue < range.begin) {
|
|
719
|
-
throw new ArgumentOutOfRangeException(argumentName);
|
|
720
|
-
}
|
|
721
|
-
if (range.end && argumentValue > range.end) {
|
|
722
|
-
throw new ArgumentOutOfRangeException(argumentName);
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
class FilterGroup extends BaseFilter {
|
|
728
|
-
constructor(logicalOperation = LogicalOperatorType.And) {
|
|
729
|
-
super(FilterType.FilterGroup);
|
|
730
|
-
this.filters = new Map();
|
|
731
|
-
this.logicalOperation = logicalOperation;
|
|
732
|
-
}
|
|
733
|
-
get items() {
|
|
734
|
-
return classToPlain(this.filters, {
|
|
735
|
-
exposeUnsetFields: false,
|
|
736
|
-
excludePrefixes: ['_'],
|
|
737
|
-
});
|
|
738
|
-
}
|
|
739
|
-
/**
|
|
740
|
-
* Returns filter item by index.
|
|
741
|
-
* @param index Item index.
|
|
742
|
-
* @returns Filter.
|
|
743
|
-
*/
|
|
744
|
-
getItemByIndex(index) {
|
|
745
|
-
return this.items[Object.keys(this.items)[index]];
|
|
746
|
-
}
|
|
747
|
-
addSchemaColumnFilterWithParameter(comparisonType, columnPath, parameterValue) {
|
|
748
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
749
|
-
const rightExpression = new ParameterExpression({ value: parameterValue });
|
|
750
|
-
const filter = new CompareFilter(comparisonType, leftExpression, rightExpression);
|
|
751
|
-
this.add(filter);
|
|
752
|
-
}
|
|
753
|
-
addSchemaColumnInFilterWithParameters(comparisonType, columnPath, parameterValues) {
|
|
754
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
755
|
-
const expressions = parameterValues.map((singleParameterValue) => new ParameterExpression({
|
|
756
|
-
value: singleParameterValue,
|
|
757
|
-
}));
|
|
758
|
-
const filter = new InFilter(comparisonType, leftExpression, expressions);
|
|
759
|
-
this.add(filter);
|
|
760
|
-
}
|
|
761
|
-
addSchemaColumnIsNullFilter(columnPath) {
|
|
762
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
763
|
-
const filter = new IsNullFilter(ComparisonType.Is_null, leftExpression);
|
|
764
|
-
this.add(filter);
|
|
765
|
-
}
|
|
766
|
-
addSchemaColumnIsNotNullFilter(columnPath) {
|
|
767
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
768
|
-
const filter = new IsNullFilter(ComparisonType.Is_not_null, leftExpression);
|
|
769
|
-
this.add(filter);
|
|
770
|
-
}
|
|
771
|
-
/**
|
|
772
|
-
* Creates and adds filter between less value and greater value.
|
|
773
|
-
* @param columnPath Column path.
|
|
774
|
-
* @param lessParamValue Less parameter value.
|
|
775
|
-
* @param greaterParamValue Greater parameter value.
|
|
776
|
-
*/
|
|
777
|
-
addSchemaColumnBetweenFilterWithParameters(columnPath, lessParamValue, greaterParamValue) {
|
|
778
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
779
|
-
const rightLessExpression = new ParameterExpression({ value: lessParamValue });
|
|
780
|
-
const rightGreaterExpression = new ParameterExpression({ value: greaterParamValue });
|
|
781
|
-
const filter = new BetweenFilter(leftExpression, rightLessExpression, rightGreaterExpression);
|
|
782
|
-
this.add(filter);
|
|
783
|
-
}
|
|
784
|
-
addExistsFilter(columnPath, subFilters) {
|
|
785
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
786
|
-
const filter = new ExistsFilter(leftExpression, subFilters);
|
|
787
|
-
this.add(filter);
|
|
788
|
-
}
|
|
789
|
-
addNotExistsFilter(columnPath, subFilters) {
|
|
790
|
-
const leftExpression = new ColumnExpression({ columnPath });
|
|
791
|
-
const filter = new ExistsFilter(leftExpression, subFilters, ComparisonType.Not_exists);
|
|
792
|
-
this.add(filter);
|
|
793
|
-
}
|
|
794
|
-
add(filter, filterKey) {
|
|
795
|
-
ValidationUtilities.checkArgumentEmpty('filter', filter);
|
|
796
|
-
const key = filterKey || generateGuid();
|
|
797
|
-
this.filters.set(key, filter);
|
|
798
|
-
}
|
|
799
|
-
clone() {
|
|
800
|
-
const filterGroup = new FilterGroup(this.logicalOperation);
|
|
801
|
-
this.filters.forEach((filter, filterKey) => {
|
|
802
|
-
filterGroup.filters.set(filterKey, filter.clone());
|
|
803
|
-
});
|
|
804
|
-
return filterGroup;
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
__decorate([
|
|
808
|
-
Exclude(),
|
|
809
|
-
__metadata("design:type", Object)
|
|
810
|
-
], FilterGroup.prototype, "filters", void 0);
|
|
811
|
-
__decorate([
|
|
812
|
-
Expose(),
|
|
813
|
-
__metadata("design:type", Object),
|
|
814
|
-
__metadata("design:paramtypes", [])
|
|
815
|
-
], FilterGroup.prototype, "items", null);
|
|
816
|
-
|
|
817
|
-
class BaseQueryColumn {
|
|
818
|
-
constructor(expression) {
|
|
819
|
-
this.orderDirection = OrderDirection.None;
|
|
820
|
-
this.orderPosition = -1;
|
|
821
|
-
this.isVisible = true;
|
|
822
|
-
this.expression = expression;
|
|
823
|
-
}
|
|
824
|
-
/**
|
|
825
|
-
* Adds ordering options.
|
|
826
|
-
* @param orderDirection Direction.
|
|
827
|
-
* @param orderPosition Position.
|
|
828
|
-
* @returns Self.
|
|
829
|
-
*/
|
|
830
|
-
withOrdering(orderDirection, orderPosition) {
|
|
831
|
-
ValidationUtilities.checkArgumentEmpty('orderDirection', orderDirection);
|
|
832
|
-
ValidationUtilities.checkArgumentEmpty('orderPosition', orderPosition);
|
|
833
|
-
ValidationUtilities.checkArgumentOutOfRange('orderPosition', orderPosition, { begin: -1 });
|
|
834
|
-
this.orderDirection = orderDirection;
|
|
835
|
-
this.orderPosition = orderPosition;
|
|
836
|
-
return this;
|
|
837
|
-
}
|
|
838
|
-
/**
|
|
839
|
-
* Adds options.
|
|
840
|
-
* @param options Options.
|
|
841
|
-
* @returns Self.
|
|
842
|
-
*/
|
|
843
|
-
withOptions(options) {
|
|
844
|
-
ValidationUtilities.checkArgumentEmpty('options', options);
|
|
845
|
-
this.isVisible = options.isVisible ?? true;
|
|
846
|
-
return this;
|
|
847
|
-
}
|
|
848
|
-
/**
|
|
849
|
-
* Adds caption.
|
|
850
|
-
* @param caption Caption.
|
|
851
|
-
* @returns Self.
|
|
852
|
-
*/
|
|
853
|
-
withCaption(caption) {
|
|
854
|
-
ValidationUtilities.checkArgumentEmpty('caption', caption);
|
|
855
|
-
this.caption = caption;
|
|
856
|
-
return this;
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
class ArithmeticQueryColumn extends BaseQueryColumn {
|
|
861
|
-
// region Constructors: Public
|
|
862
|
-
constructor(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand) {
|
|
863
|
-
super(new ArithmeticExpression({ arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand }));
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
class EntityQueryColumn extends BaseQueryColumn {
|
|
868
|
-
// region Constructors: Public
|
|
869
|
-
constructor(columnPath) {
|
|
870
|
-
super(new ColumnExpression({ columnPath }));
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
class ParameterQueryColumn extends BaseQueryColumn {
|
|
875
|
-
// region Constructors: Public
|
|
876
|
-
constructor(value, dataValueType) {
|
|
877
|
-
super(new ParameterExpression({ value, dataValueType }));
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
class AggregationSubQueryColumn extends BaseQueryColumn {
|
|
882
|
-
// region Constructors: Public
|
|
883
|
-
constructor(columnPath, aggregationType, subFilters, subOrderDirection, subOrderColumn) {
|
|
884
|
-
super(new AggregationSubQueryExpression({
|
|
885
|
-
aggregationType,
|
|
886
|
-
columnPath,
|
|
887
|
-
subFilters,
|
|
888
|
-
subOrderDirection,
|
|
889
|
-
subOrderColumn,
|
|
890
|
-
}));
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
class SubQueryColumn extends BaseQueryColumn {
|
|
895
|
-
// region Constructors: Public
|
|
896
|
-
constructor(columnPath, subFilters) {
|
|
897
|
-
super(new SubQueryExpression({ columnPath, subFilters }));
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
class AggregationFunctionColumn extends BaseQueryColumn {
|
|
902
|
-
// region Constructors: Public
|
|
903
|
-
constructor(aggregationType, aggregationEvalType, functionArgument) {
|
|
904
|
-
super(new AggregationFunctionExpression({
|
|
905
|
-
aggregationType,
|
|
906
|
-
aggregationEvalType,
|
|
907
|
-
functionArgument,
|
|
908
|
-
}));
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
class DatePartFunctionColumn extends BaseQueryColumn {
|
|
913
|
-
// region Constructors: Public
|
|
914
|
-
constructor(datePartType, functionArgument) {
|
|
915
|
-
super(new DatePartFunctionExpression({
|
|
916
|
-
datePartType,
|
|
917
|
-
functionArgument,
|
|
918
|
-
}));
|
|
919
|
-
}
|
|
920
|
-
// endregion
|
|
921
|
-
// region Properties: Public
|
|
922
|
-
get datePartType() {
|
|
923
|
-
return this.expression?.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
|
-
}
|
|
5
|
+
import { __decorate, __metadata } from 'tslib';
|
|
947
6
|
|
|
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,182 +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
|
-
}
|
|
1167
|
-
/**
|
|
1168
|
-
* @internal
|
|
1169
|
-
*/
|
|
1170
|
-
function checkCrtTypeNamePascalCase(type) {
|
|
1171
|
-
const [vendor, typeName] = type.split('.');
|
|
1172
|
-
const pascalTypeName = toPascalCase(typeName);
|
|
1173
|
-
if (vendor.toLowerCase() === 'crt' && pascalTypeName !== typeName) {
|
|
1174
|
-
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');
|
|
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
|
-
}
|
|
216
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
217
|
+
const DesignerToolGroupType = { ...ViewElementDataGroupType, ...ViewElementGroupType };
|
|
218
|
+
|
|
1191
219
|
/**
|
|
220
|
+
* Handler source types in order of call priority.
|
|
1192
221
|
* @internal
|
|
1193
222
|
*/
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
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
230
|
/**
|
|
1201
231
|
* @internal
|
|
1202
232
|
*/
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
this._addItemListeners.splice(this._addItemListeners.indexOf(handler), 1);
|
|
1211
|
-
};
|
|
1212
|
-
}
|
|
1213
|
-
static onRemoveRequestHandler(handler) {
|
|
1214
|
-
this._removeItemListeners.push(handler);
|
|
1215
|
-
return () => {
|
|
1216
|
-
this._removeItemListeners.splice(this._removeItemListeners.indexOf(handler), 1);
|
|
1217
|
-
};
|
|
1218
|
-
}
|
|
1219
|
-
static addRequestHandler(handlerType, config) {
|
|
1220
|
-
if (!this._requestHandlersMap.has(handlerType)) {
|
|
1221
|
-
this._requestHandlersMap.set(handlerType, config);
|
|
1222
|
-
for (const listener of this._addItemListeners) {
|
|
1223
|
-
listener(handlerType, config);
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
static removeRequestHandler(handlerType) {
|
|
1228
|
-
const config = this._requestHandlersMap.get(handlerType);
|
|
1229
|
-
if (config) {
|
|
1230
|
-
this._requestHandlersMap.delete(handlerType);
|
|
1231
|
-
for (const listener of this._removeItemListeners) {
|
|
1232
|
-
listener(handlerType, config);
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
InternalRequestHandlerRegistryType._addItemListeners = [];
|
|
1238
|
-
InternalRequestHandlerRegistryType._removeItemListeners = [];
|
|
1239
|
-
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
|
+
|
|
1240
240
|
const global$3 = window;
|
|
1241
|
-
global$3.creatio ?? (global$3.creatio = {});
|
|
1242
|
-
if (!global$3.creatio.requestHandlerRegistry) {
|
|
1243
|
-
Object.defineProperty(global$3.creatio, 'requestHandlerRegistry', {
|
|
1244
|
-
get: () => InternalRequestHandlerRegistryType,
|
|
1245
|
-
configurable: false,
|
|
1246
|
-
});
|
|
1247
|
-
}
|
|
1248
241
|
/**
|
|
1249
|
-
* @
|
|
242
|
+
* @public
|
|
243
|
+
* @description For internal use only.
|
|
1250
244
|
*/
|
|
1251
245
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1252
|
-
|
|
1253
|
-
/**
|
|
1254
|
-
* @internal
|
|
1255
|
-
*/
|
|
1256
|
-
class RequestHandlerRegistryService {
|
|
1257
|
-
/**
|
|
1258
|
-
* Register request handler class.
|
|
1259
|
-
* @param config Request handler registration config.
|
|
1260
|
-
* @param type Request handler type.
|
|
1261
|
-
*/
|
|
1262
|
-
static register(config, type) {
|
|
1263
|
-
const requestType = config.requestType;
|
|
1264
|
-
const requestHandlerType = config.type;
|
|
1265
|
-
if (!requestType) {
|
|
1266
|
-
throw new Error(`Error when register ${requestHandlerType}. Request type not specified.`);
|
|
1267
|
-
}
|
|
1268
|
-
const requestHandlerMapValue = {
|
|
1269
|
-
instanceType: type,
|
|
1270
|
-
instanceConfig: config,
|
|
1271
|
-
};
|
|
1272
|
-
RequestHandlerRegistryService._internalRegistry.addRequestHandler(requestHandlerType, requestHandlerMapValue);
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
RequestHandlerRegistryService._internalRegistry = global$3.creatio.requestHandlerRegistry;
|
|
1276
|
-
|
|
1277
|
-
/**
|
|
1278
|
-
* @internal
|
|
1279
|
-
*/
|
|
1280
|
-
class RequestRegistryService {
|
|
1281
|
-
static get requestsRegistrationInfos() {
|
|
1282
|
-
return this._requestsRegistrationInfos;
|
|
1283
|
-
}
|
|
1284
|
-
/**
|
|
1285
|
-
* Registers a specified request class.
|
|
1286
|
-
* @param config Request registration config.
|
|
1287
|
-
* @param type Request type.
|
|
1288
|
-
*/
|
|
1289
|
-
static register(config, type) {
|
|
1290
|
-
const requestType = config.type;
|
|
1291
|
-
// TODO RND-21723
|
|
1292
|
-
RequestRegistryService._requestsMap.set(requestType, type);
|
|
1293
|
-
RequestRegistryService._requestsRegistrationInfos.set(requestType, config);
|
|
1294
|
-
}
|
|
1295
|
-
/**
|
|
1296
|
-
* Creates request instance by specified registered request type.
|
|
1297
|
-
* @param type Request type.
|
|
1298
|
-
* @returns The instance of registered request.
|
|
1299
|
-
*/
|
|
1300
|
-
static get(type) {
|
|
1301
|
-
const requestInstanceConstructor = RequestRegistryService._requestsMap.get(type);
|
|
1302
|
-
checkIfTypeRegistered(type, requestInstanceConstructor);
|
|
1303
|
-
return requestInstanceConstructor && new requestInstanceConstructor();
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
RequestRegistryService._requestsMap = new Map();
|
|
1307
|
-
RequestRegistryService._requestsRegistrationInfos = new Map();
|
|
1308
|
-
|
|
1309
|
-
const global$2 = window;
|
|
1310
|
-
/**
|
|
1311
|
-
* @internal
|
|
1312
|
-
*/
|
|
1313
|
-
class BaseRegistry {
|
|
246
|
+
class ɵBaseRegistry {
|
|
1314
247
|
constructor() {
|
|
1315
248
|
this.store = {
|
|
1316
249
|
typeInfos: new Map(),
|
|
@@ -1318,1255 +251,1014 @@ class BaseRegistry {
|
|
|
1318
251
|
}
|
|
1319
252
|
static get store() {
|
|
1320
253
|
if (!this._instance) {
|
|
1321
|
-
let globalInstance = get(global$
|
|
254
|
+
let globalInstance = get(global$3, this._prefix + this.registryKey);
|
|
1322
255
|
if (!globalInstance) {
|
|
1323
256
|
globalInstance = new this();
|
|
1324
|
-
set(global$
|
|
257
|
+
set(global$3, this._prefix + this.registryKey, globalInstance);
|
|
1325
258
|
}
|
|
1326
259
|
this._instance = globalInstance;
|
|
1327
260
|
}
|
|
1328
261
|
return this._instance.store;
|
|
1329
262
|
}
|
|
1330
263
|
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
/**
|
|
1334
|
-
* @internal
|
|
1335
|
-
*/
|
|
1336
|
-
class ConverterRegistry extends BaseRegistry {
|
|
1337
|
-
static get(type) {
|
|
1338
|
-
if (!this.store.typeInfos.has(type)) {
|
|
1339
|
-
throw new Error(`'${type}' converter doesn't exist`);
|
|
1340
|
-
}
|
|
1341
|
-
return this.store.typeInfos.get(type);
|
|
1342
|
-
}
|
|
1343
|
-
static register(item) {
|
|
1344
|
-
checkTypeNameFormat(item.type, 'ConverterTypeName');
|
|
1345
|
-
checkCrtTypeNamePascalCase(item.type);
|
|
1346
|
-
// TODO RND-21723
|
|
1347
|
-
this.store.typeInfos.set(item.type, item);
|
|
1348
|
-
}
|
|
1349
|
-
static clear() {
|
|
1350
|
-
this.store.typeInfos.clear();
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
ConverterRegistry.registryKey = 'ConverterRegistry';
|
|
264
|
+
ɵBaseRegistry._prefix = 'creatio.registry.';
|
|
1354
265
|
|
|
1355
266
|
/**
|
|
1356
267
|
* @internal
|
|
1357
268
|
*/
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
* @internal
|
|
1361
|
-
*/
|
|
1362
|
-
class ViewElementRegistry extends BaseRegistry {
|
|
1363
|
-
static validate(config) {
|
|
1364
|
-
checkTypeNameFormat(config.type, 'ViewElementTypeName');
|
|
1365
|
-
checkOnlyOneRegistration(config.type, config, ViewElementRegistry.viewElements);
|
|
1366
|
-
}
|
|
1367
|
-
static get viewElements() {
|
|
269
|
+
class PkgTopology extends ɵBaseRegistry {
|
|
270
|
+
static get items() {
|
|
1368
271
|
return this.store.typeInfos;
|
|
1369
272
|
}
|
|
1370
|
-
static
|
|
1371
|
-
this.
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
return
|
|
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;
|
|
1376
279
|
}
|
|
1377
280
|
}
|
|
1378
|
-
|
|
281
|
+
PkgTopology.registryKey = 'pkgTopology';
|
|
1379
282
|
|
|
1380
283
|
/**
|
|
1381
284
|
* @internal
|
|
1382
285
|
*/
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
static validate(config) {
|
|
1389
|
-
checkTypeNameFormat(config.type, 'InterfaceDesignerItemTypeName');
|
|
1390
|
-
checkCrtTypeNamePascalCase(config.type);
|
|
1391
|
-
checkOnlyOneRegistration(config.type, config, this.interfaceDesignerItemRegistrationInfos);
|
|
286
|
+
class HandlersOrderComparer {
|
|
287
|
+
constructor(_request) {
|
|
288
|
+
this._request = _request;
|
|
289
|
+
const scopesOrderEntries = [...(this._request.scopes ?? [])].reverse().map((scope, index) => [scope, index]);
|
|
290
|
+
this._scopesOrder = Object.fromEntries(scopesOrderEntries);
|
|
1392
291
|
}
|
|
1393
|
-
|
|
1394
|
-
|
|
292
|
+
_getOrderByScopes(handler) {
|
|
293
|
+
if (!handler.scopes) {
|
|
294
|
+
return Number.MAX_VALUE;
|
|
295
|
+
}
|
|
296
|
+
const scopesOrder = handler.scopes.filter((s) => s in this._scopesOrder).map((s) => this._scopesOrder[s]);
|
|
297
|
+
return Math.min(...scopesOrder);
|
|
1395
298
|
}
|
|
1396
|
-
|
|
1397
|
-
|
|
299
|
+
_getOrderByPkgTopology(handler) {
|
|
300
|
+
if (handler.source.type === HandlerSourceType.Host) {
|
|
301
|
+
return Number.MAX_VALUE;
|
|
302
|
+
}
|
|
303
|
+
return PkgTopology.get(handler.source.packageName);
|
|
1398
304
|
}
|
|
1399
|
-
|
|
1400
|
-
|
|
305
|
+
compare(a, b) {
|
|
306
|
+
const aScopeOrder = this._getOrderByScopes(a);
|
|
307
|
+
const bScopeOrder = this._getOrderByScopes(b);
|
|
308
|
+
let diff = aScopeOrder - bScopeOrder;
|
|
309
|
+
if (diff) {
|
|
310
|
+
return diff;
|
|
311
|
+
}
|
|
312
|
+
const aPkgTopologyOrder = this._getOrderByPkgTopology(a);
|
|
313
|
+
const bPkgTopologyOrder = this._getOrderByPkgTopology(b);
|
|
314
|
+
diff = aPkgTopologyOrder - bPkgTopologyOrder;
|
|
315
|
+
if (diff) {
|
|
316
|
+
return diff;
|
|
317
|
+
}
|
|
318
|
+
diff = a.source.type - b.source.type;
|
|
319
|
+
return diff;
|
|
1401
320
|
}
|
|
1402
321
|
}
|
|
1403
|
-
InterfaceDesignerItemRegistry.registryKey = interfaceDesignerItemRegistryKey;
|
|
1404
322
|
|
|
1405
|
-
const global$1 = window;
|
|
1406
323
|
/**
|
|
1407
324
|
* @internal
|
|
1408
325
|
*/
|
|
1409
|
-
class
|
|
326
|
+
class InternalHandlerChain {
|
|
1410
327
|
constructor() {
|
|
1411
|
-
this.
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
*/
|
|
1435
|
-
class HandlerChainServicesRegistry extends BaseRegistry {
|
|
1436
|
-
static validate({ requestType }) {
|
|
1437
|
-
checkTypeNameFormat(requestType, this.registryKey);
|
|
1438
|
-
checkCrtTypeNamePascalCase(requestType);
|
|
1439
|
-
this.checkUniqueRequestType(requestType);
|
|
328
|
+
this._handlers = [];
|
|
329
|
+
this._handlersCache = new Map();
|
|
330
|
+
this._handlersScopesByContextId = new Map();
|
|
331
|
+
this.handlerChain$ = {
|
|
332
|
+
process: async (request) => {
|
|
333
|
+
const handler = this._getHandler(request);
|
|
334
|
+
return handler?.handle(request);
|
|
335
|
+
},
|
|
336
|
+
register: (info) => {
|
|
337
|
+
this._handlersCache.delete(info.requestType);
|
|
338
|
+
this._handlers.push(info);
|
|
339
|
+
return () => {
|
|
340
|
+
const index = this._handlers.indexOf(info);
|
|
341
|
+
if (index > -1) {
|
|
342
|
+
this._handlers.splice(index, 1);
|
|
343
|
+
this._handlersCache.delete(info.requestType);
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
console.warn(`${info?.requestType} not found to unsubscribe`);
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
},
|
|
350
|
+
};
|
|
1440
351
|
}
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
}
|
|
352
|
+
clearContextedHandlersCache(contextId) {
|
|
353
|
+
const configs = this._handlersScopesByContextId.get(contextId) ?? [];
|
|
354
|
+
return configs.every(({ requestType, scope }) => this._handlersCache.get(requestType)?.delete(scope));
|
|
1445
355
|
}
|
|
1446
|
-
|
|
1447
|
-
this.
|
|
1448
|
-
this.services.set(config.requestType, config);
|
|
356
|
+
_getHandler(request) {
|
|
357
|
+
return this._hasCacheHandler(request) ? this._getCacheHandler(request) : this._buildHandlersChain(request);
|
|
1449
358
|
}
|
|
1450
|
-
|
|
1451
|
-
|
|
359
|
+
_getCacheHandler(request) {
|
|
360
|
+
const map = this._handlersCache.get(request.type);
|
|
361
|
+
const key = this._getCacheScopesKey(request);
|
|
362
|
+
return map.get(key);
|
|
1452
363
|
}
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
* @internal
|
|
1458
|
-
*/
|
|
1459
|
-
const designTimeViewElementRegistryKey = 'DesignTimeViewElementRegistry';
|
|
1460
|
-
/**
|
|
1461
|
-
* @internal
|
|
1462
|
-
*/
|
|
1463
|
-
class DesignTimeViewElementRegistry extends BaseRegistry {
|
|
1464
|
-
static validate(config) {
|
|
1465
|
-
checkTypeNameFormat(config.type, 'DesignTimeViewElementRegistryItemTypeName');
|
|
1466
|
-
checkCrtTypeNamePascalCase(config.type);
|
|
1467
|
-
checkOnlyOneRegistration(config.type, config, this.infos);
|
|
364
|
+
_hasCacheHandler(request) {
|
|
365
|
+
const map = this._handlersCache.get(request.type);
|
|
366
|
+
const key = this._getCacheScopesKey(request);
|
|
367
|
+
return map && map.has(key);
|
|
1468
368
|
}
|
|
1469
|
-
|
|
1470
|
-
this.
|
|
369
|
+
_getCacheScopesKey(request) {
|
|
370
|
+
const injectionContextKey = this._getInjectionContext(request?.$context)?.id ?? '';
|
|
371
|
+
return (request.scopes || ['']).join('_').concat(injectionContextKey);
|
|
1471
372
|
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
373
|
+
_getInjectionContext(viewModel) {
|
|
374
|
+
return (viewModel?.['_injectionContext'] ||
|
|
375
|
+
(viewModel?.['parent'] && this._getInjectionContext(viewModel['parent'])));
|
|
376
|
+
}
|
|
377
|
+
_setContextedScopes(request, scope) {
|
|
378
|
+
const injectionContext = this._getInjectionContext(request?.$context)?.id;
|
|
379
|
+
const configs = this._handlersScopesByContextId.has(injectionContext)
|
|
380
|
+
? this._handlersScopesByContextId.get(injectionContext)
|
|
381
|
+
: [];
|
|
382
|
+
configs.push({ requestType: request.type, scope });
|
|
383
|
+
this._handlersScopesByContextId.set(injectionContext, configs);
|
|
384
|
+
}
|
|
385
|
+
_setCacheHandler(request, handler) {
|
|
386
|
+
const map = this._handlersCache.has(request.type)
|
|
387
|
+
? this._handlersCache.get(request.type)
|
|
388
|
+
: new Map();
|
|
389
|
+
const key = this._getCacheScopesKey(request);
|
|
390
|
+
map.set(key, handler);
|
|
391
|
+
if (this._getInjectionContext(request?.$context)?.id) {
|
|
392
|
+
this._setContextedScopes(request, key);
|
|
1476
393
|
}
|
|
1477
|
-
|
|
394
|
+
this._handlersCache.set(request.type, map);
|
|
1478
395
|
}
|
|
1479
|
-
|
|
1480
|
-
return
|
|
396
|
+
_isRequestHandler(handler) {
|
|
397
|
+
return (typeof handler.handle === 'function' &&
|
|
398
|
+
typeof handler.setNext === 'function');
|
|
399
|
+
}
|
|
400
|
+
_checkHandlerInstanceOf(handler) {
|
|
401
|
+
if (!this._isRequestHandler(handler)) {
|
|
402
|
+
throw new Error('Handler should implement "BaseRequestHandler"');
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
_buildHandlersChain(request) {
|
|
406
|
+
const handlers = this._handlers.filter((h) => {
|
|
407
|
+
if (h.requestType !== request.type) {
|
|
408
|
+
return false;
|
|
409
|
+
}
|
|
410
|
+
if (!h.scopes?.length) {
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
return h.scopes.some((s) => request.scopes?.includes(s));
|
|
414
|
+
});
|
|
415
|
+
const comparer = new HandlersOrderComparer(request);
|
|
416
|
+
handlers.sort((a, b) => comparer.compare(a, b));
|
|
417
|
+
const handlerInstances = handlers.map((handlerConfig) => {
|
|
418
|
+
const injectionContext = this._getInjectionContext(request?.$context);
|
|
419
|
+
return handlerConfig.createHandler(injectionContext);
|
|
420
|
+
});
|
|
421
|
+
handlerInstances.forEach((handler) => this._checkHandlerInstanceOf(handler));
|
|
422
|
+
this._joinHandlersInChain(handlerInstances);
|
|
423
|
+
const result = handlerInstances[0];
|
|
424
|
+
this._setCacheHandler(request, result);
|
|
425
|
+
return result;
|
|
426
|
+
}
|
|
427
|
+
_joinHandlersInChain(handlers) {
|
|
428
|
+
for (let index = 0; index < handlers.length - 1; index++) {
|
|
429
|
+
try {
|
|
430
|
+
handlers[index].setNext(handlers[index + 1]);
|
|
431
|
+
}
|
|
432
|
+
catch (error) {
|
|
433
|
+
if (error instanceof ɵNextHandlerAlreadySpecifiedException) {
|
|
434
|
+
throw new Error('Handler factory should return new instance of ' +
|
|
435
|
+
'BaseRequestHandler class or its subclass ' +
|
|
436
|
+
'(next handler should not be specified)');
|
|
437
|
+
}
|
|
438
|
+
throw error;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
1481
441
|
}
|
|
1482
442
|
}
|
|
1483
|
-
DesignTimeViewElementRegistry.registryKey = designTimeViewElementRegistryKey;
|
|
1484
443
|
|
|
444
|
+
const global$2 = window;
|
|
1485
445
|
/**
|
|
1486
|
-
* @
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
}
|
|
1490
|
-
/**
|
|
1491
|
-
* @internal
|
|
1492
|
-
*/
|
|
1493
|
-
const validatorRegistryKey = 'ValidatorRegistry';
|
|
1494
|
-
/**
|
|
1495
|
-
* @internal
|
|
446
|
+
* @public
|
|
447
|
+
* @class HandlerChainService
|
|
448
|
+
* @classdesc Service to design handlers in chain.
|
|
1496
449
|
*/
|
|
1497
|
-
class
|
|
1498
|
-
|
|
1499
|
-
return
|
|
450
|
+
class HandlerChainService {
|
|
451
|
+
get _chain() {
|
|
452
|
+
return global$2.handlerChain;
|
|
1500
453
|
}
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
454
|
+
set _chain(value) {
|
|
455
|
+
global$2.handlerChain = value;
|
|
456
|
+
}
|
|
457
|
+
static get instance() {
|
|
458
|
+
return HandlerChainService._instance || (HandlerChainService._instance = new HandlerChainService());
|
|
459
|
+
}
|
|
460
|
+
constructor() {
|
|
461
|
+
if (!this._chain) {
|
|
462
|
+
this._createGlobalHandlerChain();
|
|
1505
463
|
}
|
|
1506
464
|
}
|
|
1507
|
-
|
|
1508
|
-
|
|
465
|
+
_createGlobalHandlerChain() {
|
|
466
|
+
this._chain = new InternalHandlerChain();
|
|
1509
467
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
468
|
+
/**
|
|
469
|
+
* @internal
|
|
470
|
+
*/
|
|
471
|
+
clearContextedHandlersCache(contextId) {
|
|
472
|
+
return this._chain.clearContextedHandlersCache(contextId);
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* @internal
|
|
476
|
+
*/
|
|
477
|
+
register(handlerConfig) {
|
|
478
|
+
return this._chain.handlerChain$.register(handlerConfig);
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* @description Method to process passed request
|
|
482
|
+
* @param request - {@link ɵBaseRequest}
|
|
483
|
+
* @return `Promise<unknown>`
|
|
484
|
+
*/
|
|
485
|
+
process(request) {
|
|
486
|
+
return this._chain.handlerChain$.process(request);
|
|
1512
487
|
}
|
|
1513
488
|
}
|
|
1514
|
-
ValidatorRegistry.registryKey = validatorRegistryKey;
|
|
1515
489
|
|
|
1516
490
|
/**
|
|
1517
491
|
* @internal
|
|
1518
492
|
*/
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
493
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
494
|
+
function ImplementUsingHandlerChain(config) {
|
|
495
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
496
|
+
return function (target, method, descriptor) {
|
|
497
|
+
const methodImplementation = function (...args) {
|
|
498
|
+
return HandlerChainService.instance.process({
|
|
499
|
+
type: config?.requestType ? config.requestType : this.requestType,
|
|
500
|
+
method: config?.methodName ? config.methodName : method,
|
|
501
|
+
args,
|
|
502
|
+
});
|
|
503
|
+
};
|
|
504
|
+
if (descriptor) {
|
|
505
|
+
descriptor.value = methodImplementation;
|
|
1527
506
|
}
|
|
1528
|
-
|
|
1529
|
-
|
|
507
|
+
else {
|
|
508
|
+
target[method] = methodImplementation;
|
|
509
|
+
}
|
|
510
|
+
};
|
|
1530
511
|
}
|
|
1531
|
-
PkgTopology.registryKey = 'pkgTopology';
|
|
1532
512
|
|
|
1533
513
|
/**
|
|
1534
514
|
* @internal
|
|
1535
|
-
* @dontChange
|
|
1536
515
|
*/
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
*/
|
|
1541
|
-
static get items() {
|
|
1542
|
-
return this.store.typeInfos;
|
|
516
|
+
function objectDeepKeys(obj) {
|
|
517
|
+
if (obj === null || typeof obj !== 'object') {
|
|
518
|
+
return [];
|
|
1543
519
|
}
|
|
520
|
+
return Object.keys(obj)
|
|
521
|
+
.filter((key) => obj[key] instanceof Object)
|
|
522
|
+
.map((key) => objectDeepKeys(obj[key]).map((k) => [key, ...k]))
|
|
523
|
+
.reduce((x, y) => [...x, ...y], Object.keys(obj).map((x) => [x]));
|
|
1544
524
|
}
|
|
1545
|
-
/**
|
|
1546
|
-
* @dontChange
|
|
1547
|
-
*/
|
|
1548
|
-
RemoteEntriesRegistry.registryKey = 'remotes';
|
|
1549
525
|
|
|
1550
526
|
/**
|
|
1551
527
|
* @internal
|
|
1552
528
|
*/
|
|
1553
|
-
function
|
|
1554
|
-
const
|
|
1555
|
-
if (
|
|
1556
|
-
|
|
529
|
+
function checkTypeNameFormat(type, element) {
|
|
530
|
+
const typeParts = type.split('.');
|
|
531
|
+
if (typeParts.length < 2) {
|
|
532
|
+
throw new Error(`Error when register ${type}. Type property should have format "VendorPrefix.${element}"`);
|
|
1557
533
|
}
|
|
1558
|
-
return !!componentConfig?.inputs[componentProperty]?.propertyBindable;
|
|
1559
534
|
}
|
|
1560
|
-
|
|
1561
535
|
/**
|
|
1562
|
-
* @
|
|
536
|
+
* @public
|
|
537
|
+
* @description For internal use only.
|
|
1563
538
|
*/
|
|
1564
|
-
|
|
1565
|
-
(
|
|
1566
|
-
|
|
1567
|
-
ViewElementGroupType["Components"] = "Components";
|
|
1568
|
-
ViewElementGroupType["LayoutElements"] = "LayoutElements";
|
|
1569
|
-
ViewElementGroupType["Inputs"] = "Inputs";
|
|
1570
|
-
ViewElementGroupType["CustomElements"] = "CustomElements";
|
|
1571
|
-
})(ViewElementGroupType || (ViewElementGroupType = {}));
|
|
1572
|
-
|
|
1573
|
-
/**
|
|
1574
|
-
* @internal
|
|
1575
|
-
*/
|
|
1576
|
-
var ViewElementDataGroupType;
|
|
1577
|
-
(function (ViewElementDataGroupType) {
|
|
1578
|
-
ViewElementDataGroupType["Data"] = "Data";
|
|
1579
|
-
})(ViewElementDataGroupType || (ViewElementDataGroupType = {}));
|
|
1580
|
-
/**
|
|
1581
|
-
* @internal
|
|
1582
|
-
*/
|
|
1583
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1584
|
-
const DesignerToolGroupType = { ...ViewElementDataGroupType, ...ViewElementGroupType };
|
|
1585
|
-
|
|
1586
|
-
/**
|
|
1587
|
-
* @internal
|
|
1588
|
-
*/
|
|
1589
|
-
var DataSourceScope;
|
|
1590
|
-
(function (DataSourceScope) {
|
|
1591
|
-
DataSourceScope["ViewElement"] = "viewElement";
|
|
1592
|
-
DataSourceScope["Page"] = "page";
|
|
1593
|
-
})(DataSourceScope || (DataSourceScope = {}));
|
|
1594
|
-
|
|
539
|
+
function ɵcheckTypeNameFormat(type, element) {
|
|
540
|
+
return checkTypeNameFormat(type, element);
|
|
541
|
+
}
|
|
1595
542
|
/**
|
|
1596
543
|
* @internal
|
|
1597
544
|
*/
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
}
|
|
1604
|
-
|
|
545
|
+
function checkTypeNamePascalCase(type) {
|
|
546
|
+
const [vendor, typeName] = type.split('.');
|
|
547
|
+
const pascalTypeName = toPascalCase(typeName);
|
|
548
|
+
if (!vendor || pascalTypeName !== typeName) {
|
|
549
|
+
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');
|
|
550
|
+
}
|
|
551
|
+
}
|
|
1605
552
|
/**
|
|
1606
|
-
* Handler source types in order of call priority.
|
|
1607
553
|
* @internal
|
|
1608
554
|
*/
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
}
|
|
1615
|
-
|
|
555
|
+
function checkCrtTypeNamePascalCase(type) {
|
|
556
|
+
const [vendor, typeName] = type.split('.');
|
|
557
|
+
const pascalTypeName = toPascalCase(typeName);
|
|
558
|
+
if (vendor.toLowerCase() === 'crt' && pascalTypeName !== typeName) {
|
|
559
|
+
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');
|
|
560
|
+
}
|
|
561
|
+
}
|
|
1616
562
|
/**
|
|
1617
563
|
* @internal
|
|
1618
564
|
*/
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
DataSchemaAttributeType["ForwardReferenceAttribute"] = "ForwardReference";
|
|
1623
|
-
DataSchemaAttributeType["BackReferenceAttribute"] = "BackReference";
|
|
1624
|
-
DataSchemaAttributeType["AggregationAttribute"] = "Aggregation";
|
|
1625
|
-
DataSchemaAttributeType["FunctionAttribute"] = "Function";
|
|
1626
|
-
})(DataSchemaAttributeType || (DataSchemaAttributeType = {}));
|
|
565
|
+
function toPascalCase(source) {
|
|
566
|
+
return upperFirst(camelCase(source));
|
|
567
|
+
}
|
|
1627
568
|
/**
|
|
1628
569
|
* @internal
|
|
1629
570
|
*/
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
})(DataSchemaAttributeUsageType || (DataSchemaAttributeUsageType = {}));
|
|
1636
|
-
|
|
571
|
+
function checkIfTypeRegistered(type, item) {
|
|
572
|
+
if (!item) {
|
|
573
|
+
throw new Error(`Error when resolve ${type}. Type was not registered.`);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
1637
576
|
/**
|
|
1638
577
|
* @internal
|
|
1639
578
|
*/
|
|
1640
|
-
|
|
1641
|
-
(
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
DefaultValueSource[DefaultValueSource["SystemValue"] = 3] = "SystemValue";
|
|
1646
|
-
DefaultValueSource[DefaultValueSource["Sequence"] = 4] = "Sequence";
|
|
1647
|
-
})(DefaultValueSource || (DefaultValueSource = {}));
|
|
579
|
+
function checkOnlyOneRegistration(type, item, map) {
|
|
580
|
+
if (map.has(type) && !isEqual(map.get(type), item)) {
|
|
581
|
+
throw new Error(`Error when register ${type}. Element with this type has already exist`);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
1648
584
|
|
|
1649
585
|
/**
|
|
1650
586
|
* @internal
|
|
1651
587
|
*/
|
|
1652
|
-
class
|
|
1653
|
-
|
|
1654
|
-
this.
|
|
1655
|
-
const scopesOrderEntries = [...(this._request.scopes ?? [])].reverse().map((scope, index) => [scope, index]);
|
|
1656
|
-
this._scopesOrder = Object.fromEntries(scopesOrderEntries);
|
|
588
|
+
class InternalRequestHandlerRegistryType {
|
|
589
|
+
static get requestHandlersMap() {
|
|
590
|
+
return this._requestHandlersMap;
|
|
1657
591
|
}
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
return Math.min(...scopesOrder);
|
|
592
|
+
static onAddRequestHandler(handler) {
|
|
593
|
+
this._addItemListeners.push(handler);
|
|
594
|
+
return () => {
|
|
595
|
+
this._addItemListeners.splice(this._addItemListeners.indexOf(handler), 1);
|
|
596
|
+
};
|
|
1664
597
|
}
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
598
|
+
static onRemoveRequestHandler(handler) {
|
|
599
|
+
this._removeItemListeners.push(handler);
|
|
600
|
+
return () => {
|
|
601
|
+
this._removeItemListeners.splice(this._removeItemListeners.indexOf(handler), 1);
|
|
602
|
+
};
|
|
1670
603
|
}
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
604
|
+
static addRequestHandler(handlerType, config) {
|
|
605
|
+
if (!this._requestHandlersMap.has(handlerType)) {
|
|
606
|
+
this._requestHandlersMap.set(handlerType, config);
|
|
607
|
+
for (const listener of this._addItemListeners) {
|
|
608
|
+
listener(handlerType, config);
|
|
609
|
+
}
|
|
1677
610
|
}
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
if (
|
|
1682
|
-
|
|
611
|
+
}
|
|
612
|
+
static removeRequestHandler(handlerType) {
|
|
613
|
+
const config = this._requestHandlersMap.get(handlerType);
|
|
614
|
+
if (config) {
|
|
615
|
+
this._requestHandlersMap.delete(handlerType);
|
|
616
|
+
for (const listener of this._removeItemListeners) {
|
|
617
|
+
listener(handlerType, config);
|
|
618
|
+
}
|
|
1683
619
|
}
|
|
1684
|
-
diff = a.source.type - b.source.type;
|
|
1685
|
-
return diff;
|
|
1686
620
|
}
|
|
1687
621
|
}
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
const
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
622
|
+
InternalRequestHandlerRegistryType._addItemListeners = [];
|
|
623
|
+
InternalRequestHandlerRegistryType._removeItemListeners = [];
|
|
624
|
+
InternalRequestHandlerRegistryType._requestHandlersMap = new Map();
|
|
625
|
+
const global$1 = window;
|
|
626
|
+
global$1.creatio ?? (global$1.creatio = {});
|
|
627
|
+
if (!global$1.creatio.requestHandlerRegistry) {
|
|
628
|
+
Object.defineProperty(global$1.creatio, 'requestHandlerRegistry', {
|
|
629
|
+
get: () => InternalRequestHandlerRegistryType,
|
|
630
|
+
configurable: false,
|
|
631
|
+
});
|
|
632
|
+
}
|
|
1696
633
|
/**
|
|
1697
634
|
* @internal
|
|
1698
635
|
*/
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
}
|
|
636
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
637
|
+
const InternalRequestHandlerRegistry = InternalRequestHandlerRegistryType;
|
|
1702
638
|
/**
|
|
1703
639
|
* @internal
|
|
1704
640
|
*/
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
641
|
+
class RequestHandlerRegistryService {
|
|
642
|
+
/**
|
|
643
|
+
* Register request handler class.
|
|
644
|
+
* @param config Request handler registration config.
|
|
645
|
+
* @param type Request handler type.
|
|
646
|
+
*/
|
|
647
|
+
static register(config, type) {
|
|
648
|
+
const requestType = config.requestType;
|
|
649
|
+
const requestHandlerType = config.type;
|
|
650
|
+
if (!requestType) {
|
|
651
|
+
throw new Error(`Error when register ${requestHandlerType}. Request type not specified.`);
|
|
652
|
+
}
|
|
653
|
+
const requestHandlerMapValue = {
|
|
654
|
+
instanceType: type,
|
|
655
|
+
instanceConfig: config,
|
|
656
|
+
};
|
|
657
|
+
RequestHandlerRegistryService._internalRegistry.addRequestHandler(requestHandlerType, requestHandlerMapValue);
|
|
1709
658
|
}
|
|
1710
|
-
return metadata;
|
|
1711
659
|
}
|
|
660
|
+
RequestHandlerRegistryService._internalRegistry = global$1.creatio.requestHandlerRegistry;
|
|
661
|
+
|
|
1712
662
|
/**
|
|
1713
663
|
* @internal
|
|
1714
664
|
*/
|
|
1715
|
-
|
|
1716
|
-
|
|
665
|
+
class RequestRegistryService {
|
|
666
|
+
static get requestsRegistrationInfos() {
|
|
667
|
+
return this._requestsRegistrationInfos;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Registers a specified request class.
|
|
671
|
+
* @param config Request registration config.
|
|
672
|
+
* @param type Request type.
|
|
673
|
+
*/
|
|
674
|
+
static register(config, type) {
|
|
675
|
+
const requestType = config.type;
|
|
676
|
+
// TODO RND-21723
|
|
677
|
+
RequestRegistryService._requestsMap.set(requestType, type);
|
|
678
|
+
RequestRegistryService._requestsRegistrationInfos.set(requestType, config);
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Creates request instance by specified registered request type.
|
|
682
|
+
* @param type Request type.
|
|
683
|
+
* @returns The instance of registered request.
|
|
684
|
+
*/
|
|
685
|
+
static get(type) {
|
|
686
|
+
const requestInstanceConstructor = RequestRegistryService._requestsMap.get(type);
|
|
687
|
+
checkIfTypeRegistered(type, requestInstanceConstructor);
|
|
688
|
+
return requestInstanceConstructor && new requestInstanceConstructor();
|
|
689
|
+
}
|
|
1717
690
|
}
|
|
691
|
+
RequestRegistryService._requestsMap = new Map();
|
|
692
|
+
RequestRegistryService._requestsRegistrationInfos = new Map();
|
|
693
|
+
|
|
1718
694
|
/**
|
|
1719
695
|
* @internal
|
|
1720
696
|
*/
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
697
|
+
class ConverterRegistry extends ɵBaseRegistry {
|
|
698
|
+
static get(type) {
|
|
699
|
+
if (!this.store.typeInfos.has(type)) {
|
|
700
|
+
throw new Error(`'${type}' converter doesn't exist`);
|
|
701
|
+
}
|
|
702
|
+
return this.store.typeInfos.get(type);
|
|
703
|
+
}
|
|
704
|
+
static register(item) {
|
|
705
|
+
checkTypeNameFormat(item.type, 'ConverterTypeName');
|
|
706
|
+
checkCrtTypeNamePascalCase(item.type);
|
|
707
|
+
// TODO RND-21723
|
|
708
|
+
this.store.typeInfos.set(item.type, item);
|
|
709
|
+
}
|
|
710
|
+
static clear() {
|
|
711
|
+
this.store.typeInfos.clear();
|
|
1725
712
|
}
|
|
1726
|
-
return metadata;
|
|
1727
713
|
}
|
|
714
|
+
ConverterRegistry.registryKey = 'ConverterRegistry';
|
|
715
|
+
|
|
1728
716
|
/**
|
|
1729
717
|
* @internal
|
|
1730
718
|
*/
|
|
1731
|
-
|
|
1732
|
-
Reflect.defineMetadata(validatorMetadataKey, metadata, type);
|
|
1733
|
-
}
|
|
719
|
+
const viewElementRegistryKey = 'ViewElementRegistry';
|
|
1734
720
|
/**
|
|
1735
721
|
* @internal
|
|
1736
722
|
*/
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
723
|
+
class ViewElementRegistry extends ɵBaseRegistry {
|
|
724
|
+
static validate(config) {
|
|
725
|
+
checkTypeNameFormat(config.type, 'ViewElementTypeName');
|
|
726
|
+
checkOnlyOneRegistration(config.type, config, ViewElementRegistry.viewElements);
|
|
727
|
+
}
|
|
728
|
+
static get viewElements() {
|
|
729
|
+
return this.store.typeInfos;
|
|
730
|
+
}
|
|
731
|
+
static register(config) {
|
|
732
|
+
this.viewElements.set(config.type, config);
|
|
733
|
+
}
|
|
734
|
+
static getFormControlRelatesAttribute(type) {
|
|
735
|
+
const config = this.store.typeInfos.get(type);
|
|
736
|
+
return (config && 'formControlConfig' in config && config.formControlConfig?.relatesTo) || null;
|
|
1741
737
|
}
|
|
1742
|
-
return metadata;
|
|
1743
738
|
}
|
|
739
|
+
ViewElementRegistry.registryKey = viewElementRegistryKey;
|
|
740
|
+
|
|
1744
741
|
/**
|
|
1745
742
|
* @internal
|
|
1746
743
|
*/
|
|
1747
|
-
|
|
1748
|
-
Reflect.defineMetadata(converterMetadataKey, metadata, type);
|
|
1749
|
-
}
|
|
744
|
+
const interfaceDesignerItemRegistryKey = 'InterfaceDesignerItemRegistry';
|
|
1750
745
|
/**
|
|
1751
746
|
* @internal
|
|
1752
747
|
*/
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
748
|
+
class InterfaceDesignerItemRegistry extends ɵBaseRegistry {
|
|
749
|
+
static validate(config) {
|
|
750
|
+
checkTypeNameFormat(config.type, 'InterfaceDesignerItemTypeName');
|
|
751
|
+
checkCrtTypeNamePascalCase(config.type);
|
|
752
|
+
checkOnlyOneRegistration(config.type, config, this.interfaceDesignerItemRegistrationInfos);
|
|
753
|
+
}
|
|
754
|
+
static register(config) {
|
|
755
|
+
this.interfaceDesignerItemRegistrationInfos.set(config.type, config);
|
|
756
|
+
}
|
|
757
|
+
static get interfaceDesignerItemRegistrationInfos() {
|
|
758
|
+
return this.store.typeInfos;
|
|
759
|
+
}
|
|
760
|
+
static get(type) {
|
|
761
|
+
return this.interfaceDesignerItemRegistrationInfos.get(type);
|
|
1757
762
|
}
|
|
1758
|
-
return metadata;
|
|
1759
763
|
}
|
|
764
|
+
InterfaceDesignerItemRegistry.registryKey = interfaceDesignerItemRegistryKey;
|
|
765
|
+
|
|
766
|
+
const global = window;
|
|
1760
767
|
/**
|
|
1761
768
|
* @internal
|
|
1762
769
|
*/
|
|
1763
|
-
|
|
1764
|
-
|
|
770
|
+
class BootstrapNotifier {
|
|
771
|
+
static get instance() {
|
|
772
|
+
if (!global.__crtModuleBootstrapNotifier) {
|
|
773
|
+
global.__crtModuleBootstrapNotifier = new BootstrapNotifier();
|
|
774
|
+
}
|
|
775
|
+
return global.__crtModuleBootstrapNotifier;
|
|
776
|
+
}
|
|
777
|
+
constructor() {
|
|
778
|
+
this._subscribers = new Set();
|
|
779
|
+
// private constructor prevent instantiation via 'new' keyword
|
|
780
|
+
}
|
|
781
|
+
notify(moduleType) {
|
|
782
|
+
for (const subscriber of this._subscribers.values()) {
|
|
783
|
+
subscriber(moduleType);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
subscribe(subscriber) {
|
|
787
|
+
this._subscribers.add(subscriber);
|
|
788
|
+
return {
|
|
789
|
+
unsubscribe: () => this._subscribers.delete(subscriber),
|
|
790
|
+
};
|
|
791
|
+
}
|
|
1765
792
|
}
|
|
793
|
+
|
|
1766
794
|
/**
|
|
1767
795
|
* @internal
|
|
1768
796
|
*/
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
797
|
+
class HandlerChainServicesRegistry extends ɵBaseRegistry {
|
|
798
|
+
static validate({ requestType }) {
|
|
799
|
+
checkTypeNameFormat(requestType, this.registryKey);
|
|
800
|
+
checkCrtTypeNamePascalCase(requestType);
|
|
801
|
+
this.checkUniqueRequestType(requestType);
|
|
802
|
+
}
|
|
803
|
+
static checkUniqueRequestType(requestType) {
|
|
804
|
+
if (this.services.get(requestType)) {
|
|
805
|
+
throw new Error(`${requestType} already registered`);
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
static register(config) {
|
|
809
|
+
this.validate(config);
|
|
810
|
+
this.services.set(config.requestType, config);
|
|
811
|
+
}
|
|
812
|
+
static get services() {
|
|
813
|
+
return this.store.typeInfos;
|
|
1773
814
|
}
|
|
1774
|
-
return metadata;
|
|
1775
815
|
}
|
|
816
|
+
HandlerChainServicesRegistry.registryKey = 'HandlerChainServicesRegistry';
|
|
817
|
+
|
|
1776
818
|
/**
|
|
1777
819
|
* @internal
|
|
1778
820
|
*/
|
|
1779
|
-
|
|
1780
|
-
Reflect.defineMetadata(designTimeViewElementMetadataKey, metadata, type);
|
|
1781
|
-
}
|
|
821
|
+
const designTimeViewElementRegistryKey = 'DesignTimeViewElementRegistry';
|
|
1782
822
|
/**
|
|
1783
823
|
* @internal
|
|
1784
824
|
*/
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
825
|
+
class DesignTimeViewElementRegistry extends ɵBaseRegistry {
|
|
826
|
+
static validate(config) {
|
|
827
|
+
checkTypeNameFormat(config.type, 'DesignTimeViewElementRegistryItemTypeName');
|
|
828
|
+
checkCrtTypeNamePascalCase(config.type);
|
|
829
|
+
checkOnlyOneRegistration(config.type, config, this.infos);
|
|
830
|
+
}
|
|
831
|
+
static register(config) {
|
|
832
|
+
this.infos.set(config.type, config);
|
|
833
|
+
}
|
|
834
|
+
static getByOverriddenType(type) {
|
|
835
|
+
const item = Array.from(this.infos).find(([_, info]) => info.overrideType === type);
|
|
836
|
+
if (item) {
|
|
837
|
+
return item[1];
|
|
838
|
+
}
|
|
839
|
+
return null;
|
|
840
|
+
}
|
|
841
|
+
static get infos() {
|
|
842
|
+
return this.store.typeInfos;
|
|
1789
843
|
}
|
|
1790
|
-
return metadata;
|
|
1791
844
|
}
|
|
845
|
+
DesignTimeViewElementRegistry.registryKey = designTimeViewElementRegistryKey;
|
|
846
|
+
|
|
1792
847
|
/**
|
|
1793
848
|
* @internal
|
|
1794
849
|
*/
|
|
1795
|
-
|
|
1796
|
-
return Reflect.hasOwnMetadata(interfaceDesignerItemMetadataKey, type);
|
|
850
|
+
class ValidatorMapValue {
|
|
1797
851
|
}
|
|
1798
852
|
/**
|
|
1799
853
|
* @internal
|
|
1800
854
|
*/
|
|
1801
|
-
|
|
1802
|
-
Reflect.defineMetadata(requestHandlerMetadataKey, metadata, type);
|
|
1803
|
-
}
|
|
855
|
+
const validatorRegistryKey = 'ValidatorRegistry';
|
|
1804
856
|
/**
|
|
1805
857
|
* @internal
|
|
1806
858
|
*/
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
859
|
+
class ValidatorRegistry extends ɵBaseRegistry {
|
|
860
|
+
static _has(configType, type) {
|
|
861
|
+
return ValidatorRegistry.items.has(configType) && ValidatorRegistry.items.get(configType)?.typeRef !== type;
|
|
862
|
+
}
|
|
863
|
+
static validate(config) {
|
|
864
|
+
checkTypeNameFormat(config.type, 'ValidatorTypeName');
|
|
865
|
+
if (ValidatorRegistry._has(config.type, config.typeRef)) {
|
|
866
|
+
throw new Error(`Error when register ${config.type}. Element with this type has already exist`);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
static get items() {
|
|
870
|
+
return this.store.typeInfos;
|
|
871
|
+
}
|
|
872
|
+
static register(config) {
|
|
873
|
+
this.items.set(config.type, config);
|
|
1811
874
|
}
|
|
1812
|
-
return metadata;
|
|
1813
875
|
}
|
|
876
|
+
ValidatorRegistry.registryKey = validatorRegistryKey;
|
|
877
|
+
|
|
1814
878
|
/**
|
|
1815
879
|
* @internal
|
|
880
|
+
* @dontChange
|
|
1816
881
|
*/
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
882
|
+
class RemoteEntriesRegistry extends ɵBaseRegistry {
|
|
883
|
+
/**
|
|
884
|
+
* @dontChange
|
|
885
|
+
*/
|
|
886
|
+
static get items() {
|
|
887
|
+
return this.store.typeInfos;
|
|
1821
888
|
}
|
|
1822
|
-
return { requestType, typeRef };
|
|
1823
889
|
}
|
|
1824
890
|
/**
|
|
1825
|
-
* @
|
|
891
|
+
* @dontChange
|
|
1826
892
|
*/
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
const crtInputKeys = keys.filter((x) => x.startsWith(crtInputPrefix));
|
|
1830
|
-
return Object.fromEntries(crtInputKeys.map((key) => {
|
|
1831
|
-
const data = Reflect.getMetadata(key, type);
|
|
1832
|
-
return [key.replace(crtInputPrefix, ''), data];
|
|
1833
|
-
}));
|
|
1834
|
-
}
|
|
893
|
+
RemoteEntriesRegistry.registryKey = 'remotes';
|
|
894
|
+
|
|
1835
895
|
/**
|
|
1836
896
|
* @internal
|
|
1837
897
|
*/
|
|
1838
|
-
function
|
|
1839
|
-
const
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
}));
|
|
898
|
+
function isComponentPropertyBindable(viewConfigType, componentProperty) {
|
|
899
|
+
const componentConfig = ViewElementRegistry.viewElements.get(viewConfigType);
|
|
900
|
+
if (!componentConfig?.inputs) {
|
|
901
|
+
return false;
|
|
902
|
+
}
|
|
903
|
+
return !!componentConfig?.inputs[componentProperty]?.propertyBindable;
|
|
1845
904
|
}
|
|
905
|
+
|
|
906
|
+
const moduleMetadataKey = 'module';
|
|
907
|
+
const viewElementMetadataKey = 'viewElement';
|
|
908
|
+
const interfaceDesignerItemMetadataKey = 'interfaceDesignerItem';
|
|
909
|
+
const requestHandlerMetadataKey = 'requestHandler';
|
|
910
|
+
const designTimeViewElementMetadataKey = 'designTimeViewElement';
|
|
911
|
+
const validatorMetadataKey = 'validator';
|
|
912
|
+
const converterMetadataKey = 'converter';
|
|
1846
913
|
/**
|
|
1847
914
|
* @internal
|
|
1848
915
|
*/
|
|
1849
|
-
function
|
|
1850
|
-
|
|
1851
|
-
const crtValidationInputKeys = keys.filter((x) => x.startsWith(crtValidationInputPrefix));
|
|
1852
|
-
return Object.fromEntries(crtValidationInputKeys.map((key) => {
|
|
1853
|
-
const data = Reflect.getMetadata(key, type);
|
|
1854
|
-
return [key.replace(crtValidationInputPrefix, ''), data];
|
|
1855
|
-
}));
|
|
916
|
+
function setModuleMetadata(metadata, type) {
|
|
917
|
+
Reflect.defineMetadata(moduleMetadataKey, metadata, type);
|
|
1856
918
|
}
|
|
1857
919
|
/**
|
|
1858
920
|
* @internal
|
|
1859
921
|
*/
|
|
1860
|
-
function
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
return [index, data];
|
|
1867
|
-
}));
|
|
922
|
+
function getModuleMetadata(type) {
|
|
923
|
+
const metadata = Reflect.getMetadata(moduleMetadataKey, type);
|
|
924
|
+
if (!metadata) {
|
|
925
|
+
throw new Error(`Module metadata was not found on '${type.name}' class`);
|
|
926
|
+
}
|
|
927
|
+
return metadata;
|
|
1868
928
|
}
|
|
1869
929
|
/**
|
|
1870
930
|
* @internal
|
|
1871
931
|
*/
|
|
1872
|
-
function
|
|
1873
|
-
|
|
1874
|
-
return parentProto ? parentProto.constructor : null;
|
|
932
|
+
function setViewElementMetadata(metadata, type) {
|
|
933
|
+
Reflect.defineMetadata(viewElementMetadataKey, metadata, type);
|
|
1875
934
|
}
|
|
1876
935
|
/**
|
|
1877
936
|
* @internal
|
|
1878
937
|
*/
|
|
1879
|
-
function
|
|
1880
|
-
const
|
|
1881
|
-
if (!
|
|
1882
|
-
|
|
1883
|
-
throw new Error(`Dependency Injection error. Cannot read dependencies of class '${type.name}'. ` +
|
|
1884
|
-
`Please make sure class '${type.name}' has decorator and ` +
|
|
1885
|
-
"'emitDecoratorMetadata' option is enabled in your 'tsconfig.json' file.");
|
|
1886
|
-
}
|
|
1887
|
-
const parentType = getParentType(type);
|
|
1888
|
-
return parentType && parentType !== Object ? getTypeDependencies(parentType) : [];
|
|
938
|
+
function getViewElementMetadata(type) {
|
|
939
|
+
const metadata = Reflect.getMetadata(viewElementMetadataKey, type);
|
|
940
|
+
if (!metadata) {
|
|
941
|
+
throw new Error(`View element metadata was not found on '${type.name}' class`);
|
|
1889
942
|
}
|
|
1890
|
-
|
|
1891
|
-
Object.entries(crtInjectMetadata).forEach(([index, token]) => (paramTypes[index] = token));
|
|
1892
|
-
return paramTypes;
|
|
943
|
+
return metadata;
|
|
1893
944
|
}
|
|
1894
|
-
|
|
1895
945
|
/**
|
|
1896
946
|
* @internal
|
|
1897
947
|
*/
|
|
1898
|
-
function
|
|
1899
|
-
|
|
1900
|
-
if (deps.length > 0) {
|
|
1901
|
-
if (!resolveDependency) {
|
|
1902
|
-
throw new Error(`Cannot resolve dependencies for ${type.name}. ` +
|
|
1903
|
-
"Please provide 'resolveDependency' bootstrap option");
|
|
1904
|
-
}
|
|
1905
|
-
const depInstances = deps.map(resolveDependency);
|
|
1906
|
-
return new type(...depInstances);
|
|
1907
|
-
}
|
|
1908
|
-
return new type();
|
|
948
|
+
function setValidatorMetadata(metadata, type) {
|
|
949
|
+
Reflect.defineMetadata(validatorMetadataKey, metadata, type);
|
|
1909
950
|
}
|
|
1910
|
-
|
|
1911
951
|
/**
|
|
1912
|
-
* @
|
|
952
|
+
* @internal
|
|
1913
953
|
*/
|
|
1914
|
-
|
|
954
|
+
function getValidatorMetadata(type) {
|
|
955
|
+
const metadata = Reflect.getOwnMetadata(validatorMetadataKey, type);
|
|
956
|
+
if (!metadata) {
|
|
957
|
+
throw new Error(`Validator metadata was not found on '${type.name}' class`);
|
|
958
|
+
}
|
|
959
|
+
return metadata;
|
|
1915
960
|
}
|
|
1916
|
-
|
|
1917
961
|
/**
|
|
1918
|
-
* @
|
|
1919
|
-
* @class BaseRequest
|
|
1920
|
-
* @describe Base definition of request.
|
|
1921
|
-
* @template TEvent
|
|
962
|
+
* @internal
|
|
1922
963
|
*/
|
|
1923
|
-
|
|
964
|
+
function setConverterMetadata(metadata, type) {
|
|
965
|
+
Reflect.defineMetadata(converterMetadataKey, metadata, type);
|
|
1924
966
|
}
|
|
1925
|
-
|
|
1926
967
|
/**
|
|
1927
|
-
* @
|
|
1928
|
-
* @class DataRequest
|
|
1929
|
-
* @description Definition of data source request.
|
|
1930
|
-
* @extends {BaseRequest} {@link BaseRequest}
|
|
1931
|
-
* @property {string} dataSourceName - name of assigned data source.
|
|
968
|
+
* @internal
|
|
1932
969
|
*/
|
|
1933
|
-
|
|
970
|
+
function getConverterMetadata(type) {
|
|
971
|
+
const metadata = Reflect.getOwnMetadata(converterMetadataKey, type);
|
|
972
|
+
if (!metadata) {
|
|
973
|
+
throw new Error(`Converter metadata was not found on '${type.name}' class`);
|
|
974
|
+
}
|
|
975
|
+
return metadata;
|
|
1934
976
|
}
|
|
1935
|
-
|
|
1936
977
|
/**
|
|
1937
|
-
* @
|
|
1938
|
-
* @description Request payload
|
|
1939
|
-
* @property {string} request - request name.
|
|
1940
|
-
* @property {unknown} params - request parameters.
|
|
978
|
+
* @internal
|
|
1941
979
|
*/
|
|
1942
|
-
|
|
980
|
+
function setInterfaceDesignerItemMetadata(metadata, type) {
|
|
981
|
+
Reflect.defineMetadata(interfaceDesignerItemMetadataKey, metadata, type);
|
|
982
|
+
}
|
|
1943
983
|
/**
|
|
1944
|
-
* @
|
|
1945
|
-
* @description Abstract Base Validator class for designing custom validators.
|
|
1946
|
-
* @example
|
|
1947
|
-
* @CrtValidator({
|
|
1948
|
-
* type: 'crt.Required',
|
|
1949
|
-
* })
|
|
1950
|
-
* export class RequiredValidator extends BaseValidator {
|
|
1951
|
-
* protected override async = false;
|
|
1952
|
-
* public validate(controlState: CrtControlState, params?: ValidatorParametersValues): CrtValidationErrors | null {
|
|
1953
|
-
* Implementation here...
|
|
1954
|
-
* }
|
|
1955
|
-
* }
|
|
984
|
+
* @internal
|
|
1956
985
|
*/
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
get isAsync() {
|
|
1962
|
-
return this.async;
|
|
1963
|
-
}
|
|
1964
|
-
/**
|
|
1965
|
-
* @description Function used for validation
|
|
1966
|
-
*/
|
|
1967
|
-
get validateFn() {
|
|
1968
|
-
return this.validate.bind(this);
|
|
1969
|
-
}
|
|
1970
|
-
/**
|
|
1971
|
-
* @internal
|
|
1972
|
-
*/
|
|
1973
|
-
static [Symbol.hasInstance](instance) {
|
|
1974
|
-
return instance?.constructor?.['_instanceOfKey'] === BaseValidator._instanceOfKey;
|
|
986
|
+
function getInterfaceDesignerItemMetadata(type) {
|
|
987
|
+
const metadata = Reflect.getOwnMetadata(interfaceDesignerItemMetadataKey, type);
|
|
988
|
+
if (!metadata) {
|
|
989
|
+
throw new Error(`Interface designer item metadata was not found on '${type.name}' class`);
|
|
1975
990
|
}
|
|
991
|
+
return metadata;
|
|
1976
992
|
}
|
|
1977
993
|
/**
|
|
1978
994
|
* @internal
|
|
1979
|
-
* @dontChange
|
|
1980
995
|
*/
|
|
1981
|
-
|
|
1982
|
-
|
|
996
|
+
function setDesignTimeViewElementMetadata(metadata, type) {
|
|
997
|
+
Reflect.defineMetadata(designTimeViewElementMetadataKey, metadata, type);
|
|
998
|
+
}
|
|
1983
999
|
/**
|
|
1984
|
-
* @
|
|
1000
|
+
* @internal
|
|
1985
1001
|
*/
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
/**
|
|
1991
|
-
* @internal
|
|
1992
|
-
*/
|
|
1993
|
-
static [Symbol.hasInstance](instance) {
|
|
1994
|
-
return instance?.constructor?.['_instanceOfKey'] === LocalizableValue._instanceOfKey;
|
|
1002
|
+
function getDesignTimeViewElementMetadata(type) {
|
|
1003
|
+
const metadata = Reflect.getOwnMetadata(designTimeViewElementMetadataKey, type);
|
|
1004
|
+
if (!metadata) {
|
|
1005
|
+
throw new Error(`Design time view element metadata was not found on '${type.name}' class`);
|
|
1995
1006
|
}
|
|
1007
|
+
return metadata;
|
|
1996
1008
|
}
|
|
1997
1009
|
/**
|
|
1998
1010
|
* @internal
|
|
1999
|
-
* @dontChange
|
|
2000
1011
|
*/
|
|
2001
|
-
|
|
2002
|
-
|
|
1012
|
+
function hasInterfaceDesignerItemMetadata(type) {
|
|
1013
|
+
return Reflect.hasOwnMetadata(interfaceDesignerItemMetadataKey, type);
|
|
1014
|
+
}
|
|
2003
1015
|
/**
|
|
2004
1016
|
* @internal
|
|
2005
1017
|
*/
|
|
2006
|
-
function
|
|
2007
|
-
|
|
2008
|
-
.map((path) => ({ path, value: get(obj, path) }))
|
|
2009
|
-
.filter(({ value }) => value instanceof LocalizableValue);
|
|
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.");
|
|
2016
|
-
}
|
|
2017
|
-
localizableEntries.forEach(({ path, value }) => {
|
|
2018
|
-
const localizedValue = localizeMetadata?.(value.key) ?? value.key;
|
|
2019
|
-
set(localized, path, localizedValue);
|
|
2020
|
-
});
|
|
2021
|
-
return localized;
|
|
1018
|
+
function setRequestHandlerMetadata(metadata, type) {
|
|
1019
|
+
Reflect.defineMetadata(requestHandlerMetadataKey, metadata, type);
|
|
2022
1020
|
}
|
|
2023
|
-
|
|
2024
1021
|
/**
|
|
2025
1022
|
* @internal
|
|
2026
1023
|
*/
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
this._handlersScopesByContextId = new Map();
|
|
2032
|
-
this.handlerChain$ = {
|
|
2033
|
-
process: async (request) => {
|
|
2034
|
-
const handler = this._getHandler(request);
|
|
2035
|
-
return handler?.handle(request);
|
|
2036
|
-
},
|
|
2037
|
-
register: (info) => {
|
|
2038
|
-
this._handlersCache.delete(info.requestType);
|
|
2039
|
-
this._handlers.push(info);
|
|
2040
|
-
return () => {
|
|
2041
|
-
const index = this._handlers.indexOf(info);
|
|
2042
|
-
if (index > -1) {
|
|
2043
|
-
this._handlers.splice(index, 1);
|
|
2044
|
-
this._handlersCache.delete(info.requestType);
|
|
2045
|
-
}
|
|
2046
|
-
else {
|
|
2047
|
-
console.warn(`${info?.requestType} not found to unsubscribe`);
|
|
2048
|
-
}
|
|
2049
|
-
};
|
|
2050
|
-
},
|
|
2051
|
-
};
|
|
2052
|
-
}
|
|
2053
|
-
clearContextedHandlersCache(contextId) {
|
|
2054
|
-
const configs = this._handlersScopesByContextId.get(contextId) ?? [];
|
|
2055
|
-
return configs.every(({ requestType, scope }) => this._handlersCache.get(requestType)?.delete(scope));
|
|
2056
|
-
}
|
|
2057
|
-
_getHandler(request) {
|
|
2058
|
-
return this._hasCacheHandler(request) ? this._getCacheHandler(request) : this._buildHandlersChain(request);
|
|
2059
|
-
}
|
|
2060
|
-
_getCacheHandler(request) {
|
|
2061
|
-
const map = this._handlersCache.get(request.type);
|
|
2062
|
-
const key = this._getCacheScopesKey(request);
|
|
2063
|
-
return map.get(key);
|
|
2064
|
-
}
|
|
2065
|
-
_hasCacheHandler(request) {
|
|
2066
|
-
const map = this._handlersCache.get(request.type);
|
|
2067
|
-
const key = this._getCacheScopesKey(request);
|
|
2068
|
-
return map && map.has(key);
|
|
2069
|
-
}
|
|
2070
|
-
_getCacheScopesKey(request) {
|
|
2071
|
-
const injectionContextKey = this._getInjectionContext(request?.$context)?.id ?? '';
|
|
2072
|
-
return (request.scopes || ['']).join('_').concat(injectionContextKey);
|
|
2073
|
-
}
|
|
2074
|
-
_getInjectionContext(viewModel) {
|
|
2075
|
-
return viewModel?.['_injectionContext'] || (viewModel?.parent && this._getInjectionContext(viewModel.parent));
|
|
2076
|
-
}
|
|
2077
|
-
_setContextedScopes(request, scope) {
|
|
2078
|
-
const injectionContext = this._getInjectionContext(request?.$context)?.id;
|
|
2079
|
-
const configs = this._handlersScopesByContextId.has(injectionContext)
|
|
2080
|
-
? this._handlersScopesByContextId.get(injectionContext)
|
|
2081
|
-
: [];
|
|
2082
|
-
configs.push({ requestType: request.type, scope });
|
|
2083
|
-
this._handlersScopesByContextId.set(injectionContext, configs);
|
|
2084
|
-
}
|
|
2085
|
-
_setCacheHandler(request, handler) {
|
|
2086
|
-
const map = this._handlersCache.has(request.type)
|
|
2087
|
-
? this._handlersCache.get(request.type)
|
|
2088
|
-
: new Map();
|
|
2089
|
-
const key = this._getCacheScopesKey(request);
|
|
2090
|
-
map.set(key, handler);
|
|
2091
|
-
if (this._getInjectionContext(request?.$context)?.id) {
|
|
2092
|
-
this._setContextedScopes(request, key);
|
|
2093
|
-
}
|
|
2094
|
-
this._handlersCache.set(request.type, map);
|
|
2095
|
-
}
|
|
2096
|
-
_isRequestHandler(handler) {
|
|
2097
|
-
return (typeof handler.handle === 'function' &&
|
|
2098
|
-
typeof handler.setNext === 'function');
|
|
2099
|
-
}
|
|
2100
|
-
_checkHandlerInstanceOf(handler) {
|
|
2101
|
-
if (!this._isRequestHandler(handler)) {
|
|
2102
|
-
throw new Error('Handler should implement "BaseRequestHandler"');
|
|
2103
|
-
}
|
|
2104
|
-
}
|
|
2105
|
-
_buildHandlersChain(request) {
|
|
2106
|
-
const handlers = this._handlers.filter((h) => {
|
|
2107
|
-
if (h.requestType !== request.type) {
|
|
2108
|
-
return false;
|
|
2109
|
-
}
|
|
2110
|
-
if (!h.scopes?.length) {
|
|
2111
|
-
return true;
|
|
2112
|
-
}
|
|
2113
|
-
return h.scopes.some((s) => request.scopes?.includes(s));
|
|
2114
|
-
});
|
|
2115
|
-
const comparer = new HandlersOrderComparer(request);
|
|
2116
|
-
handlers.sort((a, b) => comparer.compare(a, b));
|
|
2117
|
-
const handlerInstances = handlers.map((handlerConfig) => {
|
|
2118
|
-
const injectionContext = this._getInjectionContext(request?.$context);
|
|
2119
|
-
return handlerConfig.createHandler(injectionContext);
|
|
2120
|
-
});
|
|
2121
|
-
handlerInstances.forEach((handler) => this._checkHandlerInstanceOf(handler));
|
|
2122
|
-
this._joinHandlersInChain(handlerInstances);
|
|
2123
|
-
const result = handlerInstances[0];
|
|
2124
|
-
this._setCacheHandler(request, result);
|
|
2125
|
-
return result;
|
|
2126
|
-
}
|
|
2127
|
-
_joinHandlersInChain(handlers) {
|
|
2128
|
-
for (let index = 0; index < handlers.length - 1; index++) {
|
|
2129
|
-
try {
|
|
2130
|
-
handlers[index].setNext(handlers[index + 1]);
|
|
2131
|
-
}
|
|
2132
|
-
catch (error) {
|
|
2133
|
-
if (error instanceof NextHandlerAlreadySpecifiedException) {
|
|
2134
|
-
throw new Error('Handler factory should return new instance of ' +
|
|
2135
|
-
'BaseRequestHandler class or its subclass ' +
|
|
2136
|
-
'(next handler should not be specified)');
|
|
2137
|
-
}
|
|
2138
|
-
throw error;
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
1024
|
+
function getRequestHandlerMetadata(type) {
|
|
1025
|
+
const metadata = Reflect.getMetadata(requestHandlerMetadataKey, type);
|
|
1026
|
+
if (!metadata) {
|
|
1027
|
+
throw new Error(`Request handler metadata was not found on '${type.name}' class`);
|
|
2141
1028
|
}
|
|
1029
|
+
return metadata;
|
|
2142
1030
|
}
|
|
2143
|
-
|
|
2144
|
-
const global = window;
|
|
2145
1031
|
/**
|
|
2146
|
-
* @
|
|
2147
|
-
* @class HandlerChainService
|
|
2148
|
-
* @classdesc Service to design handlers in chain.
|
|
1032
|
+
* @internal
|
|
2149
1033
|
*/
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
}
|
|
2155
|
-
}
|
|
2156
|
-
get _chain() {
|
|
2157
|
-
return global.handlerChain;
|
|
2158
|
-
}
|
|
2159
|
-
set _chain(value) {
|
|
2160
|
-
global.handlerChain = value;
|
|
2161
|
-
}
|
|
2162
|
-
static get instance() {
|
|
2163
|
-
return HandlerChainService._instance || (HandlerChainService._instance = new HandlerChainService());
|
|
2164
|
-
}
|
|
2165
|
-
_createGlobalHandlerChain() {
|
|
2166
|
-
this._chain = new InternalHandlerChain();
|
|
2167
|
-
}
|
|
2168
|
-
/**
|
|
2169
|
-
* @internal
|
|
2170
|
-
*/
|
|
2171
|
-
clearContextedHandlersCache(contextId) {
|
|
2172
|
-
return this._chain.clearContextedHandlersCache(contextId);
|
|
2173
|
-
}
|
|
2174
|
-
/**
|
|
2175
|
-
* @internal
|
|
2176
|
-
*/
|
|
2177
|
-
register(handlerConfig) {
|
|
2178
|
-
return this._chain.handlerChain$.register(handlerConfig);
|
|
2179
|
-
}
|
|
2180
|
-
/**
|
|
2181
|
-
* @description Method to process passed request
|
|
2182
|
-
* @param request - {@link BaseRequest}
|
|
2183
|
-
* @return `Promise<unknown>`
|
|
2184
|
-
*/
|
|
2185
|
-
process(request) {
|
|
2186
|
-
return this._chain.handlerChain$.process(request);
|
|
1034
|
+
function getHandlerChainServiceMetadata(typeRef) {
|
|
1035
|
+
const requestType = Reflect.getMetadata('requestType', typeRef);
|
|
1036
|
+
if (!requestType) {
|
|
1037
|
+
throw new Error(`requestType was not found on '${typeRef.name}' class`);
|
|
2187
1038
|
}
|
|
1039
|
+
return { requestType, typeRef };
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* @internal
|
|
1043
|
+
*/
|
|
1044
|
+
function getCrtInputsMetadata(type) {
|
|
1045
|
+
const keys = Reflect.getMetadataKeys(type);
|
|
1046
|
+
const crtInputKeys = keys.filter((x) => x.startsWith(crtInputPrefix));
|
|
1047
|
+
return Object.fromEntries(crtInputKeys.map((key) => {
|
|
1048
|
+
const data = Reflect.getMetadata(key, type);
|
|
1049
|
+
return [key.replace(crtInputPrefix, ''), data];
|
|
1050
|
+
}));
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* @internal
|
|
1054
|
+
*/
|
|
1055
|
+
function getCrtOutputsMetadata(type) {
|
|
1056
|
+
const keys = Reflect.getMetadataKeys(type);
|
|
1057
|
+
const crtOutputKeys = keys.filter((x) => x.startsWith(crtOutputPrefix));
|
|
1058
|
+
return Object.fromEntries(crtOutputKeys.map((key) => {
|
|
1059
|
+
const data = Reflect.getMetadata(key, type);
|
|
1060
|
+
return [key.replace(crtOutputPrefix, ''), data];
|
|
1061
|
+
}));
|
|
2188
1062
|
}
|
|
2189
|
-
|
|
2190
1063
|
/**
|
|
2191
1064
|
* @internal
|
|
2192
1065
|
*/
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
return
|
|
2197
|
-
const
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
method: config?.methodName ? config.methodName : method,
|
|
2201
|
-
args,
|
|
2202
|
-
});
|
|
2203
|
-
};
|
|
2204
|
-
if (descriptor) {
|
|
2205
|
-
descriptor.value = methodImplementation;
|
|
2206
|
-
}
|
|
2207
|
-
else {
|
|
2208
|
-
target[method] = methodImplementation;
|
|
2209
|
-
}
|
|
2210
|
-
};
|
|
1066
|
+
function getCrtValidationInputsMetadata(type) {
|
|
1067
|
+
const keys = Reflect.getMetadataKeys(type);
|
|
1068
|
+
const crtValidationInputKeys = keys.filter((x) => x.startsWith(crtValidationInputPrefix));
|
|
1069
|
+
return Object.fromEntries(crtValidationInputKeys.map((key) => {
|
|
1070
|
+
const data = Reflect.getMetadata(key, type);
|
|
1071
|
+
return [key.replace(crtValidationInputPrefix, ''), data];
|
|
1072
|
+
}));
|
|
2211
1073
|
}
|
|
2212
|
-
|
|
2213
1074
|
/**
|
|
2214
1075
|
* @internal
|
|
2215
1076
|
*/
|
|
2216
|
-
function
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
};
|
|
1077
|
+
function getCrtInjectMetadata(type) {
|
|
1078
|
+
const keys = Reflect.getOwnMetadataKeys(type);
|
|
1079
|
+
const crtInjectKeys = keys.filter((x) => x.startsWith(crtInjectPrefix));
|
|
1080
|
+
return Object.fromEntries(crtInjectKeys.map((key) => {
|
|
1081
|
+
const index = Number(key.replace(crtInjectPrefix, ''));
|
|
1082
|
+
const data = Reflect.getMetadata(key, type);
|
|
1083
|
+
return [index, data];
|
|
1084
|
+
}));
|
|
2224
1085
|
}
|
|
2225
|
-
|
|
2226
1086
|
/**
|
|
2227
1087
|
* @internal
|
|
2228
1088
|
*/
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
return
|
|
2232
|
-
checkTypeNameFormat(config.type, 'RequestTypeName');
|
|
2233
|
-
checkCrtTypeNamePascalCase(config.type);
|
|
2234
|
-
RequestRegistryService.register(config, type);
|
|
2235
|
-
};
|
|
1089
|
+
function getParentType(type) {
|
|
1090
|
+
const parentProto = type.prototype ? Object.getPrototypeOf(type.prototype) : null;
|
|
1091
|
+
return parentProto ? parentProto.constructor : null;
|
|
2236
1092
|
}
|
|
2237
|
-
|
|
2238
1093
|
/**
|
|
2239
1094
|
* @internal
|
|
2240
1095
|
*/
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
getMetadata() {
|
|
2252
|
-
return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
|
|
1096
|
+
function getTypeDependencies(type) {
|
|
1097
|
+
const paramTypes = Reflect.getOwnMetadata('design:paramtypes', type);
|
|
1098
|
+
if (!paramTypes) {
|
|
1099
|
+
if (type.length > 0) {
|
|
1100
|
+
throw new Error(`Dependency Injection error. Cannot read dependencies of class '${type.name}'. ` +
|
|
1101
|
+
`Please make sure class '${type.name}' has decorator and ` +
|
|
1102
|
+
"'emitDecoratorMetadata' option is enabled in your 'tsconfig.json' file.");
|
|
1103
|
+
}
|
|
1104
|
+
const parentType = getParentType(type);
|
|
1105
|
+
return parentType && parentType !== Object ? getTypeDependencies(parentType) : [];
|
|
2253
1106
|
}
|
|
1107
|
+
const crtInjectMetadata = getCrtInjectMetadata(type);
|
|
1108
|
+
Object.entries(crtInjectMetadata).forEach(([index, token]) => (paramTypes[index] = token));
|
|
1109
|
+
return paramTypes;
|
|
2254
1110
|
}
|
|
2255
1111
|
|
|
2256
1112
|
/**
|
|
2257
1113
|
* @internal
|
|
2258
1114
|
*/
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
1115
|
+
function instantiate(type, resolveDependency) {
|
|
1116
|
+
const deps = getTypeDependencies(type);
|
|
1117
|
+
if (deps.length > 0) {
|
|
1118
|
+
if (!resolveDependency) {
|
|
1119
|
+
throw new Error(`Cannot resolve dependencies for ${type.name}. ` +
|
|
1120
|
+
"Please provide 'resolveDependency' bootstrap option");
|
|
1121
|
+
}
|
|
1122
|
+
const depInstances = deps.map(resolveDependency);
|
|
1123
|
+
return new type(...depInstances);
|
|
2266
1124
|
}
|
|
1125
|
+
return new type();
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* @public
|
|
1129
|
+
* @description For internal use only.
|
|
1130
|
+
*/
|
|
1131
|
+
function ɵinstantiate(type, resolveDependency) {
|
|
1132
|
+
return instantiate(type, resolveDependency);
|
|
2267
1133
|
}
|
|
2268
1134
|
|
|
2269
1135
|
/**
|
|
2270
|
-
* @
|
|
1136
|
+
* @public
|
|
2271
1137
|
*/
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
QueryOperationType[QueryOperationType["Select"] = 0] = "Select";
|
|
2275
|
-
QueryOperationType[QueryOperationType["Insert"] = 1] = "Insert";
|
|
2276
|
-
QueryOperationType[QueryOperationType["Update"] = 2] = "Update";
|
|
2277
|
-
QueryOperationType[QueryOperationType["Delete"] = 3] = "Delete";
|
|
2278
|
-
// Batch,
|
|
2279
|
-
// ListSelect,
|
|
2280
|
-
// FilteredSelect,
|
|
2281
|
-
// LookupSelect
|
|
2282
|
-
})(QueryOperationType || (QueryOperationType = {}));
|
|
1138
|
+
class CrtInputRegistrationConfig {
|
|
1139
|
+
}
|
|
2283
1140
|
|
|
2284
1141
|
/**
|
|
2285
|
-
* @
|
|
1142
|
+
* @public
|
|
1143
|
+
* @class DataRequest
|
|
1144
|
+
* @description Definition of data source request.
|
|
1145
|
+
* @extends {ɵBaseRequest} {@link ɵBaseRequest}
|
|
1146
|
+
* @property {string} dataSourceName - name of assigned data source.
|
|
2286
1147
|
*/
|
|
2287
|
-
class
|
|
2288
|
-
// region Constructors: Public
|
|
2289
|
-
constructor(rootSchemaName) {
|
|
2290
|
-
super(QueryOperationType.Delete, rootSchemaName);
|
|
2291
|
-
}
|
|
1148
|
+
class DataRequest extends ɵBaseRequest {
|
|
2292
1149
|
}
|
|
2293
1150
|
|
|
2294
1151
|
/**
|
|
2295
|
-
* @
|
|
1152
|
+
* @public
|
|
1153
|
+
* @description Request payload
|
|
1154
|
+
* @property {string} request - request name.
|
|
1155
|
+
* @property {unknown} params - request parameters.
|
|
2296
1156
|
*/
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
*/
|
|
2314
|
-
this.rowsOffset = -1;
|
|
2315
|
-
this.useLocalization = true;
|
|
2316
|
-
this._getIsPageable = () => this.rowCount > 0 && this.rowsOffset > -1;
|
|
2317
|
-
}
|
|
2318
|
-
// endregion
|
|
2319
|
-
// region Methods: Private
|
|
2320
|
-
_internalAddColumn(key, column) {
|
|
2321
|
-
if (!this._columns.has(key)) {
|
|
2322
|
-
this._columns.set(key, column);
|
|
2323
|
-
}
|
|
2324
|
-
}
|
|
2325
|
-
// endregion
|
|
2326
|
-
// region Methods: Public
|
|
2327
|
-
/**
|
|
2328
|
-
* Returns column instance by column alias.
|
|
2329
|
-
* @param columnAlias Column alias.
|
|
2330
|
-
* @returns [BaseQueryColumn] Column instance.
|
|
2331
|
-
*/
|
|
2332
|
-
getColumn(columnAlias) {
|
|
2333
|
-
if (!this._columns.has(columnAlias)) {
|
|
2334
|
-
throw new ItemNotFoundException(columnAlias);
|
|
2335
|
-
}
|
|
2336
|
-
return this.findColumn(columnAlias);
|
|
2337
|
-
}
|
|
2338
|
-
/**
|
|
2339
|
-
* Returns column instance by column alias if not found returns null.
|
|
2340
|
-
*/
|
|
2341
|
-
findColumn(columnAlias) {
|
|
2342
|
-
return this._columns.get(columnAlias);
|
|
2343
|
-
}
|
|
2344
|
-
/**
|
|
2345
|
-
* @inheritDoc
|
|
2346
|
-
*/
|
|
2347
|
-
getMetadata() {
|
|
2348
|
-
return {
|
|
2349
|
-
...super.getMetadata(),
|
|
2350
|
-
columns: {
|
|
2351
|
-
items: classToPlain(this._columns, { exposeUnsetFields: false, excludePrefixes: ['_'] }),
|
|
2352
|
-
},
|
|
2353
|
-
allColumns: false,
|
|
2354
|
-
isDistinct: this.isDistinct,
|
|
2355
|
-
ignoreDisplayValues: false,
|
|
2356
|
-
rowCount: this.rowCount,
|
|
2357
|
-
rowsOffset: this.rowsOffset,
|
|
2358
|
-
isPageable: this._getIsPageable(),
|
|
2359
|
-
conditionalValues: this.conditionalValues ? this.conditionalValues : null,
|
|
2360
|
-
isHierarchical: false,
|
|
2361
|
-
hierarchicalMaxDepth: 0,
|
|
2362
|
-
hierarchicalColumnName: null,
|
|
2363
|
-
hierarchicalColumnValue: null,
|
|
2364
|
-
useLocalization: this.useLocalization,
|
|
2365
|
-
useRecordDeactivation: false,
|
|
2366
|
-
};
|
|
2367
|
-
}
|
|
2368
|
-
/**
|
|
2369
|
-
* Add column.
|
|
2370
|
-
* @param column Column path.
|
|
2371
|
-
* @param columnAlias Column alias.
|
|
2372
|
-
* @returns [BaseQueryColumn] Column instance.
|
|
2373
|
-
*/
|
|
2374
|
-
addColumn(column, columnAlias) {
|
|
2375
|
-
this._internalAddColumn(columnAlias, column);
|
|
2376
|
-
return column;
|
|
2377
|
-
}
|
|
2378
|
-
/**
|
|
2379
|
-
* Add column by column path.
|
|
2380
|
-
* @param columnPath Column path.
|
|
2381
|
-
* @param columnAlias Column alias.
|
|
2382
|
-
* @returns [EntityQueryColumn] Column instance.
|
|
2383
|
-
*/
|
|
2384
|
-
addSchemaColumn(columnPath, columnAlias) {
|
|
2385
|
-
ValidationUtilities.checkArgumentEmpty('columnPath', columnPath);
|
|
2386
|
-
const column = new EntityQueryColumn(columnPath);
|
|
2387
|
-
this._internalAddColumn(columnAlias || columnPath, column);
|
|
2388
|
-
return column;
|
|
2389
|
-
}
|
|
2390
|
-
/**
|
|
2391
|
-
* Add aggregation sub query column.
|
|
2392
|
-
* @param columnPath Column path.
|
|
2393
|
-
* @param aggregationType Aggregation type.
|
|
2394
|
-
* @param subFilters Sub query filters.
|
|
2395
|
-
* @param columnAlias Column alias.
|
|
2396
|
-
* @returns [AggregationSubQueryColumn] Column instance.
|
|
2397
|
-
*/
|
|
2398
|
-
addAggregationSubQueryColumn(columnPath, aggregationType, aggregationConfig, columnAlias) {
|
|
2399
|
-
const column = new AggregationSubQueryColumn(columnPath, aggregationType, aggregationConfig.filter, aggregationConfig.sortByDirection, aggregationConfig.sortByColumn);
|
|
2400
|
-
this._internalAddColumn(columnAlias || columnPath, column);
|
|
2401
|
-
return column;
|
|
2402
|
-
}
|
|
2403
|
-
/**
|
|
2404
|
-
* Add parameter column.
|
|
2405
|
-
* @param value Parameter value.
|
|
2406
|
-
* @param dataValueType Parameter data value type.
|
|
2407
|
-
* @param columnAlias Column alias.
|
|
2408
|
-
* @returns [ParameterQueryColumn] Column instance.
|
|
2409
|
-
*/
|
|
2410
|
-
addParameterColumn(value, dataValueType, columnAlias) {
|
|
2411
|
-
const column = new ParameterQueryColumn(value, dataValueType);
|
|
2412
|
-
this._internalAddColumn(columnAlias, column);
|
|
2413
|
-
return column;
|
|
2414
|
-
}
|
|
2415
|
-
/**
|
|
2416
|
-
* Add arithmetic column.
|
|
2417
|
-
* @param arithmeticOperation Arithmetic operation.
|
|
2418
|
-
* @param leftArithmeticOperand Left arithmetic operand expression.
|
|
2419
|
-
* @param rightArithmeticOperand Right arithmetic operand expression.
|
|
2420
|
-
* @param columnAlias Column alias.
|
|
2421
|
-
* @returns [ArithmeticQueryColumn] Column instance.
|
|
2422
|
-
*/
|
|
2423
|
-
addArithmeticColumn(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand, columnAlias) {
|
|
2424
|
-
const column = new ArithmeticQueryColumn(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand);
|
|
2425
|
-
this._internalAddColumn(columnAlias, column);
|
|
2426
|
-
return column;
|
|
2427
|
-
}
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* @public
|
|
1160
|
+
* @description Abstract Base Validator class for designing custom validators.
|
|
1161
|
+
* @example
|
|
1162
|
+
* @CrtValidator({
|
|
1163
|
+
* type: 'crt.Required',
|
|
1164
|
+
* })
|
|
1165
|
+
* export class RequiredValidator extends BaseValidator {
|
|
1166
|
+
* protected override async = false;
|
|
1167
|
+
* public validate(controlState: CrtControlState, params?: ValidatorParametersValues): CrtValidationErrors | null {
|
|
1168
|
+
* Implementation here...
|
|
1169
|
+
* }
|
|
1170
|
+
* }
|
|
1171
|
+
*/
|
|
1172
|
+
class BaseValidator {
|
|
2428
1173
|
/**
|
|
2429
|
-
*
|
|
2430
|
-
* @param queryMacrosType Macros type.
|
|
2431
|
-
* @param columnAlias Column alias.
|
|
2432
|
-
* @returns [MacrosFunctionColumn] Column instance.
|
|
1174
|
+
* @description getter for async/sync indicator
|
|
2433
1175
|
*/
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
this._internalAddColumn(columnAlias, column);
|
|
2437
|
-
return column;
|
|
1176
|
+
get isAsync() {
|
|
1177
|
+
return this.async;
|
|
2438
1178
|
}
|
|
2439
1179
|
/**
|
|
2440
|
-
*
|
|
2441
|
-
* @param columnPath Column path.
|
|
2442
|
-
* @param datePartType Date part type.
|
|
2443
|
-
* @param columnAlias Column alias.
|
|
2444
|
-
* @returns [DatePartFunctionColumn] Column instance.
|
|
1180
|
+
* @description Function used for validation
|
|
2445
1181
|
*/
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
const column = new DatePartFunctionColumn(datePartType, functionArgument);
|
|
2449
|
-
this._internalAddColumn(columnAlias, column);
|
|
2450
|
-
return column;
|
|
1182
|
+
get validateFn() {
|
|
1183
|
+
return this.validate.bind(this);
|
|
2451
1184
|
}
|
|
2452
1185
|
/**
|
|
2453
|
-
*
|
|
2454
|
-
* @param columnPath Column path.
|
|
2455
|
-
* @param aggregationType Aggregation type.
|
|
2456
|
-
* @param columnAlias Column alias.
|
|
2457
|
-
* @param aggregationEvalType Aggregation eval type.
|
|
2458
|
-
* @returns [AggregationFunctionColumn] Column instance.
|
|
1186
|
+
* @internal
|
|
2459
1187
|
*/
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
const column = new AggregationFunctionColumn(aggregationType, aggregationEvalType, functionArgument);
|
|
2463
|
-
this._internalAddColumn(columnAlias, column);
|
|
2464
|
-
return column;
|
|
1188
|
+
static [Symbol.hasInstance](instance) {
|
|
1189
|
+
return instance?.constructor?.['_instanceOfKey'] === BaseValidator._instanceOfKey;
|
|
2465
1190
|
}
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* @internal
|
|
1194
|
+
* @dontChange
|
|
1195
|
+
*/
|
|
1196
|
+
BaseValidator._instanceOfKey = 'devkit_BaseValidator';
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* @public
|
|
1200
|
+
*/
|
|
1201
|
+
class LocalizableValue {
|
|
1202
|
+
constructor(key) {
|
|
1203
|
+
this.key = key;
|
|
2477
1204
|
}
|
|
2478
1205
|
/**
|
|
2479
|
-
*
|
|
2480
|
-
* @param columnPath Column path.
|
|
2481
|
-
* @param aggregationType Aggregation type.
|
|
2482
|
-
* @param columnAlias Column alias.
|
|
2483
|
-
* @param aggregationEvalType Aggregation eval type.
|
|
2484
|
-
* @returns [WindowFunctionColumn] Column instance.
|
|
1206
|
+
* @internal
|
|
2485
1207
|
*/
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
aggregationType,
|
|
2489
|
-
aggregationEvalType,
|
|
2490
|
-
functionArgument: new ColumnExpression({ columnPath }),
|
|
2491
|
-
});
|
|
2492
|
-
const column = new WindowFunctionColumn(functionArgument);
|
|
2493
|
-
this._internalAddColumn(columnAlias, column);
|
|
2494
|
-
return column;
|
|
1208
|
+
static [Symbol.hasInstance](instance) {
|
|
1209
|
+
return instance?.constructor?.['_instanceOfKey'] === LocalizableValue._instanceOfKey;
|
|
2495
1210
|
}
|
|
2496
1211
|
}
|
|
1212
|
+
/**
|
|
1213
|
+
* @internal
|
|
1214
|
+
* @dontChange
|
|
1215
|
+
*/
|
|
1216
|
+
LocalizableValue._instanceOfKey = 'devkit_LocalizableValue';
|
|
2497
1217
|
|
|
2498
1218
|
/**
|
|
2499
1219
|
* @internal
|
|
2500
1220
|
*/
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
this._columnValues = new Map();
|
|
2508
|
-
}
|
|
2509
|
-
// endregion
|
|
2510
|
-
// region Properties: Public
|
|
2511
|
-
get columnValues() {
|
|
2512
|
-
return {
|
|
2513
|
-
items: classToPlain(this._columnValues),
|
|
2514
|
-
};
|
|
1221
|
+
function applyLocalizeMetadataFn(obj, localizeMetadata) {
|
|
1222
|
+
const localizableEntries = objectDeepKeys(obj)
|
|
1223
|
+
.map((path) => ({ path, value: get(obj, path) }))
|
|
1224
|
+
.filter(({ value }) => value instanceof LocalizableValue);
|
|
1225
|
+
if (localizableEntries.length === 0) {
|
|
1226
|
+
return obj;
|
|
2515
1227
|
}
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
ValidationUtilities.checkArgumentEmpty('columnName', columnName);
|
|
2520
|
-
this._columnValues.set(columnName, new ParameterExpression({ value: columnValue, dataValueType }));
|
|
1228
|
+
const localized = cloneDeep(obj);
|
|
1229
|
+
if (!localizeMetadata) {
|
|
1230
|
+
console.error("Unable to localize metadata. 'localizeMetadata' bootstrap option was not provided.");
|
|
2521
1231
|
}
|
|
1232
|
+
localizableEntries.forEach(({ path, value }) => {
|
|
1233
|
+
const localizedValue = localizeMetadata?.(value.key) ?? value.key;
|
|
1234
|
+
set(localized, path, localizedValue);
|
|
1235
|
+
});
|
|
1236
|
+
return localized;
|
|
2522
1237
|
}
|
|
2523
|
-
__decorate([
|
|
2524
|
-
Expose(),
|
|
2525
|
-
__metadata("design:type", Object),
|
|
2526
|
-
__metadata("design:paramtypes", [])
|
|
2527
|
-
], InsertQuery.prototype, "columnValues", null);
|
|
2528
1238
|
|
|
2529
1239
|
/**
|
|
2530
1240
|
* @internal
|
|
2531
1241
|
*/
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
// region Fields: Private
|
|
2538
|
-
this._columnValues = new Map();
|
|
2539
|
-
// endregion
|
|
2540
|
-
// region Fields: Public
|
|
2541
|
-
/**
|
|
2542
|
-
* Flag that indicates whether to force save data.
|
|
2543
|
-
*/
|
|
2544
|
-
this.isForceUpdate = false;
|
|
2545
|
-
}
|
|
2546
|
-
// endregion
|
|
2547
|
-
// region Properties: Public
|
|
2548
|
-
get columnValues() {
|
|
2549
|
-
return {
|
|
2550
|
-
items: classToPlain(this._columnValues),
|
|
1242
|
+
function CrtDesignTimeViewElement(config) {
|
|
1243
|
+
return function (type) {
|
|
1244
|
+
const registrationConfig = {
|
|
1245
|
+
...config,
|
|
1246
|
+
typeRef: type,
|
|
2551
1247
|
};
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
// region Methods: Public
|
|
2555
|
-
addColumn(columnName, columnValue, dataValueType) {
|
|
2556
|
-
ValidationUtilities.checkArgumentEmpty('columnName', columnName);
|
|
2557
|
-
this._columnValues.set(columnName, new ParameterExpression({ value: columnValue, dataValueType }));
|
|
2558
|
-
}
|
|
1248
|
+
setDesignTimeViewElementMetadata(registrationConfig, type);
|
|
1249
|
+
};
|
|
2559
1250
|
}
|
|
2560
|
-
__decorate([
|
|
2561
|
-
Expose(),
|
|
2562
|
-
__metadata("design:type", Object),
|
|
2563
|
-
__metadata("design:paramtypes", [])
|
|
2564
|
-
], UpdateQuery.prototype, "columnValues", null);
|
|
2565
1251
|
|
|
2566
1252
|
/**
|
|
2567
1253
|
* @internal
|
|
2568
1254
|
*/
|
|
2569
|
-
|
|
1255
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1256
|
+
function CrtRequest(config) {
|
|
1257
|
+
return function (type) {
|
|
1258
|
+
checkTypeNameFormat(config.type, 'RequestTypeName');
|
|
1259
|
+
checkCrtTypeNamePascalCase(config.type);
|
|
1260
|
+
RequestRegistryService.register(config, type);
|
|
1261
|
+
};
|
|
2570
1262
|
}
|
|
2571
1263
|
|
|
2572
1264
|
/**
|
|
@@ -2579,11 +1271,11 @@ class InterfaceDesignerItemRegistrationConfig {
|
|
|
2579
1271
|
* @internal
|
|
2580
1272
|
* @class MethodInvokeRequest
|
|
2581
1273
|
* @description Definition of invoke method request.
|
|
2582
|
-
* @extends {
|
|
1274
|
+
* @extends {ɵBaseRequest} {@link ɵBaseRequest}
|
|
2583
1275
|
* @property {string} method - method name.
|
|
2584
1276
|
* @property {unknown[]} args - arguments passing to the method.
|
|
2585
1277
|
*/
|
|
2586
|
-
class MethodInvokeRequest extends
|
|
1278
|
+
class MethodInvokeRequest extends ɵBaseRequest {
|
|
2587
1279
|
}
|
|
2588
1280
|
|
|
2589
1281
|
/**
|
|
@@ -2706,7 +1398,6 @@ function CrtModule(moduleDefinition) {
|
|
|
2706
1398
|
return (type) => setModuleMetadata(moduleDefinition, type);
|
|
2707
1399
|
}
|
|
2708
1400
|
|
|
2709
|
-
// noinspection ES6PreferShortImport
|
|
2710
1401
|
/**
|
|
2711
1402
|
* @internal
|
|
2712
1403
|
*/
|
|
@@ -2751,7 +1442,11 @@ function CrtInject(token) {
|
|
|
2751
1442
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2752
1443
|
function CrtValidator(config) {
|
|
2753
1444
|
if (!config) {
|
|
2754
|
-
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
|
+
};
|
|
2755
1450
|
}
|
|
2756
1451
|
return function (type) {
|
|
2757
1452
|
checkTypeNameFormat(config.type, 'ValidatorTypeName');
|
|
@@ -2769,7 +1464,11 @@ function CrtValidator(config) {
|
|
|
2769
1464
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2770
1465
|
function CrtRequestHandler(config) {
|
|
2771
1466
|
if (!config) {
|
|
2772
|
-
return (type) => {
|
|
1467
|
+
return (type) => {
|
|
1468
|
+
// the decorator won't do anything by itself,
|
|
1469
|
+
// but will be used by the compiler to generate class metadata,
|
|
1470
|
+
// which is required for DI
|
|
1471
|
+
};
|
|
2773
1472
|
}
|
|
2774
1473
|
return function (type) {
|
|
2775
1474
|
checkTypeNameFormat(config.type, 'RequestHandlerTypeName');
|
|
@@ -2958,10 +1657,7 @@ function registerRequestHandlers(types, options, remoteName) {
|
|
|
2958
1657
|
RequestHandlerRegistryService.register(registrationConfig, type);
|
|
2959
1658
|
});
|
|
2960
1659
|
}
|
|
2961
|
-
|
|
2962
|
-
* @internal
|
|
2963
|
-
*/
|
|
2964
|
-
function _bootstrapCrtModule(name, type, options) {
|
|
1660
|
+
function bootstrapDefaultCrtModule(name, type, options) {
|
|
2965
1661
|
try {
|
|
2966
1662
|
const moduleDefinition = getModuleMetadata(type);
|
|
2967
1663
|
if (moduleDefinition.viewElements) {
|
|
@@ -2980,12 +1676,34 @@ function _bootstrapCrtModule(name, type, options) {
|
|
|
2980
1676
|
if (moduleDefinition.converters) {
|
|
2981
1677
|
registerConverters(moduleDefinition.converters, options);
|
|
2982
1678
|
}
|
|
2983
|
-
moduleDefinition.includes?.forEach((t) =>
|
|
1679
|
+
moduleDefinition.includes?.forEach((t) => {
|
|
1680
|
+
bootstrapDefaultCrtModule(name, t, options);
|
|
1681
|
+
bootstrapPredefinedModules(name, t, options);
|
|
1682
|
+
});
|
|
2984
1683
|
}
|
|
2985
1684
|
catch (error) {
|
|
2986
1685
|
console.error(error);
|
|
2987
1686
|
}
|
|
2988
1687
|
}
|
|
1688
|
+
/**
|
|
1689
|
+
* @internal
|
|
1690
|
+
*/
|
|
1691
|
+
function bootstrapPredefinedModules(name, type, options) {
|
|
1692
|
+
const modulePrefix = 'module:';
|
|
1693
|
+
const metadataKeys = Reflect.getOwnMetadataKeys(type);
|
|
1694
|
+
for (const key of metadataKeys) {
|
|
1695
|
+
if (typeof key === 'string' && key.startsWith(modulePrefix)) {
|
|
1696
|
+
const moduleType = key.substring(modulePrefix.length);
|
|
1697
|
+
const predefinedBootstrapper = Reflect.getOwnMetadata('moduleBootstrapper:' + moduleType, type);
|
|
1698
|
+
try {
|
|
1699
|
+
predefinedBootstrapper(name, type, options);
|
|
1700
|
+
}
|
|
1701
|
+
catch (error) {
|
|
1702
|
+
console.error(error);
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
2989
1707
|
/**
|
|
2990
1708
|
* @internal
|
|
2991
1709
|
*/
|
|
@@ -3002,7 +1720,8 @@ function bootstrapCrtModule(...args) {
|
|
|
3002
1720
|
throw new Error('Host module cannot have name');
|
|
3003
1721
|
}
|
|
3004
1722
|
}
|
|
3005
|
-
|
|
1723
|
+
bootstrapDefaultCrtModule(name, type, options);
|
|
1724
|
+
bootstrapPredefinedModules(name, type, options);
|
|
3006
1725
|
if (options.moduleType === 'remote') {
|
|
3007
1726
|
BootstrapNotifier.instance.notify(type);
|
|
3008
1727
|
}
|
|
@@ -3082,11 +1801,11 @@ class BaseRequestHandler {
|
|
|
3082
1801
|
}
|
|
3083
1802
|
/**
|
|
3084
1803
|
* @description Method to set request handler to handler chain.
|
|
3085
|
-
* @param next - link for next request handler - {@link
|
|
1804
|
+
* @param next - link for next request handler - {@link ɵRequestHandler}
|
|
3086
1805
|
*/
|
|
3087
1806
|
setNext(next) {
|
|
3088
1807
|
if (this._next) {
|
|
3089
|
-
throw new
|
|
1808
|
+
throw new ɵNextHandlerAlreadySpecifiedException();
|
|
3090
1809
|
}
|
|
3091
1810
|
this._next = next;
|
|
3092
1811
|
}
|
|
@@ -3182,13 +1901,13 @@ __decorate([
|
|
|
3182
1901
|
* @public
|
|
3183
1902
|
* @class SysSetting
|
|
3184
1903
|
* @classdesc Class contains info related system setting
|
|
3185
|
-
* @property {
|
|
1904
|
+
* @property {ɵGuid} id - id of system setting.
|
|
3186
1905
|
* @property {string} name - name of system setting.
|
|
3187
1906
|
* @property {string} code - code of system setting.
|
|
3188
1907
|
* @property {isCacheable} boolean - indicator whether system setting is cacheable
|
|
3189
1908
|
* @property {any} value - value of system setting
|
|
3190
1909
|
* @property {string} displayValue - display value of system setting
|
|
3191
|
-
* @property {
|
|
1910
|
+
* @property {ɵDataValueType} ɵDataValueType - system setting {@link ɵDataValueType}
|
|
3192
1911
|
*/
|
|
3193
1912
|
class SysSetting {
|
|
3194
1913
|
}
|
|
@@ -3239,27 +1958,37 @@ class HttpClientService extends BaseHandlerChainService {
|
|
|
3239
1958
|
* @description HTTP GET request.
|
|
3240
1959
|
* @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
|
|
3241
1960
|
*/
|
|
3242
|
-
get() {
|
|
1961
|
+
get() {
|
|
1962
|
+
// the method will be implemented dynamically by the decorator
|
|
1963
|
+
}
|
|
3243
1964
|
/**
|
|
3244
1965
|
* @description HTTP POST request.
|
|
3245
1966
|
* @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
|
|
3246
1967
|
*/
|
|
3247
|
-
post() {
|
|
1968
|
+
post() {
|
|
1969
|
+
// the method will be implemented dynamically by the decorator
|
|
1970
|
+
}
|
|
3248
1971
|
/**
|
|
3249
1972
|
* @description HTTP DELETE request.
|
|
3250
1973
|
* @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
|
|
3251
1974
|
*/
|
|
3252
|
-
delete() {
|
|
1975
|
+
delete() {
|
|
1976
|
+
// the method will be implemented dynamically by the decorator
|
|
1977
|
+
}
|
|
3253
1978
|
/**
|
|
3254
1979
|
* @description HTTP PUT request.
|
|
3255
1980
|
* @return `Promise<HttpResponse> | void`` {(Promise<HttpResponse> | void)}
|
|
3256
1981
|
*/
|
|
3257
|
-
put() {
|
|
1982
|
+
put() {
|
|
1983
|
+
// the method will be implemented dynamically by the decorator
|
|
1984
|
+
}
|
|
3258
1985
|
/**
|
|
3259
1986
|
* @description HTTP PATCH request.
|
|
3260
1987
|
* @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
|
|
3261
1988
|
*/
|
|
3262
|
-
patch() {
|
|
1989
|
+
patch() {
|
|
1990
|
+
// the method will be implemented dynamically by the decorator
|
|
1991
|
+
}
|
|
3263
1992
|
}
|
|
3264
1993
|
__decorate([
|
|
3265
1994
|
ImplementUsingHandlerChain(),
|
|
@@ -3303,7 +2032,7 @@ var SchemaViewMaskRequestAction;
|
|
|
3303
2032
|
/**
|
|
3304
2033
|
* @internal
|
|
3305
2034
|
*/
|
|
3306
|
-
class SchemaViewMaskRequest extends
|
|
2035
|
+
class SchemaViewMaskRequest extends ɵBaseRequest {
|
|
3307
2036
|
constructor(action, taskName, $context) {
|
|
3308
2037
|
super();
|
|
3309
2038
|
this.action = action;
|
|
@@ -3416,21 +2145,9 @@ __decorate([
|
|
|
3416
2145
|
__metadata("design:type", Function)
|
|
3417
2146
|
], Model.prototype, "_create", void 0);
|
|
3418
2147
|
|
|
3419
|
-
/**
|
|
3420
|
-
* @public
|
|
3421
|
-
*/
|
|
3422
|
-
var ModelParameterType;
|
|
3423
|
-
(function (ModelParameterType) {
|
|
3424
|
-
ModelParameterType["PrimaryColumnValue"] = "primaryColumnValue";
|
|
3425
|
-
ModelParameterType["Filter"] = "filter";
|
|
3426
|
-
ModelParameterType["PrimaryDisplayValueFilter"] = "primaryDisplayValueFilter";
|
|
3427
|
-
ModelParameterType["Empty"] = "empty";
|
|
3428
|
-
ModelParameterType["Never"] = "never";
|
|
3429
|
-
})(ModelParameterType || (ModelParameterType = {}));
|
|
3430
|
-
|
|
3431
2148
|
/**
|
|
3432
2149
|
* Generated bundle index. Do not edit.
|
|
3433
2150
|
*/
|
|
3434
2151
|
|
|
3435
|
-
export {
|
|
2152
|
+
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 };
|
|
3436
2153
|
//# sourceMappingURL=creatio-devkit-common.mjs.map
|