@creatio-devkit/common 0.808.0 → 0.810.0

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