@creatio-devkit/common 0.807.0 → 0.809.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 (314) hide show
  1. package/CHANGELOG.md +10 -5
  2. package/esm2020/creatio-devkit-common.mjs +1 -1
  3. package/esm2020/index.mjs +1 -1
  4. package/esm2020/lib/external/functions/aggregation-adapter.mjs +1 -1
  5. package/esm2020/lib/external/functions/date-part-type-adapter.mjs +1 -1
  6. package/esm2020/lib/external/functions/function-type-adapter.mjs +1 -1
  7. package/esm2020/lib/external/functions/index.mjs +1 -1
  8. package/esm2020/lib/external/functions/order-direction-adapter.mjs +1 -1
  9. package/esm2020/lib/external/models/attribute-value-config.mjs +1 -1
  10. package/esm2020/lib/external/models/date-time/grouped-date-value.mjs +1 -1
  11. package/esm2020/lib/external/models/date-time/index.mjs +1 -1
  12. package/esm2020/lib/external/models/file-value.model.mjs +1 -1
  13. package/esm2020/lib/external/models/index.mjs +1 -1
  14. package/esm2020/lib/external/models/model-init-config.mjs +1 -1
  15. package/esm2020/lib/external/utils/date-utils.mjs +29 -0
  16. package/esm2020/lib/external/utils/index.mjs +2 -0
  17. package/esm2020/lib/index.mjs +12 -11
  18. package/esm2020/lib/internal/constants/index.mjs +1 -1
  19. package/esm2020/lib/internal/constants/metadata.const.mjs +1 -1
  20. package/esm2020/lib/internal/decorators/design-time-view-element/design-time-view-element.decorator.mjs +1 -1
  21. package/esm2020/lib/internal/decorators/design-time-view-element/index.mjs +1 -1
  22. package/esm2020/lib/internal/decorators/implement-using-handler-chain/implement-using-handler-chain.decorator.mjs +1 -1
  23. package/esm2020/lib/internal/decorators/implement-using-handler-chain/index.mjs +1 -1
  24. package/esm2020/lib/internal/decorators/index.mjs +1 -2
  25. package/esm2020/lib/internal/decorators/request/index.mjs +1 -1
  26. package/esm2020/lib/internal/decorators/request/request.decorator.mjs +1 -1
  27. package/esm2020/lib/internal/enums/data-schema-attribute-type.enum.mjs +1 -1
  28. package/esm2020/lib/internal/enums/data-schema-type.enum.mjs +10 -0
  29. package/esm2020/lib/internal/enums/data-source-scope.enum.mjs +1 -1
  30. package/esm2020/lib/internal/enums/default-value-source.enum.mjs +1 -1
  31. package/esm2020/lib/internal/enums/designer-group-type.enum.mjs +1 -1
  32. package/esm2020/lib/internal/enums/handler-source-type.enum.mjs +1 -1
  33. package/esm2020/lib/internal/enums/index.mjs +2 -1
  34. package/esm2020/lib/internal/enums/model-in-page-action.enum.mjs +1 -1
  35. package/esm2020/lib/internal/enums/view-element-group-type.enum.mjs +1 -1
  36. package/esm2020/lib/internal/esq/data-model/index.mjs +1 -1
  37. package/esm2020/lib/internal/esq/data-model/metadata-provider/metadata-provider.mjs +1 -1
  38. package/esm2020/lib/internal/esq/data-model/queries/base-filterable-query.mjs +2 -2
  39. package/esm2020/lib/internal/esq/data-model/queries/base-query.mjs +1 -1
  40. package/esm2020/lib/internal/esq/data-model/queries/delete-query.mjs +1 -1
  41. package/esm2020/lib/internal/esq/data-model/queries/entity-schema-query.mjs +14 -15
  42. package/esm2020/lib/internal/esq/data-model/queries/index.mjs +1 -1
  43. package/esm2020/lib/internal/esq/data-model/queries/insert-query.mjs +3 -3
  44. package/esm2020/lib/internal/esq/data-model/queries/query-operation-type.mjs +1 -1
  45. package/esm2020/lib/internal/esq/data-model/queries/select-localization-query.mjs +1 -1
  46. package/esm2020/lib/internal/esq/data-model/queries/update-query.mjs +3 -3
  47. package/esm2020/lib/internal/esq/index.mjs +1 -1
  48. package/esm2020/lib/internal/model/data-schema/data-schema-attribute-aggregation-config.model.mjs +1 -1
  49. package/esm2020/lib/internal/model/data-schema/data-schema-attribute-function-config.model.mjs +1 -1
  50. package/esm2020/lib/internal/model/data-schema/data-schema-validator-config.model.mjs +1 -1
  51. package/esm2020/lib/internal/model/data-schema/index.mjs +1 -1
  52. package/esm2020/lib/internal/model/data-source-config.mjs +1 -1
  53. package/esm2020/lib/internal/model/index.mjs +1 -1
  54. package/esm2020/lib/internal/models/converter/converter-registry-item.mjs +2 -0
  55. package/esm2020/lib/internal/models/converter/index.mjs +2 -0
  56. package/esm2020/lib/internal/models/default-value-schema.mjs +1 -1
  57. package/esm2020/lib/internal/models/design-time-view-element-registry-item.mjs +1 -1
  58. package/esm2020/lib/internal/models/handler-chain-service-registry-item.mjs +1 -1
  59. package/esm2020/lib/internal/models/index.mjs +3 -2
  60. package/esm2020/lib/internal/models/injection-context/index.mjs +2 -0
  61. package/esm2020/lib/internal/models/injection-context/injection-context.mjs +2 -0
  62. package/esm2020/lib/internal/models/interface-designer-item/base-interface-designer-item-registration-config.mjs +1 -1
  63. package/esm2020/lib/internal/models/interface-designer-item/index.mjs +1 -1
  64. package/esm2020/lib/internal/models/interface-designer-item/interface-designer-item-registration-config.model.mjs +1 -1
  65. package/esm2020/lib/internal/models/interface-designer-item/toolbar-view-element-config.mjs +1 -1
  66. package/esm2020/lib/internal/models/interface-designer-registry-item.mjs +1 -1
  67. package/esm2020/lib/internal/models/internal-interface-designer-item-registration-config.model.mjs +1 -1
  68. package/esm2020/lib/internal/models/remote-build-info.mjs +9 -0
  69. package/esm2020/lib/internal/models/request/index.mjs +1 -1
  70. package/esm2020/lib/internal/models/request/method-invoke-request.mjs +1 -1
  71. package/esm2020/lib/internal/models/request-handler/contexed-handler-scope-config.mjs +2 -0
  72. package/esm2020/lib/internal/models/request-handler/handler-config.mjs +1 -1
  73. package/esm2020/lib/internal/models/request-handler/handler-source.mjs +1 -1
  74. package/esm2020/lib/internal/models/request-handler/index.mjs +2 -1
  75. package/esm2020/lib/internal/models/request-handler/request-handler-factory.mjs +1 -1
  76. package/esm2020/lib/internal/models/request-handler/request-handler-registration-config.model.mjs +1 -1
  77. package/esm2020/lib/internal/models/validator/index.mjs +1 -1
  78. package/esm2020/lib/internal/models/validator/validator-parameters.mjs +1 -1
  79. package/esm2020/lib/internal/models/validator/validator-registry-item.mjs +1 -1
  80. package/esm2020/lib/internal/models/validator/validator-schema-config.model.mjs +1 -1
  81. package/esm2020/lib/internal/models/view-element/angular-view-element-registration-config.model.mjs +1 -1
  82. package/esm2020/lib/internal/models/view-element/index.mjs +1 -1
  83. package/esm2020/lib/internal/models/view-element-registry-item.mjs +1 -1
  84. package/esm2020/lib/internal/services/base-handler-chain.service.mjs +1 -1
  85. package/esm2020/lib/internal/services/base-registry/base-registry.mjs +1 -1
  86. package/esm2020/lib/internal/services/base-registry/index.mjs +1 -1
  87. package/esm2020/lib/internal/services/bootstrap-notifier/bootstrap-notifier.mjs +1 -1
  88. package/esm2020/lib/internal/services/bootstrap-notifier/index.mjs +1 -1
  89. package/esm2020/lib/internal/services/design-time-view-element-registry/design-time-view-element-registry.mjs +1 -1
  90. package/esm2020/lib/internal/services/design-time-view-element-registry/index.mjs +1 -1
  91. package/esm2020/lib/internal/services/element-registration-checker/element-registration-checker.mjs +1 -1
  92. package/esm2020/lib/internal/services/element-registration-checker/index.mjs +1 -1
  93. package/esm2020/lib/internal/services/global-converters-registry/converter-registry.mjs +24 -0
  94. package/esm2020/lib/internal/services/global-converters-registry/index.mjs +2 -2
  95. package/esm2020/lib/internal/services/handler-chain-services-registry/handler-chain-services-registry.mjs +3 -2
  96. package/esm2020/lib/internal/services/handler-chain-services-registry/index.mjs +1 -1
  97. package/esm2020/lib/internal/services/index.mjs +1 -1
  98. package/esm2020/lib/internal/services/interface-designer-item-registry/index.mjs +1 -1
  99. package/esm2020/lib/internal/services/interface-designer-item-registry/interface-designer-item-registry.mjs +3 -2
  100. package/esm2020/lib/internal/services/pkg-topology-registry/index.mjs +1 -1
  101. package/esm2020/lib/internal/services/pkg-topology-registry/pkg-topology-registry.mjs +1 -1
  102. package/esm2020/lib/internal/services/remote-entries-registry/index.mjs +1 -1
  103. package/esm2020/lib/internal/services/remote-entries-registry/remote-entries-registry.mjs +8 -1
  104. package/esm2020/lib/internal/services/request-handler-registry/index.mjs +1 -1
  105. package/esm2020/lib/internal/services/request-handler-registry/request-handler-registry.service.mjs +1 -1
  106. package/esm2020/lib/internal/services/request-registry/index.mjs +1 -1
  107. package/esm2020/lib/internal/services/request-registry/request-registry.service.mjs +1 -1
  108. package/esm2020/lib/internal/services/validator-registry/index.mjs +1 -1
  109. package/esm2020/lib/internal/services/validator-registry/validator-registry.mjs +1 -1
  110. package/esm2020/lib/internal/services/view-element-registry/index.mjs +1 -1
  111. package/esm2020/lib/internal/services/view-element-registry/view-element-registry.mjs +1 -1
  112. package/esm2020/lib/internal/types/index.mjs +2 -1
  113. package/esm2020/lib/internal/types/internal-resolve-dependency-fn.type.mjs +2 -0
  114. package/esm2020/lib/internal/types/localizable-values.type.mjs +1 -1
  115. package/esm2020/lib/internal/utils/component-config-utils.mjs +1 -1
  116. package/esm2020/lib/internal/utils/handlers-order-comparer.mjs +2 -2
  117. package/esm2020/lib/internal/utils/index.mjs +5 -5
  118. package/esm2020/lib/internal/utils/instantiate.mjs +1 -1
  119. package/esm2020/lib/internal/utils/localization-utils.mjs +2 -2
  120. package/esm2020/lib/internal/utils/metadata-utils.mjs +18 -1
  121. package/esm2020/lib/internal/utils/object-deep-keys/index.mjs +1 -1
  122. package/esm2020/lib/internal/utils/object-deep-keys/object-deep-keys.mjs +1 -1
  123. package/esm2020/lib/public/decorators/converter/converter.decorator.mjs +21 -0
  124. package/esm2020/lib/public/decorators/converter/index.mjs +2 -0
  125. package/esm2020/lib/public/decorators/index.mjs +2 -1
  126. package/esm2020/lib/public/decorators/inject/index.mjs +1 -1
  127. package/esm2020/lib/public/decorators/inject/inject.decorator.mjs +1 -1
  128. package/esm2020/lib/public/decorators/input/index.mjs +1 -1
  129. package/esm2020/lib/public/decorators/input/input.decorator.mjs +1 -1
  130. package/esm2020/lib/public/decorators/interface-designer-item/index.mjs +1 -1
  131. package/esm2020/lib/public/decorators/interface-designer-item/interface-designer-item.decorator.mjs +1 -1
  132. package/esm2020/lib/public/decorators/module/index.mjs +1 -1
  133. package/esm2020/lib/public/decorators/module/module.decorator.mjs +1 -1
  134. package/esm2020/lib/public/decorators/output/index.mjs +1 -1
  135. package/esm2020/lib/public/decorators/output/output.decorator.mjs +1 -1
  136. package/esm2020/lib/public/decorators/request-handler/index.mjs +1 -1
  137. package/esm2020/lib/public/decorators/request-handler/request-handler.decorator.mjs +1 -1
  138. package/esm2020/lib/public/decorators/validation-input/index.mjs +1 -1
  139. package/esm2020/lib/public/decorators/validation-input/validation-input.decorator.mjs +1 -1
  140. package/esm2020/lib/public/decorators/validator/index.mjs +1 -1
  141. package/esm2020/lib/public/decorators/validator/validator.decorator.mjs +1 -1
  142. package/esm2020/lib/public/decorators/view-element/index.mjs +1 -1
  143. package/esm2020/lib/public/decorators/view-element/view-element.decorator.mjs +1 -1
  144. package/esm2020/lib/public/enums/aggregation-function.enum.mjs +1 -1
  145. package/esm2020/lib/public/enums/aggregation-type.enum.mjs +1 -1
  146. package/esm2020/lib/public/enums/data-value-type.enum.mjs +1 -1
  147. package/esm2020/lib/public/enums/index.mjs +1 -1
  148. package/esm2020/lib/public/esq/data-model/columns/arithmetic/arithmetic-query-column.mjs +1 -1
  149. package/esm2020/lib/public/esq/data-model/columns/base-query-column.mjs +1 -1
  150. package/esm2020/lib/public/esq/data-model/columns/entity-column/entity-query-column.mjs +1 -1
  151. package/esm2020/lib/public/esq/data-model/columns/functions/aggregation-function-column.mjs +1 -1
  152. package/esm2020/lib/public/esq/data-model/columns/functions/date-part-function-column.mjs +1 -1
  153. package/esm2020/lib/public/esq/data-model/columns/functions/length-function-column.mjs +1 -1
  154. package/esm2020/lib/public/esq/data-model/columns/functions/macros-function-column.mjs +1 -1
  155. package/esm2020/lib/public/esq/data-model/columns/functions/window-function-column.mjs +1 -1
  156. package/esm2020/lib/public/esq/data-model/columns/index.mjs +1 -1
  157. package/esm2020/lib/public/esq/data-model/columns/parameters/parameter-query-column.mjs +1 -1
  158. package/esm2020/lib/public/esq/data-model/columns/sub-queries/aggregation-sub-query-column.mjs +1 -1
  159. package/esm2020/lib/public/esq/data-model/columns/sub-queries/sub-query-column.mjs +1 -1
  160. package/esm2020/lib/public/esq/data-model/enums/aggregation-eval-type.enum.mjs +1 -1
  161. package/esm2020/lib/public/esq/data-model/enums/arithmetic-operation.enum.mjs +1 -1
  162. package/esm2020/lib/public/esq/data-model/enums/comparison-type.enum.mjs +1 -1
  163. package/esm2020/lib/public/esq/data-model/enums/date-part-type.enum.mjs +1 -1
  164. package/esm2020/lib/public/esq/data-model/enums/expression-type.enum.mjs +1 -1
  165. package/esm2020/lib/public/esq/data-model/enums/filter-type.enum.mjs +1 -1
  166. package/esm2020/lib/public/esq/data-model/enums/function-type.enum.mjs +5 -1
  167. package/esm2020/lib/public/esq/data-model/enums/index.mjs +1 -1
  168. package/esm2020/lib/public/esq/data-model/enums/logical-operator-type.enum.mjs +1 -1
  169. package/esm2020/lib/public/esq/data-model/enums/order-direction.enum.mjs +1 -1
  170. package/esm2020/lib/public/esq/data-model/enums/query-macros-type.enum.mjs +1 -1
  171. package/esm2020/lib/public/esq/data-model/expressions/arithmetic/arithmetic-expression.mjs +1 -1
  172. package/esm2020/lib/public/esq/data-model/expressions/arithmetic/index.mjs +1 -1
  173. package/esm2020/lib/public/esq/data-model/expressions/base-expression.mjs +1 -1
  174. package/esm2020/lib/public/esq/data-model/expressions/columns/column-expression.mjs +1 -1
  175. package/esm2020/lib/public/esq/data-model/expressions/columns/index.mjs +1 -1
  176. package/esm2020/lib/public/esq/data-model/expressions/functions/aggregation-function-expression.mjs +2 -2
  177. package/esm2020/lib/public/esq/data-model/expressions/functions/argument-function-expression.mjs +1 -1
  178. package/esm2020/lib/public/esq/data-model/expressions/functions/date-part-function-expression.mjs +2 -2
  179. package/esm2020/lib/public/esq/data-model/expressions/functions/function-expression.mjs +1 -1
  180. package/esm2020/lib/public/esq/data-model/expressions/functions/index.mjs +1 -1
  181. package/esm2020/lib/public/esq/data-model/expressions/functions/length-function-expression.mjs +2 -2
  182. package/esm2020/lib/public/esq/data-model/expressions/functions/macros-function-expression.mjs +2 -2
  183. package/esm2020/lib/public/esq/data-model/expressions/functions/window-function-expression.mjs +2 -2
  184. package/esm2020/lib/public/esq/data-model/expressions/index.mjs +1 -1
  185. package/esm2020/lib/public/esq/data-model/expressions/mocks/expression.mock.mjs +1 -1
  186. package/esm2020/lib/public/esq/data-model/expressions/mocks/index.mjs +1 -1
  187. package/esm2020/lib/public/esq/data-model/expressions/parameters/index.mjs +1 -1
  188. package/esm2020/lib/public/esq/data-model/expressions/parameters/parameter-expression.mjs +7 -1
  189. package/esm2020/lib/public/esq/data-model/expressions/sub-queries/aggregation-sub-query-expression.mjs +1 -1
  190. package/esm2020/lib/public/esq/data-model/expressions/sub-queries/index.mjs +1 -1
  191. package/esm2020/lib/public/esq/data-model/expressions/sub-queries/sub-query-expression.mjs +1 -1
  192. package/esm2020/lib/public/esq/data-model/filters/base-filter.mjs +1 -1
  193. package/esm2020/lib/public/esq/data-model/filters/between-filter.mjs +2 -2
  194. package/esm2020/lib/public/esq/data-model/filters/compare-filter.mjs +2 -2
  195. package/esm2020/lib/public/esq/data-model/filters/exists-filter.mjs +2 -2
  196. package/esm2020/lib/public/esq/data-model/filters/filter-group.mjs +20 -6
  197. package/esm2020/lib/public/esq/data-model/filters/in-filter.mjs +2 -2
  198. package/esm2020/lib/public/esq/data-model/filters/index.mjs +1 -1
  199. package/esm2020/lib/public/esq/data-model/filters/isnull-filter.mjs +2 -2
  200. package/esm2020/lib/public/esq/data-model/filters/mocks/filter.mock.mjs +1 -1
  201. package/esm2020/lib/public/esq/data-model/filters/mocks/index.mjs +1 -1
  202. package/esm2020/lib/public/esq/data-model/filters/single-filter.mjs +1 -1
  203. package/esm2020/lib/public/esq/data-model/index.mjs +1 -1
  204. package/esm2020/lib/public/esq/index.mjs +1 -1
  205. package/esm2020/lib/public/exceptions/argument-empty-exception.mjs +1 -1
  206. package/esm2020/lib/public/exceptions/argument-out-of-range-exception.mjs +1 -1
  207. package/esm2020/lib/public/exceptions/index.mjs +1 -1
  208. package/esm2020/lib/public/exceptions/item-not-found-exception.mjs +1 -1
  209. package/esm2020/lib/public/exceptions/next-handler-already-specified-exception.mjs +1 -1
  210. package/esm2020/lib/public/exceptions/validation-utilities.mjs +1 -1
  211. package/esm2020/lib/public/functions/bootstrap-crt-module-handler-chain-services.mjs +1 -1
  212. package/esm2020/lib/public/functions/bootstrap-crt-module.mjs +35 -6
  213. package/esm2020/lib/public/functions/index.mjs +1 -1
  214. package/esm2020/lib/public/functions/localize.mjs +1 -1
  215. package/esm2020/lib/public/functions/register-angular-view-element.mjs +1 -1
  216. package/esm2020/lib/public/functions/register-view-element.mjs +1 -1
  217. package/esm2020/lib/public/handlers/base-request-handler.mjs +2 -2
  218. package/esm2020/lib/public/handlers/index.mjs +1 -1
  219. package/esm2020/lib/public/models/base-response.model.mjs +1 -1
  220. package/esm2020/lib/public/models/converter/converter-config.mjs +2 -0
  221. package/esm2020/lib/public/models/converter/index.mjs +2 -0
  222. package/esm2020/lib/public/models/converter.model.mjs +1 -1
  223. package/esm2020/lib/public/models/data-source/data-source-insert-result.model.mjs +1 -1
  224. package/esm2020/lib/public/models/data-source/data-source-save-result.model.mjs +1 -1
  225. package/esm2020/lib/public/models/data-source/index.mjs +1 -1
  226. package/esm2020/lib/public/models/entity.model.mjs +1 -1
  227. package/esm2020/lib/public/models/error-info.model.mjs +1 -1
  228. package/esm2020/lib/public/models/image-value.model.mjs +1 -1
  229. package/esm2020/lib/public/models/index.mjs +2 -1
  230. package/esm2020/lib/public/models/input/index.mjs +1 -1
  231. package/esm2020/lib/public/models/input/input-registration-config.model.mjs +1 -1
  232. package/esm2020/lib/public/models/interface-designer-item/index.mjs +1 -1
  233. package/esm2020/lib/public/models/interface-designer-item/interface-designer-item-definition.mjs +1 -1
  234. package/esm2020/lib/public/models/localizable-value.mjs +1 -1
  235. package/esm2020/lib/public/models/lookup-value.model.mjs +1 -1
  236. package/esm2020/lib/public/models/mask-settings.mjs +1 -1
  237. package/esm2020/lib/public/models/module-definition.mjs +1 -1
  238. package/esm2020/lib/public/models/request/base-request-config.mjs +1 -1
  239. package/esm2020/lib/public/models/request/base-request.mjs +1 -1
  240. package/esm2020/lib/public/models/request/data-source-request.mjs +1 -1
  241. package/esm2020/lib/public/models/request/index.mjs +1 -1
  242. package/esm2020/lib/public/models/request/request-registration-config.model.mjs +1 -1
  243. package/esm2020/lib/public/models/request-handler/index.mjs +1 -1
  244. package/esm2020/lib/public/models/request-handler/request-handler-definition.mjs +1 -1
  245. package/esm2020/lib/public/models/request-handler/request-handler.mjs +1 -1
  246. package/esm2020/lib/public/models/validation/base-validator.mjs +1 -1
  247. package/esm2020/lib/public/models/validation/crt-control-state.mjs +1 -1
  248. package/esm2020/lib/public/models/validation/crt-validation-errors.mjs +1 -1
  249. package/esm2020/lib/public/models/validation/crt-validator-fn.mjs +1 -1
  250. package/esm2020/lib/public/models/validation/index.mjs +1 -1
  251. package/esm2020/lib/public/models/validation/validation-info.mjs +1 -1
  252. package/esm2020/lib/public/models/validation/validator-config.mjs +1 -1
  253. package/esm2020/lib/public/models/validation/validator-parameter-values.mjs +1 -1
  254. package/esm2020/lib/public/models/view-element/base-view-element-registration-config.mjs +1 -1
  255. package/esm2020/lib/public/models/view-element/index.mjs +1 -1
  256. package/esm2020/lib/public/models/view-element/view-element-registration-config.mjs +1 -1
  257. package/esm2020/lib/public/models/view-element/view-element-slot-definition.mjs +1 -1
  258. package/esm2020/lib/public/models/view-model-context.mjs +1 -1
  259. package/esm2020/lib/public/services/feature/feature.service.mjs +1 -1
  260. package/esm2020/lib/public/services/feature/index.mjs +1 -1
  261. package/esm2020/lib/public/services/handler-chain/handler-chain.service.mjs +7 -1
  262. package/esm2020/lib/public/services/handler-chain/index.mjs +1 -1
  263. package/esm2020/lib/public/services/handler-chain/internal-handler-chain.mjs +32 -8
  264. package/esm2020/lib/public/services/http-client/http-client.service.mjs +1 -1
  265. package/esm2020/lib/public/services/http-client/http-headers.mjs +1 -1
  266. package/esm2020/lib/public/services/http-client/http-response.mjs +1 -1
  267. package/esm2020/lib/public/services/http-client/index.mjs +1 -1
  268. package/esm2020/lib/public/services/index.mjs +1 -1
  269. package/esm2020/lib/public/services/mask-service/index.mjs +2 -1
  270. package/esm2020/lib/public/services/mask-service/mask.service.mjs +21 -1
  271. package/esm2020/lib/public/services/mask-service/schema-view-mask.request.mjs +22 -0
  272. package/esm2020/lib/public/services/model/data-schema-attribute.mjs +1 -1
  273. package/esm2020/lib/public/services/model/data-schema.mjs +1 -1
  274. package/esm2020/lib/public/services/model/data-source-aggregation-config.mjs +1 -1
  275. package/esm2020/lib/public/services/model/data-source-attribute.mjs +1 -1
  276. package/esm2020/lib/public/services/model/data-source-can-execute-operation.mjs +1 -1
  277. package/esm2020/lib/public/services/model/data-source-function-config.mjs +1 -1
  278. package/esm2020/lib/public/services/model/data-source-paging-config.mjs +1 -1
  279. package/esm2020/lib/public/services/model/data-source-parameter.mjs +1 -1
  280. package/esm2020/lib/public/services/model/data-source-sorting-config.mjs +1 -1
  281. package/esm2020/lib/public/services/model/index.mjs +1 -1
  282. package/esm2020/lib/public/services/model/model-load-options.mjs +1 -1
  283. package/esm2020/lib/public/services/model/model.mjs +1 -1
  284. package/esm2020/lib/public/services/rights/index.mjs +1 -1
  285. package/esm2020/lib/public/services/rights/rights.service.mjs +1 -1
  286. package/esm2020/lib/public/services/sys-settings/index.mjs +1 -1
  287. package/esm2020/lib/public/services/sys-settings/sys-setting.model.mjs +1 -1
  288. package/esm2020/lib/public/services/sys-settings/sys-settings.service.mjs +1 -1
  289. package/esm2020/lib/public/services/sys-values/index.mjs +1 -1
  290. package/esm2020/lib/public/services/sys-values/sys-values.mjs +1 -1
  291. package/esm2020/lib/public/services/sys-values/sys-values.service.mjs +1 -1
  292. package/esm2020/lib/public/types/abstract-type.mjs +1 -1
  293. package/esm2020/lib/public/types/aggregation-eval.type.mjs +1 -1
  294. package/esm2020/lib/public/types/date-part.type.mjs +1 -1
  295. package/esm2020/lib/public/types/entity-column-value.mjs +1 -1
  296. package/esm2020/lib/public/types/function.type.mjs +1 -1
  297. package/esm2020/lib/public/types/guid.type.mjs +1 -1
  298. package/esm2020/lib/public/types/index.mjs +1 -1
  299. package/esm2020/lib/public/types/json-data.type.mjs +1 -1
  300. package/esm2020/lib/public/types/localizable-string.type.mjs +1 -1
  301. package/esm2020/lib/public/types/localize-fn.type.mjs +1 -1
  302. package/esm2020/lib/public/types/resolve-dependency-fn.type.mjs +1 -1
  303. package/esm2020/lib/public/types/sort-direction.type.mjs +1 -1
  304. package/esm2020/lib/public/types/type.mjs +1 -1
  305. package/fesm2015/creatio-devkit-common.mjs +2141 -1937
  306. package/fesm2015/creatio-devkit-common.mjs.map +1 -1
  307. package/fesm2020/creatio-devkit-common.mjs +2140 -1940
  308. package/fesm2020/creatio-devkit-common.mjs.map +1 -1
  309. package/index.d.ts +101 -8
  310. package/package.json +3 -3
  311. package/esm2020/lib/internal/decorators/converter/converter.decorator.mjs +0 -11
  312. package/esm2020/lib/internal/decorators/converter/index.mjs +0 -2
  313. package/esm2020/lib/internal/models/remote-entry-info.mjs +0 -2
  314. package/esm2020/lib/internal/services/global-converters-registry/global-converters-registry.service.mjs +0 -23
@@ -1,1125 +1,1318 @@
1
- import 'reflect-metadata';
2
- import { upperFirst, camelCase, isEqual, get, set, cloneDeep } from 'lodash';
3
- import { __awaiter, __decorate, __metadata } from 'tslib';
1
+ import { __decorate, __metadata, __awaiter } from 'tslib';
4
2
  import { Exclude, Expose, classToPlain } from 'class-transformer';
3
+ import { get, set, upperFirst, camelCase, isEqual, cloneDeep } from 'lodash';
4
+ import 'reflect-metadata';
5
5
 
6
- /**
7
- * @internal
8
- */
9
- const crtInputPrefix = 'crtInput:';
10
- /**
11
- * @internal
12
- */
13
- const crtOutputPrefix = 'crtOutput:';
14
- /**
15
- * @internal
16
- */
17
- const crtValidationInputPrefix = 'crtValidationInput:';
18
- /**
19
- * @internal
20
- */
21
- const crtInjectPrefix = 'crtInject:';
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 = {}));
22
53
 
23
- /**
24
- * @public
25
- * @description Creatio platform interacts with input's of user-defined component through CrtInput decorator.
26
- * @param config {@link CrtInputRegistrationConfig}
27
- *
28
- * @example
29
- * export class AppComponent {
30
- * @CrtInput()
31
- * public value!: string;
32
- * }
33
- */
34
- // eslint-disable-next-line @typescript-eslint/naming-convention
35
- function CrtInput(config) {
36
- return function (target, propertyKey) {
37
- if (!config) {
38
- config = {
39
- propertyBindable: false,
40
- };
41
- }
42
- Reflect.defineMetadata(crtInputPrefix + propertyKey.toString(), config, target.constructor);
43
- };
44
- }
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 = {}));
45
71
 
46
- /**
47
- * @public
48
- * @description User-defined components could notify Creatio platform about changes through CrtOutput decorator.
49
- * @example
50
- * export class AppComponent {
51
- * @Input()
52
- * @CrtOutput()
53
- * public valueChange;
54
- * }
55
- */
56
- // eslint-disable-next-line @typescript-eslint/naming-convention
57
- function CrtOutput() {
58
- return function (target, propertyKey) {
59
- Reflect.defineMetadata(crtOutputPrefix + propertyKey.toString(), {}, target.constructor);
60
- };
61
- }
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 = {}));
62
89
 
63
- /**
64
- * @public
65
- * @description User-defined components receive validationInfo changes through CrtValidationInput decorator.
66
- * Make sure you have defined input for every validationInfo input.
67
- * To properly declare validationInfo field:
68
- * 1. Declare input field inside inputs section. For example `value`
69
- * 2. In validationInputs section declare same field which ends with ValidationInfo.
70
- * For previous example `valueValidationInfo`
71
- *
72
- * @example
73
- * export class AppComponent {
74
- * @CrtInput()
75
- public value;
76
- *
77
- * @CrtValidationInput()
78
- * public valueValidationInfo;
79
- * }
80
- */
81
- // eslint-disable-next-line @typescript-eslint/naming-convention
82
- function CrtValidationInput() {
83
- return function (target, propertyKey) {
84
- Reflect.defineMetadata(crtValidationInputPrefix + propertyKey.toString(), {}, target.constructor);
85
- };
86
- }
90
+ var LogicalOperatorType;
91
+ (function (LogicalOperatorType) {
92
+ LogicalOperatorType[LogicalOperatorType["And"] = 0] = "And";
93
+ LogicalOperatorType[LogicalOperatorType["Or"] = 1] = "Or";
94
+ })(LogicalOperatorType || (LogicalOperatorType = {}));
87
95
 
88
- /**
89
- * @internal
90
- */
91
- function checkTypeNameFormat(type, element) {
92
- const typeParts = type.split('.');
93
- if (typeParts.length < 2) {
94
- throw new Error(`Error when register ${type}. Type property should have format "VendorPrefix.${element}"`);
95
- }
96
- }
97
- /**
98
- * @internal
99
- */
100
- function checkTypeNamePascalCase(type) {
101
- const [vendor, typeName] = type.split('.');
102
- const pascalTypeName = toPascalCase(typeName);
103
- if (!vendor || pascalTypeName !== typeName) {
104
- 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');
105
- }
106
- }
107
- /**
108
- * @internal
109
- */
110
- function checkCrtTypeNamePascalCase(type) {
111
- const [vendor, typeName] = type.split('.');
112
- const pascalTypeName = toPascalCase(typeName);
113
- if (vendor.toLowerCase() === 'crt' && pascalTypeName !== typeName) {
114
- 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');
115
- }
116
- }
117
- /**
118
- * @internal
119
- */
120
- function toPascalCase(source) {
121
- return upperFirst(camelCase(source));
122
- }
123
- /**
124
- * @internal
125
- */
126
- function checkIfTypeRegistered(type, item) {
127
- if (!item) {
128
- throw new Error(`Error when resolve ${type}. Type was not registered.`);
129
- }
130
- }
131
- /**
132
- * @internal
133
- */
134
- function checkOnlyOneRegistration(type, item, map) {
135
- if (map.has(type) && !isEqual(map.get(type), item)) {
136
- throw new Error(`Error when register ${type}. Element with this type has already exist`);
137
- }
138
- }
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 = {}));
139
105
 
140
- var _a;
141
- /**
142
- * @internal
143
- */
144
- class InternalRequestHandlerRegistryType {
145
- static get requestHandlersMap() {
146
- return this._requestHandlersMap;
147
- }
148
- static onAddRequestHandler(handler) {
149
- this._addItemListeners.push(handler);
150
- return () => {
151
- this._addItemListeners.splice(this._addItemListeners.indexOf(handler), 1);
152
- };
153
- }
154
- static onRemoveRequestHandler(handler) {
155
- this._removeItemListeners.push(handler);
156
- return () => {
157
- this._removeItemListeners.splice(this._removeItemListeners.indexOf(handler), 1);
158
- };
159
- }
160
- static addRequestHandler(handlerType, config) {
161
- if (!this._requestHandlersMap.has(handlerType)) {
162
- this._requestHandlersMap.set(handlerType, config);
163
- for (const listener of this._addItemListeners) {
164
- listener(handlerType, config);
165
- }
166
- }
167
- }
168
- static removeRequestHandler(handlerType) {
169
- const config = this._requestHandlersMap.get(handlerType);
170
- if (config) {
171
- this._requestHandlersMap.delete(handlerType);
172
- for (const listener of this._removeItemListeners) {
173
- listener(handlerType, config);
174
- }
175
- }
176
- }
177
- }
178
- InternalRequestHandlerRegistryType._addItemListeners = [];
179
- InternalRequestHandlerRegistryType._removeItemListeners = [];
180
- InternalRequestHandlerRegistryType._requestHandlersMap = new Map();
181
- const global$3 = window;
182
- (_a = global$3.creatio) !== null && _a !== void 0 ? _a : (global$3.creatio = {});
183
- if (!global$3.creatio.requestHandlerRegistry) {
184
- Object.defineProperty(global$3.creatio, 'requestHandlerRegistry', {
185
- get: () => InternalRequestHandlerRegistryType,
186
- configurable: false,
187
- });
188
- }
189
- /**
190
- * @internal
191
- */
192
- // eslint-disable-next-line @typescript-eslint/naming-convention
193
- const InternalRequestHandlerRegistry = InternalRequestHandlerRegistryType;
194
- /**
195
- * @internal
196
- */
197
- class RequestHandlerRegistryService {
198
- /**
199
- * Register request handler class.
200
- * @param config Request handler registration config.
201
- * @param type Request handler type.
202
- */
203
- static register(config, type) {
204
- const requestType = config.requestType;
205
- const requestHandlerType = config.type;
206
- if (!requestType) {
207
- throw new Error(`Error when register ${requestHandlerType}. Request type not specified.`);
208
- }
209
- const requestHandlerMapValue = {
210
- instanceType: type,
211
- instanceConfig: config,
212
- };
213
- RequestHandlerRegistryService._internalRegistry.addRequestHandler(requestHandlerType, requestHandlerMapValue);
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
+ /** Date add. */
193
+ FunctionType[FunctionType["DateAdd"] = 6] = "DateAdd";
194
+ /** Date diff. */
195
+ FunctionType[FunctionType["DateDiff"] = 7] = "DateDiff";
196
+ })(FunctionType || (FunctionType = {}));
197
+
198
+ var OrderDirection;
199
+ (function (OrderDirection) {
200
+ OrderDirection[OrderDirection["None"] = 0] = "None";
201
+ OrderDirection[OrderDirection["Asc"] = 1] = "Asc";
202
+ OrderDirection[OrderDirection["Desc"] = 2] = "Desc";
203
+ })(OrderDirection || (OrderDirection = {}));
204
+
205
+ var QueryMacrosType;
206
+ (function (QueryMacrosType) {
207
+ /** Macro type not defined. */
208
+ QueryMacrosType[QueryMacrosType["None"] = 0] = "None";
209
+ /** Current user. */
210
+ QueryMacrosType[QueryMacrosType["CurrentUser"] = 1] = "CurrentUser";
211
+ /** Current user contact. */
212
+ QueryMacrosType[QueryMacrosType["CurrentUserContact"] = 2] = "CurrentUserContact";
213
+ /** Yesterday. */
214
+ QueryMacrosType[QueryMacrosType["Yesterday"] = 3] = "Yesterday";
215
+ /** Today. */
216
+ QueryMacrosType[QueryMacrosType["Today"] = 4] = "Today";
217
+ /** Tomorrow. */
218
+ QueryMacrosType[QueryMacrosType["Tomorrow"] = 5] = "Tomorrow";
219
+ /** Previous week. */
220
+ QueryMacrosType[QueryMacrosType["PreviousWeek"] = 6] = "PreviousWeek";
221
+ /** This week. */
222
+ QueryMacrosType[QueryMacrosType["CurrentWeek"] = 7] = "CurrentWeek";
223
+ /** Next week. */
224
+ QueryMacrosType[QueryMacrosType["NextWeek"] = 8] = "NextWeek";
225
+ /** Previous month. */
226
+ QueryMacrosType[QueryMacrosType["PreviousMonth"] = 9] = "PreviousMonth";
227
+ /** Current month. */
228
+ QueryMacrosType[QueryMacrosType["CurrentMonth"] = 10] = "CurrentMonth";
229
+ /** Next month. */
230
+ QueryMacrosType[QueryMacrosType["NextMonth"] = 11] = "NextMonth";
231
+ /** Previous quarter. */
232
+ QueryMacrosType[QueryMacrosType["PreviousQuarter"] = 12] = "PreviousQuarter";
233
+ /** Current quarter. */
234
+ QueryMacrosType[QueryMacrosType["CurrentQuarter"] = 13] = "CurrentQuarter";
235
+ /** Next quarter. */
236
+ QueryMacrosType[QueryMacrosType["NextQuarter"] = 14] = "NextQuarter";
237
+ /** Previous half of the year. */
238
+ QueryMacrosType[QueryMacrosType["PreviousHalfYear"] = 15] = "PreviousHalfYear";
239
+ /** Current half-year. */
240
+ QueryMacrosType[QueryMacrosType["CurrentHalfYear"] = 16] = "CurrentHalfYear";
241
+ /** Next half-year. */
242
+ QueryMacrosType[QueryMacrosType["NextHalfYear"] = 17] = "NextHalfYear";
243
+ /** Last year. */
244
+ QueryMacrosType[QueryMacrosType["PreviousYear"] = 18] = "PreviousYear";
245
+ /** This year. */
246
+ QueryMacrosType[QueryMacrosType["CurrentYear"] = 19] = "CurrentYear";
247
+ /** Previous hour. */
248
+ QueryMacrosType[QueryMacrosType["PreviousHour"] = 20] = "PreviousHour";
249
+ /** Current hour. */
250
+ QueryMacrosType[QueryMacrosType["CurrentHour"] = 21] = "CurrentHour";
251
+ /** Next hour. */
252
+ QueryMacrosType[QueryMacrosType["NextHour"] = 22] = "NextHour";
253
+ /** Next year. */
254
+ QueryMacrosType[QueryMacrosType["NextYear"] = 23] = "NextYear";
255
+ /** Next N Days. */
256
+ QueryMacrosType[QueryMacrosType["NextNDays"] = 24] = "NextNDays";
257
+ /** Previous N days. */
258
+ QueryMacrosType[QueryMacrosType["PreviousNDays"] = 25] = "PreviousNDays";
259
+ /** Next N hours. */
260
+ QueryMacrosType[QueryMacrosType["NextNHours"] = 26] = "NextNHours";
261
+ /** Previous N hours. */
262
+ QueryMacrosType[QueryMacrosType["PreviousNHours"] = 27] = "PreviousNHours";
263
+ /** Primary column. */
264
+ QueryMacrosType[QueryMacrosType["PrimaryColumn"] = 34] = "PrimaryColumn";
265
+ /** Primary displayed column. */
266
+ QueryMacrosType[QueryMacrosType["PrimaryDisplayColumn"] = 35] = "PrimaryDisplayColumn";
267
+ /** Primary image display column. */
268
+ QueryMacrosType[QueryMacrosType["PrimaryImageColumn"] = 36] = "PrimaryImageColumn";
269
+ /** Anniversary today. */
270
+ QueryMacrosType[QueryMacrosType["DayOfYearToday"] = 37] = "DayOfYearToday";
271
+ /** Anniversary on the date computed as today plus days offset. */
272
+ QueryMacrosType[QueryMacrosType["DayOfYearTodayPlusDaysOffset"] = 38] = "DayOfYearTodayPlusDaysOffset";
273
+ /** Anniversary on the next several days. */
274
+ QueryMacrosType[QueryMacrosType["NextNDaysOfYear"] = 39] = "NextNDaysOfYear";
275
+ /** Anniversary on the previous several days. */
276
+ QueryMacrosType[QueryMacrosType["PreviousNDaysOfYear"] = 40] = "PreviousNDaysOfYear";
277
+ /** Primary color display column. */
278
+ QueryMacrosType[QueryMacrosType["PrimaryColorColumn"] = 41] = "PrimaryColorColumn";
279
+ })(QueryMacrosType || (QueryMacrosType = {}));
280
+
281
+ class BaseExpression {
282
+ constructor(config) {
283
+ this.isBlock = false;
284
+ this.isBlock = config === null || config === void 0 ? void 0 : config.isBlock;
214
285
  }
215
286
  }
216
- RequestHandlerRegistryService._internalRegistry = global$3.creatio.requestHandlerRegistry;
217
287
 
218
- /**
219
- * @internal
220
- */
221
- class RequestRegistryService {
222
- static get requestsRegistrationInfos() {
223
- return this._requestsRegistrationInfos;
224
- }
225
- /**
226
- * Registers a specified request class.
227
- * @param config Request registration config.
228
- * @param type Request type.
229
- */
230
- static register(config, type) {
231
- const requestType = config.type;
232
- // TODO RND-21723
233
- RequestRegistryService._requestsMap.set(requestType, type);
234
- RequestRegistryService._requestsRegistrationInfos.set(requestType, config);
288
+ class ArithmeticExpression extends BaseExpression {
289
+ constructor(config) {
290
+ super(config);
291
+ this.expressionType = ExpressionType.ArithmeticOperation;
292
+ this.arithmeticOperation = config === null || config === void 0 ? void 0 : config.arithmeticOperation;
293
+ this.leftArithmeticOperand = config === null || config === void 0 ? void 0 : config.leftArithmeticOperand.clone();
294
+ this.rightArithmeticOperand = config === null || config === void 0 ? void 0 : config.rightArithmeticOperand.clone();
235
295
  }
236
- /**
237
- * Creates request instance by specified registered request type.
238
- * @param type Request type.
239
- * @returns The instance of registered request.
240
- */
241
- static get(type) {
242
- const requestInstanceConstructor = RequestRegistryService._requestsMap.get(type);
243
- checkIfTypeRegistered(type, requestInstanceConstructor);
244
- return requestInstanceConstructor && new requestInstanceConstructor();
296
+ clone() {
297
+ return new ArithmeticExpression(this);
245
298
  }
246
299
  }
247
- RequestRegistryService._requestsMap = new Map();
248
- RequestRegistryService._requestsRegistrationInfos = new Map();
249
300
 
250
- /**
251
- * @internal
252
- */
253
- class GlobalConvertersRegistryService {
254
- static get(type) {
255
- if (!this._converters.has(type)) {
256
- throw new Error(`'${type}' converter doesn't exist`);
257
- }
258
- return this._converters.get(type);
259
- }
260
- static register(type, ctor) {
261
- checkTypeNameFormat(type, 'ConverterTypeName');
262
- checkCrtTypeNamePascalCase(type);
263
- // TODO RND-21723
264
- this._converters.set(type, new ctor());
301
+ class ColumnExpression extends BaseExpression {
302
+ constructor(config) {
303
+ super(config);
304
+ this.expressionType = ExpressionType.SchemaColumn;
305
+ this.columnPath = config === null || config === void 0 ? void 0 : config.columnPath;
265
306
  }
266
- static clear() {
267
- this._converters.clear();
307
+ clone() {
308
+ return new ColumnExpression(this);
268
309
  }
269
310
  }
270
- GlobalConvertersRegistryService._converters = new Map();
271
311
 
272
- const global$2 = window;
273
- /**
274
- * @internal
275
- */
276
- class BaseRegistry {
277
- constructor() {
278
- this.store = {
279
- typeInfos: new Map(),
280
- };
281
- }
282
- static get store() {
283
- if (!this._instance) {
284
- let globalInstance = get(global$2, this._prefix + this.registryKey);
285
- if (!globalInstance) {
286
- globalInstance = new this();
287
- set(global$2, this._prefix + this.registryKey, globalInstance);
288
- }
289
- this._instance = globalInstance;
290
- }
291
- return this._instance.store;
312
+ class FunctionExpression extends BaseExpression {
313
+ constructor(config) {
314
+ super(config);
315
+ this.expressionType = ExpressionType.Function;
292
316
  }
293
317
  }
294
- BaseRegistry._prefix = 'creatio.registry.';
295
318
 
296
- /**
297
- * @internal
298
- */
299
- const viewElementRegistryKey = 'ViewElementRegistry';
300
- /**
301
- * @internal
302
- */
303
- class ViewElementRegistry extends BaseRegistry {
304
- static validate(config) {
305
- checkTypeNameFormat(config.type, 'ViewElementTypeName');
306
- checkOnlyOneRegistration(config.type, config, ViewElementRegistry.viewElements);
307
- }
308
- static get viewElements() {
309
- return this.store.typeInfos;
310
- }
311
- static register(config) {
312
- this.viewElements.set(config.type, config);
313
- }
314
- static getFormControlRelatesAttribute(type) {
315
- var _a;
316
- const config = this.store.typeInfos.get(type);
317
- return (config && 'formControlConfig' in config && ((_a = config.formControlConfig) === null || _a === void 0 ? void 0 : _a.relatesTo)) || null;
319
+ class ArgumentFunctionExpression extends FunctionExpression {
320
+ constructor(config) {
321
+ super(config);
322
+ this.functionArgument = config === null || config === void 0 ? void 0 : config.functionArgument.clone();
318
323
  }
319
324
  }
320
- ViewElementRegistry.registryKey = viewElementRegistryKey;
321
325
 
322
- /**
323
- * @internal
324
- */
325
- const interfaceDesignerItemRegistryKey = 'InterfaceDesignerItemRegistry';
326
- /**
327
- * @internal
328
- */
329
- class InterfaceDesignerItemRegistry extends BaseRegistry {
330
- static validate(config) {
331
- checkTypeNameFormat(config.type, 'InterfaceDesignerItemTypeName');
332
- checkCrtTypeNamePascalCase(config.type);
333
- checkOnlyOneRegistration(config.type, config, this.interfaceDesignerItemRegistrationInfos);
334
- }
335
- static register(config) {
336
- this.interfaceDesignerItemRegistrationInfos.set(config.type, config);
337
- }
338
- static get interfaceDesignerItemRegistrationInfos() {
339
- return this.store.typeInfos;
326
+ class AggregationFunctionExpression extends ArgumentFunctionExpression {
327
+ constructor(config) {
328
+ super(config);
329
+ this.functionType = FunctionType.Aggregation;
330
+ this.aggregationType = config === null || config === void 0 ? void 0 : config.aggregationType;
331
+ this.aggregationEvalType = config === null || config === void 0 ? void 0 : config.aggregationEvalType;
340
332
  }
341
- static get(type) {
342
- return this.interfaceDesignerItemRegistrationInfos.get(type);
333
+ clone() {
334
+ return new AggregationFunctionExpression(this);
343
335
  }
344
336
  }
345
- InterfaceDesignerItemRegistry.registryKey = interfaceDesignerItemRegistryKey;
346
337
 
347
- const global$1 = window;
348
- /**
349
- * @internal
350
- */
351
- class BootstrapNotifier {
352
- constructor() {
353
- this._subscribers = new Set();
354
- }
355
- static get instance() {
356
- if (!global$1.__crtModuleBootstrapNotifier) {
357
- global$1.__crtModuleBootstrapNotifier = new BootstrapNotifier();
358
- }
359
- return global$1.__crtModuleBootstrapNotifier;
360
- }
361
- notify(moduleType) {
362
- for (const subscriber of this._subscribers.values()) {
363
- subscriber(moduleType);
364
- }
338
+ class DatePartFunctionExpression extends ArgumentFunctionExpression {
339
+ constructor(config) {
340
+ super(config);
341
+ this.functionType = FunctionType.DatePart;
342
+ this.datePartType = config === null || config === void 0 ? void 0 : config.datePartType;
365
343
  }
366
- subscribe(subscriber) {
367
- this._subscribers.add(subscriber);
368
- return {
369
- unsubscribe: () => this._subscribers.delete(subscriber),
370
- };
344
+ clone() {
345
+ return new DatePartFunctionExpression(this);
371
346
  }
372
347
  }
373
348
 
374
- /**
375
- * @internal
376
- */
377
- class HandlerChainServicesRegistry extends BaseRegistry {
378
- static validate({ requestType }) {
379
- checkTypeNameFormat(requestType, this.registryKey);
380
- checkCrtTypeNamePascalCase(requestType);
381
- this.checkUniqueRequestType(requestType);
382
- }
383
- static checkUniqueRequestType(requestType) {
384
- if (this.services.get(requestType)) {
385
- throw new Error(`${requestType} already registered`);
386
- }
387
- }
388
- static register(config) {
389
- this.validate(config);
390
- this.services.set(config.requestType, config);
349
+ class LengthFunctionExpression extends ArgumentFunctionExpression {
350
+ constructor(config) {
351
+ super(config);
352
+ this.functionType = FunctionType.Length;
391
353
  }
392
- static get services() {
393
- return this.store.typeInfos;
354
+ clone() {
355
+ return new LengthFunctionExpression(this);
394
356
  }
395
357
  }
396
- HandlerChainServicesRegistry.registryKey = 'HandlerChainServicesRegistry';
397
358
 
398
- /**
399
- * @internal
400
- */
401
- const designTimeViewElementRegistryKey = 'DesignTimeViewElementRegistry';
402
- /**
403
- * @internal
404
- */
405
- class DesignTimeViewElementRegistry extends BaseRegistry {
406
- static validate(config) {
407
- checkTypeNameFormat(config.type, 'DesignTimeViewElementRegistryItemTypeName');
408
- checkCrtTypeNamePascalCase(config.type);
409
- checkOnlyOneRegistration(config.type, config, this.infos);
410
- }
411
- static register(config) {
412
- this.infos.set(config.type, config);
413
- }
414
- static getByOverriddenType(type) {
415
- const item = Array.from(this.infos).find(([_, info]) => info.overrideType === type);
416
- if (item) {
417
- return item[1];
418
- }
419
- return null;
359
+ class MacrosFunctionExpression extends FunctionExpression {
360
+ constructor(config) {
361
+ super(config);
362
+ this.functionType = FunctionType.Macros;
363
+ this.macrosType = config === null || config === void 0 ? void 0 : config.macrosType;
420
364
  }
421
- static get infos() {
422
- return this.store.typeInfos;
365
+ clone() {
366
+ return new MacrosFunctionExpression(this);
423
367
  }
424
368
  }
425
- DesignTimeViewElementRegistry.registryKey = designTimeViewElementRegistryKey;
426
369
 
427
- /**
428
- * @internal
429
- */
430
- class ValidatorMapValue {
431
- }
432
- /**
433
- * @internal
434
- */
435
- const validatorRegistryKey = 'ValidatorRegistry';
436
- /**
437
- * @internal
438
- */
439
- class ValidatorRegistry extends BaseRegistry {
440
- static _has(configType, type) {
441
- var _a;
442
- return ValidatorRegistry.items.has(configType) && ((_a = ValidatorRegistry.items.get(configType)) === null || _a === void 0 ? void 0 : _a.typeRef) !== type;
443
- }
444
- static validate(config) {
445
- checkTypeNameFormat(config.type, 'ValidatorTypeName');
446
- if (ValidatorRegistry._has(config.type, config.typeRef)) {
447
- throw new Error(`Error when register ${config.type}. Element with this type has already exist`);
448
- }
449
- }
450
- static get items() {
451
- return this.store.typeInfos;
370
+ class WindowFunctionExpression extends ArgumentFunctionExpression {
371
+ constructor(config) {
372
+ super(config);
373
+ this.functionType = FunctionType.Window;
452
374
  }
453
- static register(config) {
454
- this.items.set(config.type, config);
375
+ clone() {
376
+ return new WindowFunctionExpression(this);
455
377
  }
456
378
  }
457
- ValidatorRegistry.registryKey = validatorRegistryKey;
458
379
 
459
380
  /**
460
381
  * @internal
382
+ * Returns a string represent of date in ISO 8601 without time zone specification(doesn't convert it
383
+ * using local timezone).
384
+ *
385
+ * Example:
386
+ *
387
+ * const date = new Date(2018, 01, 20, 15, 10, 30);
388
+ * const result = toLocalISOString(date);
389
+ * //result: '2018-02-20T15:10:30'
390
+ *
391
+ * @param date Date value.
461
392
  */
462
- class PkgTopology extends BaseRegistry {
463
- static get items() {
464
- return this.store.typeInfos;
465
- }
466
- static get(pkgName) {
467
- const order = this.items.get(pkgName);
468
- if (order === undefined) {
469
- throw new Error(`Package with name ${pkgName} not found in topology`);
470
- }
471
- return order;
393
+ function toLocalISOString(date) {
394
+ if (!(date instanceof Date)) {
395
+ throw new TypeError();
472
396
  }
397
+ const timeZoneOffset = date.getTimezoneOffset() * 60000;
398
+ return new Date(date.getTime() - timeZoneOffset).toISOString().slice(0, -1);
473
399
  }
474
- PkgTopology.registryKey = 'pkgTopology';
475
-
476
400
  /**
477
401
  * @internal
402
+ * Returns encoded date in string value.
403
+ * @param date Date value.
478
404
  */
479
- class RemoteEntriesRegistry extends BaseRegistry {
480
- static get items() {
481
- return this.store.typeInfos;
482
- }
405
+ function encodeDate(date) {
406
+ return `"${toLocalISOString(date)}"`;
483
407
  }
484
- RemoteEntriesRegistry.registryKey = 'remotes';
485
408
 
486
- /**
487
- * @internal
488
- */
489
- function objectDeepKeys(obj) {
490
- if (obj === null || typeof obj !== 'object') {
491
- return [];
409
+ class ParameterExpression extends BaseExpression {
410
+ constructor(config) {
411
+ var _a;
412
+ super(config);
413
+ this.expressionType = ExpressionType.Parameter;
414
+ const value = config === null || config === void 0 ? void 0 : config.value;
415
+ if (value instanceof Date) {
416
+ const cloneDate = new Date();
417
+ cloneDate.setTime(value.getTime());
418
+ this.value = cloneDate;
419
+ }
420
+ else if (!value) {
421
+ this.value = value;
422
+ }
423
+ else {
424
+ this.value = typeof value === 'object' ? Object.assign({}, value) : value;
425
+ }
426
+ this.dataValueType = (_a = config === null || config === void 0 ? void 0 : config.dataValueType) !== null && _a !== void 0 ? _a : DataValueType.Text;
427
+ }
428
+ get parameter() {
429
+ return Object.assign({ dataValueType: this.dataValueType }, this._getParameterValueMetadata());
430
+ }
431
+ _convertStringToBlobArray(str) {
432
+ const out = [];
433
+ let position = 0;
434
+ for (let i = 0; i < str.length; i++) {
435
+ const code = str.charCodeAt(i);
436
+ if (code < 128) {
437
+ out[position++] = String.fromCharCode(code);
438
+ }
439
+ else if (code < 2048) {
440
+ /* eslint-disable no-bitwise */
441
+ out[position++] = String.fromCharCode((code >> 6) | 192);
442
+ out[position++] = String.fromCharCode((code & 63) | 128);
443
+ }
444
+ else {
445
+ out[position++] = String.fromCharCode((code >> 12) | 224);
446
+ out[position++] = String.fromCharCode(((code >> 6) & 63) | 128);
447
+ out[position++] = String.fromCharCode((code & 63) | 128);
448
+ /* eslint-enable no-bitwise */
449
+ }
450
+ }
451
+ return out;
452
+ }
453
+ _getParameterValueMetadata() {
454
+ if (this.dataValueType === DataValueType.Blob) {
455
+ return {
456
+ arrayValue: !this.value ? [] : this._convertStringToBlobArray(this.value),
457
+ };
458
+ }
459
+ else if (this.value instanceof Date) {
460
+ return {
461
+ value: encodeDate(this.value),
462
+ };
463
+ }
464
+ else {
465
+ return {
466
+ value: this.value,
467
+ };
468
+ }
469
+ }
470
+ clone() {
471
+ return new ParameterExpression(this);
492
472
  }
493
- return Object.keys(obj)
494
- .filter((key) => obj[key] instanceof Object)
495
- .map((key) => objectDeepKeys(obj[key]).map((k) => [key, ...k]))
496
- .reduce((x, y) => [...x, ...y], Object.keys(obj).map((x) => [x]));
497
473
  }
474
+ __decorate([
475
+ Exclude(),
476
+ __metadata("design:type", Object)
477
+ ], ParameterExpression.prototype, "value", void 0);
478
+ __decorate([
479
+ Exclude(),
480
+ __metadata("design:type", Number)
481
+ ], ParameterExpression.prototype, "dataValueType", void 0);
482
+ __decorate([
483
+ Expose(),
484
+ __metadata("design:type", Object),
485
+ __metadata("design:paramtypes", [])
486
+ ], ParameterExpression.prototype, "parameter", null);
498
487
 
499
- const moduleMetadataKey = 'module';
500
- const viewElementMetadataKey = 'viewElement';
501
- const interfaceDesignerItemMetadataKey = 'interfaceDesignerItem';
502
- const requestHandlerMetadataKey = 'requestHandler';
503
- const designTimeViewElementMetadataKey = 'designTimeViewElement';
504
- const validatorMetadataKey = 'validator';
505
- /**
506
- * @internal
507
- */
508
- function setModuleMetadata(metadata, type) {
509
- Reflect.defineMetadata(moduleMetadataKey, metadata, type);
488
+ class SubQueryExpression extends BaseExpression {
489
+ constructor(config) {
490
+ super(config);
491
+ this.expressionType = ExpressionType.SubQuery;
492
+ this.columnPath = config === null || config === void 0 ? void 0 : config.columnPath;
493
+ const subFilter = config === null || config === void 0 ? void 0 : config.subFilters;
494
+ this.subFilters = typeof (subFilter === null || subFilter === void 0 ? void 0 : subFilter.clone) === 'function' ? subFilter.clone() : subFilter;
495
+ this.subOrderDirection = config.subOrderDirection;
496
+ this.subOrderColumn = config.subOrderColumn;
497
+ }
498
+ clone() {
499
+ return new SubQueryExpression(this);
500
+ }
501
+ }
502
+
503
+ class AggregationSubQueryExpression extends SubQueryExpression {
504
+ constructor(config) {
505
+ super(config);
506
+ this.aggregationType = config === null || config === void 0 ? void 0 : config.aggregationType;
507
+ }
508
+ clone() {
509
+ return new AggregationSubQueryExpression(this);
510
+ }
511
+ }
512
+
513
+ const EXPRESSION_TYPE_MOCK = -1;
514
+ class ExpressionMock extends BaseExpression {
515
+ constructor(config) {
516
+ super(config || {});
517
+ this.expressionType = EXPRESSION_TYPE_MOCK;
518
+ }
519
+ // eslint-disable-next-line @typescript-eslint/ban-types
520
+ get plainObject() {
521
+ return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
522
+ }
523
+ clone() {
524
+ return new ExpressionMock(this);
525
+ }
526
+ }
527
+
528
+ class BaseFilter {
529
+ constructor(filterType) {
530
+ this.isEnabled = true;
531
+ this.trimDateTimeParameterToDate = false;
532
+ this.filterType = filterType;
533
+ }
534
+ }
535
+
536
+ class FilterMock extends BaseFilter {
537
+ constructor(filterType = FilterType.None) {
538
+ super(filterType);
539
+ }
540
+ // eslint-disable-next-line @typescript-eslint/ban-types
541
+ get plainObject() {
542
+ return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
543
+ }
544
+ clone() {
545
+ return new FilterMock(this.filterType);
546
+ }
547
+ }
548
+
549
+ class SingleFilter extends BaseFilter {
550
+ constructor(filterType, comparisonType, leftExpression) {
551
+ super(filterType);
552
+ this.comparisonType = comparisonType;
553
+ this.leftExpression = leftExpression.clone();
554
+ }
555
+ }
556
+
557
+ class CompareFilter extends SingleFilter {
558
+ constructor(comparisonType, leftExpression, rightExpression) {
559
+ super(FilterType.Compare, comparisonType, leftExpression);
560
+ this.rightExpression = rightExpression.clone();
561
+ }
562
+ clone() {
563
+ return new CompareFilter(this.comparisonType, this.leftExpression, this.rightExpression);
564
+ }
565
+ }
566
+
567
+ class BetweenFilter extends SingleFilter {
568
+ constructor(leftExpression, rightLessExpression, rightGreaterExpression) {
569
+ super(FilterType.Between, ComparisonType.Between, leftExpression);
570
+ this.rightLessExpression = rightLessExpression.clone();
571
+ this.rightGreaterExpression = rightGreaterExpression.clone();
572
+ }
573
+ clone() {
574
+ return new BetweenFilter(this.leftExpression, this.rightLessExpression, this.rightGreaterExpression);
575
+ }
576
+ }
577
+
578
+ class ExistsFilter extends SingleFilter {
579
+ constructor(leftExpression, subFilters, comparisonType = ComparisonType.Exists, isAggregative = true) {
580
+ super(FilterType.Exists, comparisonType, leftExpression);
581
+ this.subFilters = subFilters === null || subFilters === void 0 ? void 0 : subFilters.clone();
582
+ this.isAggregative = isAggregative;
583
+ }
584
+ clone() {
585
+ return new ExistsFilter(this.leftExpression, this.subFilters, this.comparisonType, this.isAggregative);
586
+ }
587
+ }
588
+
589
+ class InFilter extends SingleFilter {
590
+ constructor(comparisonType, leftExpression, rightExpressions) {
591
+ super(FilterType.In, comparisonType, leftExpression);
592
+ this.rightExpressions = rightExpressions.map((expression) => expression.clone());
593
+ }
594
+ clone() {
595
+ return new InFilter(this.comparisonType, this.leftExpression, this.rightExpressions);
596
+ }
597
+ }
598
+
599
+ class IsNullFilter extends SingleFilter {
600
+ constructor(comparisonType, leftExpression) {
601
+ super(FilterType.IsNull, comparisonType, leftExpression);
602
+ }
603
+ get isNull() {
604
+ return this.comparisonType === ComparisonType.Is_null;
605
+ }
606
+ clone() {
607
+ return new IsNullFilter(this.comparisonType, this.leftExpression);
608
+ }
510
609
  }
610
+ __decorate([
611
+ Expose(),
612
+ __metadata("design:type", Boolean),
613
+ __metadata("design:paramtypes", [])
614
+ ], IsNullFilter.prototype, "isNull", null);
615
+
511
616
  /**
617
+ * Empty Guid constant.
512
618
  * @internal
513
619
  */
514
- function getModuleMetadata(type) {
515
- const metadata = Reflect.getMetadata(moduleMetadataKey, type);
516
- if (!metadata) {
517
- throw new Error(`Module metadata was not found on '${type.name}' class`);
518
- }
519
- return metadata;
520
- }
620
+ const EMPTY_GUID = '00000000-0000-0000-0000-000000000000';
521
621
  /**
622
+ * Regular expression for Guid validation.
522
623
  * @internal
523
624
  */
524
- function setViewElementMetadata(metadata, type) {
525
- Reflect.defineMetadata(viewElementMetadataKey, metadata, type);
526
- }
625
+ 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');
527
626
  /**
627
+ * Generates guid part.
628
+ * @param length Part length.
528
629
  * @internal
529
630
  */
530
- function getViewElementMetadata(type) {
531
- const metadata = Reflect.getMetadata(viewElementMetadataKey, type);
532
- if (!metadata) {
533
- throw new Error(`View element metadata was not found on '${type.name}' class`);
631
+ function generateGuidPart(length) {
632
+ let out = '';
633
+ for (let i = 0; i < length; i++) {
634
+ // eslint-disable-next-line no-bitwise
635
+ out += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
534
636
  }
535
- return metadata;
637
+ return out;
536
638
  }
537
639
  /**
640
+ * Generates new Guid.
538
641
  * @internal
539
642
  */
540
- function setValidatorMetadata(metadata, type) {
541
- Reflect.defineMetadata(validatorMetadataKey, metadata, type);
643
+ function generateGuid() {
644
+ return [
645
+ generateGuidPart(2),
646
+ generateGuidPart(1),
647
+ generateGuidPart(1),
648
+ generateGuidPart(1),
649
+ generateGuidPart(3),
650
+ ].join('-');
542
651
  }
543
652
  /**
653
+ * Checks if value is Guid.
654
+ * @param value Value for check.
544
655
  * @internal
545
656
  */
546
- function getValidatorMetadata(type) {
547
- const metadata = Reflect.getOwnMetadata(validatorMetadataKey, type);
548
- if (!metadata) {
549
- throw new Error(`Validator metadata was not found on '${type.name}' class`);
550
- }
551
- return metadata;
657
+ function isGuid(value) {
658
+ return Boolean(value) && validator.test(value);
552
659
  }
553
660
  /**
661
+ * Checks if Guid is empty value or equal to EMPTY_GUID.
662
+ * @param guid Guid for check.
554
663
  * @internal
555
664
  */
556
- function setInterfaceDesignerItemMetadata(metadata, type) {
557
- Reflect.defineMetadata(interfaceDesignerItemMetadataKey, metadata, type);
665
+ function isEmptyGuid(guid) {
666
+ return !guid || guid === EMPTY_GUID;
558
667
  }
668
+
559
669
  /**
560
670
  * @internal
561
671
  */
562
- function getInterfaceDesignerItemMetadata(type) {
563
- const metadata = Reflect.getOwnMetadata(interfaceDesignerItemMetadataKey, type);
564
- if (!metadata) {
565
- throw new Error(`Interface designer item metadata was not found on '${type.name}' class`);
672
+ class NextHandlerAlreadySpecifiedException extends Error {
673
+ constructor() {
674
+ super('Next handler already specified');
566
675
  }
567
- return metadata;
568
- }
569
- /**
570
- * @internal
571
- */
572
- function setDesignTimeViewElementMetadata(metadata, type) {
573
- Reflect.defineMetadata(designTimeViewElementMetadataKey, metadata, type);
574
676
  }
575
- /**
576
- * @internal
577
- */
578
- function getDesignTimeViewElementMetadata(type) {
579
- const metadata = Reflect.getOwnMetadata(designTimeViewElementMetadataKey, type);
580
- if (!metadata) {
581
- throw new Error(`Design time view element metadata was not found on '${type.name}' class`);
677
+
678
+ class ArgumentEmptyException extends Error {
679
+ // region Constructors: Public
680
+ constructor(argumentName) {
681
+ super(`Argument with name '${argumentName}' is empty.`);
582
682
  }
583
- return metadata;
584
- }
585
- /**
586
- * @internal
587
- */
588
- function hasInterfaceDesignerItemMetadata(type) {
589
- return Reflect.hasOwnMetadata(interfaceDesignerItemMetadataKey, type);
590
- }
591
- /**
592
- * @internal
593
- */
594
- function setRequestHandlerMetadata(metadata, type) {
595
- Reflect.defineMetadata(requestHandlerMetadataKey, metadata, type);
596
683
  }
597
- /**
598
- * @internal
599
- */
600
- function getRequestHandlerMetadata(type) {
601
- const metadata = Reflect.getMetadata(requestHandlerMetadataKey, type);
602
- if (!metadata) {
603
- throw new Error(`Request handler metadata was not found on '${type.name}' class`);
684
+
685
+ class ArgumentOutOfRangeException extends Error {
686
+ // region Constructors: Public
687
+ constructor(argumentName) {
688
+ super(`Argument with name '${argumentName}' is out of range.`);
604
689
  }
605
- return metadata;
606
690
  }
607
- /**
608
- * @internal
609
- */
610
- function getHandlerChainServiceMetadata(typeRef) {
611
- const requestType = Reflect.getMetadata('requestType', typeRef);
612
- if (!requestType) {
613
- throw new Error(`requestType was not found on '${typeRef.name}' class`);
691
+
692
+ class ItemNotFoundException extends Error {
693
+ // region Constructors: Public
694
+ constructor(key) {
695
+ super(`Item with key '${key}' does not exist.`);
614
696
  }
615
- return { requestType, typeRef };
616
- }
617
- /**
618
- * @internal
619
- */
620
- function getCrtInputsMetadata(type) {
621
- const keys = Reflect.getMetadataKeys(type);
622
- const crtInputKeys = keys.filter((x) => x.startsWith(crtInputPrefix));
623
- return Object.fromEntries(crtInputKeys.map((key) => {
624
- const data = Reflect.getMetadata(key, type);
625
- return [key.replace(crtInputPrefix, ''), data];
626
- }));
627
- }
628
- /**
629
- * @internal
630
- */
631
- function getCrtOutputsMetadata(type) {
632
- const keys = Reflect.getMetadataKeys(type);
633
- const crtOutputKeys = keys.filter((x) => x.startsWith(crtOutputPrefix));
634
- return Object.fromEntries(crtOutputKeys.map((key) => {
635
- const data = Reflect.getMetadata(key, type);
636
- return [key.replace(crtOutputPrefix, ''), data];
637
- }));
638
- }
639
- /**
640
- * @internal
641
- */
642
- function getCrtValidationInputsMetadata(type) {
643
- const keys = Reflect.getMetadataKeys(type);
644
- const crtValidationInputKeys = keys.filter((x) => x.startsWith(crtValidationInputPrefix));
645
- return Object.fromEntries(crtValidationInputKeys.map((key) => {
646
- const data = Reflect.getMetadata(key, type);
647
- return [key.replace(crtValidationInputPrefix, ''), data];
648
- }));
649
- }
650
- /**
651
- * @internal
652
- */
653
- function getCrtInjectMetadata(type) {
654
- const keys = Reflect.getOwnMetadataKeys(type);
655
- const crtInjectKeys = keys.filter((x) => x.startsWith(crtInjectPrefix));
656
- return Object.fromEntries(crtInjectKeys.map((key) => {
657
- const index = Number(key.replace(crtInjectPrefix, ''));
658
- const data = Reflect.getMetadata(key, type);
659
- return [index, data];
660
- }));
661
- }
662
- /**
663
- * @internal
664
- */
665
- function getParentType(type) {
666
- const parentProto = type.prototype ? Object.getPrototypeOf(type.prototype) : null;
667
- return parentProto ? parentProto.constructor : null;
668
697
  }
669
- /**
670
- * @internal
671
- */
672
- function getTypeDependencies(type) {
673
- const paramTypes = Reflect.getOwnMetadata('design:paramtypes', type);
674
- if (!paramTypes) {
675
- if (type.length > 0) {
676
- throw new Error(`Dependency Injection error. Cannot read dependencies of class '${type.name}'. ` +
677
- `Please make sure class '${type.name}' has decorator and ` +
678
- "'emitDecoratorMetadata' option is enabled in your 'tsconfig.json' file.");
698
+
699
+ class ValidationUtilities {
700
+ // region Methods: Public
701
+ static checkArgumentEmpty(argumentName, argumentValue) {
702
+ if (argumentValue === undefined || argumentValue === null) {
703
+ throw new ArgumentEmptyException(argumentName);
679
704
  }
680
- const parentType = getParentType(type);
681
- return parentType && parentType !== Object ? getTypeDependencies(parentType) : [];
682
705
  }
683
- const crtInjectMetadata = getCrtInjectMetadata(type);
684
- Object.entries(crtInjectMetadata).forEach(([index, token]) => (paramTypes[index] = token));
685
- return paramTypes;
686
- }
687
-
688
- /**
689
- * @public
690
- */
691
- class CrtInputRegistrationConfig {
692
- }
693
-
694
- /**
695
- * @public
696
- * @class BaseRequest
697
- * @describe Base definition of request.
698
- * @template TEvent
699
- */
700
- class BaseRequest {
701
- }
702
-
703
- /**
704
- * @public
705
- * @class DataRequest
706
- * @description Definition of data source request.
707
- * @extends {BaseRequest} {@link BaseRequest}
708
- * @property {string} dataSourceName - name of assigned data source.
709
- */
710
- class DataRequest extends BaseRequest {
711
- }
712
-
713
- /**
714
- * @public
715
- * @description Abstract Base Validator class for designing custom validators.
716
- * @example
717
- * @CrtValidator({
718
- * type: 'crt.Required',
719
- * })
720
- * export class RequiredValidator extends BaseValidator {
721
- * protected override async = false;
722
- * public validate(controlState: CrtControlState, params?: ValidatorParametersValues): CrtValidationErrors | null {
723
- * Implementation here...
724
- * }
725
- * }
726
- */
727
- class BaseValidator {
728
- /**
729
- * @description getter for async/sync indicator
730
- */
731
- get isAsync() {
732
- return this.async;
706
+ static checkArrayEmpty(argumentName, argumentValue) {
707
+ ValidationUtilities.checkArgumentEmpty(argumentName, argumentValue);
708
+ if (argumentValue.length === 0) {
709
+ throw new ArgumentEmptyException(argumentName);
710
+ }
733
711
  }
734
- /**
735
- * @description Function used for validation
736
- */
737
- get validateFn() {
738
- return this.validate.bind(this);
712
+ static checkStringIsNotEmpty(argumentName, argumentValue) {
713
+ this.checkArgumentEmpty(argumentName, argumentValue);
714
+ if (argumentValue === '') {
715
+ throw new ArgumentEmptyException(argumentName);
716
+ }
717
+ return argumentValue;
739
718
  }
740
- /**
741
- * @internal
742
- */
743
- static [Symbol.hasInstance](instance) {
744
- var _a;
745
- return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === BaseValidator._instanceOfKey;
719
+ static checkArgumentOutOfRange(argumentName, argumentValue, range) {
720
+ if (range.begin && argumentValue < range.begin) {
721
+ throw new ArgumentOutOfRangeException(argumentName);
722
+ }
723
+ if (range.end && argumentValue > range.end) {
724
+ throw new ArgumentOutOfRangeException(argumentName);
725
+ }
746
726
  }
747
727
  }
748
- /**
749
- * @internal
750
- * @dontChange
751
- */
752
- BaseValidator._instanceOfKey = 'devkit_BaseValidator';
753
728
 
754
- /**
755
- * @public
756
- */
757
- class LocalizableValue {
758
- constructor(key) {
759
- this.key = key;
729
+ class FilterGroup extends BaseFilter {
730
+ constructor(logicalOperation = LogicalOperatorType.And) {
731
+ super(FilterType.FilterGroup);
732
+ this.filters = new Map();
733
+ this.logicalOperation = logicalOperation;
734
+ }
735
+ get items() {
736
+ return classToPlain(this.filters, {
737
+ exposeUnsetFields: false,
738
+ excludePrefixes: ['_'],
739
+ });
760
740
  }
761
741
  /**
762
- * @internal
742
+ * Returns filter item by index.
743
+ * @param index Item index.
744
+ * @returns Filter.
763
745
  */
764
- static [Symbol.hasInstance](instance) {
765
- var _a;
766
- return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === LocalizableValue._instanceOfKey;
746
+ getItemByIndex(index) {
747
+ return this.items[Object.keys(this.items)[index]];
767
748
  }
768
- }
769
- /**
770
- * @internal
771
- * @dontChange
772
- */
773
- LocalizableValue._instanceOfKey = 'devkit_LocalizableValue';
774
-
775
- /**
776
- * @internal
777
- */
778
- function applyLocalizeMetadataFn(obj, localizeMetadata) {
779
- const localizableEntries = objectDeepKeys(obj)
780
- .map((path) => ({ path, value: get(obj, path) }))
781
- .filter(({ value }) => value instanceof LocalizableValue);
782
- if (localizableEntries.length === 0) {
783
- return obj;
749
+ addSchemaColumnFilterWithParameter(comparisonType, columnPath, parameterValue) {
750
+ const leftExpression = new ColumnExpression({ columnPath });
751
+ const rightExpression = new ParameterExpression({ value: parameterValue });
752
+ const filter = new CompareFilter(comparisonType, leftExpression, rightExpression);
753
+ this.add(filter);
784
754
  }
785
- const localized = cloneDeep(obj);
786
- if (!localizeMetadata) {
787
- console.error("Unable to localize metadata. 'localizeMetadata' bootstrap option was not provided.");
755
+ addSchemaColumnInFilterWithParameters(comparisonType, columnPath, parameterValues) {
756
+ const leftExpression = new ColumnExpression({ columnPath });
757
+ const expressions = parameterValues.map((singleParameterValue) => new ParameterExpression({
758
+ value: singleParameterValue,
759
+ }));
760
+ const filter = new InFilter(comparisonType, leftExpression, expressions);
761
+ this.add(filter);
788
762
  }
789
- localizableEntries.forEach(({ path, value }) => {
763
+ addSchemaColumnIsNullFilter(columnPath) {
764
+ const leftExpression = new ColumnExpression({ columnPath });
765
+ const filter = new IsNullFilter(ComparisonType.Is_null, leftExpression);
766
+ this.add(filter);
767
+ }
768
+ addSchemaColumnIsNotNullFilter(columnPath) {
769
+ const leftExpression = new ColumnExpression({ columnPath });
770
+ const filter = new IsNullFilter(ComparisonType.Is_not_null, leftExpression);
771
+ this.add(filter);
772
+ }
773
+ /**
774
+ * Creates and adds filter between less value and greater value.
775
+ * @param columnPath Column path.
776
+ * @param lessParamValue Less parameter value.
777
+ * @param greaterParamValue Greater parameter value.
778
+ */
779
+ addSchemaColumnBetweenFilterWithParameters(columnPath, lessParamValue, greaterParamValue) {
780
+ const leftExpression = new ColumnExpression({ columnPath });
781
+ const rightLessExpression = new ParameterExpression({ value: lessParamValue });
782
+ const rightGreaterExpression = new ParameterExpression({ value: greaterParamValue });
783
+ const filter = new BetweenFilter(leftExpression, rightLessExpression, rightGreaterExpression);
784
+ this.add(filter);
785
+ }
786
+ addExistsFilter(columnPath, subFilters) {
787
+ const leftExpression = new ColumnExpression({ columnPath });
788
+ const filter = new ExistsFilter(leftExpression, subFilters);
789
+ this.add(filter);
790
+ }
791
+ addNotExistsFilter(columnPath, subFilters) {
792
+ const leftExpression = new ColumnExpression({ columnPath });
793
+ const filter = new ExistsFilter(leftExpression, subFilters, ComparisonType.Not_exists);
794
+ this.add(filter);
795
+ }
796
+ add(filter, filterKey) {
797
+ ValidationUtilities.checkArgumentEmpty('filter', filter);
798
+ const key = filterKey || generateGuid();
799
+ this.filters.set(key, filter);
800
+ }
801
+ clone() {
802
+ const filterGroup = new FilterGroup(this.logicalOperation);
803
+ this.filters.forEach((filter, filterKey) => {
804
+ filterGroup.filters.set(filterKey, filter.clone());
805
+ });
806
+ return filterGroup;
807
+ }
808
+ }
809
+ __decorate([
810
+ Exclude(),
811
+ __metadata("design:type", Object)
812
+ ], FilterGroup.prototype, "filters", void 0);
813
+ __decorate([
814
+ Expose(),
815
+ __metadata("design:type", Object),
816
+ __metadata("design:paramtypes", [])
817
+ ], FilterGroup.prototype, "items", null);
818
+
819
+ class BaseQueryColumn {
820
+ constructor(expression) {
821
+ this.orderDirection = OrderDirection.None;
822
+ this.orderPosition = -1;
823
+ this.isVisible = true;
824
+ this.expression = expression;
825
+ }
826
+ /**
827
+ * Adds ordering options.
828
+ * @param orderDirection Direction.
829
+ * @param orderPosition Position.
830
+ * @returns Self.
831
+ */
832
+ withOrdering(orderDirection, orderPosition) {
833
+ ValidationUtilities.checkArgumentEmpty('orderDirection', orderDirection);
834
+ ValidationUtilities.checkArgumentEmpty('orderPosition', orderPosition);
835
+ ValidationUtilities.checkArgumentOutOfRange('orderPosition', orderPosition, { begin: -1 });
836
+ this.orderDirection = orderDirection;
837
+ this.orderPosition = orderPosition;
838
+ return this;
839
+ }
840
+ /**
841
+ * Adds options.
842
+ * @param options Options.
843
+ * @returns Self.
844
+ */
845
+ withOptions(options) {
790
846
  var _a;
791
- const localizedValue = (_a = localizeMetadata === null || localizeMetadata === void 0 ? void 0 : localizeMetadata(value.key)) !== null && _a !== void 0 ? _a : value.key;
792
- set(localized, path, localizedValue);
793
- });
794
- return localized;
847
+ ValidationUtilities.checkArgumentEmpty('options', options);
848
+ this.isVisible = (_a = options.isVisible) !== null && _a !== void 0 ? _a : true;
849
+ return this;
850
+ }
851
+ /**
852
+ * Adds caption.
853
+ * @param caption Caption.
854
+ * @returns Self.
855
+ */
856
+ withCaption(caption) {
857
+ ValidationUtilities.checkArgumentEmpty('caption', caption);
858
+ this.caption = caption;
859
+ return this;
860
+ }
795
861
  }
796
862
 
797
- /**
798
- * @internal
799
- */
800
- function instantiate(type, resolveDependency) {
801
- const deps = getTypeDependencies(type);
802
- if (deps.length > 0) {
803
- if (!resolveDependency) {
804
- throw new Error(`Cannot resolve dependencies for ${type.name}. ` +
805
- "Please provide 'resolveDependency' bootstrap option");
806
- }
807
- const depInstances = deps.map(resolveDependency);
808
- return new type(...depInstances);
863
+ class ArithmeticQueryColumn extends BaseQueryColumn {
864
+ // region Constructors: Public
865
+ constructor(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand) {
866
+ super(new ArithmeticExpression({ arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand }));
809
867
  }
810
- return new type();
811
868
  }
812
869
 
813
- /**
814
- * @internal
815
- */
816
- var ViewElementGroupType;
817
- (function (ViewElementGroupType) {
818
- ViewElementGroupType["Charts"] = "Charts";
819
- ViewElementGroupType["Components"] = "Components";
820
- ViewElementGroupType["LayoutElements"] = "LayoutElements";
821
- ViewElementGroupType["Inputs"] = "Inputs";
822
- ViewElementGroupType["CustomElements"] = "CustomElements";
823
- })(ViewElementGroupType || (ViewElementGroupType = {}));
870
+ class EntityQueryColumn extends BaseQueryColumn {
871
+ // region Constructors: Public
872
+ constructor(columnPath) {
873
+ super(new ColumnExpression({ columnPath }));
874
+ }
875
+ }
824
876
 
825
- /**
826
- * @internal
827
- */
828
- var ViewElementDataGroupType;
829
- (function (ViewElementDataGroupType) {
830
- ViewElementDataGroupType["Data"] = "Data";
831
- })(ViewElementDataGroupType || (ViewElementDataGroupType = {}));
832
- /**
833
- * @internal
834
- */
835
- // eslint-disable-next-line @typescript-eslint/naming-convention
836
- const DesignerToolGroupType = Object.assign(Object.assign({}, ViewElementDataGroupType), ViewElementGroupType);
877
+ class ParameterQueryColumn extends BaseQueryColumn {
878
+ // region Constructors: Public
879
+ constructor(value, dataValueType) {
880
+ super(new ParameterExpression({ value, dataValueType }));
881
+ }
882
+ }
837
883
 
838
- /**
839
- * @internal
840
- */
841
- var DataSourceScope;
842
- (function (DataSourceScope) {
843
- DataSourceScope["ViewElement"] = "viewElement";
844
- DataSourceScope["Page"] = "page";
845
- })(DataSourceScope || (DataSourceScope = {}));
884
+ class AggregationSubQueryColumn extends BaseQueryColumn {
885
+ // region Constructors: Public
886
+ constructor(columnPath, aggregationType, subFilters, subOrderDirection, subOrderColumn) {
887
+ super(new AggregationSubQueryExpression({
888
+ aggregationType,
889
+ columnPath,
890
+ subFilters,
891
+ subOrderDirection,
892
+ subOrderColumn,
893
+ }));
894
+ }
895
+ }
846
896
 
847
- /**
848
- * @internal
849
- */
850
- var ModelInPageAction;
851
- (function (ModelInPageAction) {
852
- ModelInPageAction["Edit"] = "edit";
853
- ModelInPageAction["Add"] = "add";
854
- ModelInPageAction["Copy"] = "copy";
855
- })(ModelInPageAction || (ModelInPageAction = {}));
897
+ class SubQueryColumn extends BaseQueryColumn {
898
+ // region Constructors: Public
899
+ constructor(columnPath, subFilters) {
900
+ super(new SubQueryExpression({ columnPath, subFilters }));
901
+ }
902
+ }
856
903
 
857
- /**
858
- * Handler source types in order of call priority.
859
- * @internal
860
- */
861
- var HandlerSourceType;
862
- (function (HandlerSourceType) {
863
- HandlerSourceType[HandlerSourceType["Schema"] = 0] = "Schema";
864
- HandlerSourceType[HandlerSourceType["Remote"] = 1] = "Remote";
865
- HandlerSourceType[HandlerSourceType["Host"] = 2] = "Host";
866
- })(HandlerSourceType || (HandlerSourceType = {}));
904
+ class AggregationFunctionColumn extends BaseQueryColumn {
905
+ // region Constructors: Public
906
+ constructor(aggregationType, aggregationEvalType, functionArgument) {
907
+ super(new AggregationFunctionExpression({
908
+ aggregationType,
909
+ aggregationEvalType,
910
+ functionArgument,
911
+ }));
912
+ }
913
+ }
914
+
915
+ class DatePartFunctionColumn extends BaseQueryColumn {
916
+ // region Constructors: Public
917
+ constructor(datePartType, functionArgument) {
918
+ super(new DatePartFunctionExpression({
919
+ datePartType,
920
+ functionArgument,
921
+ }));
922
+ }
923
+ // endregion
924
+ // region Properties: Public
925
+ get datePartType() {
926
+ var _a;
927
+ return (_a = this.expression) === null || _a === void 0 ? void 0 : _a.datePartType;
928
+ }
929
+ }
930
+
931
+ class LengthFunctionColumn extends BaseQueryColumn {
932
+ // region Constructors: Public
933
+ constructor(functionArgument) {
934
+ super(new LengthFunctionExpression({ functionArgument }));
935
+ }
936
+ }
937
+
938
+ class MacrosFunctionColumn extends BaseQueryColumn {
939
+ // region Constructors: Public
940
+ constructor(macrosType) {
941
+ super(new MacrosFunctionExpression({ macrosType }));
942
+ }
943
+ }
944
+
945
+ class WindowFunctionColumn extends BaseQueryColumn {
946
+ // region Constructors: Public
947
+ constructor(functionArgument) {
948
+ super(new WindowFunctionExpression({ functionArgument }));
949
+ }
950
+ }
867
951
 
868
952
  /**
869
953
  * @internal
870
954
  */
871
- var DataSchemaAttributeType;
872
- (function (DataSchemaAttributeType) {
873
- DataSchemaAttributeType["OwnAttribute"] = "Own";
874
- DataSchemaAttributeType["ForwardReferenceAttribute"] = "ForwardReference";
875
- DataSchemaAttributeType["BackReferenceAttribute"] = "BackReference";
876
- DataSchemaAttributeType["AggregationAttribute"] = "Aggregation";
877
- DataSchemaAttributeType["FunctionAttribute"] = "Function";
878
- })(DataSchemaAttributeType || (DataSchemaAttributeType = {}));
955
+ function toAggregationType(aggregationFunction) {
956
+ switch (aggregationFunction) {
957
+ case AggregationFunction.Count:
958
+ return AggregationType.Count;
959
+ case AggregationFunction.Sum:
960
+ return AggregationType.Sum;
961
+ case AggregationFunction.Avg:
962
+ return AggregationType.Avg;
963
+ case AggregationFunction.Min:
964
+ return AggregationType.Min;
965
+ case AggregationFunction.Max:
966
+ return AggregationType.Max;
967
+ case AggregationFunction.TopOne:
968
+ return AggregationType.TopOne;
969
+ default:
970
+ return AggregationType.None;
971
+ }
972
+ }
879
973
  /**
880
974
  * @internal
881
975
  */
882
- var DataSchemaAttributeUsageType;
883
- (function (DataSchemaAttributeUsageType) {
884
- DataSchemaAttributeUsageType[DataSchemaAttributeUsageType["General"] = 0] = "General";
885
- DataSchemaAttributeUsageType[DataSchemaAttributeUsageType["Advanced"] = 1] = "Advanced";
886
- DataSchemaAttributeUsageType[DataSchemaAttributeUsageType["None"] = 2] = "None";
887
- })(DataSchemaAttributeUsageType || (DataSchemaAttributeUsageType = {}));
888
-
976
+ function toAggregationFunction(aggregationType) {
977
+ switch (aggregationType) {
978
+ case AggregationType.Count:
979
+ return AggregationFunction.Count;
980
+ case AggregationType.Sum:
981
+ return AggregationFunction.Sum;
982
+ case AggregationType.Avg:
983
+ return AggregationFunction.Avg;
984
+ case AggregationType.Min:
985
+ return AggregationFunction.Min;
986
+ case AggregationType.Max:
987
+ return AggregationFunction.Max;
988
+ case AggregationType.TopOne:
989
+ return AggregationFunction.TopOne;
990
+ default:
991
+ return AggregationFunction.None;
992
+ }
993
+ }
889
994
  /**
890
995
  * @internal
891
996
  */
892
- var DefaultValueSource;
893
- (function (DefaultValueSource) {
894
- DefaultValueSource[DefaultValueSource["None"] = 0] = "None";
895
- DefaultValueSource[DefaultValueSource["Const"] = 1] = "Const";
896
- DefaultValueSource[DefaultValueSource["Settings"] = 2] = "Settings";
897
- DefaultValueSource[DefaultValueSource["SystemValue"] = 3] = "SystemValue";
898
- DefaultValueSource[DefaultValueSource["Sequence"] = 4] = "Sequence";
899
- })(DefaultValueSource || (DefaultValueSource = {}));
900
-
997
+ function toAggregationEvalType(aggregationEval) {
998
+ switch (aggregationEval) {
999
+ case 'all':
1000
+ return AggregationEvalType.All;
1001
+ case 'distinct':
1002
+ return AggregationEvalType.Distinct;
1003
+ default:
1004
+ return AggregationEvalType.None;
1005
+ }
1006
+ }
901
1007
  /**
902
1008
  * @internal
903
1009
  */
904
- class HandlersOrderComparer {
905
- constructor(_request) {
906
- var _a;
907
- this._request = _request;
908
- const scopesOrderEntries = [...((_a = this._request.scopes) !== null && _a !== void 0 ? _a : [])].reverse().map((scope, index) => [scope, index]);
909
- this._scopesOrder = Object.fromEntries(scopesOrderEntries);
910
- }
911
- _getOrderByScopes(handler) {
912
- if (!handler.scopes) {
913
- return Number.MAX_VALUE;
914
- }
915
- const scopesOrder = handler.scopes.filter((s) => s in this._scopesOrder).map((s) => this._scopesOrder[s]);
916
- return Math.min(...scopesOrder);
917
- }
918
- _getOrderByPkgTopology(handler) {
919
- if (handler.source.type === HandlerSourceType.Host) {
920
- return Number.MAX_VALUE;
921
- }
922
- return PkgTopology.get(handler.source.packageName);
923
- }
924
- compare(a, b) {
925
- const aScopeOrder = this._getOrderByScopes(a);
926
- const bScopeOrder = this._getOrderByScopes(b);
927
- let diff = aScopeOrder - bScopeOrder;
928
- if (diff) {
929
- return diff;
930
- }
931
- const aPkgTopologyOrder = this._getOrderByPkgTopology(a);
932
- const bPkgTopologyOrder = this._getOrderByPkgTopology(b);
933
- diff = aPkgTopologyOrder - bPkgTopologyOrder;
934
- if (diff) {
935
- return diff;
936
- }
937
- diff = a.source.type - b.source.type;
938
- return diff;
1010
+ function toAggregationEval(aggregationEvalType) {
1011
+ switch (aggregationEvalType) {
1012
+ case AggregationEvalType.All:
1013
+ return 'all';
1014
+ case AggregationEvalType.Distinct:
1015
+ return 'distinct';
1016
+ default:
1017
+ return 'none';
939
1018
  }
940
1019
  }
941
1020
 
942
1021
  /**
943
1022
  * @internal
944
1023
  */
945
- function isComponentPropertyBindable(viewConfigType, componentProperty) {
946
- var _a;
947
- const componentConfig = ViewElementRegistry.viewElements.get(viewConfigType);
948
- if (!(componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.inputs)) {
949
- return false;
1024
+ function toDatePartType(aggregationFunction) {
1025
+ switch (aggregationFunction) {
1026
+ case 'minute':
1027
+ return DatePartType.HourMinute;
1028
+ case 'hour':
1029
+ return DatePartType.Hour;
1030
+ case 'day':
1031
+ return DatePartType.Day;
1032
+ case 'weekday':
1033
+ return DatePartType.WeekDay;
1034
+ case 'week':
1035
+ return DatePartType.Week;
1036
+ case 'month':
1037
+ return DatePartType.Month;
1038
+ case 'year':
1039
+ return DatePartType.Year;
1040
+ default:
1041
+ return DatePartType.None;
950
1042
  }
951
- return !!((_a = componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.inputs[componentProperty]) === null || _a === void 0 ? void 0 : _a.propertyBindable);
952
1043
  }
953
-
954
1044
  /**
955
1045
  * @internal
956
1046
  */
957
- // eslint-disable-next-line @typescript-eslint/naming-convention
958
- function CrtViewElement(config) {
959
- return function (type) {
960
- checkTypeNamePascalCase(config.type);
961
- const inputs = getCrtInputsMetadata(type);
962
- const outputs = getCrtOutputsMetadata(type);
963
- const validationInputs = getCrtValidationInputsMetadata(type);
964
- const baseRegistrationConfig = Object.assign(Object.assign({}, config), { inputs,
965
- outputs,
966
- validationInputs });
967
- const registrationConfig = 'selector' in config
968
- ? Object.assign(Object.assign({}, baseRegistrationConfig), { selector: config.selector }) : Object.assign(Object.assign({}, baseRegistrationConfig), { typeRef: type });
969
- setViewElementMetadata(registrationConfig, type);
970
- };
1047
+ function toDatePart(aggregationType) {
1048
+ switch (aggregationType) {
1049
+ case DatePartType.HourMinute:
1050
+ return 'minute';
1051
+ case DatePartType.Hour:
1052
+ return 'hour';
1053
+ case DatePartType.Day:
1054
+ return 'day';
1055
+ case DatePartType.WeekDay:
1056
+ return 'weekday';
1057
+ case DatePartType.Week:
1058
+ return 'week';
1059
+ case DatePartType.Month:
1060
+ return 'month';
1061
+ case DatePartType.Year:
1062
+ return 'year';
1063
+ default:
1064
+ return 'none';
1065
+ }
971
1066
  }
972
1067
 
973
1068
  /**
974
- * @public
975
- * @description CrtModule decorator is a 'container' where user actually setup elements.
976
- * In could contain viewElements, definitions of other CrtModules.
977
- * @param moduleDefinition - {@link ModuleDefinition}
978
- *
979
- * @example
980
- * @CrtModule({
981
- * viewElements: [AppComponent],
982
- * requestHandlers: [SomeRequestHandler],
983
- * validators: [SomeValidator],
984
- * })
985
- * @NgModule({
986
- * declarations: [AppComponent],
987
- * imports: [BrowserModule],
988
- * providers: [],
989
- * })
990
- * export class AppModule {}
1069
+ * @internal
991
1070
  */
992
- function CrtModule(moduleDefinition) {
993
- return (type) => setModuleMetadata(moduleDefinition, type);
1071
+ function toStringFunctionType(functionType) {
1072
+ switch (functionType) {
1073
+ case FunctionType.Aggregation:
1074
+ return 'aggregation';
1075
+ case FunctionType.DatePart:
1076
+ return 'datePart';
1077
+ default:
1078
+ return 'none';
1079
+ }
994
1080
  }
995
-
996
- // noinspection ES6PreferShortImport
997
1081
  /**
998
1082
  * @internal
999
1083
  */
1000
- // eslint-disable-next-line @typescript-eslint/naming-convention
1001
- function CrtInterfaceDesignerItem(config) {
1002
- function _applyTypeCaption() {
1003
- if (!config.typeCaption && config.toolbarConfig) {
1004
- const toolbarConfig = Array.isArray(config.toolbarConfig)
1005
- ? config.toolbarConfig[0]
1006
- : config.toolbarConfig;
1007
- config.typeCaption = toolbarConfig.caption;
1008
- }
1084
+ function toNumericFunctionType(functionType) {
1085
+ switch (functionType) {
1086
+ case 'aggregation':
1087
+ return FunctionType.Aggregation;
1088
+ case 'datePart':
1089
+ return FunctionType.DatePart;
1090
+ default:
1091
+ return FunctionType.None;
1009
1092
  }
1010
- return function (type) {
1011
- var _a;
1012
- config.typeRef = type;
1013
- (_a = config.viewElementGroupType) !== null && _a !== void 0 ? _a : (config.viewElementGroupType = ViewElementGroupType.CustomElements);
1014
- _applyTypeCaption();
1015
- setInterfaceDesignerItemMetadata(config, type);
1016
- };
1017
1093
  }
1018
1094
 
1019
1095
  /**
1020
- * @public
1021
- * @description
1022
- * Constructor parameter decorator.
1023
- * Mark parameter as dependency that should be obtained by token.
1024
- * @param token - token by which the dependency instance will be obtained
1025
- * @example
1026
- * class MyHandler {
1027
- * constructor(@CrtInject(USER_NAME_TOKEN) userName: string) {}
1028
- * }
1096
+ * @internal
1029
1097
  */
1030
- function CrtInject(token) {
1031
- return function (target, paramKey, paramIndex) {
1032
- Reflect.defineMetadata(crtInjectPrefix + paramIndex, token, target);
1033
- };
1098
+ function toOrderDirection(sortDirection) {
1099
+ switch (sortDirection) {
1100
+ case 'asc':
1101
+ return OrderDirection.Asc;
1102
+ case 'desc':
1103
+ return OrderDirection.Desc;
1104
+ default:
1105
+ return OrderDirection.None;
1106
+ }
1034
1107
  }
1035
-
1036
1108
  /**
1037
1109
  * @internal
1038
1110
  */
1039
- // eslint-disable-next-line @typescript-eslint/naming-convention
1040
- function CrtValidator(config) {
1041
- if (!config) {
1042
- return (type) => { };
1043
- }
1044
- return function (type) {
1045
- checkTypeNameFormat(config.type, 'ValidatorTypeName');
1046
- const registrationConfig = Object.assign(Object.assign({}, config), { typeRef: type });
1047
- setValidatorMetadata(registrationConfig, type);
1048
- };
1111
+ function toSortDirection(orderDirection) {
1112
+ switch (orderDirection) {
1113
+ case OrderDirection.Asc:
1114
+ return 'asc';
1115
+ case OrderDirection.Desc:
1116
+ return 'desc';
1117
+ default:
1118
+ return 'none';
1119
+ }
1049
1120
  }
1050
1121
 
1122
+ /**
1123
+ * @internal
1124
+ */
1125
+ const crtInputPrefix = 'crtInput:';
1126
+ /**
1127
+ * @internal
1128
+ */
1129
+ const crtOutputPrefix = 'crtOutput:';
1130
+ /**
1131
+ * @internal
1132
+ */
1133
+ const crtValidationInputPrefix = 'crtValidationInput:';
1134
+ /**
1135
+ * @internal
1136
+ */
1137
+ const crtInjectPrefix = 'crtInject:';
1138
+
1139
+ /**
1140
+ * @internal
1141
+ */
1142
+ var ViewElementGroupType;
1143
+ (function (ViewElementGroupType) {
1144
+ ViewElementGroupType["Charts"] = "Charts";
1145
+ ViewElementGroupType["Components"] = "Components";
1146
+ ViewElementGroupType["LayoutElements"] = "LayoutElements";
1147
+ ViewElementGroupType["Inputs"] = "Inputs";
1148
+ ViewElementGroupType["CustomElements"] = "CustomElements";
1149
+ })(ViewElementGroupType || (ViewElementGroupType = {}));
1150
+
1151
+ /**
1152
+ * @internal
1153
+ */
1154
+ var ViewElementDataGroupType;
1155
+ (function (ViewElementDataGroupType) {
1156
+ ViewElementDataGroupType["Data"] = "Data";
1157
+ })(ViewElementDataGroupType || (ViewElementDataGroupType = {}));
1051
1158
  /**
1052
1159
  * @internal
1053
1160
  */
1054
1161
  // eslint-disable-next-line @typescript-eslint/naming-convention
1055
- function CrtRequestHandler(config) {
1056
- if (!config) {
1057
- return (type) => { };
1058
- }
1059
- return function (type) {
1060
- checkTypeNameFormat(config.type, 'RequestHandlerTypeName');
1061
- checkCrtTypeNamePascalCase(config.type);
1062
- setRequestHandlerMetadata(config, type);
1063
- };
1064
- }
1162
+ const DesignerToolGroupType = Object.assign(Object.assign({}, ViewElementDataGroupType), ViewElementGroupType);
1065
1163
 
1066
1164
  /**
1067
1165
  * @internal
1068
1166
  */
1069
- class NextHandlerAlreadySpecifiedException extends Error {
1167
+ var DataSourceScope;
1168
+ (function (DataSourceScope) {
1169
+ DataSourceScope["ViewElement"] = "viewElement";
1170
+ DataSourceScope["Page"] = "page";
1171
+ })(DataSourceScope || (DataSourceScope = {}));
1172
+
1173
+ /**
1174
+ * @internal
1175
+ */
1176
+ var ModelInPageAction;
1177
+ (function (ModelInPageAction) {
1178
+ ModelInPageAction["Edit"] = "edit";
1179
+ ModelInPageAction["Add"] = "add";
1180
+ ModelInPageAction["Copy"] = "copy";
1181
+ })(ModelInPageAction || (ModelInPageAction = {}));
1182
+
1183
+ /**
1184
+ * Handler source types in order of call priority.
1185
+ * @internal
1186
+ */
1187
+ var HandlerSourceType;
1188
+ (function (HandlerSourceType) {
1189
+ HandlerSourceType[HandlerSourceType["Schema"] = 0] = "Schema";
1190
+ HandlerSourceType[HandlerSourceType["Remote"] = 1] = "Remote";
1191
+ HandlerSourceType[HandlerSourceType["Host"] = 2] = "Host";
1192
+ })(HandlerSourceType || (HandlerSourceType = {}));
1193
+
1194
+ /**
1195
+ * @internal
1196
+ */
1197
+ var DataSchemaAttributeType;
1198
+ (function (DataSchemaAttributeType) {
1199
+ DataSchemaAttributeType["OwnAttribute"] = "Own";
1200
+ DataSchemaAttributeType["ForwardReferenceAttribute"] = "ForwardReference";
1201
+ DataSchemaAttributeType["BackReferenceAttribute"] = "BackReference";
1202
+ DataSchemaAttributeType["AggregationAttribute"] = "Aggregation";
1203
+ DataSchemaAttributeType["FunctionAttribute"] = "Function";
1204
+ })(DataSchemaAttributeType || (DataSchemaAttributeType = {}));
1205
+ /**
1206
+ * @internal
1207
+ */
1208
+ var DataSchemaAttributeUsageType;
1209
+ (function (DataSchemaAttributeUsageType) {
1210
+ DataSchemaAttributeUsageType[DataSchemaAttributeUsageType["General"] = 0] = "General";
1211
+ DataSchemaAttributeUsageType[DataSchemaAttributeUsageType["Advanced"] = 1] = "Advanced";
1212
+ DataSchemaAttributeUsageType[DataSchemaAttributeUsageType["None"] = 2] = "None";
1213
+ })(DataSchemaAttributeUsageType || (DataSchemaAttributeUsageType = {}));
1214
+
1215
+ /**
1216
+ * Type of DataSchema. In combination with the name is used for unique identification of {@link DataSchema}.
1217
+ * @internal
1218
+ */
1219
+ var DataSchemaType;
1220
+ (function (DataSchemaType) {
1221
+ DataSchemaType["Entity"] = "Entity";
1222
+ DataSchemaType["ClientUnit"] = "ClientUnit";
1223
+ })(DataSchemaType || (DataSchemaType = {}));
1224
+
1225
+ /**
1226
+ * @internal
1227
+ */
1228
+ var DefaultValueSource;
1229
+ (function (DefaultValueSource) {
1230
+ DefaultValueSource[DefaultValueSource["None"] = 0] = "None";
1231
+ DefaultValueSource[DefaultValueSource["Const"] = 1] = "Const";
1232
+ DefaultValueSource[DefaultValueSource["Settings"] = 2] = "Settings";
1233
+ DefaultValueSource[DefaultValueSource["SystemValue"] = 3] = "SystemValue";
1234
+ DefaultValueSource[DefaultValueSource["Sequence"] = 4] = "Sequence";
1235
+ })(DefaultValueSource || (DefaultValueSource = {}));
1236
+
1237
+ const global$3 = window;
1238
+ /**
1239
+ * @internal
1240
+ */
1241
+ class BaseRegistry {
1070
1242
  constructor() {
1071
- super('Next handler already specified');
1243
+ this.store = {
1244
+ typeInfos: new Map(),
1245
+ };
1072
1246
  }
1073
- }
1074
-
1075
- class ArgumentEmptyException extends Error {
1076
- // region Constructors: Public
1077
- constructor(argumentName) {
1078
- super(`Argument with name '${argumentName}' is empty.`);
1247
+ static get store() {
1248
+ if (!this._instance) {
1249
+ let globalInstance = get(global$3, this._prefix + this.registryKey);
1250
+ if (!globalInstance) {
1251
+ globalInstance = new this();
1252
+ set(global$3, this._prefix + this.registryKey, globalInstance);
1253
+ }
1254
+ this._instance = globalInstance;
1255
+ }
1256
+ return this._instance.store;
1079
1257
  }
1080
1258
  }
1259
+ BaseRegistry._prefix = 'creatio.registry.';
1081
1260
 
1082
- class ArgumentOutOfRangeException extends Error {
1083
- // region Constructors: Public
1084
- constructor(argumentName) {
1085
- super(`Argument with name '${argumentName}' is out of range.`);
1261
+ /**
1262
+ * @internal
1263
+ */
1264
+ class PkgTopology extends BaseRegistry {
1265
+ static get items() {
1266
+ return this.store.typeInfos;
1086
1267
  }
1087
- }
1088
-
1089
- class ItemNotFoundException extends Error {
1090
- // region Constructors: Public
1091
- constructor(key) {
1092
- super(`Item with key '${key}' does not exist.`);
1268
+ static get(pkgName) {
1269
+ const order = this.items.get(pkgName);
1270
+ if (order === undefined) {
1271
+ throw new Error(`Package with name ${pkgName} not found in topology`);
1272
+ }
1273
+ return order;
1093
1274
  }
1094
1275
  }
1276
+ PkgTopology.registryKey = 'pkgTopology';
1095
1277
 
1096
- class ValidationUtilities {
1097
- // region Methods: Public
1098
- static checkArgumentEmpty(argumentName, argumentValue) {
1099
- if (argumentValue === undefined || argumentValue === null) {
1100
- throw new ArgumentEmptyException(argumentName);
1101
- }
1278
+ /**
1279
+ * @internal
1280
+ */
1281
+ class HandlersOrderComparer {
1282
+ constructor(_request) {
1283
+ var _a;
1284
+ this._request = _request;
1285
+ const scopesOrderEntries = [...((_a = this._request.scopes) !== null && _a !== void 0 ? _a : [])].reverse().map((scope, index) => [scope, index]);
1286
+ this._scopesOrder = Object.fromEntries(scopesOrderEntries);
1102
1287
  }
1103
- static checkArrayEmpty(argumentName, argumentValue) {
1104
- ValidationUtilities.checkArgumentEmpty(argumentName, argumentValue);
1105
- if (argumentValue.length === 0) {
1106
- throw new ArgumentEmptyException(argumentName);
1288
+ _getOrderByScopes(handler) {
1289
+ if (!handler.scopes) {
1290
+ return Number.MAX_VALUE;
1107
1291
  }
1292
+ const scopesOrder = handler.scopes.filter((s) => s in this._scopesOrder).map((s) => this._scopesOrder[s]);
1293
+ return Math.min(...scopesOrder);
1108
1294
  }
1109
- static checkStringIsNotEmpty(argumentName, argumentValue) {
1110
- this.checkArgumentEmpty(argumentName, argumentValue);
1111
- if (argumentValue === '') {
1112
- throw new ArgumentEmptyException(argumentName);
1295
+ _getOrderByPkgTopology(handler) {
1296
+ if (handler.source.type === HandlerSourceType.Host) {
1297
+ return Number.MAX_VALUE;
1113
1298
  }
1114
- return argumentValue;
1299
+ return PkgTopology.get(handler.source.packageName);
1115
1300
  }
1116
- static checkArgumentOutOfRange(argumentName, argumentValue, range) {
1117
- if (range.begin && argumentValue < range.begin) {
1118
- throw new ArgumentOutOfRangeException(argumentName);
1301
+ compare(a, b) {
1302
+ const aScopeOrder = this._getOrderByScopes(a);
1303
+ const bScopeOrder = this._getOrderByScopes(b);
1304
+ let diff = aScopeOrder - bScopeOrder;
1305
+ if (diff) {
1306
+ return diff;
1119
1307
  }
1120
- if (range.end && argumentValue > range.end) {
1121
- throw new ArgumentOutOfRangeException(argumentName);
1308
+ const aPkgTopologyOrder = this._getOrderByPkgTopology(a);
1309
+ const bPkgTopologyOrder = this._getOrderByPkgTopology(b);
1310
+ diff = aPkgTopologyOrder - bPkgTopologyOrder;
1311
+ if (diff) {
1312
+ return diff;
1122
1313
  }
1314
+ diff = a.source.type - b.source.type;
1315
+ return diff;
1123
1316
  }
1124
1317
  }
1125
1318
 
@@ -1130,6 +1323,7 @@ class InternalHandlerChain {
1130
1323
  constructor() {
1131
1324
  this._handlers = [];
1132
1325
  this._handlersCache = new Map();
1326
+ this._handlersScopesByContextId = new Map();
1133
1327
  this.handlerChain$ = {
1134
1328
  process: (request) => __awaiter(this, void 0, void 0, function* () {
1135
1329
  const handler = this._getHandler(request);
@@ -1151,28 +1345,52 @@ class InternalHandlerChain {
1151
1345
  },
1152
1346
  };
1153
1347
  }
1348
+ clearContextedHandlersCache(contextId) {
1349
+ var _a;
1350
+ const configs = (_a = this._handlersScopesByContextId.get(contextId)) !== null && _a !== void 0 ? _a : [];
1351
+ return configs.every(({ requestType, scope }) => { var _a; return (_a = this._handlersCache.get(requestType)) === null || _a === void 0 ? void 0 : _a.delete(scope); });
1352
+ }
1154
1353
  _getHandler(request) {
1155
1354
  return this._hasCacheHandler(request) ? this._getCacheHandler(request) : this._buildHandlersChain(request);
1156
1355
  }
1157
1356
  _getCacheHandler(request) {
1158
1357
  const map = this._handlersCache.get(request.type);
1159
- const key = this._getCacheScopesKey(request.scopes);
1358
+ const key = this._getCacheScopesKey(request);
1160
1359
  return map.get(key);
1161
1360
  }
1162
1361
  _hasCacheHandler(request) {
1163
1362
  const map = this._handlersCache.get(request.type);
1164
- const key = this._getCacheScopesKey(request.scopes);
1363
+ const key = this._getCacheScopesKey(request);
1165
1364
  return map && map.has(key);
1166
1365
  }
1167
- _getCacheScopesKey(scopes) {
1168
- return (scopes || ['']).join('_');
1366
+ _getCacheScopesKey(request) {
1367
+ var _a, _b;
1368
+ 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 : '';
1369
+ return (request.scopes || ['']).join('_').concat(injectionContextKey);
1370
+ }
1371
+ _getInjectionContext(viewModel) {
1372
+ return ((viewModel === null || viewModel === void 0 ? void 0 : viewModel['_injectionContext']) ||
1373
+ ((viewModel === null || viewModel === void 0 ? void 0 : viewModel['parent']) && this._getInjectionContext(viewModel['parent'])));
1374
+ }
1375
+ _setContextedScopes(request, scope) {
1376
+ var _a;
1377
+ const injectionContext = (_a = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context)) === null || _a === void 0 ? void 0 : _a.id;
1378
+ const configs = this._handlersScopesByContextId.has(injectionContext)
1379
+ ? this._handlersScopesByContextId.get(injectionContext)
1380
+ : [];
1381
+ configs.push({ requestType: request.type, scope });
1382
+ this._handlersScopesByContextId.set(injectionContext, configs);
1169
1383
  }
1170
1384
  _setCacheHandler(request, handler) {
1385
+ var _a;
1171
1386
  const map = this._handlersCache.has(request.type)
1172
1387
  ? this._handlersCache.get(request.type)
1173
1388
  : new Map();
1174
- const key = this._getCacheScopesKey(request.scopes);
1389
+ const key = this._getCacheScopesKey(request);
1175
1390
  map.set(key, handler);
1391
+ if ((_a = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context)) === null || _a === void 0 ? void 0 : _a.id) {
1392
+ this._setContextedScopes(request, key);
1393
+ }
1176
1394
  this._handlersCache.set(request.type, map);
1177
1395
  }
1178
1396
  _isRequestHandler(handler) {
@@ -1197,7 +1415,10 @@ class InternalHandlerChain {
1197
1415
  });
1198
1416
  const comparer = new HandlersOrderComparer(request);
1199
1417
  handlers.sort((a, b) => comparer.compare(a, b));
1200
- const handlerInstances = handlers.map((handlerConfig) => handlerConfig.createHandler());
1418
+ const handlerInstances = handlers.map((handlerConfig) => {
1419
+ const injectionContext = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context);
1420
+ return handlerConfig.createHandler(injectionContext);
1421
+ });
1201
1422
  handlerInstances.forEach((handler) => this._checkHandlerInstanceOf(handler));
1202
1423
  this._joinHandlersInChain(handlerInstances);
1203
1424
  const result = handlerInstances[0];
@@ -1221,7 +1442,7 @@ class InternalHandlerChain {
1221
1442
  }
1222
1443
  }
1223
1444
 
1224
- const global = window;
1445
+ const global$2 = window;
1225
1446
  /**
1226
1447
  * @public
1227
1448
  * @class HandlerChainService
@@ -1234,10 +1455,10 @@ class HandlerChainService {
1234
1455
  }
1235
1456
  }
1236
1457
  get _chain() {
1237
- return global.handlerChain;
1458
+ return global$2.handlerChain;
1238
1459
  }
1239
1460
  set _chain(value) {
1240
- global.handlerChain = value;
1461
+ global$2.handlerChain = value;
1241
1462
  }
1242
1463
  static get instance() {
1243
1464
  return HandlerChainService._instance || (HandlerChainService._instance = new HandlerChainService());
@@ -1245,6 +1466,12 @@ class HandlerChainService {
1245
1466
  _createGlobalHandlerChain() {
1246
1467
  this._chain = new InternalHandlerChain();
1247
1468
  }
1469
+ /**
1470
+ * @internal
1471
+ */
1472
+ clearContextedHandlersCache(contextId) {
1473
+ return this._chain.clearContextedHandlersCache(contextId);
1474
+ }
1248
1475
  /**
1249
1476
  * @internal
1250
1477
  */
@@ -1287,868 +1514,743 @@ function ImplementUsingHandlerChain(config) {
1287
1514
  /**
1288
1515
  * @internal
1289
1516
  */
1290
- // eslint-disable-next-line @typescript-eslint/naming-convention
1291
- function CrtConverter(name) {
1292
- return function (type) {
1293
- GlobalConvertersRegistryService.register(name, type);
1294
- };
1517
+ function objectDeepKeys(obj) {
1518
+ if (obj === null || typeof obj !== 'object') {
1519
+ return [];
1520
+ }
1521
+ return Object.keys(obj)
1522
+ .filter((key) => obj[key] instanceof Object)
1523
+ .map((key) => objectDeepKeys(obj[key]).map((k) => [key, ...k]))
1524
+ .reduce((x, y) => [...x, ...y], Object.keys(obj).map((x) => [x]));
1295
1525
  }
1296
1526
 
1297
1527
  /**
1298
1528
  * @internal
1299
1529
  */
1300
- function CrtDesignTimeViewElement(config) {
1301
- return function (type) {
1302
- const registrationConfig = Object.assign(Object.assign({}, config), { typeRef: type });
1303
- setDesignTimeViewElementMetadata(registrationConfig, type);
1304
- };
1305
- }
1306
-
1307
- /**
1308
- * @internal
1309
- */
1310
- // eslint-disable-next-line @typescript-eslint/naming-convention
1311
- function CrtRequest(config) {
1312
- return function (type) {
1313
- checkTypeNameFormat(config.type, 'RequestTypeName');
1314
- checkCrtTypeNamePascalCase(config.type);
1315
- RequestRegistryService.register(config, type);
1316
- };
1530
+ function checkTypeNameFormat(type, element) {
1531
+ const typeParts = type.split('.');
1532
+ if (typeParts.length < 2) {
1533
+ throw new Error(`Error when register ${type}. Type property should have format "VendorPrefix.${element}"`);
1534
+ }
1535
+ }
1536
+ /**
1537
+ * @internal
1538
+ */
1539
+ function checkTypeNamePascalCase(type) {
1540
+ const [vendor, typeName] = type.split('.');
1541
+ const pascalTypeName = toPascalCase(typeName);
1542
+ if (!vendor || pascalTypeName !== typeName) {
1543
+ 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');
1544
+ }
1545
+ }
1546
+ /**
1547
+ * @internal
1548
+ */
1549
+ function checkCrtTypeNamePascalCase(type) {
1550
+ const [vendor, typeName] = type.split('.');
1551
+ const pascalTypeName = toPascalCase(typeName);
1552
+ if (vendor.toLowerCase() === 'crt' && pascalTypeName !== typeName) {
1553
+ 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');
1554
+ }
1555
+ }
1556
+ /**
1557
+ * @internal
1558
+ */
1559
+ function toPascalCase(source) {
1560
+ return upperFirst(camelCase(source));
1561
+ }
1562
+ /**
1563
+ * @internal
1564
+ */
1565
+ function checkIfTypeRegistered(type, item) {
1566
+ if (!item) {
1567
+ throw new Error(`Error when resolve ${type}. Type was not registered.`);
1568
+ }
1569
+ }
1570
+ /**
1571
+ * @internal
1572
+ */
1573
+ function checkOnlyOneRegistration(type, item, map) {
1574
+ if (map.has(type) && !isEqual(map.get(type), item)) {
1575
+ throw new Error(`Error when register ${type}. Element with this type has already exist`);
1576
+ }
1317
1577
  }
1318
1578
 
1319
- var DataValueType;
1320
- (function (DataValueType) {
1321
- DataValueType[DataValueType["Guid"] = 0] = "Guid";
1322
- DataValueType[DataValueType["Text"] = 1] = "Text";
1323
- DataValueType[DataValueType["Integer"] = 4] = "Integer";
1324
- DataValueType[DataValueType["Float"] = 5] = "Float";
1325
- DataValueType[DataValueType["Money"] = 6] = "Money";
1326
- DataValueType[DataValueType["DateTime"] = 7] = "DateTime";
1327
- DataValueType[DataValueType["Date"] = 8] = "Date";
1328
- DataValueType[DataValueType["Time"] = 9] = "Time";
1329
- DataValueType[DataValueType["Lookup"] = 10] = "Lookup";
1330
- DataValueType[DataValueType["Enum"] = 11] = "Enum";
1331
- DataValueType[DataValueType["Boolean"] = 12] = "Boolean";
1332
- DataValueType[DataValueType["Blob"] = 13] = "Blob";
1333
- DataValueType[DataValueType["Image"] = 14] = "Image";
1334
- DataValueType[DataValueType["CUSTOM_OBJECT"] = 15] = "CUSTOM_OBJECT";
1335
- DataValueType[DataValueType["IMAGELOOKUP"] = 16] = "IMAGELOOKUP";
1336
- DataValueType[DataValueType["COLLECTION"] = 17] = "COLLECTION";
1337
- DataValueType[DataValueType["Color"] = 18] = "Color";
1338
- DataValueType[DataValueType["LOCALIZABLE_STRING"] = 19] = "LOCALIZABLE_STRING";
1339
- DataValueType[DataValueType["ENTITY"] = 20] = "ENTITY";
1340
- DataValueType[DataValueType["ENTITY_COLLECTION"] = 21] = "ENTITY_COLLECTION";
1341
- DataValueType[DataValueType["ENTITY_COLUMN_MAPPING_COLLECTION"] = 22] = "ENTITY_COLUMN_MAPPING_COLLECTION";
1342
- DataValueType[DataValueType["HASH_TEXT"] = 23] = "HASH_TEXT";
1343
- DataValueType[DataValueType["SECURE_TEXT"] = 24] = "SECURE_TEXT";
1344
- DataValueType[DataValueType["FILE"] = 25] = "FILE";
1345
- DataValueType[DataValueType["MAPPING"] = 26] = "MAPPING";
1346
- DataValueType[DataValueType["SHORT_TEXT"] = 27] = "SHORT_TEXT";
1347
- DataValueType[DataValueType["MEDIUM_TEXT"] = 28] = "MEDIUM_TEXT";
1348
- DataValueType[DataValueType["MAXSIZE_TEXT"] = 29] = "MAXSIZE_TEXT";
1349
- DataValueType[DataValueType["LONG_TEXT"] = 30] = "LONG_TEXT";
1350
- DataValueType[DataValueType["FLOAT1"] = 31] = "FLOAT1";
1351
- DataValueType[DataValueType["FLOAT2"] = 32] = "FLOAT2";
1352
- DataValueType[DataValueType["FLOAT3"] = 33] = "FLOAT3";
1353
- DataValueType[DataValueType["FLOAT4"] = 34] = "FLOAT4";
1354
- DataValueType[DataValueType["LOCALIZABLE_PARAMETER_VALUES_LIST"] = 35] = "LOCALIZABLE_PARAMETER_VALUES_LIST";
1355
- DataValueType[DataValueType["METADATA_TEXT"] = 36] = "METADATA_TEXT";
1356
- DataValueType[DataValueType["STAGE_INDICATOR"] = 37] = "STAGE_INDICATOR";
1357
- DataValueType[DataValueType["OBJECT_LIST"] = 38] = "OBJECT_LIST";
1358
- DataValueType[DataValueType["COMPOSITE_OBJECT_LIST"] = 39] = "COMPOSITE_OBJECT_LIST";
1359
- DataValueType[DataValueType["FLOAT8"] = 40] = "FLOAT8";
1360
- DataValueType[DataValueType["FILE_LOCATOR"] = 41] = "FILE_LOCATOR";
1361
- DataValueType[DataValueType["PHONE_TEXT"] = 42] = "PHONE_TEXT";
1362
- DataValueType[DataValueType["RICH_TEXT"] = 43] = "RICH_TEXT";
1363
- DataValueType[DataValueType["WEB_TEXT"] = 44] = "WEB_TEXT";
1364
- DataValueType[DataValueType["EMAIL_TEXT"] = 45] = "EMAIL_TEXT";
1365
- })(DataValueType || (DataValueType = {}));
1366
-
1367
- var AggregationType;
1368
- (function (AggregationType) {
1369
- /** Aggregation function type not defined. */
1370
- AggregationType[AggregationType["None"] = 0] = "None";
1371
- /** Aggregation function type not defined. */
1372
- AggregationType[AggregationType["Count"] = 1] = "Count";
1373
- /** Sum of values of all elements. */
1374
- AggregationType[AggregationType["Sum"] = 2] = "Sum";
1375
- /** Average value for all elements. */
1376
- AggregationType[AggregationType["Avg"] = 3] = "Avg";
1377
- /** The minimum value among all elements. */
1378
- AggregationType[AggregationType["Min"] = 4] = "Min";
1379
- /** The maximum value among all elements. */
1380
- AggregationType[AggregationType["Max"] = 5] = "Max";
1381
- /** Top one record from collection. */
1382
- AggregationType[AggregationType["TopOne"] = 6] = "TopOne";
1383
- })(AggregationType || (AggregationType = {}));
1384
-
1385
- var AggregationFunction;
1386
- (function (AggregationFunction) {
1387
- /** Aggregation function type not defined. */
1388
- AggregationFunction["None"] = "";
1389
- /** Aggregation function type not defined. */
1390
- AggregationFunction["Count"] = "Count";
1391
- /** Sum of values of all elements. */
1392
- AggregationFunction["Sum"] = "Sum";
1393
- /** Average value for all elements. */
1394
- AggregationFunction["Avg"] = "Avg";
1395
- /** The minimum value among all elements. */
1396
- AggregationFunction["Min"] = "Min";
1397
- /** The maximum value among all elements. */
1398
- AggregationFunction["Max"] = "Max";
1399
- /** Top one record from collection. */
1400
- AggregationFunction["TopOne"] = "TopOne";
1401
- })(AggregationFunction || (AggregationFunction = {}));
1402
-
1403
- var LogicalOperatorType;
1404
- (function (LogicalOperatorType) {
1405
- LogicalOperatorType[LogicalOperatorType["And"] = 0] = "And";
1406
- LogicalOperatorType[LogicalOperatorType["Or"] = 1] = "Or";
1407
- })(LogicalOperatorType || (LogicalOperatorType = {}));
1408
-
1409
- var AggregationEvalType;
1410
- (function (AggregationEvalType) {
1411
- /** The scope of the aggregating function is not defined. */
1412
- AggregationEvalType[AggregationEvalType["None"] = 0] = "None";
1413
- /** Applies to all elements. */
1414
- AggregationEvalType[AggregationEvalType["All"] = 1] = "All";
1415
- /** Applies to unique values. */
1416
- AggregationEvalType[AggregationEvalType["Distinct"] = 2] = "Distinct";
1417
- })(AggregationEvalType || (AggregationEvalType = {}));
1418
-
1419
- var ArithmeticOperation;
1420
- (function (ArithmeticOperation) {
1421
- /** Addition. */
1422
- ArithmeticOperation[ArithmeticOperation["Addition"] = 0] = "Addition";
1423
- /** Subtraction. */
1424
- ArithmeticOperation[ArithmeticOperation["Subtraction"] = 1] = "Subtraction";
1425
- /** Multiplication. */
1426
- ArithmeticOperation[ArithmeticOperation["Multiplication"] = 2] = "Multiplication";
1427
- /** Division. */
1428
- ArithmeticOperation[ArithmeticOperation["Division"] = 3] = "Division";
1429
- })(ArithmeticOperation || (ArithmeticOperation = {}));
1430
-
1431
- var ComparisonType;
1432
- (function (ComparisonType) {
1433
- ComparisonType[ComparisonType["Between"] = 0] = "Between";
1434
- ComparisonType[ComparisonType["Contain"] = 11] = "Contain";
1435
- ComparisonType[ComparisonType["End_with"] = 13] = "End_with";
1436
- ComparisonType[ComparisonType["Equal"] = 3] = "Equal";
1437
- ComparisonType[ComparisonType["Exists"] = 15] = "Exists";
1438
- ComparisonType[ComparisonType["Greater"] = 7] = "Greater";
1439
- ComparisonType[ComparisonType["Greater_or_equal"] = 8] = "Greater_or_equal";
1440
- ComparisonType[ComparisonType["Is_not_null"] = 2] = "Is_not_null";
1441
- ComparisonType[ComparisonType["Is_null"] = 1] = "Is_null";
1442
- ComparisonType[ComparisonType["Less"] = 5] = "Less";
1443
- ComparisonType[ComparisonType["Less_or_equal"] = 6] = "Less_or_equal";
1444
- ComparisonType[ComparisonType["Not_contain"] = 12] = "Not_contain";
1445
- ComparisonType[ComparisonType["Not_end_with"] = 14] = "Not_end_with";
1446
- ComparisonType[ComparisonType["Not_equal"] = 4] = "Not_equal";
1447
- ComparisonType[ComparisonType["Not_exists"] = 16] = "Not_exists";
1448
- ComparisonType[ComparisonType["Not_start_with"] = 10] = "Not_start_with";
1449
- ComparisonType[ComparisonType["Start_with"] = 9] = "Start_with";
1450
- })(ComparisonType || (ComparisonType = {}));
1451
-
1452
- var DatePartType;
1453
- (function (DatePartType) {
1454
- /** Empty value. */
1455
- DatePartType[DatePartType["None"] = 0] = "None";
1456
- /** Day. */
1457
- DatePartType[DatePartType["Day"] = 1] = "Day";
1458
- /** Week. */
1459
- DatePartType[DatePartType["Week"] = 2] = "Week";
1460
- /** Month. */
1461
- DatePartType[DatePartType["Month"] = 3] = "Month";
1462
- /** Year. */
1463
- DatePartType[DatePartType["Year"] = 4] = "Year";
1464
- /** Day of the week. */
1465
- DatePartType[DatePartType["WeekDay"] = 5] = "WeekDay";
1466
- /** Hour. */
1467
- DatePartType[DatePartType["Hour"] = 6] = "Hour";
1468
- /** Minute. */
1469
- DatePartType[DatePartType["HourMinute"] = 7] = "HourMinute";
1470
- })(DatePartType || (DatePartType = {}));
1471
-
1472
- var ExpressionType;
1473
- (function (ExpressionType) {
1474
- ExpressionType[ExpressionType["SchemaColumn"] = 0] = "SchemaColumn";
1475
- ExpressionType[ExpressionType["Function"] = 1] = "Function";
1476
- ExpressionType[ExpressionType["Parameter"] = 2] = "Parameter";
1477
- ExpressionType[ExpressionType["SubQuery"] = 3] = "SubQuery";
1478
- ExpressionType[ExpressionType["ArithmeticOperation"] = 4] = "ArithmeticOperation";
1479
- })(ExpressionType || (ExpressionType = {}));
1480
-
1481
- var FilterType;
1482
- (function (FilterType) {
1483
- FilterType[FilterType["None"] = 0] = "None";
1484
- FilterType[FilterType["Compare"] = 1] = "Compare";
1485
- FilterType[FilterType["IsNull"] = 2] = "IsNull";
1486
- FilterType[FilterType["Between"] = 3] = "Between";
1487
- FilterType[FilterType["In"] = 4] = "In";
1488
- FilterType[FilterType["Exists"] = 5] = "Exists";
1489
- FilterType[FilterType["FilterGroup"] = 6] = "FilterGroup";
1490
- })(FilterType || (FilterType = {}));
1491
-
1492
- var FunctionType;
1493
- (function (FunctionType) {
1494
- FunctionType[FunctionType["None"] = 0] = "None";
1495
- /** Substitution by macro. */
1496
- FunctionType[FunctionType["Macros"] = 1] = "Macros";
1497
- /** Aggregating function. */
1498
- FunctionType[FunctionType["Aggregation"] = 2] = "Aggregation";
1499
- /** Date fragment. */
1500
- FunctionType[FunctionType["DatePart"] = 3] = "DatePart";
1501
- /** The size of the value in bytes, used for binary data. */
1502
- FunctionType[FunctionType["Length"] = 4] = "Length";
1503
- /** Window query function */
1504
- FunctionType[FunctionType["Window"] = 5] = "Window";
1505
- })(FunctionType || (FunctionType = {}));
1506
-
1507
- var OrderDirection;
1508
- (function (OrderDirection) {
1509
- OrderDirection[OrderDirection["None"] = 0] = "None";
1510
- OrderDirection[OrderDirection["Asc"] = 1] = "Asc";
1511
- OrderDirection[OrderDirection["Desc"] = 2] = "Desc";
1512
- })(OrderDirection || (OrderDirection = {}));
1513
-
1514
- var QueryMacrosType;
1515
- (function (QueryMacrosType) {
1516
- /** Macro type not defined. */
1517
- QueryMacrosType[QueryMacrosType["None"] = 0] = "None";
1518
- /** Current user. */
1519
- QueryMacrosType[QueryMacrosType["CurrentUser"] = 1] = "CurrentUser";
1520
- /** Current user contact. */
1521
- QueryMacrosType[QueryMacrosType["CurrentUserContact"] = 2] = "CurrentUserContact";
1522
- /** Yesterday. */
1523
- QueryMacrosType[QueryMacrosType["Yesterday"] = 3] = "Yesterday";
1524
- /** Today. */
1525
- QueryMacrosType[QueryMacrosType["Today"] = 4] = "Today";
1526
- /** Tomorrow. */
1527
- QueryMacrosType[QueryMacrosType["Tomorrow"] = 5] = "Tomorrow";
1528
- /** Previous week. */
1529
- QueryMacrosType[QueryMacrosType["PreviousWeek"] = 6] = "PreviousWeek";
1530
- /** This week. */
1531
- QueryMacrosType[QueryMacrosType["CurrentWeek"] = 7] = "CurrentWeek";
1532
- /** Next week. */
1533
- QueryMacrosType[QueryMacrosType["NextWeek"] = 8] = "NextWeek";
1534
- /** Previous month. */
1535
- QueryMacrosType[QueryMacrosType["PreviousMonth"] = 9] = "PreviousMonth";
1536
- /** Current month. */
1537
- QueryMacrosType[QueryMacrosType["CurrentMonth"] = 10] = "CurrentMonth";
1538
- /** Next month. */
1539
- QueryMacrosType[QueryMacrosType["NextMonth"] = 11] = "NextMonth";
1540
- /** Previous quarter. */
1541
- QueryMacrosType[QueryMacrosType["PreviousQuarter"] = 12] = "PreviousQuarter";
1542
- /** Current quarter. */
1543
- QueryMacrosType[QueryMacrosType["CurrentQuarter"] = 13] = "CurrentQuarter";
1544
- /** Next quarter. */
1545
- QueryMacrosType[QueryMacrosType["NextQuarter"] = 14] = "NextQuarter";
1546
- /** Previous half of the year. */
1547
- QueryMacrosType[QueryMacrosType["PreviousHalfYear"] = 15] = "PreviousHalfYear";
1548
- /** Current half-year. */
1549
- QueryMacrosType[QueryMacrosType["CurrentHalfYear"] = 16] = "CurrentHalfYear";
1550
- /** Next half-year. */
1551
- QueryMacrosType[QueryMacrosType["NextHalfYear"] = 17] = "NextHalfYear";
1552
- /** Last year. */
1553
- QueryMacrosType[QueryMacrosType["PreviousYear"] = 18] = "PreviousYear";
1554
- /** This year. */
1555
- QueryMacrosType[QueryMacrosType["CurrentYear"] = 19] = "CurrentYear";
1556
- /** Previous hour. */
1557
- QueryMacrosType[QueryMacrosType["PreviousHour"] = 20] = "PreviousHour";
1558
- /** Current hour. */
1559
- QueryMacrosType[QueryMacrosType["CurrentHour"] = 21] = "CurrentHour";
1560
- /** Next hour. */
1561
- QueryMacrosType[QueryMacrosType["NextHour"] = 22] = "NextHour";
1562
- /** Next year. */
1563
- QueryMacrosType[QueryMacrosType["NextYear"] = 23] = "NextYear";
1564
- /** Next N Days. */
1565
- QueryMacrosType[QueryMacrosType["NextNDays"] = 24] = "NextNDays";
1566
- /** Previous N days. */
1567
- QueryMacrosType[QueryMacrosType["PreviousNDays"] = 25] = "PreviousNDays";
1568
- /** Next N hours. */
1569
- QueryMacrosType[QueryMacrosType["NextNHours"] = 26] = "NextNHours";
1570
- /** Previous N hours. */
1571
- QueryMacrosType[QueryMacrosType["PreviousNHours"] = 27] = "PreviousNHours";
1572
- /** Primary column. */
1573
- QueryMacrosType[QueryMacrosType["PrimaryColumn"] = 34] = "PrimaryColumn";
1574
- /** Primary displayed column. */
1575
- QueryMacrosType[QueryMacrosType["PrimaryDisplayColumn"] = 35] = "PrimaryDisplayColumn";
1576
- /** Primary image display column. */
1577
- QueryMacrosType[QueryMacrosType["PrimaryImageColumn"] = 36] = "PrimaryImageColumn";
1578
- /** Anniversary today. */
1579
- QueryMacrosType[QueryMacrosType["DayOfYearToday"] = 37] = "DayOfYearToday";
1580
- /** Anniversary on the date computed as today plus days offset. */
1581
- QueryMacrosType[QueryMacrosType["DayOfYearTodayPlusDaysOffset"] = 38] = "DayOfYearTodayPlusDaysOffset";
1582
- /** Anniversary on the next several days. */
1583
- QueryMacrosType[QueryMacrosType["NextNDaysOfYear"] = 39] = "NextNDaysOfYear";
1584
- /** Anniversary on the previous several days. */
1585
- QueryMacrosType[QueryMacrosType["PreviousNDaysOfYear"] = 40] = "PreviousNDaysOfYear";
1586
- /** Primary color display column. */
1587
- QueryMacrosType[QueryMacrosType["PrimaryColorColumn"] = 41] = "PrimaryColorColumn";
1588
- })(QueryMacrosType || (QueryMacrosType = {}));
1589
-
1590
- class BaseExpression {
1591
- constructor(config) {
1592
- this.isBlock = false;
1593
- this.isBlock = config === null || config === void 0 ? void 0 : config.isBlock;
1579
+ var _a;
1580
+ /**
1581
+ * @internal
1582
+ */
1583
+ class InternalRequestHandlerRegistryType {
1584
+ static get requestHandlersMap() {
1585
+ return this._requestHandlersMap;
1586
+ }
1587
+ static onAddRequestHandler(handler) {
1588
+ this._addItemListeners.push(handler);
1589
+ return () => {
1590
+ this._addItemListeners.splice(this._addItemListeners.indexOf(handler), 1);
1591
+ };
1592
+ }
1593
+ static onRemoveRequestHandler(handler) {
1594
+ this._removeItemListeners.push(handler);
1595
+ return () => {
1596
+ this._removeItemListeners.splice(this._removeItemListeners.indexOf(handler), 1);
1597
+ };
1598
+ }
1599
+ static addRequestHandler(handlerType, config) {
1600
+ if (!this._requestHandlersMap.has(handlerType)) {
1601
+ this._requestHandlersMap.set(handlerType, config);
1602
+ for (const listener of this._addItemListeners) {
1603
+ listener(handlerType, config);
1604
+ }
1605
+ }
1606
+ }
1607
+ static removeRequestHandler(handlerType) {
1608
+ const config = this._requestHandlersMap.get(handlerType);
1609
+ if (config) {
1610
+ this._requestHandlersMap.delete(handlerType);
1611
+ for (const listener of this._removeItemListeners) {
1612
+ listener(handlerType, config);
1613
+ }
1614
+ }
1615
+ }
1616
+ }
1617
+ InternalRequestHandlerRegistryType._addItemListeners = [];
1618
+ InternalRequestHandlerRegistryType._removeItemListeners = [];
1619
+ InternalRequestHandlerRegistryType._requestHandlersMap = new Map();
1620
+ const global$1 = window;
1621
+ (_a = global$1.creatio) !== null && _a !== void 0 ? _a : (global$1.creatio = {});
1622
+ if (!global$1.creatio.requestHandlerRegistry) {
1623
+ Object.defineProperty(global$1.creatio, 'requestHandlerRegistry', {
1624
+ get: () => InternalRequestHandlerRegistryType,
1625
+ configurable: false,
1626
+ });
1627
+ }
1628
+ /**
1629
+ * @internal
1630
+ */
1631
+ // eslint-disable-next-line @typescript-eslint/naming-convention
1632
+ const InternalRequestHandlerRegistry = InternalRequestHandlerRegistryType;
1633
+ /**
1634
+ * @internal
1635
+ */
1636
+ class RequestHandlerRegistryService {
1637
+ /**
1638
+ * Register request handler class.
1639
+ * @param config Request handler registration config.
1640
+ * @param type Request handler type.
1641
+ */
1642
+ static register(config, type) {
1643
+ const requestType = config.requestType;
1644
+ const requestHandlerType = config.type;
1645
+ if (!requestType) {
1646
+ throw new Error(`Error when register ${requestHandlerType}. Request type not specified.`);
1647
+ }
1648
+ const requestHandlerMapValue = {
1649
+ instanceType: type,
1650
+ instanceConfig: config,
1651
+ };
1652
+ RequestHandlerRegistryService._internalRegistry.addRequestHandler(requestHandlerType, requestHandlerMapValue);
1594
1653
  }
1595
1654
  }
1655
+ RequestHandlerRegistryService._internalRegistry = global$1.creatio.requestHandlerRegistry;
1596
1656
 
1597
- class ArithmeticExpression extends BaseExpression {
1598
- constructor(config) {
1599
- super(config);
1600
- this.expressionType = ExpressionType.ArithmeticOperation;
1601
- this.arithmeticOperation = config === null || config === void 0 ? void 0 : config.arithmeticOperation;
1602
- this.leftArithmeticOperand = config === null || config === void 0 ? void 0 : config.leftArithmeticOperand.clone();
1603
- this.rightArithmeticOperand = config === null || config === void 0 ? void 0 : config.rightArithmeticOperand.clone();
1657
+ /**
1658
+ * @internal
1659
+ */
1660
+ class RequestRegistryService {
1661
+ static get requestsRegistrationInfos() {
1662
+ return this._requestsRegistrationInfos;
1604
1663
  }
1605
- clone() {
1606
- return new ArithmeticExpression(this);
1664
+ /**
1665
+ * Registers a specified request class.
1666
+ * @param config Request registration config.
1667
+ * @param type Request type.
1668
+ */
1669
+ static register(config, type) {
1670
+ const requestType = config.type;
1671
+ // TODO RND-21723
1672
+ RequestRegistryService._requestsMap.set(requestType, type);
1673
+ RequestRegistryService._requestsRegistrationInfos.set(requestType, config);
1674
+ }
1675
+ /**
1676
+ * Creates request instance by specified registered request type.
1677
+ * @param type Request type.
1678
+ * @returns The instance of registered request.
1679
+ */
1680
+ static get(type) {
1681
+ const requestInstanceConstructor = RequestRegistryService._requestsMap.get(type);
1682
+ checkIfTypeRegistered(type, requestInstanceConstructor);
1683
+ return requestInstanceConstructor && new requestInstanceConstructor();
1607
1684
  }
1608
1685
  }
1686
+ RequestRegistryService._requestsMap = new Map();
1687
+ RequestRegistryService._requestsRegistrationInfos = new Map();
1609
1688
 
1610
- class ColumnExpression extends BaseExpression {
1611
- constructor(config) {
1612
- super(config);
1613
- this.expressionType = ExpressionType.SchemaColumn;
1614
- this.columnPath = config === null || config === void 0 ? void 0 : config.columnPath;
1689
+ /**
1690
+ * @internal
1691
+ */
1692
+ class ConverterRegistry extends BaseRegistry {
1693
+ static get(type) {
1694
+ if (!this.store.typeInfos.has(type)) {
1695
+ throw new Error(`'${type}' converter doesn't exist`);
1696
+ }
1697
+ return this.store.typeInfos.get(type);
1615
1698
  }
1616
- clone() {
1617
- return new ColumnExpression(this);
1699
+ static register(item) {
1700
+ checkTypeNameFormat(item.type, 'ConverterTypeName');
1701
+ checkCrtTypeNamePascalCase(item.type);
1702
+ // TODO RND-21723
1703
+ this.store.typeInfos.set(item.type, item);
1704
+ }
1705
+ static clear() {
1706
+ this.store.typeInfos.clear();
1618
1707
  }
1619
1708
  }
1709
+ ConverterRegistry.registryKey = 'ConverterRegistry';
1620
1710
 
1621
- class FunctionExpression extends BaseExpression {
1622
- constructor(config) {
1623
- super(config);
1624
- this.expressionType = ExpressionType.Function;
1711
+ /**
1712
+ * @internal
1713
+ */
1714
+ const viewElementRegistryKey = 'ViewElementRegistry';
1715
+ /**
1716
+ * @internal
1717
+ */
1718
+ class ViewElementRegistry extends BaseRegistry {
1719
+ static validate(config) {
1720
+ checkTypeNameFormat(config.type, 'ViewElementTypeName');
1721
+ checkOnlyOneRegistration(config.type, config, ViewElementRegistry.viewElements);
1722
+ }
1723
+ static get viewElements() {
1724
+ return this.store.typeInfos;
1725
+ }
1726
+ static register(config) {
1727
+ this.viewElements.set(config.type, config);
1728
+ }
1729
+ static getFormControlRelatesAttribute(type) {
1730
+ var _a;
1731
+ const config = this.store.typeInfos.get(type);
1732
+ return (config && 'formControlConfig' in config && ((_a = config.formControlConfig) === null || _a === void 0 ? void 0 : _a.relatesTo)) || null;
1625
1733
  }
1626
1734
  }
1735
+ ViewElementRegistry.registryKey = viewElementRegistryKey;
1627
1736
 
1628
- class ArgumentFunctionExpression extends FunctionExpression {
1629
- constructor(config) {
1630
- super(config);
1631
- this.functionArgument = config === null || config === void 0 ? void 0 : config.functionArgument.clone();
1737
+ /**
1738
+ * @internal
1739
+ */
1740
+ const interfaceDesignerItemRegistryKey = 'InterfaceDesignerItemRegistry';
1741
+ /**
1742
+ * @internal
1743
+ */
1744
+ class InterfaceDesignerItemRegistry extends BaseRegistry {
1745
+ static validate(config) {
1746
+ checkTypeNameFormat(config.type, 'InterfaceDesignerItemTypeName');
1747
+ checkCrtTypeNamePascalCase(config.type);
1748
+ checkOnlyOneRegistration(config.type, config, this.interfaceDesignerItemRegistrationInfos);
1749
+ }
1750
+ static register(config) {
1751
+ this.interfaceDesignerItemRegistrationInfos.set(config.type, config);
1752
+ }
1753
+ static get interfaceDesignerItemRegistrationInfos() {
1754
+ return this.store.typeInfos;
1755
+ }
1756
+ static get(type) {
1757
+ return this.interfaceDesignerItemRegistrationInfos.get(type);
1632
1758
  }
1633
1759
  }
1760
+ InterfaceDesignerItemRegistry.registryKey = interfaceDesignerItemRegistryKey;
1634
1761
 
1635
- class AggregationFunctionExpression extends ArgumentFunctionExpression {
1636
- constructor(config) {
1637
- super(config);
1638
- this.functionType = FunctionType.Aggregation;
1639
- this.aggregationType = config === null || config === void 0 ? void 0 : config.aggregationType;
1640
- this.aggregationEvalType = config === null || config === void 0 ? void 0 : config.aggregationEvalType;
1762
+ const global = window;
1763
+ /**
1764
+ * @internal
1765
+ */
1766
+ class BootstrapNotifier {
1767
+ constructor() {
1768
+ this._subscribers = new Set();
1641
1769
  }
1642
- clone() {
1643
- return new AggregationFunctionExpression(this);
1770
+ static get instance() {
1771
+ if (!global.__crtModuleBootstrapNotifier) {
1772
+ global.__crtModuleBootstrapNotifier = new BootstrapNotifier();
1773
+ }
1774
+ return global.__crtModuleBootstrapNotifier;
1775
+ }
1776
+ notify(moduleType) {
1777
+ for (const subscriber of this._subscribers.values()) {
1778
+ subscriber(moduleType);
1779
+ }
1780
+ }
1781
+ subscribe(subscriber) {
1782
+ this._subscribers.add(subscriber);
1783
+ return {
1784
+ unsubscribe: () => this._subscribers.delete(subscriber),
1785
+ };
1644
1786
  }
1645
1787
  }
1646
1788
 
1647
- class DatePartFunctionExpression extends ArgumentFunctionExpression {
1648
- constructor(config) {
1649
- super(config);
1650
- this.functionType = FunctionType.DatePart;
1651
- this.datePartType = config === null || config === void 0 ? void 0 : config.datePartType;
1789
+ /**
1790
+ * @internal
1791
+ */
1792
+ class HandlerChainServicesRegistry extends BaseRegistry {
1793
+ static validate({ requestType }) {
1794
+ checkTypeNameFormat(requestType, this.registryKey);
1795
+ checkCrtTypeNamePascalCase(requestType);
1796
+ this.checkUniqueRequestType(requestType);
1652
1797
  }
1653
- clone() {
1654
- return new DatePartFunctionExpression(this);
1798
+ static checkUniqueRequestType(requestType) {
1799
+ if (this.services.get(requestType)) {
1800
+ throw new Error(`${requestType} already registered`);
1801
+ }
1655
1802
  }
1656
- }
1657
-
1658
- class LengthFunctionExpression extends ArgumentFunctionExpression {
1659
- constructor(config) {
1660
- super(config);
1661
- this.functionType = FunctionType.Length;
1803
+ static register(config) {
1804
+ this.validate(config);
1805
+ this.services.set(config.requestType, config);
1662
1806
  }
1663
- clone() {
1664
- return new LengthFunctionExpression(this);
1807
+ static get services() {
1808
+ return this.store.typeInfos;
1665
1809
  }
1666
1810
  }
1811
+ HandlerChainServicesRegistry.registryKey = 'HandlerChainServicesRegistry';
1667
1812
 
1668
- class MacrosFunctionExpression extends FunctionExpression {
1669
- constructor(config) {
1670
- super(config);
1671
- this.functionType = FunctionType.Macros;
1672
- this.macrosType = config === null || config === void 0 ? void 0 : config.macrosType;
1813
+ /**
1814
+ * @internal
1815
+ */
1816
+ const designTimeViewElementRegistryKey = 'DesignTimeViewElementRegistry';
1817
+ /**
1818
+ * @internal
1819
+ */
1820
+ class DesignTimeViewElementRegistry extends BaseRegistry {
1821
+ static validate(config) {
1822
+ checkTypeNameFormat(config.type, 'DesignTimeViewElementRegistryItemTypeName');
1823
+ checkCrtTypeNamePascalCase(config.type);
1824
+ checkOnlyOneRegistration(config.type, config, this.infos);
1673
1825
  }
1674
- clone() {
1675
- return new MacrosFunctionExpression(this);
1826
+ static register(config) {
1827
+ this.infos.set(config.type, config);
1676
1828
  }
1677
- }
1678
-
1679
- class WindowFunctionExpression extends ArgumentFunctionExpression {
1680
- constructor(config) {
1681
- super(config);
1682
- this.functionType = FunctionType.Window;
1829
+ static getByOverriddenType(type) {
1830
+ const item = Array.from(this.infos).find(([_, info]) => info.overrideType === type);
1831
+ if (item) {
1832
+ return item[1];
1833
+ }
1834
+ return null;
1683
1835
  }
1684
- clone() {
1685
- return new WindowFunctionExpression(this);
1836
+ static get infos() {
1837
+ return this.store.typeInfos;
1686
1838
  }
1687
1839
  }
1840
+ DesignTimeViewElementRegistry.registryKey = designTimeViewElementRegistryKey;
1688
1841
 
1689
- class ParameterExpression extends BaseExpression {
1690
- constructor(config) {
1842
+ /**
1843
+ * @internal
1844
+ */
1845
+ class ValidatorMapValue {
1846
+ }
1847
+ /**
1848
+ * @internal
1849
+ */
1850
+ const validatorRegistryKey = 'ValidatorRegistry';
1851
+ /**
1852
+ * @internal
1853
+ */
1854
+ class ValidatorRegistry extends BaseRegistry {
1855
+ static _has(configType, type) {
1691
1856
  var _a;
1692
- super(config);
1693
- this.expressionType = ExpressionType.Parameter;
1694
- const value = config === null || config === void 0 ? void 0 : config.value;
1695
- if (value instanceof Date) {
1696
- const cloneDate = new Date();
1697
- cloneDate.setTime(value.getTime());
1698
- this.value = cloneDate;
1699
- }
1700
- else if (!value) {
1701
- this.value = value;
1702
- }
1703
- else {
1704
- this.value = typeof value === 'object' ? Object.assign({}, value) : value;
1705
- }
1706
- this.dataValueType = (_a = config === null || config === void 0 ? void 0 : config.dataValueType) !== null && _a !== void 0 ? _a : DataValueType.Text;
1707
- }
1708
- get parameter() {
1709
- return Object.assign({ dataValueType: this.dataValueType }, this._getParameterValueMetadata());
1857
+ return ValidatorRegistry.items.has(configType) && ((_a = ValidatorRegistry.items.get(configType)) === null || _a === void 0 ? void 0 : _a.typeRef) !== type;
1710
1858
  }
1711
- _convertStringToBlobArray(str) {
1712
- const out = [];
1713
- let position = 0;
1714
- for (let i = 0; i < str.length; i++) {
1715
- const code = str.charCodeAt(i);
1716
- if (code < 128) {
1717
- out[position++] = String.fromCharCode(code);
1718
- }
1719
- else if (code < 2048) {
1720
- /* eslint-disable no-bitwise */
1721
- out[position++] = String.fromCharCode((code >> 6) | 192);
1722
- out[position++] = String.fromCharCode((code & 63) | 128);
1723
- }
1724
- else {
1725
- out[position++] = String.fromCharCode((code >> 12) | 224);
1726
- out[position++] = String.fromCharCode(((code >> 6) & 63) | 128);
1727
- out[position++] = String.fromCharCode((code & 63) | 128);
1728
- /* eslint-enable no-bitwise */
1729
- }
1859
+ static validate(config) {
1860
+ checkTypeNameFormat(config.type, 'ValidatorTypeName');
1861
+ if (ValidatorRegistry._has(config.type, config.typeRef)) {
1862
+ throw new Error(`Error when register ${config.type}. Element with this type has already exist`);
1730
1863
  }
1731
- return out;
1732
1864
  }
1733
- _getParameterValueMetadata() {
1734
- if (this.dataValueType === DataValueType.Blob) {
1735
- return {
1736
- arrayValue: !this.value ? [] : this._convertStringToBlobArray(this.value),
1737
- };
1738
- }
1739
- else {
1740
- return {
1741
- value: this.value,
1742
- };
1743
- }
1865
+ static get items() {
1866
+ return this.store.typeInfos;
1744
1867
  }
1745
- clone() {
1746
- return new ParameterExpression(this);
1868
+ static register(config) {
1869
+ this.items.set(config.type, config);
1747
1870
  }
1748
1871
  }
1749
- __decorate([
1750
- Exclude(),
1751
- __metadata("design:type", Object)
1752
- ], ParameterExpression.prototype, "value", void 0);
1753
- __decorate([
1754
- Exclude(),
1755
- __metadata("design:type", Number)
1756
- ], ParameterExpression.prototype, "dataValueType", void 0);
1757
- __decorate([
1758
- Expose(),
1759
- __metadata("design:type", Object),
1760
- __metadata("design:paramtypes", [])
1761
- ], ParameterExpression.prototype, "parameter", null);
1872
+ ValidatorRegistry.registryKey = validatorRegistryKey;
1762
1873
 
1763
- class SubQueryExpression extends BaseExpression {
1764
- constructor(config) {
1765
- super(config);
1766
- this.expressionType = ExpressionType.SubQuery;
1767
- this.columnPath = config === null || config === void 0 ? void 0 : config.columnPath;
1768
- const subFilter = config === null || config === void 0 ? void 0 : config.subFilters;
1769
- this.subFilters = typeof (subFilter === null || subFilter === void 0 ? void 0 : subFilter.clone) === 'function' ? subFilter.clone() : subFilter;
1770
- this.subOrderDirection = config.subOrderDirection;
1771
- this.subOrderColumn = config.subOrderColumn;
1772
- }
1773
- clone() {
1774
- return new SubQueryExpression(this);
1874
+ /**
1875
+ * @internal
1876
+ * @dontChange
1877
+ */
1878
+ class RemoteEntriesRegistry extends BaseRegistry {
1879
+ /**
1880
+ * @dontChange
1881
+ */
1882
+ static get items() {
1883
+ return this.store.typeInfos;
1775
1884
  }
1776
1885
  }
1886
+ /**
1887
+ * @dontChange
1888
+ */
1889
+ RemoteEntriesRegistry.registryKey = 'remotes';
1777
1890
 
1778
- class AggregationSubQueryExpression extends SubQueryExpression {
1779
- constructor(config) {
1780
- super(config);
1781
- this.aggregationType = config === null || config === void 0 ? void 0 : config.aggregationType;
1782
- }
1783
- clone() {
1784
- return new AggregationSubQueryExpression(this);
1891
+ /**
1892
+ * @internal
1893
+ */
1894
+ function isComponentPropertyBindable(viewConfigType, componentProperty) {
1895
+ var _a;
1896
+ const componentConfig = ViewElementRegistry.viewElements.get(viewConfigType);
1897
+ if (!(componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.inputs)) {
1898
+ return false;
1785
1899
  }
1900
+ return !!((_a = componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.inputs[componentProperty]) === null || _a === void 0 ? void 0 : _a.propertyBindable);
1786
1901
  }
1787
1902
 
1788
- const EXPRESSION_TYPE_MOCK = -1;
1789
- class ExpressionMock extends BaseExpression {
1790
- constructor(config) {
1791
- super(config || {});
1792
- this.expressionType = EXPRESSION_TYPE_MOCK;
1793
- }
1794
- // eslint-disable-next-line @typescript-eslint/ban-types
1795
- get plainObject() {
1796
- return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
1903
+ const moduleMetadataKey = 'module';
1904
+ const viewElementMetadataKey = 'viewElement';
1905
+ const interfaceDesignerItemMetadataKey = 'interfaceDesignerItem';
1906
+ const requestHandlerMetadataKey = 'requestHandler';
1907
+ const designTimeViewElementMetadataKey = 'designTimeViewElement';
1908
+ const validatorMetadataKey = 'validator';
1909
+ const converterMetadataKey = 'converter';
1910
+ /**
1911
+ * @internal
1912
+ */
1913
+ function setModuleMetadata(metadata, type) {
1914
+ Reflect.defineMetadata(moduleMetadataKey, metadata, type);
1915
+ }
1916
+ /**
1917
+ * @internal
1918
+ */
1919
+ function getModuleMetadata(type) {
1920
+ const metadata = Reflect.getMetadata(moduleMetadataKey, type);
1921
+ if (!metadata) {
1922
+ throw new Error(`Module metadata was not found on '${type.name}' class`);
1797
1923
  }
1798
- clone() {
1799
- return new ExpressionMock(this);
1924
+ return metadata;
1925
+ }
1926
+ /**
1927
+ * @internal
1928
+ */
1929
+ function setViewElementMetadata(metadata, type) {
1930
+ Reflect.defineMetadata(viewElementMetadataKey, metadata, type);
1931
+ }
1932
+ /**
1933
+ * @internal
1934
+ */
1935
+ function getViewElementMetadata(type) {
1936
+ const metadata = Reflect.getMetadata(viewElementMetadataKey, type);
1937
+ if (!metadata) {
1938
+ throw new Error(`View element metadata was not found on '${type.name}' class`);
1800
1939
  }
1940
+ return metadata;
1801
1941
  }
1802
-
1803
- class BaseFilter {
1804
- constructor(filterType) {
1805
- this.isEnabled = true;
1806
- this.trimDateTimeParameterToDate = false;
1807
- this.filterType = filterType;
1942
+ /**
1943
+ * @internal
1944
+ */
1945
+ function setValidatorMetadata(metadata, type) {
1946
+ Reflect.defineMetadata(validatorMetadataKey, metadata, type);
1947
+ }
1948
+ /**
1949
+ * @internal
1950
+ */
1951
+ function getValidatorMetadata(type) {
1952
+ const metadata = Reflect.getOwnMetadata(validatorMetadataKey, type);
1953
+ if (!metadata) {
1954
+ throw new Error(`Validator metadata was not found on '${type.name}' class`);
1808
1955
  }
1956
+ return metadata;
1809
1957
  }
1810
-
1811
- class FilterMock extends BaseFilter {
1812
- constructor(filterType = FilterType.None) {
1813
- super(filterType);
1814
- }
1815
- // eslint-disable-next-line @typescript-eslint/ban-types
1816
- get plainObject() {
1817
- return classToPlain(this, { exposeUnsetFields: false, excludePrefixes: ['_'] });
1818
- }
1819
- clone() {
1820
- return new FilterMock(this.filterType);
1821
- }
1958
+ /**
1959
+ * @internal
1960
+ */
1961
+ function setConverterMetadata(metadata, type) {
1962
+ Reflect.defineMetadata(converterMetadataKey, metadata, type);
1822
1963
  }
1823
-
1824
- class SingleFilter extends BaseFilter {
1825
- constructor(filterType, comparisonType, leftExpression) {
1826
- super(filterType);
1827
- this.comparisonType = comparisonType;
1828
- this.leftExpression = leftExpression.clone();
1964
+ /**
1965
+ * @internal
1966
+ */
1967
+ function getConverterMetadata(type) {
1968
+ const metadata = Reflect.getOwnMetadata(converterMetadataKey, type);
1969
+ if (!metadata) {
1970
+ throw new Error(`Converter metadata was not found on '${type.name}' class`);
1829
1971
  }
1972
+ return metadata;
1830
1973
  }
1831
-
1832
- class CompareFilter extends SingleFilter {
1833
- constructor(comparisonType, leftExpression, rightExpression) {
1834
- super(FilterType.Compare, comparisonType, leftExpression);
1835
- this.rightExpression = rightExpression.clone();
1974
+ /**
1975
+ * @internal
1976
+ */
1977
+ function setInterfaceDesignerItemMetadata(metadata, type) {
1978
+ Reflect.defineMetadata(interfaceDesignerItemMetadataKey, metadata, type);
1979
+ }
1980
+ /**
1981
+ * @internal
1982
+ */
1983
+ function getInterfaceDesignerItemMetadata(type) {
1984
+ const metadata = Reflect.getOwnMetadata(interfaceDesignerItemMetadataKey, type);
1985
+ if (!metadata) {
1986
+ throw new Error(`Interface designer item metadata was not found on '${type.name}' class`);
1836
1987
  }
1837
- clone() {
1838
- return new CompareFilter(this.comparisonType, this.leftExpression, this.rightExpression);
1988
+ return metadata;
1989
+ }
1990
+ /**
1991
+ * @internal
1992
+ */
1993
+ function setDesignTimeViewElementMetadata(metadata, type) {
1994
+ Reflect.defineMetadata(designTimeViewElementMetadataKey, metadata, type);
1995
+ }
1996
+ /**
1997
+ * @internal
1998
+ */
1999
+ function getDesignTimeViewElementMetadata(type) {
2000
+ const metadata = Reflect.getOwnMetadata(designTimeViewElementMetadataKey, type);
2001
+ if (!metadata) {
2002
+ throw new Error(`Design time view element metadata was not found on '${type.name}' class`);
1839
2003
  }
2004
+ return metadata;
1840
2005
  }
1841
-
1842
2006
  /**
1843
- * Empty Guid constant.
1844
2007
  * @internal
1845
2008
  */
1846
- const EMPTY_GUID = '00000000-0000-0000-0000-000000000000';
2009
+ function hasInterfaceDesignerItemMetadata(type) {
2010
+ return Reflect.hasOwnMetadata(interfaceDesignerItemMetadataKey, type);
2011
+ }
1847
2012
  /**
1848
- * Regular expression for Guid validation.
1849
2013
  * @internal
1850
2014
  */
1851
- 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');
2015
+ function setRequestHandlerMetadata(metadata, type) {
2016
+ Reflect.defineMetadata(requestHandlerMetadataKey, metadata, type);
2017
+ }
1852
2018
  /**
1853
- * Generates guid part.
1854
- * @param length Part length.
1855
2019
  * @internal
1856
2020
  */
1857
- function generateGuidPart(length) {
1858
- let out = '';
1859
- for (let i = 0; i < length; i++) {
1860
- // eslint-disable-next-line no-bitwise
1861
- out += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
2021
+ function getRequestHandlerMetadata(type) {
2022
+ const metadata = Reflect.getMetadata(requestHandlerMetadataKey, type);
2023
+ if (!metadata) {
2024
+ throw new Error(`Request handler metadata was not found on '${type.name}' class`);
1862
2025
  }
1863
- return out;
2026
+ return metadata;
1864
2027
  }
1865
2028
  /**
1866
- * Generates new Guid.
1867
2029
  * @internal
1868
2030
  */
1869
- function generateGuid() {
1870
- return [
1871
- generateGuidPart(2),
1872
- generateGuidPart(1),
1873
- generateGuidPart(1),
1874
- generateGuidPart(1),
1875
- generateGuidPart(3),
1876
- ].join('-');
2031
+ function getHandlerChainServiceMetadata(typeRef) {
2032
+ const requestType = Reflect.getMetadata('requestType', typeRef);
2033
+ if (!requestType) {
2034
+ throw new Error(`requestType was not found on '${typeRef.name}' class`);
2035
+ }
2036
+ return { requestType, typeRef };
1877
2037
  }
1878
2038
  /**
1879
- * Checks if value is Guid.
1880
- * @param value Value for check.
1881
2039
  * @internal
1882
2040
  */
1883
- function isGuid(value) {
1884
- return Boolean(value) && validator.test(value);
2041
+ function getCrtInputsMetadata(type) {
2042
+ const keys = Reflect.getMetadataKeys(type);
2043
+ const crtInputKeys = keys.filter((x) => x.startsWith(crtInputPrefix));
2044
+ return Object.fromEntries(crtInputKeys.map((key) => {
2045
+ const data = Reflect.getMetadata(key, type);
2046
+ return [key.replace(crtInputPrefix, ''), data];
2047
+ }));
1885
2048
  }
1886
2049
  /**
1887
- * Checks if Guid is empty value or equal to EMPTY_GUID.
1888
- * @param guid Guid for check.
1889
2050
  * @internal
1890
2051
  */
1891
- function isEmptyGuid(guid) {
1892
- return !guid || guid === EMPTY_GUID;
2052
+ function getCrtOutputsMetadata(type) {
2053
+ const keys = Reflect.getMetadataKeys(type);
2054
+ const crtOutputKeys = keys.filter((x) => x.startsWith(crtOutputPrefix));
2055
+ return Object.fromEntries(crtOutputKeys.map((key) => {
2056
+ const data = Reflect.getMetadata(key, type);
2057
+ return [key.replace(crtOutputPrefix, ''), data];
2058
+ }));
1893
2059
  }
1894
-
1895
- class ExistsFilter extends SingleFilter {
1896
- constructor(leftExpression, subFilters, comparisonType = ComparisonType.Exists, isAggregative = true) {
1897
- super(FilterType.Exists, comparisonType, leftExpression);
1898
- this.subFilters = subFilters === null || subFilters === void 0 ? void 0 : subFilters.clone();
1899
- this.isAggregative = isAggregative;
1900
- }
1901
- clone() {
1902
- return new ExistsFilter(this.leftExpression, this.subFilters, this.comparisonType, this.isAggregative);
1903
- }
2060
+ /**
2061
+ * @internal
2062
+ */
2063
+ function getCrtValidationInputsMetadata(type) {
2064
+ const keys = Reflect.getMetadataKeys(type);
2065
+ const crtValidationInputKeys = keys.filter((x) => x.startsWith(crtValidationInputPrefix));
2066
+ return Object.fromEntries(crtValidationInputKeys.map((key) => {
2067
+ const data = Reflect.getMetadata(key, type);
2068
+ return [key.replace(crtValidationInputPrefix, ''), data];
2069
+ }));
1904
2070
  }
1905
-
1906
- class InFilter extends SingleFilter {
1907
- constructor(comparisonType, leftExpression, rightExpressions) {
1908
- super(FilterType.In, comparisonType, leftExpression);
1909
- this.rightExpressions = rightExpressions.map((expression) => expression.clone());
1910
- }
1911
- clone() {
1912
- return new InFilter(this.comparisonType, this.leftExpression, this.rightExpressions);
1913
- }
2071
+ /**
2072
+ * @internal
2073
+ */
2074
+ function getCrtInjectMetadata(type) {
2075
+ const keys = Reflect.getOwnMetadataKeys(type);
2076
+ const crtInjectKeys = keys.filter((x) => x.startsWith(crtInjectPrefix));
2077
+ return Object.fromEntries(crtInjectKeys.map((key) => {
2078
+ const index = Number(key.replace(crtInjectPrefix, ''));
2079
+ const data = Reflect.getMetadata(key, type);
2080
+ return [index, data];
2081
+ }));
1914
2082
  }
1915
-
1916
- class IsNullFilter extends SingleFilter {
1917
- constructor(comparisonType, leftExpression) {
1918
- super(FilterType.IsNull, comparisonType, leftExpression);
1919
- }
1920
- get isNull() {
1921
- return this.comparisonType === ComparisonType.Is_null;
1922
- }
1923
- clone() {
1924
- return new IsNullFilter(this.comparisonType, this.leftExpression);
1925
- }
2083
+ /**
2084
+ * @internal
2085
+ */
2086
+ function getParentType(type) {
2087
+ const parentProto = type.prototype ? Object.getPrototypeOf(type.prototype) : null;
2088
+ return parentProto ? parentProto.constructor : null;
1926
2089
  }
1927
- __decorate([
1928
- Expose(),
1929
- __metadata("design:type", Boolean),
1930
- __metadata("design:paramtypes", [])
1931
- ], IsNullFilter.prototype, "isNull", null);
1932
-
1933
- class FilterGroup extends BaseFilter {
1934
- constructor(logicalOperation = LogicalOperatorType.And) {
1935
- super(FilterType.FilterGroup);
1936
- this.filters = new Map();
1937
- this.logicalOperation = logicalOperation;
1938
- }
1939
- get items() {
1940
- return classToPlain(this.filters, {
1941
- exposeUnsetFields: false,
1942
- excludePrefixes: ['_'],
1943
- });
1944
- }
1945
- /**
1946
- * Returns filter item by index.
1947
- * @param index Item index.
1948
- * @returns Filter.
1949
- */
1950
- getItemByIndex(index) {
1951
- return this.items[Object.keys(this.items)[index]];
1952
- }
1953
- addSchemaColumnFilterWithParameter(comparisonType, columnPath, parameterValue) {
1954
- const leftExpression = new ColumnExpression({ columnPath });
1955
- const rightExpression = new ParameterExpression({ value: parameterValue });
1956
- const filter = new CompareFilter(comparisonType, leftExpression, rightExpression);
1957
- this.add(filter);
1958
- }
1959
- addSchemaColumnInFilterWithParameters(comparisonType, columnPath, parameterValues) {
1960
- const leftExpression = new ColumnExpression({ columnPath });
1961
- const expressions = parameterValues.map((singleParameterValue) => new ParameterExpression({
1962
- value: singleParameterValue,
1963
- }));
1964
- const filter = new InFilter(comparisonType, leftExpression, expressions);
1965
- this.add(filter);
1966
- }
1967
- addSchemaColumnIsNullFilter(columnPath) {
1968
- const leftExpression = new ColumnExpression({ columnPath });
1969
- const filter = new IsNullFilter(ComparisonType.Is_null, leftExpression);
1970
- this.add(filter);
1971
- }
1972
- addSchemaColumnIsNotNullFilter(columnPath) {
1973
- const leftExpression = new ColumnExpression({ columnPath });
1974
- const filter = new IsNullFilter(ComparisonType.Is_not_null, leftExpression);
1975
- this.add(filter);
1976
- }
1977
- addExistsFilter(columnPath, subFilters) {
1978
- const leftExpression = new ColumnExpression({ columnPath });
1979
- const filter = new ExistsFilter(leftExpression, subFilters);
1980
- this.add(filter);
1981
- }
1982
- addNotExistsFilter(columnPath, subFilters) {
1983
- const leftExpression = new ColumnExpression({ columnPath });
1984
- const filter = new ExistsFilter(leftExpression, subFilters, ComparisonType.Not_exists);
1985
- this.add(filter);
1986
- }
1987
- add(filter, filterKey) {
1988
- ValidationUtilities.checkArgumentEmpty('filter', filter);
1989
- const key = filterKey || generateGuid();
1990
- this.filters.set(key, filter);
1991
- }
1992
- clone() {
1993
- const filterGroup = new FilterGroup(this.logicalOperation);
1994
- this.filters.forEach((filter, filterKey) => {
1995
- filterGroup.filters.set(filterKey, filter.clone());
1996
- });
1997
- return filterGroup;
2090
+ /**
2091
+ * @internal
2092
+ */
2093
+ function getTypeDependencies(type) {
2094
+ const paramTypes = Reflect.getOwnMetadata('design:paramtypes', type);
2095
+ if (!paramTypes) {
2096
+ if (type.length > 0) {
2097
+ throw new Error(`Dependency Injection error. Cannot read dependencies of class '${type.name}'. ` +
2098
+ `Please make sure class '${type.name}' has decorator and ` +
2099
+ "'emitDecoratorMetadata' option is enabled in your 'tsconfig.json' file.");
2100
+ }
2101
+ const parentType = getParentType(type);
2102
+ return parentType && parentType !== Object ? getTypeDependencies(parentType) : [];
1998
2103
  }
2104
+ const crtInjectMetadata = getCrtInjectMetadata(type);
2105
+ Object.entries(crtInjectMetadata).forEach(([index, token]) => (paramTypes[index] = token));
2106
+ return paramTypes;
1999
2107
  }
2000
- __decorate([
2001
- Exclude(),
2002
- __metadata("design:type", Object)
2003
- ], FilterGroup.prototype, "filters", void 0);
2004
- __decorate([
2005
- Expose(),
2006
- __metadata("design:type", Object),
2007
- __metadata("design:paramtypes", [])
2008
- ], FilterGroup.prototype, "items", null);
2009
2108
 
2010
- class BetweenFilter extends SingleFilter {
2011
- constructor(leftExpression, rightLessExpression, rightGreaterExpression) {
2012
- super(FilterType.Between, ComparisonType.Between, leftExpression);
2013
- this.rightLessExpression = rightLessExpression.clone();
2014
- this.rightGreaterExpression = rightGreaterExpression.clone();
2015
- }
2016
- clone() {
2017
- return new BetweenFilter(this.leftExpression, this.rightLessExpression, this.rightGreaterExpression);
2109
+ /**
2110
+ * @internal
2111
+ */
2112
+ function instantiate(type, resolveDependency) {
2113
+ const deps = getTypeDependencies(type);
2114
+ if (deps.length > 0) {
2115
+ if (!resolveDependency) {
2116
+ throw new Error(`Cannot resolve dependencies for ${type.name}. ` +
2117
+ "Please provide 'resolveDependency' bootstrap option");
2118
+ }
2119
+ const depInstances = deps.map(resolveDependency);
2120
+ return new type(...depInstances);
2018
2121
  }
2122
+ return new type();
2019
2123
  }
2020
2124
 
2021
- class BaseQueryColumn {
2022
- constructor(expression) {
2023
- this.orderDirection = OrderDirection.None;
2024
- this.orderPosition = -1;
2025
- this.isVisible = true;
2026
- this.expression = expression;
2027
- }
2125
+ /**
2126
+ * @public
2127
+ */
2128
+ class CrtInputRegistrationConfig {
2129
+ }
2130
+
2131
+ /**
2132
+ * @public
2133
+ * @class BaseRequest
2134
+ * @describe Base definition of request.
2135
+ * @template TEvent
2136
+ */
2137
+ class BaseRequest {
2138
+ }
2139
+
2140
+ /**
2141
+ * @public
2142
+ * @class DataRequest
2143
+ * @description Definition of data source request.
2144
+ * @extends {BaseRequest} {@link BaseRequest}
2145
+ * @property {string} dataSourceName - name of assigned data source.
2146
+ */
2147
+ class DataRequest extends BaseRequest {
2148
+ }
2149
+
2150
+ /**
2151
+ * @public
2152
+ * @description Abstract Base Validator class for designing custom validators.
2153
+ * @example
2154
+ * @CrtValidator({
2155
+ * type: 'crt.Required',
2156
+ * })
2157
+ * export class RequiredValidator extends BaseValidator {
2158
+ * protected override async = false;
2159
+ * public validate(controlState: CrtControlState, params?: ValidatorParametersValues): CrtValidationErrors | null {
2160
+ * Implementation here...
2161
+ * }
2162
+ * }
2163
+ */
2164
+ class BaseValidator {
2028
2165
  /**
2029
- * Adds ordering options.
2030
- * @param orderDirection Direction.
2031
- * @param orderPosition Position.
2032
- * @returns Self.
2166
+ * @description getter for async/sync indicator
2033
2167
  */
2034
- withOrdering(orderDirection, orderPosition) {
2035
- ValidationUtilities.checkArgumentEmpty('orderDirection', orderDirection);
2036
- ValidationUtilities.checkArgumentEmpty('orderPosition', orderPosition);
2037
- ValidationUtilities.checkArgumentOutOfRange('orderPosition', orderPosition, { begin: -1 });
2038
- this.orderDirection = orderDirection;
2039
- this.orderPosition = orderPosition;
2040
- return this;
2168
+ get isAsync() {
2169
+ return this.async;
2041
2170
  }
2042
2171
  /**
2043
- * Adds options.
2044
- * @param options Options.
2045
- * @returns Self.
2172
+ * @description Function used for validation
2046
2173
  */
2047
- withOptions(options) {
2048
- var _a;
2049
- ValidationUtilities.checkArgumentEmpty('options', options);
2050
- this.isVisible = (_a = options.isVisible) !== null && _a !== void 0 ? _a : true;
2051
- return this;
2174
+ get validateFn() {
2175
+ return this.validate.bind(this);
2052
2176
  }
2053
2177
  /**
2054
- * Adds caption.
2055
- * @param caption Caption.
2056
- * @returns Self.
2178
+ * @internal
2057
2179
  */
2058
- withCaption(caption) {
2059
- ValidationUtilities.checkArgumentEmpty('caption', caption);
2060
- this.caption = caption;
2061
- return this;
2062
- }
2063
- }
2064
-
2065
- class ArithmeticQueryColumn extends BaseQueryColumn {
2066
- // region Constructors: Public
2067
- constructor(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand) {
2068
- super(new ArithmeticExpression({ arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand }));
2069
- }
2070
- }
2071
-
2072
- class EntityQueryColumn extends BaseQueryColumn {
2073
- // region Constructors: Public
2074
- constructor(columnPath) {
2075
- super(new ColumnExpression({ columnPath }));
2076
- }
2077
- }
2078
-
2079
- class ParameterQueryColumn extends BaseQueryColumn {
2080
- // region Constructors: Public
2081
- constructor(value, dataValueType) {
2082
- super(new ParameterExpression({ value, dataValueType }));
2180
+ static [Symbol.hasInstance](instance) {
2181
+ var _a;
2182
+ return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === BaseValidator._instanceOfKey;
2083
2183
  }
2084
2184
  }
2185
+ /**
2186
+ * @internal
2187
+ * @dontChange
2188
+ */
2189
+ BaseValidator._instanceOfKey = 'devkit_BaseValidator';
2085
2190
 
2086
- class AggregationSubQueryColumn extends BaseQueryColumn {
2087
- // region Constructors: Public
2088
- constructor(columnPath, aggregationType, subFilters, subOrderDirection, subOrderColumn) {
2089
- super(new AggregationSubQueryExpression({
2090
- aggregationType,
2091
- columnPath,
2092
- subFilters,
2093
- subOrderDirection,
2094
- subOrderColumn,
2095
- }));
2191
+ /**
2192
+ * @public
2193
+ */
2194
+ class LocalizableValue {
2195
+ constructor(key) {
2196
+ this.key = key;
2096
2197
  }
2097
- }
2098
-
2099
- class SubQueryColumn extends BaseQueryColumn {
2100
- // region Constructors: Public
2101
- constructor(columnPath, subFilters) {
2102
- super(new SubQueryExpression({ columnPath, subFilters }));
2198
+ /**
2199
+ * @internal
2200
+ */
2201
+ static [Symbol.hasInstance](instance) {
2202
+ var _a;
2203
+ return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === LocalizableValue._instanceOfKey;
2103
2204
  }
2104
2205
  }
2206
+ /**
2207
+ * @internal
2208
+ * @dontChange
2209
+ */
2210
+ LocalizableValue._instanceOfKey = 'devkit_LocalizableValue';
2105
2211
 
2106
- class AggregationFunctionColumn extends BaseQueryColumn {
2107
- // region Constructors: Public
2108
- constructor(aggregationType, aggregationEvalType, functionArgument) {
2109
- super(new AggregationFunctionExpression({
2110
- aggregationType,
2111
- aggregationEvalType,
2112
- functionArgument,
2113
- }));
2212
+ /**
2213
+ * @internal
2214
+ */
2215
+ function applyLocalizeMetadataFn(obj, localizeMetadata) {
2216
+ const localizableEntries = objectDeepKeys(obj)
2217
+ .map((path) => ({ path, value: get(obj, path) }))
2218
+ .filter(({ value }) => value instanceof LocalizableValue);
2219
+ if (localizableEntries.length === 0) {
2220
+ return obj;
2114
2221
  }
2115
- }
2116
-
2117
- class DatePartFunctionColumn extends BaseQueryColumn {
2118
- // region Constructors: Public
2119
- constructor(datePartType, functionArgument) {
2120
- super(new DatePartFunctionExpression({
2121
- datePartType,
2122
- functionArgument,
2123
- }));
2222
+ const localized = cloneDeep(obj);
2223
+ if (!localizeMetadata) {
2224
+ console.error("Unable to localize metadata. 'localizeMetadata' bootstrap option was not provided.");
2124
2225
  }
2125
- // endregion
2126
- // region Properties: Public
2127
- get datePartType() {
2226
+ localizableEntries.forEach(({ path, value }) => {
2128
2227
  var _a;
2129
- return (_a = this.expression) === null || _a === void 0 ? void 0 : _a.datePartType;
2130
- }
2131
- }
2132
-
2133
- class LengthFunctionColumn extends BaseQueryColumn {
2134
- // region Constructors: Public
2135
- constructor(functionArgument) {
2136
- super(new LengthFunctionExpression({ functionArgument }));
2137
- }
2228
+ const localizedValue = (_a = localizeMetadata === null || localizeMetadata === void 0 ? void 0 : localizeMetadata(value.key)) !== null && _a !== void 0 ? _a : value.key;
2229
+ set(localized, path, localizedValue);
2230
+ });
2231
+ return localized;
2138
2232
  }
2139
2233
 
2140
- class MacrosFunctionColumn extends BaseQueryColumn {
2141
- // region Constructors: Public
2142
- constructor(macrosType) {
2143
- super(new MacrosFunctionExpression({ macrosType }));
2144
- }
2234
+ /**
2235
+ * @internal
2236
+ */
2237
+ function CrtDesignTimeViewElement(config) {
2238
+ return function (type) {
2239
+ const registrationConfig = Object.assign(Object.assign({}, config), { typeRef: type });
2240
+ setDesignTimeViewElementMetadata(registrationConfig, type);
2241
+ };
2145
2242
  }
2146
2243
 
2147
- class WindowFunctionColumn extends BaseQueryColumn {
2148
- // region Constructors: Public
2149
- constructor(functionArgument) {
2150
- super(new WindowFunctionExpression({ functionArgument }));
2151
- }
2244
+ /**
2245
+ * @internal
2246
+ */
2247
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2248
+ function CrtRequest(config) {
2249
+ return function (type) {
2250
+ checkTypeNameFormat(config.type, 'RequestTypeName');
2251
+ checkCrtTypeNamePascalCase(config.type);
2252
+ RequestRegistryService.register(config, type);
2253
+ };
2152
2254
  }
2153
2255
 
2154
2256
  /**
@@ -2233,7 +2335,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2233
2335
  }
2234
2336
  // endregion
2235
2337
  // region Methods: Private
2236
- internalAddColumn(key, column) {
2338
+ _internalAddColumn(key, column) {
2237
2339
  if (!this._columns.has(key)) {
2238
2340
  this._columns.set(key, column);
2239
2341
  }
@@ -2263,9 +2365,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2263
2365
  getMetadata() {
2264
2366
  return Object.assign(Object.assign({}, super.getMetadata()), { columns: {
2265
2367
  items: classToPlain(this._columns, { exposeUnsetFields: false, excludePrefixes: ['_'] }),
2266
- }, allColumns: false, isDistinct: this.isDistinct, ignoreDisplayValues: false, rowCount: this.rowCount, rowsOffset: this.rowsOffset, isPageable: this._getIsPageable(),
2267
- // TODO: CRM-61150: https://tscore-task/browse/CRM-61150
2268
- conditionalValues: this.conditionalValues ? this.conditionalValues : null, isHierarchical: false, hierarchicalMaxDepth: 0, hierarchicalColumnName: null, hierarchicalColumnValue: null, useLocalization: this.useLocalization, useRecordDeactivation: false });
2368
+ }, 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 });
2269
2369
  }
2270
2370
  /**
2271
2371
  * Add column.
@@ -2274,7 +2374,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2274
2374
  * @returns [BaseQueryColumn] Column instance.
2275
2375
  */
2276
2376
  addColumn(column, columnAlias) {
2277
- this.internalAddColumn(columnAlias, column);
2377
+ this._internalAddColumn(columnAlias, column);
2278
2378
  return column;
2279
2379
  }
2280
2380
  /**
@@ -2286,7 +2386,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2286
2386
  addSchemaColumn(columnPath, columnAlias) {
2287
2387
  ValidationUtilities.checkArgumentEmpty('columnPath', columnPath);
2288
2388
  const column = new EntityQueryColumn(columnPath);
2289
- this.internalAddColumn(columnAlias || columnPath, column);
2389
+ this._internalAddColumn(columnAlias || columnPath, column);
2290
2390
  return column;
2291
2391
  }
2292
2392
  /**
@@ -2299,7 +2399,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2299
2399
  */
2300
2400
  addAggregationSubQueryColumn(columnPath, aggregationType, aggregationConfig, columnAlias) {
2301
2401
  const column = new AggregationSubQueryColumn(columnPath, aggregationType, aggregationConfig.filter, aggregationConfig.sortByDirection, aggregationConfig.sortByColumn);
2302
- this.internalAddColumn(columnAlias || columnPath, column);
2402
+ this._internalAddColumn(columnAlias || columnPath, column);
2303
2403
  return column;
2304
2404
  }
2305
2405
  /**
@@ -2311,7 +2411,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2311
2411
  */
2312
2412
  addParameterColumn(value, dataValueType, columnAlias) {
2313
2413
  const column = new ParameterQueryColumn(value, dataValueType);
2314
- this.internalAddColumn(columnAlias, column);
2414
+ this._internalAddColumn(columnAlias, column);
2315
2415
  return column;
2316
2416
  }
2317
2417
  /**
@@ -2324,7 +2424,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2324
2424
  */
2325
2425
  addArithmeticColumn(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand, columnAlias) {
2326
2426
  const column = new ArithmeticQueryColumn(arithmeticOperation, leftArithmeticOperand, rightArithmeticOperand);
2327
- this.internalAddColumn(columnAlias, column);
2427
+ this._internalAddColumn(columnAlias, column);
2328
2428
  return column;
2329
2429
  }
2330
2430
  /**
@@ -2335,7 +2435,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2335
2435
  */
2336
2436
  addMacrosFunctionColumn(queryMacrosType, columnAlias) {
2337
2437
  const column = new MacrosFunctionColumn(queryMacrosType);
2338
- this.internalAddColumn(columnAlias, column);
2438
+ this._internalAddColumn(columnAlias, column);
2339
2439
  return column;
2340
2440
  }
2341
2441
  /**
@@ -2348,7 +2448,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2348
2448
  addDatePartFunctionColumn(columnPath, datePartType, columnAlias) {
2349
2449
  const functionArgument = new ColumnExpression({ columnPath });
2350
2450
  const column = new DatePartFunctionColumn(datePartType, functionArgument);
2351
- this.internalAddColumn(columnAlias, column);
2451
+ this._internalAddColumn(columnAlias, column);
2352
2452
  return column;
2353
2453
  }
2354
2454
  /**
@@ -2362,7 +2462,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2362
2462
  addAggregationFunctionColumn(columnPath, aggregationType, columnAlias, aggregationEvalType = AggregationEvalType.None) {
2363
2463
  const functionArgument = new ColumnExpression({ columnPath });
2364
2464
  const column = new AggregationFunctionColumn(aggregationType, aggregationEvalType, functionArgument);
2365
- this.internalAddColumn(columnAlias, column);
2465
+ this._internalAddColumn(columnAlias, column);
2366
2466
  return column;
2367
2467
  }
2368
2468
  /**
@@ -2374,7 +2474,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2374
2474
  addLengthFunctionColumn(columnPath, columnAlias) {
2375
2475
  const functionArgument = new ColumnExpression({ columnPath });
2376
2476
  const column = new LengthFunctionColumn(functionArgument);
2377
- this.internalAddColumn(columnAlias, column);
2477
+ this._internalAddColumn(columnAlias, column);
2378
2478
  return column;
2379
2479
  }
2380
2480
  /**
@@ -2392,7 +2492,7 @@ class EntitySchemaQuery extends BaseFilterableQuery {
2392
2492
  functionArgument: new ColumnExpression({ columnPath }),
2393
2493
  });
2394
2494
  const column = new WindowFunctionColumn(functionArgument);
2395
- this.internalAddColumn(columnAlias, column);
2495
+ this._internalAddColumn(columnAlias, column);
2396
2496
  return column;
2397
2497
  }
2398
2498
  }
@@ -2471,6 +2571,228 @@ __decorate([
2471
2571
  class SelectLocalizationQuery extends EntitySchemaQuery {
2472
2572
  }
2473
2573
 
2574
+ /**
2575
+ * @internal
2576
+ */
2577
+ class InterfaceDesignerItemRegistrationConfig {
2578
+ }
2579
+
2580
+ /**
2581
+ * @internal
2582
+ * @class MethodInvokeRequest
2583
+ * @description Definition of invoke method request.
2584
+ * @extends {BaseRequest} {@link BaseRequest}
2585
+ * @property {string} method - method name.
2586
+ * @property {unknown[]} args - arguments passing to the method.
2587
+ */
2588
+ class MethodInvokeRequest extends BaseRequest {
2589
+ }
2590
+
2591
+ /**
2592
+ * @internal
2593
+ */
2594
+ var RemoteEntryType;
2595
+ (function (RemoteEntryType) {
2596
+ RemoteEntryType["Script"] = "script";
2597
+ RemoteEntryType["Module"] = "module";
2598
+ })(RemoteEntryType || (RemoteEntryType = {}));
2599
+
2600
+ /**
2601
+ * @public
2602
+ * @description Creatio platform interacts with input's of user-defined component through CrtInput decorator.
2603
+ * @param config {@link CrtInputRegistrationConfig}
2604
+ *
2605
+ * @example
2606
+ * export class AppComponent {
2607
+ * @CrtInput()
2608
+ * public value!: string;
2609
+ * }
2610
+ */
2611
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2612
+ function CrtInput(config) {
2613
+ return function (target, propertyKey) {
2614
+ if (!config) {
2615
+ config = {
2616
+ propertyBindable: false,
2617
+ };
2618
+ }
2619
+ Reflect.defineMetadata(crtInputPrefix + propertyKey.toString(), config, target.constructor);
2620
+ };
2621
+ }
2622
+
2623
+ /**
2624
+ * @public
2625
+ * @description User-defined components could notify Creatio platform about changes through CrtOutput decorator.
2626
+ * @example
2627
+ * export class AppComponent {
2628
+ * @Input()
2629
+ * @CrtOutput()
2630
+ * public valueChange;
2631
+ * }
2632
+ */
2633
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2634
+ function CrtOutput() {
2635
+ return function (target, propertyKey) {
2636
+ Reflect.defineMetadata(crtOutputPrefix + propertyKey.toString(), {}, target.constructor);
2637
+ };
2638
+ }
2639
+
2640
+ /**
2641
+ * @public
2642
+ * @description User-defined components receive validationInfo changes through CrtValidationInput decorator.
2643
+ * Make sure you have defined input for every validationInfo input.
2644
+ * To properly declare validationInfo field:
2645
+ * 1. Declare input field inside inputs section. For example `value`
2646
+ * 2. In validationInputs section declare same field which ends with ValidationInfo.
2647
+ * For previous example `valueValidationInfo`
2648
+ *
2649
+ * @example
2650
+ * export class AppComponent {
2651
+ * @CrtInput()
2652
+ public value;
2653
+ *
2654
+ * @CrtValidationInput()
2655
+ * public valueValidationInfo;
2656
+ * }
2657
+ */
2658
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2659
+ function CrtValidationInput() {
2660
+ return function (target, propertyKey) {
2661
+ Reflect.defineMetadata(crtValidationInputPrefix + propertyKey.toString(), {}, target.constructor);
2662
+ };
2663
+ }
2664
+
2665
+ /**
2666
+ * @internal
2667
+ */
2668
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2669
+ function CrtViewElement(config) {
2670
+ return function (type) {
2671
+ checkTypeNamePascalCase(config.type);
2672
+ const inputs = getCrtInputsMetadata(type);
2673
+ const outputs = getCrtOutputsMetadata(type);
2674
+ const validationInputs = getCrtValidationInputsMetadata(type);
2675
+ const baseRegistrationConfig = Object.assign(Object.assign({}, config), { inputs,
2676
+ outputs,
2677
+ validationInputs });
2678
+ const registrationConfig = 'selector' in config
2679
+ ? Object.assign(Object.assign({}, baseRegistrationConfig), { selector: config.selector }) : Object.assign(Object.assign({}, baseRegistrationConfig), { typeRef: type });
2680
+ setViewElementMetadata(registrationConfig, type);
2681
+ };
2682
+ }
2683
+
2684
+ /**
2685
+ * @public
2686
+ * @description CrtModule decorator is a 'container' where user actually setup elements.
2687
+ * In could contain viewElements, definitions of other CrtModules.
2688
+ * @param moduleDefinition - {@link ModuleDefinition}
2689
+ *
2690
+ * @example
2691
+ * @CrtModule({
2692
+ * viewElements: [AppComponent],
2693
+ * requestHandlers: [SomeRequestHandler],
2694
+ * validators: [SomeValidator],
2695
+ * })
2696
+ * @NgModule({
2697
+ * declarations: [AppComponent],
2698
+ * imports: [BrowserModule],
2699
+ * providers: [],
2700
+ * })
2701
+ * export class AppModule {}
2702
+ */
2703
+ function CrtModule(moduleDefinition) {
2704
+ return (type) => setModuleMetadata(moduleDefinition, type);
2705
+ }
2706
+
2707
+ // noinspection ES6PreferShortImport
2708
+ /**
2709
+ * @internal
2710
+ */
2711
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2712
+ function CrtInterfaceDesignerItem(config) {
2713
+ function _applyTypeCaption() {
2714
+ if (!config.typeCaption && config.toolbarConfig) {
2715
+ const toolbarConfig = Array.isArray(config.toolbarConfig)
2716
+ ? config.toolbarConfig[0]
2717
+ : config.toolbarConfig;
2718
+ config.typeCaption = toolbarConfig.caption;
2719
+ }
2720
+ }
2721
+ return function (type) {
2722
+ var _a;
2723
+ config.typeRef = type;
2724
+ (_a = config.viewElementGroupType) !== null && _a !== void 0 ? _a : (config.viewElementGroupType = ViewElementGroupType.CustomElements);
2725
+ _applyTypeCaption();
2726
+ setInterfaceDesignerItemMetadata(config, type);
2727
+ };
2728
+ }
2729
+
2730
+ /**
2731
+ * @public
2732
+ * @description
2733
+ * Constructor parameter decorator.
2734
+ * Mark parameter as dependency that should be obtained by token.
2735
+ * @param token - token by which the dependency instance will be obtained
2736
+ * @example
2737
+ * class MyHandler {
2738
+ * constructor(@CrtInject(USER_NAME_TOKEN) userName: string) {}
2739
+ * }
2740
+ */
2741
+ function CrtInject(token) {
2742
+ return function (target, paramKey, paramIndex) {
2743
+ Reflect.defineMetadata(crtInjectPrefix + paramIndex, token, target);
2744
+ };
2745
+ }
2746
+
2747
+ /**
2748
+ * @internal
2749
+ */
2750
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2751
+ function CrtValidator(config) {
2752
+ if (!config) {
2753
+ return (type) => { };
2754
+ }
2755
+ return function (type) {
2756
+ checkTypeNameFormat(config.type, 'ValidatorTypeName');
2757
+ const registrationConfig = Object.assign(Object.assign({}, config), { typeRef: type });
2758
+ setValidatorMetadata(registrationConfig, type);
2759
+ };
2760
+ }
2761
+
2762
+ /**
2763
+ * @internal
2764
+ */
2765
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2766
+ function CrtRequestHandler(config) {
2767
+ if (!config) {
2768
+ return (type) => { };
2769
+ }
2770
+ return function (type) {
2771
+ checkTypeNameFormat(config.type, 'RequestHandlerTypeName');
2772
+ checkCrtTypeNamePascalCase(config.type);
2773
+ setRequestHandlerMetadata(config, type);
2774
+ };
2775
+ }
2776
+
2777
+ /**
2778
+ * @internal
2779
+ */
2780
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2781
+ function CrtConverter(config) {
2782
+ if (!config) {
2783
+ return (type) => { };
2784
+ }
2785
+ return function (typeRef) {
2786
+ const type = typeof config === 'string' ? config : config.type;
2787
+ checkTypeNameFormat(type, 'converterTypeName');
2788
+ const registrationConfig = {
2789
+ type: type,
2790
+ typeRef: typeRef,
2791
+ };
2792
+ setConverterMetadata(registrationConfig, typeRef);
2793
+ };
2794
+ }
2795
+
2474
2796
  /**
2475
2797
  * @public
2476
2798
  * @description Function allows to register user-defined component as view element in Creatio platform.
@@ -2560,13 +2882,31 @@ function registerDesignTimeViewElements(types) {
2560
2882
  function registerValidators(types, options) {
2561
2883
  resistantForEach(types, (type) => {
2562
2884
  const metadata = getValidatorMetadata(type);
2563
- const registrationConfig = Object.assign(Object.assign({}, metadata), { instantiate: function () {
2564
- return instantiate(this.typeRef, options === null || options === void 0 ? void 0 : options.resolveDependency);
2885
+ const registrationConfig = Object.assign(Object.assign({}, metadata), { instantiate: function (injectionContext) {
2886
+ const resolveDependency = (options === null || options === void 0 ? void 0 : options.resolveDependency)
2887
+ ? (token) => options.resolveDependency(token, injectionContext)
2888
+ : null;
2889
+ return instantiate(type, resolveDependency);
2565
2890
  } });
2566
2891
  ValidatorRegistry.validate(registrationConfig);
2567
2892
  ValidatorRegistry.register(registrationConfig);
2568
2893
  });
2569
2894
  }
2895
+ /**
2896
+ * @internal
2897
+ */
2898
+ function registerConverters(types, options) {
2899
+ resistantForEach(types, (type) => {
2900
+ const metadata = getConverterMetadata(type);
2901
+ const registrationConfig = Object.assign(Object.assign({}, metadata), { instantiate: function (injectionContext) {
2902
+ const resolveDependency = (options === null || options === void 0 ? void 0 : options.resolveDependency)
2903
+ ? (token) => options.resolveDependency(token, injectionContext)
2904
+ : null;
2905
+ return instantiate(type, resolveDependency);
2906
+ } });
2907
+ ConverterRegistry.register(registrationConfig);
2908
+ });
2909
+ }
2570
2910
  /**
2571
2911
  * @internal
2572
2912
  */
@@ -2578,7 +2918,12 @@ function registerRequestHandlers(types, options, remoteName) {
2578
2918
  resistantForEach(types, (type) => {
2579
2919
  const metadata = getRequestHandlerMetadata(type);
2580
2920
  let registrationConfig;
2581
- const createHandler = () => instantiate(type, options === null || options === void 0 ? void 0 : options.resolveDependency);
2921
+ const createHandler = (injectionContext) => {
2922
+ const resolveDependency = (options === null || options === void 0 ? void 0 : options.resolveDependency)
2923
+ ? (token) => options.resolveDependency(token, injectionContext)
2924
+ : null;
2925
+ return instantiate(type, resolveDependency);
2926
+ };
2582
2927
  if (options.moduleType === 'host') {
2583
2928
  registrationConfig = Object.assign(Object.assign({}, metadata), { source: { type: HandlerSourceType.Host }, createHandler });
2584
2929
  }
@@ -2612,6 +2957,9 @@ function _bootstrapCrtModule(name, type, options) {
2612
2957
  if (moduleDefinition.validators) {
2613
2958
  registerValidators(moduleDefinition.validators, options);
2614
2959
  }
2960
+ if (moduleDefinition.converters) {
2961
+ registerConverters(moduleDefinition.converters, options);
2962
+ }
2615
2963
  (_a = moduleDefinition.includes) === null || _a === void 0 ? void 0 : _a.forEach((t) => _bootstrapCrtModule(name, t, options));
2616
2964
  }
2617
2965
  catch (error) {
@@ -2687,14 +3035,50 @@ function _bootstrapCrtModuleHandlerChainServices(type) {
2687
3035
  if (moduleDefinition.handlerChainServices) {
2688
3036
  registerHandlerChainServices(moduleDefinition.handlerChainServices);
2689
3037
  }
2690
- (_a = moduleDefinition.includes) === null || _a === void 0 ? void 0 : _a.forEach((t) => _bootstrapCrtModuleHandlerChainServices(t));
3038
+ (_a = moduleDefinition.includes) === null || _a === void 0 ? void 0 : _a.forEach((t) => _bootstrapCrtModuleHandlerChainServices(t));
3039
+ }
3040
+ /**
3041
+ * @internal
3042
+ */
3043
+ function bootstrapCrtModuleHandlerChainServices(type) {
3044
+ _bootstrapCrtModuleHandlerChainServices(type);
3045
+ }
3046
+
3047
+ /**
3048
+ * @public
3049
+ * @abstract
3050
+ * @classdesc Class for designing request handlers.
3051
+ */
3052
+ class BaseRequestHandler {
3053
+ constructor() {
3054
+ this.handlerChain = HandlerChainService.instance;
3055
+ }
3056
+ get next() {
3057
+ return this._next;
3058
+ }
3059
+ /**
3060
+ * @internal
3061
+ */
3062
+ static [Symbol.hasInstance](instance) {
3063
+ var _a;
3064
+ return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === BaseRequestHandler._instanceOfKey;
3065
+ }
3066
+ /**
3067
+ * @description Method to set request handler to handler chain.
3068
+ * @param next - link for next request handler - {@link RequestHandler}
3069
+ */
3070
+ setNext(next) {
3071
+ if (this._next) {
3072
+ throw new NextHandlerAlreadySpecifiedException();
3073
+ }
3074
+ this._next = next;
3075
+ }
2691
3076
  }
2692
3077
  /**
2693
3078
  * @internal
3079
+ * @dontChange
2694
3080
  */
2695
- function bootstrapCrtModuleHandlerChainServices(type) {
2696
- _bootstrapCrtModuleHandlerChainServices(type);
2697
- }
3081
+ BaseRequestHandler._instanceOfKey = 'devkit_BaseRequestHandler';
2698
3082
 
2699
3083
  class BaseHandlerChainService {
2700
3084
  }
@@ -2891,6 +3275,27 @@ __decorate([
2891
3275
  __metadata("design:returntype", Object)
2892
3276
  ], HttpClientService.prototype, "patch", null);
2893
3277
 
3278
+ /**
3279
+ * @internal
3280
+ */
3281
+ var SchemaViewMaskRequestAction;
3282
+ (function (SchemaViewMaskRequestAction) {
3283
+ SchemaViewMaskRequestAction["AddTask"] = "addTask";
3284
+ SchemaViewMaskRequestAction["RemoveTask"] = "removeTask";
3285
+ })(SchemaViewMaskRequestAction || (SchemaViewMaskRequestAction = {}));
3286
+ /**
3287
+ * @internal
3288
+ */
3289
+ class SchemaViewMaskRequest extends BaseRequest {
3290
+ constructor(action, taskName, $context) {
3291
+ super();
3292
+ this.action = action;
3293
+ this.taskName = taskName;
3294
+ this.$context = $context;
3295
+ this.type = 'crt.SchemaViewMaskRequest';
3296
+ }
3297
+ }
3298
+
2894
3299
  /**
2895
3300
  * @public
2896
3301
  * @classdesc Service to working with mask using handler chain
@@ -2904,6 +3309,28 @@ class MaskService extends BaseHandlerChainService {
2904
3309
  */
2905
3310
  this.requestType = 'crt.MaskService';
2906
3311
  }
3312
+ /**
3313
+ * @internal
3314
+ * @param taskName
3315
+ * @param context
3316
+ */
3317
+ showMask(taskName, context) {
3318
+ return __awaiter(this, void 0, void 0, function* () {
3319
+ const request = new SchemaViewMaskRequest(SchemaViewMaskRequestAction.AddTask, taskName, context);
3320
+ yield HandlerChainService.instance.process(request);
3321
+ });
3322
+ }
3323
+ /**
3324
+ * @internal
3325
+ * @param taskName
3326
+ * @param context
3327
+ */
3328
+ hideMask(taskName, context) {
3329
+ return __awaiter(this, void 0, void 0, function* () {
3330
+ const request = new SchemaViewMaskRequest(SchemaViewMaskRequestAction.RemoveTask, taskName, context);
3331
+ yield HandlerChainService.instance.process(request);
3332
+ });
3333
+ }
2907
3334
  }
2908
3335
  __decorate([
2909
3336
  ImplementUsingHandlerChain(),
@@ -2990,232 +3417,9 @@ var ModelParameterType;
2990
3417
  ModelParameterType["Never"] = "never";
2991
3418
  })(ModelParameterType || (ModelParameterType = {}));
2992
3419
 
2993
- /**
2994
- * @public
2995
- * @abstract
2996
- * @classdesc Class for designing request handlers.
2997
- */
2998
- class BaseRequestHandler {
2999
- constructor() {
3000
- this.handlerChain = HandlerChainService.instance;
3001
- }
3002
- get next() {
3003
- return this._next;
3004
- }
3005
- /**
3006
- * @internal
3007
- */
3008
- static [Symbol.hasInstance](instance) {
3009
- var _a;
3010
- return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === BaseRequestHandler._instanceOfKey;
3011
- }
3012
- /**
3013
- * @description Method to set request handler to handler chain.
3014
- * @param next - link for next request handler - {@link RequestHandler}
3015
- */
3016
- setNext(next) {
3017
- if (this._next) {
3018
- throw new NextHandlerAlreadySpecifiedException();
3019
- }
3020
- this._next = next;
3021
- }
3022
- }
3023
- /**
3024
- * @internal
3025
- * @dontChange
3026
- */
3027
- BaseRequestHandler._instanceOfKey = 'devkit_BaseRequestHandler';
3028
-
3029
- /**
3030
- * @internal
3031
- */
3032
- class InterfaceDesignerItemRegistrationConfig {
3033
- }
3034
-
3035
- /**
3036
- * @internal
3037
- * @class MethodInvokeRequest
3038
- * @description Definition of invoke method request.
3039
- * @extends {BaseRequest} {@link BaseRequest}
3040
- * @property {string} method - method name.
3041
- * @property {unknown[]} args - arguments passing to the method.
3042
- */
3043
- class MethodInvokeRequest extends BaseRequest {
3044
- }
3045
-
3046
- /**
3047
- * @internal
3048
- */
3049
- function toAggregationType(aggregationFunction) {
3050
- switch (aggregationFunction) {
3051
- case AggregationFunction.Count:
3052
- return AggregationType.Count;
3053
- case AggregationFunction.Sum:
3054
- return AggregationType.Sum;
3055
- case AggregationFunction.Avg:
3056
- return AggregationType.Avg;
3057
- case AggregationFunction.Min:
3058
- return AggregationType.Min;
3059
- case AggregationFunction.Max:
3060
- return AggregationType.Max;
3061
- case AggregationFunction.TopOne:
3062
- return AggregationType.TopOne;
3063
- default:
3064
- return AggregationType.None;
3065
- }
3066
- }
3067
- /**
3068
- * @internal
3069
- */
3070
- function toAggregationFunction(aggregationType) {
3071
- switch (aggregationType) {
3072
- case AggregationType.Count:
3073
- return AggregationFunction.Count;
3074
- case AggregationType.Sum:
3075
- return AggregationFunction.Sum;
3076
- case AggregationType.Avg:
3077
- return AggregationFunction.Avg;
3078
- case AggregationType.Min:
3079
- return AggregationFunction.Min;
3080
- case AggregationType.Max:
3081
- return AggregationFunction.Max;
3082
- case AggregationType.TopOne:
3083
- return AggregationFunction.TopOne;
3084
- default:
3085
- return AggregationFunction.None;
3086
- }
3087
- }
3088
- /**
3089
- * @internal
3090
- */
3091
- function toAggregationEvalType(aggregationEval) {
3092
- switch (aggregationEval) {
3093
- case 'all':
3094
- return AggregationEvalType.All;
3095
- case 'distinct':
3096
- return AggregationEvalType.Distinct;
3097
- default:
3098
- return AggregationEvalType.None;
3099
- }
3100
- }
3101
- /**
3102
- * @internal
3103
- */
3104
- function toAggregationEval(aggregationEvalType) {
3105
- switch (aggregationEvalType) {
3106
- case AggregationEvalType.All:
3107
- return 'all';
3108
- case AggregationEvalType.Distinct:
3109
- return 'distinct';
3110
- default:
3111
- return 'none';
3112
- }
3113
- }
3114
-
3115
- /**
3116
- * @internal
3117
- */
3118
- function toDatePartType(aggregationFunction) {
3119
- switch (aggregationFunction) {
3120
- case 'minute':
3121
- return DatePartType.HourMinute;
3122
- case 'hour':
3123
- return DatePartType.Hour;
3124
- case 'day':
3125
- return DatePartType.Day;
3126
- case 'weekday':
3127
- return DatePartType.WeekDay;
3128
- case 'week':
3129
- return DatePartType.Week;
3130
- case 'month':
3131
- return DatePartType.Month;
3132
- case 'year':
3133
- return DatePartType.Year;
3134
- default:
3135
- return DatePartType.None;
3136
- }
3137
- }
3138
- /**
3139
- * @internal
3140
- */
3141
- function toDatePart(aggregationType) {
3142
- switch (aggregationType) {
3143
- case DatePartType.HourMinute:
3144
- return 'minute';
3145
- case DatePartType.Hour:
3146
- return 'hour';
3147
- case DatePartType.Day:
3148
- return 'day';
3149
- case DatePartType.WeekDay:
3150
- return 'weekday';
3151
- case DatePartType.Week:
3152
- return 'week';
3153
- case DatePartType.Month:
3154
- return 'month';
3155
- case DatePartType.Year:
3156
- return 'year';
3157
- default:
3158
- return 'none';
3159
- }
3160
- }
3161
-
3162
- /**
3163
- * @internal
3164
- */
3165
- function toStringFunctionType(functionType) {
3166
- switch (functionType) {
3167
- case FunctionType.Aggregation:
3168
- return 'aggregation';
3169
- case FunctionType.DatePart:
3170
- return 'datePart';
3171
- default:
3172
- return 'none';
3173
- }
3174
- }
3175
- /**
3176
- * @internal
3177
- */
3178
- function toNumericFunctionType(functionType) {
3179
- switch (functionType) {
3180
- case 'aggregation':
3181
- return FunctionType.Aggregation;
3182
- case 'datePart':
3183
- return FunctionType.DatePart;
3184
- default:
3185
- return FunctionType.None;
3186
- }
3187
- }
3188
-
3189
- /**
3190
- * @internal
3191
- */
3192
- function toOrderDirection(sortDirection) {
3193
- switch (sortDirection) {
3194
- case 'asc':
3195
- return OrderDirection.Asc;
3196
- case 'desc':
3197
- return OrderDirection.Desc;
3198
- default:
3199
- return OrderDirection.None;
3200
- }
3201
- }
3202
- /**
3203
- * @internal
3204
- */
3205
- function toSortDirection(orderDirection) {
3206
- switch (orderDirection) {
3207
- case OrderDirection.Asc:
3208
- return 'asc';
3209
- case OrderDirection.Desc:
3210
- return 'desc';
3211
- default:
3212
- return 'none';
3213
- }
3214
- }
3215
-
3216
3420
  /**
3217
3421
  * Generated bundle index. Do not edit.
3218
3422
  */
3219
3423
 
3220
- 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, 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, GlobalConvertersRegistryService, 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, RequestHandlerRegistryService, RequestRegistryService, RightsService, 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, generateGuid, getCrtInputsMetadata, getCrtOutputsMetadata, getCrtValidationInputsMetadata, getDesignTimeViewElementMetadata, getHandlerChainServiceMetadata, getInterfaceDesignerItemMetadata, getModuleMetadata, getRequestHandlerMetadata, getTypeDependencies, getValidatorMetadata, getViewElementMetadata, hasInterfaceDesignerItemMetadata, instantiate, interfaceDesignerItemRegistryKey, isComponentPropertyBindable, isEmptyGuid, isGuid, localize, objectDeepKeys, registerAngularViewElement, registerViewElement, setDesignTimeViewElementMetadata, setInterfaceDesignerItemMetadata, setModuleMetadata, setRequestHandlerMetadata, setValidatorMetadata, setViewElementMetadata, toAggregationEval, toAggregationEvalType, toAggregationFunction, toAggregationType, toDatePart, toDatePartType, toNumericFunctionType, toOrderDirection, toPascalCase, toSortDirection, toStringFunctionType, validatorRegistryKey, viewElementRegistryKey };
3424
+ 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, DataSchemaType, 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 };
3221
3425
  //# sourceMappingURL=creatio-devkit-common.mjs.map