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