@creatio-devkit/common 0.814.0 → 0.820.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 (271) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/esm2022/lib/base-exports.mjs +5 -0
  3. package/esm2022/lib/external/functions/aggregation-adapter.mjs +72 -0
  4. package/esm2022/lib/external/functions/date-part-type-adapter.mjs +48 -0
  5. package/esm2022/lib/external/functions/function-type-adapter.mjs +28 -0
  6. package/esm2022/lib/external/functions/order-direction-adapter.mjs +28 -0
  7. package/esm2022/lib/internal/decorators/design-time-view-element/design-time-view-element.decorator.mjs +17 -0
  8. package/{esm2020 → esm2022}/lib/internal/decorators/implement-using-handler-chain/implement-using-handler-chain.decorator.mjs +1 -1
  9. package/esm2022/lib/internal/models/design-time-view-element-registry-item.mjs +2 -0
  10. package/esm2022/lib/internal/models/internal-interface-designer-item-registration-config.model.mjs +2 -0
  11. package/esm2022/lib/internal/models/lazy-module-ref.mjs +26 -0
  12. package/esm2022/lib/internal/services/base-registry/base-registry.mjs +31 -0
  13. package/esm2022/lib/internal/services/bootstrap-notifier/bootstrap-notifier.mjs +28 -0
  14. package/esm2022/lib/internal/services/chat-message-type-registry/chat-message-type-registry.mjs +22 -0
  15. package/esm2022/lib/internal/services/design-time-view-element-registry/design-time-view-element-registry.mjs +32 -0
  16. package/esm2022/lib/internal/services/element-registration-checker/element-registration-checker.mjs +60 -0
  17. package/esm2022/lib/internal/services/global-converters-registry/converter-registry.mjs +32 -0
  18. package/esm2022/lib/internal/services/handler-chain-services-registry/handler-chain-services-registry.mjs +26 -0
  19. package/esm2022/lib/internal/services/interface-designer-item-registry/interface-designer-item-registry.mjs +28 -0
  20. package/esm2022/lib/internal/services/lazy-modules-manager/lazy-modules-manager.mjs +35 -0
  21. package/esm2022/lib/internal/services/pkg-topology-registry/pkg-topology-registry.mjs +18 -0
  22. package/{esm2020 → esm2022}/lib/internal/services/remote-entries-registry/remote-entries-registry.mjs +5 -5
  23. package/esm2022/lib/internal/services/request-handler-registry/request-handler-registry.service.mjs +106 -0
  24. package/esm2022/lib/internal/services/request-registry/request-registry.service.mjs +33 -0
  25. package/esm2022/lib/internal/services/validator-registry/validator-registry.mjs +42 -0
  26. package/esm2022/lib/internal/services/view-element-registry/view-element-registry.mjs +75 -0
  27. package/{esm2020 → esm2022}/lib/internal/utils/component-config-utils.mjs +1 -1
  28. package/esm2022/lib/internal/utils/handlers-order-comparer.mjs +42 -0
  29. package/{esm2020 → esm2022}/lib/internal/utils/index.mjs +2 -1
  30. package/esm2022/lib/internal/utils/instantiate.mjs +24 -0
  31. package/esm2022/lib/internal/utils/localization-utils.mjs +24 -0
  32. package/esm2022/lib/internal/utils/metadata-utils.mjs +208 -0
  33. package/esm2022/lib/internal/utils/module-utils.mjs +38 -0
  34. package/esm2022/lib/internal/utils/object-deep-keys/object-deep-keys.mjs +13 -0
  35. package/{esm2020 → esm2022}/lib/internal/utils/request-handler-scopes.mjs +1 -1
  36. package/esm2022/lib/public/decorators/converter/converter.decorator.mjs +21 -0
  37. package/esm2022/lib/public/decorators/input/input.decorator.mjs +25 -0
  38. package/esm2022/lib/public/decorators/interface-designer-item/interface-designer-item.decorator.mjs +23 -0
  39. package/esm2022/lib/public/decorators/request-handler/request-handler.decorator.mjs +22 -0
  40. package/esm2022/lib/public/decorators/validator/validator.decorator.mjs +25 -0
  41. package/{esm2020 → esm2022}/lib/public/decorators/view-element/view-element.decorator.mjs +2 -2
  42. package/esm2022/lib/public/functions/bootstrap-crt-module-handler-chain-services.mjs +32 -0
  43. package/esm2022/lib/public/functions/bootstrap-crt-module.mjs +303 -0
  44. package/esm2022/lib/public/functions/bootstrapped-crt-modules.mjs +8 -0
  45. package/esm2022/lib/public/functions/crt-module-context-hooks.mjs +30 -0
  46. package/esm2022/lib/public/handlers/base-request-handler.mjs +37 -0
  47. package/{esm2020 → esm2022}/lib/public/models/item-creation-config.mjs +1 -1
  48. package/{esm2020 → esm2022}/lib/public/models/localizable-value.mjs +6 -6
  49. package/esm2022/lib/public/models/module-definition.mjs +2 -0
  50. package/{esm2020 → esm2022}/lib/public/models/request/handle-view-model-attribute-change.request.mjs +1 -1
  51. package/esm2022/lib/public/models/validation/base-validator.mjs +40 -0
  52. package/esm2022/lib/public/models/view-element/base-view-element-registration-config.mjs +2 -0
  53. package/{esm2020 → esm2022}/lib/public/models/view-element/index.mjs +2 -2
  54. package/esm2022/lib/public/models/view-element/view-element-render-strategy.mjs +16 -0
  55. package/{esm2020 → esm2022}/lib/public/services/crt-zone/crt-zone.service.mjs +1 -1
  56. package/{esm2020 → esm2022}/lib/public/services/dialog-service/dialog.service.mjs +1 -1
  57. package/{esm2020 → esm2022}/lib/public/services/feature/feature.service.mjs +1 -1
  58. package/esm2022/lib/public/services/handler-chain/handler-chain.service.mjs +71 -0
  59. package/esm2022/lib/public/services/handler-chain/internal-handler-chain.mjs +195 -0
  60. package/{esm2020 → esm2022}/lib/public/services/http-client/http-client.service.mjs +1 -1
  61. package/{esm2020 → esm2022}/lib/public/services/index.mjs +2 -1
  62. package/esm2022/lib/public/services/license/license.service.mjs +30 -0
  63. package/{esm2020 → esm2022}/lib/public/services/mask-service/mask.service.mjs +1 -1
  64. package/esm2022/lib/public/services/message-channel/index.mjs +2 -0
  65. package/esm2022/lib/public/services/message-channel/message-channel.service.mjs +27 -0
  66. package/esm2022/lib/public/services/model/model.mjs +85 -0
  67. package/{esm2020 → esm2022}/lib/public/services/rights/rights.service.mjs +1 -1
  68. package/{esm2020 → esm2022}/lib/public/services/sys-settings/sys-settings.service.mjs +1 -1
  69. package/esm2022/lib/public/services/sys-values/sys-values.mjs +2 -0
  70. package/{esm2020 → esm2022}/lib/public/services/sys-values/sys-values.service.mjs +1 -1
  71. package/{fesm2020 → fesm2022}/creatio-devkit-common.mjs +416 -325
  72. package/fesm2022/creatio-devkit-common.mjs.map +1 -0
  73. package/index.d.ts +81 -25
  74. package/package.json +8 -17
  75. package/esm2020/lib/base-exports.mjs +0 -4
  76. package/esm2020/lib/external/functions/aggregation-adapter.mjs +0 -72
  77. package/esm2020/lib/external/functions/date-part-type-adapter.mjs +0 -48
  78. package/esm2020/lib/external/functions/function-type-adapter.mjs +0 -28
  79. package/esm2020/lib/external/functions/order-direction-adapter.mjs +0 -28
  80. package/esm2020/lib/internal/decorators/design-time-view-element/design-time-view-element.decorator.mjs +0 -15
  81. package/esm2020/lib/internal/models/design-time-view-element-registry-item.mjs +0 -2
  82. package/esm2020/lib/internal/models/internal-interface-designer-item-registration-config.model.mjs +0 -2
  83. package/esm2020/lib/internal/models/lazy-module-ref.mjs +0 -26
  84. package/esm2020/lib/internal/services/base-registry/base-registry.mjs +0 -31
  85. package/esm2020/lib/internal/services/bootstrap-notifier/bootstrap-notifier.mjs +0 -28
  86. package/esm2020/lib/internal/services/chat-message-type-registry/chat-message-type-registry.mjs +0 -22
  87. package/esm2020/lib/internal/services/design-time-view-element-registry/design-time-view-element-registry.mjs +0 -32
  88. package/esm2020/lib/internal/services/element-registration-checker/element-registration-checker.mjs +0 -60
  89. package/esm2020/lib/internal/services/global-converters-registry/converter-registry.mjs +0 -32
  90. package/esm2020/lib/internal/services/handler-chain-services-registry/handler-chain-services-registry.mjs +0 -26
  91. package/esm2020/lib/internal/services/interface-designer-item-registry/interface-designer-item-registry.mjs +0 -28
  92. package/esm2020/lib/internal/services/lazy-modules-manager/lazy-modules-manager.mjs +0 -35
  93. package/esm2020/lib/internal/services/pkg-topology-registry/pkg-topology-registry.mjs +0 -18
  94. package/esm2020/lib/internal/services/request-handler-registry/request-handler-registry.service.mjs +0 -106
  95. package/esm2020/lib/internal/services/request-registry/request-registry.service.mjs +0 -33
  96. package/esm2020/lib/internal/services/validator-registry/validator-registry.mjs +0 -42
  97. package/esm2020/lib/internal/services/view-element-registry/view-element-registry.mjs +0 -60
  98. package/esm2020/lib/internal/utils/handlers-order-comparer.mjs +0 -42
  99. package/esm2020/lib/internal/utils/instantiate.mjs +0 -24
  100. package/esm2020/lib/internal/utils/localization-utils.mjs +0 -24
  101. package/esm2020/lib/internal/utils/metadata-utils.mjs +0 -208
  102. package/esm2020/lib/internal/utils/object-deep-keys/object-deep-keys.mjs +0 -13
  103. package/esm2020/lib/public/decorators/converter/converter.decorator.mjs +0 -21
  104. package/esm2020/lib/public/decorators/input/input.decorator.mjs +0 -25
  105. package/esm2020/lib/public/decorators/interface-designer-item/interface-designer-item.decorator.mjs +0 -23
  106. package/esm2020/lib/public/decorators/request-handler/request-handler.decorator.mjs +0 -22
  107. package/esm2020/lib/public/decorators/validator/validator.decorator.mjs +0 -25
  108. package/esm2020/lib/public/functions/bootstrap-crt-module-handler-chain-services.mjs +0 -32
  109. package/esm2020/lib/public/functions/bootstrap-crt-module.mjs +0 -303
  110. package/esm2020/lib/public/functions/bootstrapped-crt-modules.mjs +0 -9
  111. package/esm2020/lib/public/functions/crt-module-context-hooks.mjs +0 -30
  112. package/esm2020/lib/public/handlers/base-request-handler.mjs +0 -37
  113. package/esm2020/lib/public/models/module-definition.mjs +0 -2
  114. package/esm2020/lib/public/models/validation/base-validator.mjs +0 -40
  115. package/esm2020/lib/public/models/view-element/base-view-element-registration-config.mjs +0 -2
  116. package/esm2020/lib/public/models/view-element/view-element-visibility-strategy.mjs +0 -16
  117. package/esm2020/lib/public/services/handler-chain/handler-chain.service.mjs +0 -71
  118. package/esm2020/lib/public/services/handler-chain/internal-handler-chain.mjs +0 -190
  119. package/esm2020/lib/public/services/license/license.service.mjs +0 -22
  120. package/esm2020/lib/public/services/model/model.mjs +0 -85
  121. package/esm2020/lib/public/services/sys-values/sys-values.mjs +0 -2
  122. package/esm2020/lib/public/types/index.mjs +0 -2
  123. package/esm2020/lib/public/types/teardown-logic.type.mjs +0 -2
  124. package/fesm2015/creatio-devkit-common.mjs +0 -2710
  125. package/fesm2015/creatio-devkit-common.mjs.map +0 -1
  126. package/fesm2020/creatio-devkit-common.mjs.map +0 -1
  127. /package/{esm2020 → esm2022}/creatio-devkit-common.mjs +0 -0
  128. /package/{esm2020 → esm2022}/index.mjs +0 -0
  129. /package/{esm2020 → esm2022}/lib/external/functions/index.mjs +0 -0
  130. /package/{esm2020 → esm2022}/lib/external/models/attribute-value-config.mjs +0 -0
  131. /package/{esm2020 → esm2022}/lib/external/models/date-time/grouped-date-value.mjs +0 -0
  132. /package/{esm2020 → esm2022}/lib/external/models/date-time/index.mjs +0 -0
  133. /package/{esm2020 → esm2022}/lib/external/models/file-value.model.mjs +0 -0
  134. /package/{esm2020 → esm2022}/lib/external/models/index.mjs +0 -0
  135. /package/{esm2020 → esm2022}/lib/index.mjs +0 -0
  136. /package/{esm2020 → esm2022}/lib/internal/constants/default-size.const.mjs +0 -0
  137. /package/{esm2020 → esm2022}/lib/internal/constants/index.mjs +0 -0
  138. /package/{esm2020 → esm2022}/lib/internal/constants/metadata.const.mjs +0 -0
  139. /package/{esm2020 → esm2022}/lib/internal/decorators/design-time-view-element/index.mjs +0 -0
  140. /package/{esm2020 → esm2022}/lib/internal/decorators/implement-using-handler-chain/index.mjs +0 -0
  141. /package/{esm2020 → esm2022}/lib/internal/decorators/index.mjs +0 -0
  142. /package/{esm2020 → esm2022}/lib/internal/decorators/request/index.mjs +0 -0
  143. /package/{esm2020 → esm2022}/lib/internal/decorators/request/request.decorator.mjs +0 -0
  144. /package/{esm2020 → esm2022}/lib/internal/enums/designer-group-type.enum.mjs +0 -0
  145. /package/{esm2020 → esm2022}/lib/internal/enums/handler-source-type.enum.mjs +0 -0
  146. /package/{esm2020 → esm2022}/lib/internal/enums/index.mjs +0 -0
  147. /package/{esm2020 → esm2022}/lib/internal/enums/view-element-group-type.enum.mjs +0 -0
  148. /package/{esm2020 → esm2022}/lib/internal/models/attribute-property-config.interface.mjs +0 -0
  149. /package/{esm2020 → esm2022}/lib/internal/models/converter/converter-registry-item.mjs +0 -0
  150. /package/{esm2020 → esm2022}/lib/internal/models/converter/index.mjs +0 -0
  151. /package/{esm2020 → esm2022}/lib/internal/models/handler-chain-service-registry-item.mjs +0 -0
  152. /package/{esm2020 → esm2022}/lib/internal/models/index.mjs +0 -0
  153. /package/{esm2020 → esm2022}/lib/internal/models/injection-context/index.mjs +0 -0
  154. /package/{esm2020 → esm2022}/lib/internal/models/injection-context/injection-context.mjs +0 -0
  155. /package/{esm2020 → esm2022}/lib/internal/models/interface-designer-item/base-interface-designer-item-registration-config.mjs +0 -0
  156. /package/{esm2020 → esm2022}/lib/internal/models/interface-designer-item/index.mjs +0 -0
  157. /package/{esm2020 → esm2022}/lib/internal/models/interface-designer-item/interface-designer-item-registration-config.model.mjs +0 -0
  158. /package/{esm2020 → esm2022}/lib/internal/models/interface-designer-item/toolbar-view-element-config.mjs +0 -0
  159. /package/{esm2020 → esm2022}/lib/internal/models/interface-designer-registry-item.mjs +0 -0
  160. /package/{esm2020 → esm2022}/lib/internal/models/internal-module-definition.mjs +0 -0
  161. /package/{esm2020 → esm2022}/lib/internal/models/lazy-module-metadata.mjs +0 -0
  162. /package/{esm2020 → esm2022}/lib/internal/models/lazy-registry-item.mjs +0 -0
  163. /package/{esm2020 → esm2022}/lib/internal/models/remote-build-info.mjs +0 -0
  164. /package/{esm2020 → esm2022}/lib/internal/models/request/index.mjs +0 -0
  165. /package/{esm2020 → esm2022}/lib/internal/models/request/method-invoke-request.mjs +0 -0
  166. /package/{esm2020 → esm2022}/lib/internal/models/request-handler/contexed-handler-scope-config.mjs +0 -0
  167. /package/{esm2020 → esm2022}/lib/internal/models/request-handler/handler-config.mjs +0 -0
  168. /package/{esm2020 → esm2022}/lib/internal/models/request-handler/handler-source.mjs +0 -0
  169. /package/{esm2020 → esm2022}/lib/internal/models/request-handler/index.mjs +0 -0
  170. /package/{esm2020 → esm2022}/lib/internal/models/request-handler/request-handler-factory.mjs +0 -0
  171. /package/{esm2020 → esm2022}/lib/internal/models/request-handler/request-handler-registration-config.model.mjs +0 -0
  172. /package/{esm2020 → esm2022}/lib/internal/models/validator/index.mjs +0 -0
  173. /package/{esm2020 → esm2022}/lib/internal/models/validator/validator-parameters.mjs +0 -0
  174. /package/{esm2020 → esm2022}/lib/internal/models/validator/validator-registry-item.mjs +0 -0
  175. /package/{esm2020 → esm2022}/lib/internal/models/validator/validator-schema-config.model.mjs +0 -0
  176. /package/{esm2020 → esm2022}/lib/internal/models/view-element/angular-view-element-registration-config.model.mjs +0 -0
  177. /package/{esm2020 → esm2022}/lib/internal/models/view-element/index.mjs +0 -0
  178. /package/{esm2020 → esm2022}/lib/internal/models/view-element-registry-item.mjs +0 -0
  179. /package/{esm2020 → esm2022}/lib/internal/services/base-handler-chain.service.mjs +0 -0
  180. /package/{esm2020 → esm2022}/lib/internal/services/base-registry/index.mjs +0 -0
  181. /package/{esm2020 → esm2022}/lib/internal/services/bootstrap-notifier/index.mjs +0 -0
  182. /package/{esm2020 → esm2022}/lib/internal/services/chat-message-type-registry/index.mjs +0 -0
  183. /package/{esm2020 → esm2022}/lib/internal/services/design-time-view-element-registry/index.mjs +0 -0
  184. /package/{esm2020 → esm2022}/lib/internal/services/element-registration-checker/index.mjs +0 -0
  185. /package/{esm2020 → esm2022}/lib/internal/services/global-converters-registry/index.mjs +0 -0
  186. /package/{esm2020 → esm2022}/lib/internal/services/handler-chain-services-registry/index.mjs +0 -0
  187. /package/{esm2020 → esm2022}/lib/internal/services/index.mjs +0 -0
  188. /package/{esm2020 → esm2022}/lib/internal/services/interface-designer-item-registry/index.mjs +0 -0
  189. /package/{esm2020 → esm2022}/lib/internal/services/lazy-modules-manager/index.mjs +0 -0
  190. /package/{esm2020 → esm2022}/lib/internal/services/pkg-topology-registry/index.mjs +0 -0
  191. /package/{esm2020 → esm2022}/lib/internal/services/remote-entries-registry/index.mjs +0 -0
  192. /package/{esm2020 → esm2022}/lib/internal/services/request-handler-registry/index.mjs +0 -0
  193. /package/{esm2020 → esm2022}/lib/internal/services/request-registry/index.mjs +0 -0
  194. /package/{esm2020 → esm2022}/lib/internal/services/validator-registry/index.mjs +0 -0
  195. /package/{esm2020 → esm2022}/lib/internal/services/view-element-registry/index.mjs +0 -0
  196. /package/{esm2020 → esm2022}/lib/internal/types/index.mjs +0 -0
  197. /package/{esm2020 → esm2022}/lib/internal/types/internal-resolve-dependency-fn.type.mjs +0 -0
  198. /package/{esm2020 → esm2022}/lib/internal/types/localizable-values.type.mjs +0 -0
  199. /package/{esm2020 → esm2022}/lib/internal/utils/object-deep-keys/index.mjs +0 -0
  200. /package/{esm2020 → esm2022}/lib/public/decorators/chat-message-type/chat-message-type.decorator.mjs +0 -0
  201. /package/{esm2020 → esm2022}/lib/public/decorators/chat-message-type/index.mjs +0 -0
  202. /package/{esm2020 → esm2022}/lib/public/decorators/converter/index.mjs +0 -0
  203. /package/{esm2020 → esm2022}/lib/public/decorators/index.mjs +0 -0
  204. /package/{esm2020 → esm2022}/lib/public/decorators/inject/index.mjs +0 -0
  205. /package/{esm2020 → esm2022}/lib/public/decorators/inject/inject.decorator.mjs +0 -0
  206. /package/{esm2020 → esm2022}/lib/public/decorators/input/index.mjs +0 -0
  207. /package/{esm2020 → esm2022}/lib/public/decorators/interface-designer-item/index.mjs +0 -0
  208. /package/{esm2020 → esm2022}/lib/public/decorators/module/index.mjs +0 -0
  209. /package/{esm2020 → esm2022}/lib/public/decorators/module/module.decorator.mjs +0 -0
  210. /package/{esm2020 → esm2022}/lib/public/decorators/output/index.mjs +0 -0
  211. /package/{esm2020 → esm2022}/lib/public/decorators/output/output.decorator.mjs +0 -0
  212. /package/{esm2020 → esm2022}/lib/public/decorators/request-handler/index.mjs +0 -0
  213. /package/{esm2020 → esm2022}/lib/public/decorators/validation-input/index.mjs +0 -0
  214. /package/{esm2020 → esm2022}/lib/public/decorators/validation-input/validation-input.decorator.mjs +0 -0
  215. /package/{esm2020 → esm2022}/lib/public/decorators/validator/index.mjs +0 -0
  216. /package/{esm2020 → esm2022}/lib/public/decorators/view-element/index.mjs +0 -0
  217. /package/{esm2020 → esm2022}/lib/public/enums/data-source-load-type.enum.mjs +0 -0
  218. /package/{esm2020 → esm2022}/lib/public/enums/index.mjs +0 -0
  219. /package/{esm2020 → esm2022}/lib/public/enums/view-element-property.enum.mjs +0 -0
  220. /package/{esm2020 → esm2022}/lib/public/functions/index.mjs +0 -0
  221. /package/{esm2020 → esm2022}/lib/public/functions/localize.mjs +0 -0
  222. /package/{esm2020 → esm2022}/lib/public/functions/register-angular-view-element.mjs +0 -0
  223. /package/{esm2020 → esm2022}/lib/public/functions/register-view-element.mjs +0 -0
  224. /package/{esm2020 → esm2022}/lib/public/functions/reset-globals.mjs +0 -0
  225. /package/{esm2020 → esm2022}/lib/public/handlers/index.mjs +0 -0
  226. /package/{esm2020 → esm2022}/lib/public/models/base-response.model.mjs +0 -0
  227. /package/{esm2020 → esm2022}/lib/public/models/converter/converter-config.mjs +0 -0
  228. /package/{esm2020 → esm2022}/lib/public/models/converter/index.mjs +0 -0
  229. /package/{esm2020 → esm2022}/lib/public/models/converter.model.mjs +0 -0
  230. /package/{esm2020 → esm2022}/lib/public/models/entity.model.mjs +0 -0
  231. /package/{esm2020 → esm2022}/lib/public/models/error-info.model.mjs +0 -0
  232. /package/{esm2020 → esm2022}/lib/public/models/image-value.model.mjs +0 -0
  233. /package/{esm2020 → esm2022}/lib/public/models/index.mjs +0 -0
  234. /package/{esm2020 → esm2022}/lib/public/models/input/index.mjs +0 -0
  235. /package/{esm2020 → esm2022}/lib/public/models/input/input-registration-config.model.mjs +0 -0
  236. /package/{esm2020 → esm2022}/lib/public/models/interface-designer-item/index.mjs +0 -0
  237. /package/{esm2020 → esm2022}/lib/public/models/interface-designer-item/interface-designer-item-definition.mjs +0 -0
  238. /package/{esm2020 → esm2022}/lib/public/models/license/index.mjs +0 -0
  239. /package/{esm2020 → esm2022}/lib/public/models/license/license-restriction-operation-values.model.mjs +0 -0
  240. /package/{esm2020 → esm2022}/lib/public/models/mask-settings.mjs +0 -0
  241. /package/{esm2020 → esm2022}/lib/public/models/request/base-request-config.mjs +0 -0
  242. /package/{esm2020 → esm2022}/lib/public/models/request/data-source-request.mjs +0 -0
  243. /package/{esm2020 → esm2022}/lib/public/models/request/index.mjs +0 -0
  244. /package/{esm2020 → esm2022}/lib/public/models/request/model-event.model.mjs +0 -0
  245. /package/{esm2020 → esm2022}/lib/public/models/request/view-model-attribute-change-event-options.mjs +0 -0
  246. /package/{esm2020 → esm2022}/lib/public/models/request-handler/index.mjs +0 -0
  247. /package/{esm2020 → esm2022}/lib/public/models/request-handler/request-handler-definition.mjs +0 -0
  248. /package/{esm2020 → esm2022}/lib/public/models/validation/crt-control-state.mjs +0 -0
  249. /package/{esm2020 → esm2022}/lib/public/models/validation/crt-validation-errors.mjs +0 -0
  250. /package/{esm2020 → esm2022}/lib/public/models/validation/crt-validator-fn.mjs +0 -0
  251. /package/{esm2020 → esm2022}/lib/public/models/validation/index.mjs +0 -0
  252. /package/{esm2020 → esm2022}/lib/public/models/validation/validation-info.mjs +0 -0
  253. /package/{esm2020 → esm2022}/lib/public/models/validation/validator-config.mjs +0 -0
  254. /package/{esm2020 → esm2022}/lib/public/models/validation/validator-parameter-values.mjs +0 -0
  255. /package/{esm2020 → esm2022}/lib/public/models/view-element/view-element-registration-config.mjs +0 -0
  256. /package/{esm2020 → esm2022}/lib/public/models/view-element/view-element-reuse-strategy.enum.mjs +0 -0
  257. /package/{esm2020 → esm2022}/lib/public/models/view-element/view-element-slot-definition.mjs +0 -0
  258. /package/{esm2020 → esm2022}/lib/public/services/crt-zone/index.mjs +0 -0
  259. /package/{esm2020 → esm2022}/lib/public/services/dialog-service/index.mjs +0 -0
  260. /package/{esm2020 → esm2022}/lib/public/services/feature/index.mjs +0 -0
  261. /package/{esm2020 → esm2022}/lib/public/services/handler-chain/index.mjs +0 -0
  262. /package/{esm2020 → esm2022}/lib/public/services/http-client/http-headers.mjs +0 -0
  263. /package/{esm2020 → esm2022}/lib/public/services/http-client/http-response.mjs +0 -0
  264. /package/{esm2020 → esm2022}/lib/public/services/http-client/index.mjs +0 -0
  265. /package/{esm2020 → esm2022}/lib/public/services/license/index.mjs +0 -0
  266. /package/{esm2020 → esm2022}/lib/public/services/mask-service/index.mjs +0 -0
  267. /package/{esm2020 → esm2022}/lib/public/services/model/index.mjs +0 -0
  268. /package/{esm2020 → esm2022}/lib/public/services/rights/index.mjs +0 -0
  269. /package/{esm2020 → esm2022}/lib/public/services/sys-settings/index.mjs +0 -0
  270. /package/{esm2020 → esm2022}/lib/public/services/sys-settings/sys-setting.model.mjs +0 -0
  271. /package/{esm2020 → esm2022}/lib/public/services/sys-values/index.mjs +0 -0
@@ -1,2710 +0,0 @@
1
- import { ɵAggregationType, ɵAggregationFunction, ɵAggregationEvalType, ɵDatePartType, ɵFunctionType, ɵOrderDirection, ɵgenerateGuid, ɵNextHandlerAlreadySpecifiedException, ɵBaseRequest, ɵSchemaViewMaskRequest, ɵSchemaViewMaskRequestAction } from '@creatio/base';
2
- export { ɵAggregationEvalType as AggregationEvalType, ɵAggregationFunction as AggregationFunction, ɵAggregationFunctionColumn as AggregationFunctionColumn, ɵAggregationFunctionExpression as AggregationFunctionExpression, ɵAggregationSubQueryColumn as AggregationSubQueryColumn, ɵAggregationSubQueryExpression as AggregationSubQueryExpression, ɵAggregationType as AggregationType, ɵArgumentEmptyException as ArgumentEmptyException, ɵArgumentFunctionExpression as ArgumentFunctionExpression, ɵArgumentOutOfRangeException as ArgumentOutOfRangeException, ɵArithmeticExpression as ArithmeticExpression, ɵArithmeticOperation as ArithmeticOperation, ɵArithmeticQueryColumn as ArithmeticQueryColumn, ɵBaseExpression as BaseExpression, ɵBaseExpressionParser as BaseExpressionParser, ɵBaseFilter as BaseFilter, ɵBaseFilterParser as BaseFilterParser, ɵBaseFilterableQuery as BaseFilterableQuery, ɵBaseQuery as BaseQuery, ɵBaseQueryColumn as BaseQueryColumn, ɵBaseRequest as BaseRequest, ɵBetweenFilter as BetweenFilter, ɵColumnExpression as ColumnExpression, ɵCompareFilter as CompareFilter, ɵComparisonType as ComparisonType, ɵDEFAULT_COLUMN_PLAIN_OBJ as DEFAULT_COLUMN_PLAIN_OBJ, ɵDEFAULT_FILTER_PLAIN_OBJ as DEFAULT_FILTER_PLAIN_OBJ, ɵDataSchemaAttributeType as DataSchemaAttributeType, ɵDataSchemaAttributeUsageType as DataSchemaAttributeUsageType, ɵDataSchemaType as DataSchemaType, ɵDataSourceScope as DataSourceScope, ɵDataValueType as DataValueType, ɵDatePartFunctionColumn as DatePartFunctionColumn, ɵDatePartFunctionExpression as DatePartFunctionExpression, ɵDatePartType as DatePartType, ɵDefaultValueSource as DefaultValueSource, ɵDeleteQuery as DeleteQuery, ɵEMPTY_GUID as EMPTY_GUID, ɵEntityQueryColumn as EntityQueryColumn, ɵEntitySchemaQuery as EntitySchemaQuery, ɵExistsFilter as ExistsFilter, ɵExpressionMock as ExpressionMock, ɵExpressionParser as ExpressionParser, ɵExpressionResolver as ExpressionResolver, ɵExpressionType as ExpressionType, ɵFilterGroup as FilterGroup, ɵFilterMock as FilterMock, ɵFilterParser as FilterParser, ɵFilterResolver as FilterResolver, ɵFilterType as FilterType, ɵFunctionExpression as FunctionExpression, ɵFunctionType as FunctionType, ɵInFilter as InFilter, ɵInsertQuery as InsertQuery, ɵIsNullFilter as IsNullFilter, ɵItemNotFoundException as ItemNotFoundException, ɵLengthFunctionColumn as LengthFunctionColumn, ɵLengthFunctionExpression as LengthFunctionExpression, ɵLogicalOperatorType as LogicalOperatorType, ɵMacrosFunctionColumn as MacrosFunctionColumn, ɵMacrosFunctionExpression as MacrosFunctionExpression, ɵModelInPageAction as ModelInPageAction, ɵModelParameterType as ModelParameterType, ɵNextHandlerAlreadySpecifiedException as NextHandlerAlreadySpecifiedException, ɵOrderDirection as OrderDirection, ɵParameterExpression as ParameterExpression, ɵParameterQueryColumn as ParameterQueryColumn, ɵPlatformAPIs as PlatformAPIs, ɵQueryMacrosType as QueryMacrosType, ɵQueryOperationType as QueryOperationType, ɵSchemaViewMaskRequest as SchemaViewMaskRequest, ɵSchemaViewMaskRequestAction as SchemaViewMaskRequestAction, ɵSelectLocalizationQuery as SelectLocalizationQuery, ɵSingleFilter as SingleFilter, ɵSubQueryColumn as SubQueryColumn, ɵSubQueryExpression as SubQueryExpression, ɵUpdateQuery as UpdateQuery, ɵValidationUtilities as ValidationUtilities, ɵWindowFunctionColumn as WindowFunctionColumn, ɵWindowFunctionExpression as WindowFunctionExpression, ɵencodeDate as encodeDate, ɵgenerateGuid as generateGuid, ɵgetColumnPlainObj as getColumnPlainObj, ɵgetFilterPlainObj as getFilterPlainObj, ɵisEmptyGuid as isEmptyGuid, ɵisGuid as isGuid, ɵparserMock as parserMock, ɵtoLocalISOString as toLocalISOString } from '@creatio/base';
3
- import { __awaiter, __decorate, __metadata } from 'tslib';
4
- import { get, set, upperFirst, camelCase, isEqual, cloneDeep } from 'lodash';
5
- import 'reflect-metadata';
6
-
7
- /**
8
- * @internal
9
- */
10
- function toAggregationType(aggregationFunction) {
11
- switch (aggregationFunction) {
12
- case ɵAggregationFunction.Count:
13
- return ɵAggregationType.Count;
14
- case ɵAggregationFunction.Sum:
15
- return ɵAggregationType.Sum;
16
- case ɵAggregationFunction.Avg:
17
- return ɵAggregationType.Avg;
18
- case ɵAggregationFunction.Min:
19
- return ɵAggregationType.Min;
20
- case ɵAggregationFunction.Max:
21
- return ɵAggregationType.Max;
22
- case ɵAggregationFunction.TopOne:
23
- return ɵAggregationType.TopOne;
24
- default:
25
- return ɵAggregationType.None;
26
- }
27
- }
28
- /**
29
- * @internal
30
- */
31
- function toAggregationFunction(aggregationType) {
32
- switch (aggregationType) {
33
- case ɵAggregationType.Count:
34
- return ɵAggregationFunction.Count;
35
- case ɵAggregationType.Sum:
36
- return ɵAggregationFunction.Sum;
37
- case ɵAggregationType.Avg:
38
- return ɵAggregationFunction.Avg;
39
- case ɵAggregationType.Min:
40
- return ɵAggregationFunction.Min;
41
- case ɵAggregationType.Max:
42
- return ɵAggregationFunction.Max;
43
- case ɵAggregationType.TopOne:
44
- return ɵAggregationFunction.TopOne;
45
- default:
46
- return ɵAggregationFunction.None;
47
- }
48
- }
49
- /**
50
- * @internal
51
- */
52
- function toAggregationEvalType(aggregationEval) {
53
- switch (aggregationEval) {
54
- case 'all':
55
- return ɵAggregationEvalType.All;
56
- case 'distinct':
57
- return ɵAggregationEvalType.Distinct;
58
- default:
59
- return ɵAggregationEvalType.None;
60
- }
61
- }
62
- /**
63
- * @internal
64
- */
65
- function toAggregationEval(aggregationEvalType) {
66
- switch (aggregationEvalType) {
67
- case ɵAggregationEvalType.All:
68
- return 'all';
69
- case ɵAggregationEvalType.Distinct:
70
- return 'distinct';
71
- default:
72
- return 'none';
73
- }
74
- }
75
-
76
- /**
77
- * @internal
78
- */
79
- function toDatePartType(aggregationFunction) {
80
- switch (aggregationFunction) {
81
- case 'minute':
82
- return ɵDatePartType.HourMinute;
83
- case 'hour':
84
- return ɵDatePartType.Hour;
85
- case 'day':
86
- return ɵDatePartType.Day;
87
- case 'weekday':
88
- return ɵDatePartType.WeekDay;
89
- case 'week':
90
- return ɵDatePartType.Week;
91
- case 'month':
92
- return ɵDatePartType.Month;
93
- case 'year':
94
- return ɵDatePartType.Year;
95
- default:
96
- return ɵDatePartType.None;
97
- }
98
- }
99
- /**
100
- * @internal
101
- */
102
- function toDatePart(aggregationType) {
103
- switch (aggregationType) {
104
- case ɵDatePartType.HourMinute:
105
- return 'minute';
106
- case ɵDatePartType.Hour:
107
- return 'hour';
108
- case ɵDatePartType.Day:
109
- return 'day';
110
- case ɵDatePartType.WeekDay:
111
- return 'weekday';
112
- case ɵDatePartType.Week:
113
- return 'week';
114
- case ɵDatePartType.Month:
115
- return 'month';
116
- case ɵDatePartType.Year:
117
- return 'year';
118
- default:
119
- return 'none';
120
- }
121
- }
122
-
123
- /**
124
- * @internal
125
- */
126
- function toStringFunctionType(functionType) {
127
- switch (functionType) {
128
- case ɵFunctionType.Aggregation:
129
- return 'aggregation';
130
- case ɵFunctionType.DatePart:
131
- return 'datePart';
132
- default:
133
- return 'none';
134
- }
135
- }
136
- /**
137
- * @internal
138
- */
139
- function toNumericFunctionType(functionType) {
140
- switch (functionType) {
141
- case 'aggregation':
142
- return ɵFunctionType.Aggregation;
143
- case 'datePart':
144
- return ɵFunctionType.DatePart;
145
- default:
146
- return ɵFunctionType.None;
147
- }
148
- }
149
-
150
- /**
151
- * @internal
152
- */
153
- function toOrderDirection(sortDirection) {
154
- switch (sortDirection) {
155
- case 'asc':
156
- return ɵOrderDirection.Asc;
157
- case 'desc':
158
- return ɵOrderDirection.Desc;
159
- default:
160
- return ɵOrderDirection.None;
161
- }
162
- }
163
- /**
164
- * @internal
165
- */
166
- function toSortDirection(orderDirection) {
167
- switch (orderDirection) {
168
- case ɵOrderDirection.Asc:
169
- return 'asc';
170
- case ɵOrderDirection.Desc:
171
- return 'desc';
172
- default:
173
- return 'none';
174
- }
175
- }
176
-
177
- /**
178
- * @internal
179
- */
180
- const crtInputPrefix = 'crtInput:';
181
- /**
182
- * @internal
183
- */
184
- const crtOutputPrefix = 'crtOutput:';
185
- /**
186
- * @internal
187
- */
188
- const crtValidationInputPrefix = 'crtValidationInput:';
189
- /**
190
- * @internal
191
- */
192
- const crtInjectPrefix = 'crtInject:';
193
-
194
- /**
195
- * @internal
196
- */
197
- const VIEW_ELEMENT_DEFAULT_HEIGHT = '39px';
198
-
199
- /**
200
- * @internal
201
- */
202
- class LazyModulesManager {
203
- constructor() {
204
- this._refs = new Set();
205
- this.lazyLoadingDisabled = false;
206
- }
207
- static get instance() {
208
- if (!this._instance) {
209
- let globalInstance = get(window, this._globalInstancePath);
210
- if (!globalInstance) {
211
- globalInstance = new this();
212
- set(window, this._globalInstancePath, globalInstance);
213
- }
214
- this._instance = globalInstance;
215
- }
216
- return this._instance;
217
- }
218
- add(ref) {
219
- this._refs.add(ref);
220
- }
221
- size() {
222
- return this._refs.size;
223
- }
224
- loadAll() {
225
- return Promise.all(Array.from(this._refs).map((ref) => ref.loadAndBootstrap()));
226
- }
227
- clear() {
228
- this._refs.clear();
229
- }
230
- }
231
- LazyModulesManager._globalInstancePath = 'creatio._lazyModulesManager';
232
-
233
- /**
234
- * @internal
235
- * @hostPublicApi
236
- */
237
- var ViewElementGroupType;
238
- (function (ViewElementGroupType) {
239
- ViewElementGroupType["Charts"] = "Charts";
240
- ViewElementGroupType["Components"] = "Components";
241
- ViewElementGroupType["LayoutElements"] = "LayoutElements";
242
- ViewElementGroupType["Inputs"] = "Inputs";
243
- ViewElementGroupType["CustomElements"] = "CustomElements";
244
- })(ViewElementGroupType || (ViewElementGroupType = {}));
245
-
246
- /**
247
- * @internal
248
- * @hostPublicApi
249
- */
250
- var ViewElementDataGroupType;
251
- (function (ViewElementDataGroupType) {
252
- ViewElementDataGroupType["Data"] = "Data";
253
- })(ViewElementDataGroupType || (ViewElementDataGroupType = {}));
254
- /**
255
- * @internal
256
- * @hostPublicApi
257
- */
258
- // eslint-disable-next-line @typescript-eslint/naming-convention
259
- const DesignerToolGroupType = Object.assign(Object.assign({}, ViewElementDataGroupType), ViewElementGroupType);
260
-
261
- /**
262
- * Handler source types in order of call priority.
263
- * @internal
264
- * @hostPublicApi
265
- */
266
- var HandlerSourceType;
267
- (function (HandlerSourceType) {
268
- HandlerSourceType[HandlerSourceType["Schema"] = 0] = "Schema";
269
- HandlerSourceType[HandlerSourceType["Remote"] = 1] = "Remote";
270
- HandlerSourceType[HandlerSourceType["Host"] = 2] = "Host";
271
- })(HandlerSourceType || (HandlerSourceType = {}));
272
-
273
- const global$4 = window;
274
- /**
275
- * @public
276
- * @description For internal use only.
277
- * @hostPublicApi
278
- */
279
- // eslint-disable-next-line @typescript-eslint/naming-convention
280
- class ɵBaseRegistry {
281
- constructor() {
282
- /**
283
- * @hostPubicApi available through window.creatio.registry.<registryKey>.store
284
- */
285
- this.store = {
286
- typeInfos: new Map(),
287
- };
288
- }
289
- static get store() {
290
- if (!this._instance) {
291
- let globalInstance = get(global$4, this._prefix + this.registryKey);
292
- if (!globalInstance) {
293
- globalInstance = new this();
294
- set(global$4, this._prefix + this.registryKey, globalInstance);
295
- }
296
- this._instance = globalInstance;
297
- }
298
- return this._instance.store;
299
- }
300
- }
301
- ɵBaseRegistry._prefix = 'creatio.registry.';
302
-
303
- /**
304
- * @internal
305
- */
306
- class PkgTopology extends ɵBaseRegistry {
307
- static get items() {
308
- return this.store.typeInfos;
309
- }
310
- static get(pkgName) {
311
- const order = this.items.get(pkgName);
312
- if (order === undefined) {
313
- throw new Error(`Package with name ${pkgName} not found in topology`);
314
- }
315
- return order;
316
- }
317
- }
318
- PkgTopology.registryKey = 'pkgTopology';
319
-
320
- /**
321
- * @internal
322
- */
323
- class HandlersOrderComparer {
324
- constructor(_request) {
325
- var _a;
326
- this._request = _request;
327
- const scopesOrderEntries = [...((_a = this._request.scopes) !== null && _a !== void 0 ? _a : [])].reverse().map((scope, index) => [scope, index]);
328
- this._scopesOrder = Object.fromEntries(scopesOrderEntries);
329
- }
330
- _getOrderByScopes(handler) {
331
- if (!handler.scopes) {
332
- return Number.MAX_VALUE;
333
- }
334
- const scopesOrder = handler.scopes.filter((s) => s in this._scopesOrder).map((s) => this._scopesOrder[s]);
335
- return Math.min(...scopesOrder);
336
- }
337
- _getOrderByPkgTopology(handler) {
338
- if (handler.source.type === HandlerSourceType.Host) {
339
- return Number.MAX_VALUE;
340
- }
341
- return PkgTopology.get(handler.source.packageName);
342
- }
343
- compare(a, b) {
344
- const aScopeOrder = this._getOrderByScopes(a);
345
- const bScopeOrder = this._getOrderByScopes(b);
346
- let diff = aScopeOrder - bScopeOrder;
347
- if (diff) {
348
- return diff;
349
- }
350
- const aPkgTopologyOrder = this._getOrderByPkgTopology(a);
351
- const bPkgTopologyOrder = this._getOrderByPkgTopology(b);
352
- diff = aPkgTopologyOrder - bPkgTopologyOrder;
353
- if (diff) {
354
- return diff;
355
- }
356
- diff = a.source.type - b.source.type;
357
- return diff;
358
- }
359
- }
360
-
361
- /**
362
- * @internal
363
- */
364
- function matchScopes(handlerScopes, requestScopes) {
365
- if (!(handlerScopes === null || handlerScopes === void 0 ? void 0 : handlerScopes.length)) {
366
- return true;
367
- }
368
- return handlerScopes.some((s) => requestScopes === null || requestScopes === void 0 ? void 0 : requestScopes.includes(s));
369
- }
370
-
371
- var _b, _c;
372
- var _a$1;
373
- const global$3 = window;
374
- (_b = global$3.creatio) !== null && _b !== void 0 ? _b : (global$3.creatio = {});
375
- (_c = (_a$1 = global$3.creatio)._bootstrappedCrtModules) !== null && _c !== void 0 ? _c : (_a$1._bootstrappedCrtModules = new Map());
376
- /**
377
- * @internal
378
- */
379
- const bootstrappedCrtModules = global$3.creatio._bootstrappedCrtModules;
380
-
381
- /**
382
- * @internal
383
- */
384
- function iterateRootModules(callback) {
385
- bootstrappedCrtModules.forEach((info, type) => {
386
- if (info.root) {
387
- callback(info, type);
388
- }
389
- });
390
- }
391
- /**
392
- * @internal
393
- */
394
- function callOnContextCreateHooks(context) {
395
- iterateRootModules((info) => { var _a, _b; return (_b = (_a = info.options) === null || _a === void 0 ? void 0 : _a.onContextCreate) === null || _b === void 0 ? void 0 : _b.call(_a, context); });
396
- }
397
- /**
398
- * @internal
399
- */
400
- function callOnContextUpdateHooks(context) {
401
- iterateRootModules((info) => { var _a, _b; return (_b = (_a = info.options) === null || _a === void 0 ? void 0 : _a.onContextUpdate) === null || _b === void 0 ? void 0 : _b.call(_a, context); });
402
- }
403
- /**
404
- * @internal
405
- */
406
- function callOnContextDestroyHooks(context) {
407
- iterateRootModules((info) => { var _a, _b; return (_b = (_a = info.options) === null || _a === void 0 ? void 0 : _a.onContextDestroy) === null || _b === void 0 ? void 0 : _b.call(_a, context); });
408
- }
409
-
410
- /**
411
- * @internal
412
- * @hostPublicApi available through window.handlerChain
413
- */
414
- class InternalHandlerChain {
415
- constructor() {
416
- this._handlers = [];
417
- this._requestListeners = new Map();
418
- this._handlersCache = new Map();
419
- this._handlersScopesByContextId = new Map();
420
- /**
421
- * @hostPublicApi
422
- */
423
- this.handlerChain$ = {
424
- /**
425
- * @hostPublicApi
426
- */
427
- process: (request) => __awaiter(this, void 0, void 0, function* () {
428
- let handler;
429
- if (this._hasCacheHandler(request)) {
430
- handler = this._getCacheHandler(request);
431
- }
432
- else {
433
- const handlers = this._getMatchedHandlers(request);
434
- if (!LazyModulesManager.instance.lazyLoadingDisabled) {
435
- yield this._loadLazyHandlers(request, handlers);
436
- }
437
- handler = this._buildHandlersChain(request, handlers);
438
- }
439
- this._requestListeners.forEach((listener) => listener === null || listener === void 0 ? void 0 : listener(request));
440
- return handler === null || handler === void 0 ? void 0 : handler.handle(request);
441
- }),
442
- /**
443
- * @hostPublicApi
444
- */
445
- register: (info) => {
446
- this._handlersCache.delete(info.requestType);
447
- this._handlers.push(info);
448
- return () => {
449
- const index = this._handlers.indexOf(info);
450
- if (index > -1) {
451
- this._handlers.splice(index, 1);
452
- this._handlersCache.delete(info.requestType);
453
- }
454
- else {
455
- console.warn(`${info === null || info === void 0 ? void 0 : info.requestType} not found to unsubscribe`);
456
- }
457
- };
458
- },
459
- /**
460
- * @hostPublicApi
461
- */
462
- update: (updatedInfo) => {
463
- const config = this._handlers.find((h) => h.type === updatedInfo.type);
464
- if (config) {
465
- config.createHandler = updatedInfo.createHandler;
466
- }
467
- },
468
- /**
469
- * @hostPublicApi
470
- */
471
- subscribe: (callback, context) => {
472
- if (!callback) {
473
- return () => void 0;
474
- }
475
- const listenerId = ɵgenerateGuid();
476
- const listenerFn = (request) => {
477
- if (!context || request.$context === context) {
478
- callback(request);
479
- }
480
- };
481
- this._requestListeners.set(listenerId, listenerFn);
482
- return () => this._requestListeners.delete(listenerId);
483
- },
484
- };
485
- }
486
- /**
487
- * @hostPublicApi
488
- */
489
- clearContextedHandlersCache(contextId) {
490
- var _a;
491
- const configs = (_a = this._handlersScopesByContextId.get(contextId)) !== null && _a !== void 0 ? _a : [];
492
- return configs.every(({ requestType, scope }) => { var _a; return (_a = this._handlersCache.get(requestType)) === null || _a === void 0 ? void 0 : _a.delete(scope); });
493
- }
494
- clear() {
495
- this._handlers.splice(0);
496
- this._requestListeners.clear();
497
- this._handlersCache.clear();
498
- this._handlersScopesByContextId.clear();
499
- }
500
- _getCacheHandler(request) {
501
- const map = this._handlersCache.get(request.type);
502
- const key = this._getCacheScopesKey(request);
503
- return map.get(key);
504
- }
505
- _hasCacheHandler(request) {
506
- const map = this._handlersCache.get(request.type);
507
- const key = this._getCacheScopesKey(request);
508
- return map && map.has(key);
509
- }
510
- _getCacheScopesKey(request) {
511
- var _a, _b;
512
- 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 : '';
513
- return (request.scopes || ['']).join('_').concat(injectionContextKey);
514
- }
515
- _getInjectionContext(viewModel) {
516
- return ((viewModel === null || viewModel === void 0 ? void 0 : viewModel['_injectionContext']) ||
517
- ((viewModel === null || viewModel === void 0 ? void 0 : viewModel['parent']) && this._getInjectionContext(viewModel['parent'])));
518
- }
519
- _setContextedScopes(request, scope) {
520
- var _a;
521
- const injectionContext = (_a = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context)) === null || _a === void 0 ? void 0 : _a.id;
522
- const configs = this._handlersScopesByContextId.has(injectionContext)
523
- ? this._handlersScopesByContextId.get(injectionContext)
524
- : [];
525
- configs.push({ requestType: request.type, scope });
526
- this._handlersScopesByContextId.set(injectionContext, configs);
527
- }
528
- _setCacheHandler(request, handler) {
529
- var _a;
530
- const map = this._handlersCache.has(request.type)
531
- ? this._handlersCache.get(request.type)
532
- : new Map();
533
- const key = this._getCacheScopesKey(request);
534
- map.set(key, handler);
535
- if ((_a = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context)) === null || _a === void 0 ? void 0 : _a.id) {
536
- this._setContextedScopes(request, key);
537
- }
538
- this._handlersCache.set(request.type, map);
539
- }
540
- _isRequestHandler(handler) {
541
- return (typeof handler.handle === 'function' &&
542
- typeof handler.setNext === 'function');
543
- }
544
- _checkHandlerInstanceOf(handler) {
545
- if (!this._isRequestHandler(handler)) {
546
- throw new Error('Handler should implement "BaseRequestHandler"');
547
- }
548
- }
549
- _loadLazyHandlers(request, configs) {
550
- return __awaiter(this, void 0, void 0, function* () {
551
- const lazyModules = new Set();
552
- configs.forEach((config) => {
553
- if (config.lazy && !config.createHandler) {
554
- lazyModules.add(config.lazyModuleRef);
555
- }
556
- });
557
- yield Promise.all([...lazyModules].map((m) => m.loadAndBootstrap()));
558
- const injectionContext = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context);
559
- if (injectionContext && lazyModules.size) {
560
- lazyModules.forEach((ref) => injectionContext.addLazyModule(ref.typeRef));
561
- callOnContextUpdateHooks(injectionContext);
562
- }
563
- });
564
- }
565
- _getMatchedHandlers(request) {
566
- return this._handlers.filter((h) => {
567
- if (h.requestType !== request.type) {
568
- return false;
569
- }
570
- return matchScopes(h.scopes, request.scopes);
571
- });
572
- }
573
- _buildHandlersChain(request, handlers) {
574
- const comparer = new HandlersOrderComparer(request);
575
- handlers.sort((a, b) => comparer.compare(a, b));
576
- const injectionContext = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context);
577
- const handlerInstances = handlers.map((handlerConfig) => handlerConfig.createHandler.call(handlerConfig, injectionContext));
578
- handlerInstances.forEach((handler) => this._checkHandlerInstanceOf(handler));
579
- this._joinHandlersInChain(handlerInstances);
580
- const result = handlerInstances[0];
581
- this._setCacheHandler(request, result);
582
- return result;
583
- }
584
- _joinHandlersInChain(handlers) {
585
- for (let index = 0; index < handlers.length - 1; index++) {
586
- try {
587
- handlers[index].setNext(handlers[index + 1]);
588
- }
589
- catch (error) {
590
- if (error instanceof ɵNextHandlerAlreadySpecifiedException) {
591
- throw new Error('Handler factory should return new instance of ' +
592
- 'BaseRequestHandler class or its subclass ' +
593
- '(next handler should not be specified)');
594
- }
595
- throw error;
596
- }
597
- }
598
- }
599
- }
600
-
601
- const global$2 = window;
602
- /**
603
- * @public
604
- * @class HandlerChainService
605
- * @classdesc Service to design handlers in chain.
606
- */
607
- class HandlerChainService {
608
- get _chain() {
609
- return global$2.handlerChain;
610
- }
611
- set _chain(value) {
612
- global$2.handlerChain = value;
613
- }
614
- static get instance() {
615
- return HandlerChainService._instance || (HandlerChainService._instance = new HandlerChainService());
616
- }
617
- constructor() {
618
- if (!this._chain) {
619
- this._createGlobalHandlerChain();
620
- }
621
- }
622
- _createGlobalHandlerChain() {
623
- this._chain = new InternalHandlerChain();
624
- }
625
- /**
626
- * @internal
627
- */
628
- clearContextedHandlersCache(contextId) {
629
- return this._chain.clearContextedHandlersCache(contextId);
630
- }
631
- /**
632
- * @internal
633
- */
634
- register(handlerConfig) {
635
- return this._chain.handlerChain$.register(handlerConfig);
636
- }
637
- /**
638
- * @internal
639
- */
640
- update(handlerConfig) {
641
- return this._chain.handlerChain$.update(handlerConfig);
642
- }
643
- /**
644
- * @description Method to process passed request
645
- * @param request - {@link ɵBaseRequest}
646
- * @return `Promise<unknown>`
647
- */
648
- process(request) {
649
- return this._chain.handlerChain$.process(request);
650
- }
651
- /**
652
- * @internal
653
- * Subscribes to requests.
654
- * @param callback A handler function for each request triggered.
655
- * @param context (optional) A context in which the requests were triggered.
656
- * The `callback` will be called only for requests with specified context.
657
- * If not specified, will be called for all requests.
658
- * @returns A function to cancel the subscription.
659
- */
660
- subscribe(callback, context) {
661
- return this._chain.handlerChain$.subscribe(callback, context);
662
- }
663
- /**
664
- * @internal
665
- */
666
- clear() {
667
- this._chain.clear();
668
- }
669
- }
670
-
671
- /**
672
- * @internal
673
- */
674
- // eslint-disable-next-line @typescript-eslint/naming-convention
675
- function ImplementUsingHandlerChain(config) {
676
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
677
- return function (target, method, descriptor) {
678
- const methodImplementation = function (...args) {
679
- return HandlerChainService.instance.process({
680
- type: (config === null || config === void 0 ? void 0 : config.requestType) ? config.requestType : this.requestType,
681
- method: (config === null || config === void 0 ? void 0 : config.methodName) ? config.methodName : method,
682
- args,
683
- });
684
- };
685
- if (descriptor) {
686
- descriptor.value = methodImplementation;
687
- }
688
- else {
689
- target[method] = methodImplementation;
690
- }
691
- };
692
- }
693
-
694
- /**
695
- * @internal
696
- */
697
- function objectDeepKeys(obj) {
698
- if (obj === null || typeof obj !== 'object') {
699
- return [];
700
- }
701
- return Object.keys(obj)
702
- .filter((key) => obj[key] instanceof Object)
703
- .map((key) => objectDeepKeys(obj[key]).map((k) => [key, ...k]))
704
- .reduce((x, y) => [...x, ...y], Object.keys(obj).map((x) => [x]));
705
- }
706
-
707
- /**
708
- * @internal
709
- */
710
- function checkTypeNameFormat(type, element) {
711
- const typeParts = type.split('.');
712
- if (typeParts.length < 2) {
713
- throw new Error(`Error when register ${type}. Type property should have format "VendorPrefix.${element}"`);
714
- }
715
- }
716
- /**
717
- * @public
718
- * @description For internal use only.
719
- */
720
- function ɵcheckTypeNameFormat(type, element) {
721
- return checkTypeNameFormat(type, element);
722
- }
723
- /**
724
- * @internal
725
- */
726
- function checkTypeNamePascalCase(type) {
727
- const [vendor, typeName] = type.split('.');
728
- const pascalTypeName = toPascalCase(typeName);
729
- if (!vendor || pascalTypeName !== typeName) {
730
- 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');
731
- }
732
- }
733
- /**
734
- * @internal
735
- */
736
- function checkCrtTypeNamePascalCase(type) {
737
- const [vendor, typeName] = type.split('.');
738
- const pascalTypeName = toPascalCase(typeName);
739
- if (vendor.toLowerCase() === 'crt' && pascalTypeName !== typeName) {
740
- 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');
741
- }
742
- }
743
- /**
744
- * @internal
745
- */
746
- function toPascalCase(source) {
747
- return upperFirst(camelCase(source));
748
- }
749
- /**
750
- * @internal
751
- */
752
- function checkIfTypeRegistered(type, item) {
753
- if (!item) {
754
- throw new Error(`Error when resolve ${type}. Type was not registered.`);
755
- }
756
- }
757
- /**
758
- * @internal
759
- */
760
- function checkOnlyOneRegistration(type, item, map) {
761
- if (map.has(type) && !isEqual(map.get(type), item)) {
762
- throw new Error(`Error when register ${type}. Element with this type has already exist`);
763
- }
764
- }
765
-
766
- var _a;
767
- /**
768
- * @internal
769
- * @hostPublicApi available through window.creatio.requestHandlerRegistry
770
- */
771
- class InternalRequestHandlerRegistryType {
772
- /**
773
- * @publicHostApi
774
- */
775
- static get requestHandlersMap() {
776
- return this._requestHandlersMap;
777
- }
778
- /**
779
- * @publicHostApi
780
- */
781
- static onAddRequestHandler(handler) {
782
- this._addItemListeners.push(handler);
783
- return () => {
784
- this._addItemListeners.splice(this._addItemListeners.indexOf(handler), 1);
785
- };
786
- }
787
- /**
788
- * @publicHostApi
789
- */
790
- static onRemoveRequestHandler(handler) {
791
- this._removeItemListeners.push(handler);
792
- return () => {
793
- this._removeItemListeners.splice(this._removeItemListeners.indexOf(handler), 1);
794
- };
795
- }
796
- /**
797
- * @publicHostApi
798
- */
799
- static addRequestHandler(handlerType, config) {
800
- var _a, _b;
801
- const existingHandler = this._requestHandlersMap.get(handlerType);
802
- if (!existingHandler || (((_a = existingHandler.instanceConfig) === null || _a === void 0 ? void 0 : _a.lazy) && !existingHandler.instanceType)) {
803
- const mergedConfig = {
804
- instanceType: config.instanceType,
805
- instanceConfig: Object.assign(Object.assign({}, ((_b = existingHandler === null || existingHandler === void 0 ? void 0 : existingHandler.instanceConfig) !== null && _b !== void 0 ? _b : {})), config.instanceConfig),
806
- };
807
- this._requestHandlersMap.set(handlerType, mergedConfig);
808
- for (const listener of this._addItemListeners) {
809
- listener(handlerType, mergedConfig);
810
- }
811
- }
812
- }
813
- /**
814
- * @publicHostApi
815
- */
816
- static removeRequestHandler(handlerType) {
817
- const config = this._requestHandlersMap.get(handlerType);
818
- if (config) {
819
- this._requestHandlersMap.delete(handlerType);
820
- for (const listener of this._removeItemListeners) {
821
- listener(handlerType, config);
822
- }
823
- }
824
- }
825
- static clear() {
826
- for (const type of this._requestHandlersMap.keys()) {
827
- this.removeRequestHandler(type);
828
- }
829
- }
830
- }
831
- InternalRequestHandlerRegistryType._addItemListeners = [];
832
- InternalRequestHandlerRegistryType._removeItemListeners = [];
833
- InternalRequestHandlerRegistryType._requestHandlersMap = new Map();
834
- const global$1 = window;
835
- (_a = global$1.creatio) !== null && _a !== void 0 ? _a : (global$1.creatio = {});
836
- if (!global$1.creatio.requestHandlerRegistry) {
837
- Object.defineProperty(global$1.creatio, 'requestHandlerRegistry', {
838
- get: () => InternalRequestHandlerRegistryType,
839
- configurable: false,
840
- });
841
- }
842
- /**
843
- * @internal
844
- */
845
- // eslint-disable-next-line @typescript-eslint/naming-convention
846
- const InternalRequestHandlerRegistry = global$1.creatio.requestHandlerRegistry;
847
- /**
848
- * @internal
849
- */
850
- class RequestHandlerRegistryService {
851
- /**
852
- * Register request handler class.
853
- * @param config Request handler registration config.
854
- * @param type Request handler type.
855
- */
856
- static register(config, type) {
857
- const requestType = config.requestType;
858
- const requestHandlerType = config.type;
859
- if (!requestType) {
860
- throw new Error(`Error when register ${requestHandlerType}. Request type not specified.`);
861
- }
862
- const requestHandlerMapValue = {
863
- instanceType: type,
864
- instanceConfig: config,
865
- };
866
- RequestHandlerRegistryService._internalRegistry.addRequestHandler(requestHandlerType, requestHandlerMapValue);
867
- }
868
- }
869
- RequestHandlerRegistryService._internalRegistry = global$1.creatio.requestHandlerRegistry;
870
-
871
- /**
872
- * @internal
873
- */
874
- class RequestRegistryService {
875
- static get requestsRegistrationInfos() {
876
- return this._requestsRegistrationInfos;
877
- }
878
- /**
879
- * Registers a specified request class.
880
- * @param config Request registration config.
881
- * @param type Request type.
882
- */
883
- static register(config, type) {
884
- const requestType = config.type;
885
- // TODO RND-21723
886
- RequestRegistryService._requestsMap.set(requestType, type);
887
- RequestRegistryService._requestsRegistrationInfos.set(requestType, config);
888
- }
889
- /**
890
- * Creates request instance by specified registered request type.
891
- * @param type Request type.
892
- * @returns The instance of registered request.
893
- */
894
- static get(type) {
895
- const requestInstanceConstructor = RequestRegistryService._requestsMap.get(type);
896
- checkIfTypeRegistered(type, requestInstanceConstructor);
897
- return requestInstanceConstructor && new requestInstanceConstructor();
898
- }
899
- }
900
- RequestRegistryService._requestsMap = new Map();
901
- RequestRegistryService._requestsRegistrationInfos = new Map();
902
-
903
- /**
904
- * @internal
905
- * @hostPublicApi available through window.creatio.registry.ConverterRegistry
906
- */
907
- class ConverterRegistry extends ɵBaseRegistry {
908
- static has(type) {
909
- return this.store.typeInfos.has(type);
910
- }
911
- static get(type) {
912
- if (!this.store.typeInfos.has(type)) {
913
- throw new Error(`'${type}' converter doesn't exist`);
914
- }
915
- return this.store.typeInfos.get(type);
916
- }
917
- static register(item) {
918
- checkTypeNameFormat(item.type, 'ConverterTypeName');
919
- checkCrtTypeNamePascalCase(item.type);
920
- // TODO RND-21723
921
- const existingItem = this.store.typeInfos.get(item.type);
922
- this.store.typeInfos.set(item.type, Object.assign(Object.assign({}, (existingItem !== null && existingItem !== void 0 ? existingItem : {})), item));
923
- }
924
- static clear() {
925
- this.store.typeInfos.clear();
926
- }
927
- }
928
- ConverterRegistry.registryKey = 'ConverterRegistry';
929
-
930
- /**
931
- * @internal
932
- */
933
- const viewElementRegistryKey = 'ViewElementRegistry';
934
- /**
935
- * @internal
936
- * @hostPublicApi available through window.creatio.registry.ValidatorRegistry
937
- */
938
- class ViewElementRegistry extends ɵBaseRegistry {
939
- static validate(config) {
940
- checkTypeNameFormat(config.type, 'ViewElementTypeName');
941
- const existingItem = ViewElementRegistry.viewElements.get(config.type);
942
- if ((existingItem === null || existingItem === void 0 ? void 0 : existingItem.lazy) && !('selector' in existingItem) && !existingItem.typeRef) {
943
- return;
944
- }
945
- checkOnlyOneRegistration(config.type, config, ViewElementRegistry.viewElements);
946
- }
947
- static get viewElements() {
948
- return this.store.typeInfos;
949
- }
950
- static register(config) {
951
- const existingConfig = this.viewElements.get(config.type);
952
- this.viewElements.set(config.type, Object.assign(Object.assign({}, (existingConfig !== null && existingConfig !== void 0 ? existingConfig : {})), config));
953
- }
954
- static getFormControlRelatesAttribute(type) {
955
- var _a;
956
- const config = this.store.typeInfos.get(type);
957
- return (config && 'formControlConfig' in config && ((_a = config.formControlConfig) === null || _a === void 0 ? void 0 : _a.relatesTo)) || null;
958
- }
959
- static getViewElementInputs(type) {
960
- var _a;
961
- const config = this.store.typeInfos.get(type);
962
- return (_a = config === null || config === void 0 ? void 0 : config.inputs) !== null && _a !== void 0 ? _a : {};
963
- }
964
- static getViewElementOutputs(type) {
965
- var _a;
966
- const config = this.store.typeInfos.get(type);
967
- return (_a = config === null || config === void 0 ? void 0 : config.outputs) !== null && _a !== void 0 ? _a : {};
968
- }
969
- static getViewElementPropertiesDefaultValues(type) {
970
- var _a;
971
- const config = this.store.typeInfos.get(type);
972
- const propertiesDefaultValues = Object.entries((_a = config === null || config === void 0 ? void 0 : config.inputs) !== null && _a !== void 0 ? _a : {})
973
- .filter(([_, inputConfig]) => Object.prototype.hasOwnProperty.call(inputConfig, 'defaultValue'))
974
- .map(([propertyName, propertyConfig]) => ({
975
- name: propertyName,
976
- defaultValue: propertyConfig.defaultValue,
977
- }));
978
- return [
979
- ...propertiesDefaultValues,
980
- {
981
- name: 'visible',
982
- defaultValue: true,
983
- },
984
- ];
985
- }
986
- }
987
- ViewElementRegistry.registryKey = viewElementRegistryKey;
988
-
989
- /**
990
- * @internal
991
- */
992
- const interfaceDesignerItemRegistryKey = 'InterfaceDesignerItemRegistry';
993
- /**
994
- * @internal
995
- * @hostPublicApi available through window.creatio.registry.InterfaceDesignerItemRegistry
996
- */
997
- class InterfaceDesignerItemRegistry extends ɵBaseRegistry {
998
- static validate(config) {
999
- checkTypeNameFormat(config.type, 'InterfaceDesignerItemTypeName');
1000
- checkCrtTypeNamePascalCase(config.type);
1001
- checkOnlyOneRegistration(config.type, config, this.interfaceDesignerItemRegistrationInfos);
1002
- }
1003
- static register(config) {
1004
- this.interfaceDesignerItemRegistrationInfos.set(config.type, config);
1005
- }
1006
- static get interfaceDesignerItemRegistrationInfos() {
1007
- return this.store.typeInfos;
1008
- }
1009
- static get(type) {
1010
- return this.interfaceDesignerItemRegistrationInfos.get(type);
1011
- }
1012
- }
1013
- InterfaceDesignerItemRegistry.registryKey = interfaceDesignerItemRegistryKey;
1014
-
1015
- const global = window;
1016
- /**
1017
- * @internal
1018
- */
1019
- class BootstrapNotifier {
1020
- static get instance() {
1021
- if (!global.__crtModuleBootstrapNotifier) {
1022
- global.__crtModuleBootstrapNotifier = new BootstrapNotifier();
1023
- }
1024
- return global.__crtModuleBootstrapNotifier;
1025
- }
1026
- constructor() {
1027
- this._subscribers = new Set();
1028
- // private constructor prevent instantiation via 'new' keyword
1029
- }
1030
- notify(moduleType) {
1031
- for (const subscriber of this._subscribers.values()) {
1032
- subscriber(moduleType);
1033
- }
1034
- }
1035
- subscribe(subscriber) {
1036
- this._subscribers.add(subscriber);
1037
- return {
1038
- unsubscribe: () => this._subscribers.delete(subscriber),
1039
- };
1040
- }
1041
- }
1042
-
1043
- /**
1044
- * @internal
1045
- */
1046
- class HandlerChainServicesRegistry extends ɵBaseRegistry {
1047
- static validate({ requestType }) {
1048
- checkTypeNameFormat(requestType, this.registryKey);
1049
- checkCrtTypeNamePascalCase(requestType);
1050
- this.checkUniqueRequestType(requestType);
1051
- }
1052
- static checkUniqueRequestType(requestType) {
1053
- if (this.services.get(requestType)) {
1054
- throw new Error(`${requestType} already registered`);
1055
- }
1056
- }
1057
- static register(config) {
1058
- this.validate(config);
1059
- this.services.set(config.requestType, config);
1060
- }
1061
- static get services() {
1062
- return this.store.typeInfos;
1063
- }
1064
- }
1065
- HandlerChainServicesRegistry.registryKey = 'HandlerChainServicesRegistry';
1066
-
1067
- /**
1068
- * @internal
1069
- */
1070
- const designTimeViewElementRegistryKey = 'DesignTimeViewElementRegistry';
1071
- /**
1072
- * @internal
1073
- * @hostPublicApi available through window.creatio.registry.DesignTimeViewElementRegistry
1074
- */
1075
- class DesignTimeViewElementRegistry extends ɵBaseRegistry {
1076
- static validate(config) {
1077
- checkTypeNameFormat(config.type, 'DesignTimeViewElementRegistryItemTypeName');
1078
- checkCrtTypeNamePascalCase(config.type);
1079
- checkOnlyOneRegistration(config.type, config, this.infos);
1080
- }
1081
- static register(config) {
1082
- this.infos.set(config.type, config);
1083
- }
1084
- static getByOverriddenType(type) {
1085
- const item = Array.from(this.infos).find(([_, info]) => info.overrideType === type);
1086
- if (item) {
1087
- return item[1];
1088
- }
1089
- return null;
1090
- }
1091
- static get infos() {
1092
- return this.store.typeInfos;
1093
- }
1094
- }
1095
- DesignTimeViewElementRegistry.registryKey = designTimeViewElementRegistryKey;
1096
-
1097
- /**
1098
- * @internal
1099
- */
1100
- class ValidatorMapValue {
1101
- }
1102
- /**
1103
- * @internal
1104
- */
1105
- const validatorRegistryKey = 'ValidatorRegistry';
1106
- /**
1107
- * @internal
1108
- * @hostPublicApi available through window.creatio.registry.ValidatorRegistry
1109
- */
1110
- class ValidatorRegistry extends ɵBaseRegistry {
1111
- static _has(configType, type) {
1112
- var _a;
1113
- const config = ValidatorRegistry.items.get(configType);
1114
- if ((config === null || config === void 0 ? void 0 : config.lazy) && !(config === null || config === void 0 ? void 0 : config.typeRef)) {
1115
- return false;
1116
- }
1117
- return ValidatorRegistry.items.has(configType) && ((_a = ValidatorRegistry.items.get(configType)) === null || _a === void 0 ? void 0 : _a.typeRef) !== type;
1118
- }
1119
- static validate(config) {
1120
- checkTypeNameFormat(config.type, 'ValidatorTypeName');
1121
- if (config.typeRef && ValidatorRegistry._has(config.type, config.typeRef)) {
1122
- throw new Error(`Error when register ${config.type}. Element with this type has already exist`);
1123
- }
1124
- }
1125
- static get items() {
1126
- return this.store.typeInfos;
1127
- }
1128
- static register(config) {
1129
- const existingConfig = this.items.get(config.type);
1130
- this.items.set(config.type, Object.assign(Object.assign({}, (existingConfig !== null && existingConfig !== void 0 ? existingConfig : {})), config));
1131
- }
1132
- }
1133
- ValidatorRegistry.registryKey = validatorRegistryKey;
1134
-
1135
- /**
1136
- * @internal
1137
- * @dontChange
1138
- */
1139
- class RemoteEntriesRegistry extends ɵBaseRegistry {
1140
- /**
1141
- * @dontChange
1142
- */
1143
- static get items() {
1144
- return this.store.typeInfos;
1145
- }
1146
- }
1147
- /**
1148
- * @dontChange
1149
- */
1150
- RemoteEntriesRegistry.registryKey = 'remotes';
1151
-
1152
- /**
1153
- * @internal
1154
- */
1155
- const registryKey = 'ChatMessageTypeRegistry';
1156
- /**
1157
- * @internal
1158
- * @hostPublicApi available through window.creatio.registry.ChatMessageTypeRegistry
1159
- */
1160
- class ChatMessageTypeRegistry extends ɵBaseRegistry {
1161
- static get messageTypes() {
1162
- return this.store.typeInfos;
1163
- }
1164
- static register(messageType, selector) {
1165
- this.messageTypes.set(messageType, selector);
1166
- }
1167
- static getSelector(messageType) {
1168
- return this.store.typeInfos.get(messageType);
1169
- }
1170
- }
1171
- ChatMessageTypeRegistry.registryKey = registryKey;
1172
-
1173
- /**
1174
- * @internal
1175
- */
1176
- function isComponentPropertyBindable(viewConfigType, componentProperty) {
1177
- var _a;
1178
- const componentConfig = ViewElementRegistry.viewElements.get(viewConfigType);
1179
- if (!(componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.inputs)) {
1180
- return false;
1181
- }
1182
- return !!((_a = componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.inputs[componentProperty]) === null || _a === void 0 ? void 0 : _a.propertyBindable);
1183
- }
1184
-
1185
- const moduleMetadataKey = 'module';
1186
- const viewElementMetadataKey = 'viewElement';
1187
- const interfaceDesignerItemMetadataKey = 'interfaceDesignerItem';
1188
- const requestHandlerMetadataKey = 'requestHandler';
1189
- const designTimeViewElementMetadataKey = 'designTimeViewElement';
1190
- const validatorMetadataKey = 'validator';
1191
- const converterMetadataKey = 'converter';
1192
- /**
1193
- * @internal
1194
- */
1195
- function setModuleMetadata(metadata, type) {
1196
- Reflect.defineMetadata(moduleMetadataKey, metadata, type);
1197
- }
1198
- /**
1199
- * @internal
1200
- */
1201
- function getModuleMetadata(type) {
1202
- const metadata = Reflect.getMetadata(moduleMetadataKey, type);
1203
- if (!metadata) {
1204
- throw new Error(`Module metadata was not found on '${type.name}' class`);
1205
- }
1206
- return metadata;
1207
- }
1208
- /**
1209
- * @internal
1210
- */
1211
- function setViewElementMetadata(metadata, type) {
1212
- Reflect.defineMetadata(viewElementMetadataKey, metadata, type);
1213
- }
1214
- /**
1215
- * @internal
1216
- */
1217
- function getViewElementMetadata(type) {
1218
- const metadata = Reflect.getMetadata(viewElementMetadataKey, type);
1219
- if (!metadata) {
1220
- throw new Error(`View element metadata was not found on '${type.name}' class`);
1221
- }
1222
- return metadata;
1223
- }
1224
- /**
1225
- * @internal
1226
- */
1227
- function setValidatorMetadata(metadata, type) {
1228
- Reflect.defineMetadata(validatorMetadataKey, metadata, type);
1229
- }
1230
- /**
1231
- * @internal
1232
- */
1233
- function getValidatorMetadata(type) {
1234
- const metadata = Reflect.getOwnMetadata(validatorMetadataKey, type);
1235
- if (!metadata) {
1236
- throw new Error(`Validator metadata was not found on '${type.name}' class`);
1237
- }
1238
- return metadata;
1239
- }
1240
- /**
1241
- * @internal
1242
- */
1243
- function setConverterMetadata(metadata, type) {
1244
- Reflect.defineMetadata(converterMetadataKey, metadata, type);
1245
- }
1246
- /**
1247
- * @internal
1248
- */
1249
- function getConverterMetadata(type) {
1250
- const metadata = Reflect.getOwnMetadata(converterMetadataKey, type);
1251
- if (!metadata) {
1252
- throw new Error(`Converter metadata was not found on '${type.name}' class`);
1253
- }
1254
- return metadata;
1255
- }
1256
- /**
1257
- * @internal
1258
- */
1259
- function setInterfaceDesignerItemMetadata(metadata, type) {
1260
- Reflect.defineMetadata(interfaceDesignerItemMetadataKey, metadata, type);
1261
- }
1262
- /**
1263
- * @internal
1264
- */
1265
- function getInterfaceDesignerItemMetadata(type) {
1266
- const metadata = Reflect.getOwnMetadata(interfaceDesignerItemMetadataKey, type);
1267
- if (!metadata) {
1268
- throw new Error(`Interface designer item metadata was not found on '${type.name}' class`);
1269
- }
1270
- return metadata;
1271
- }
1272
- /**
1273
- * @internal
1274
- */
1275
- function setDesignTimeViewElementMetadata(metadata, type) {
1276
- Reflect.defineMetadata(designTimeViewElementMetadataKey, metadata, type);
1277
- }
1278
- /**
1279
- * @internal
1280
- */
1281
- function getDesignTimeViewElementMetadata(type) {
1282
- const metadata = Reflect.getOwnMetadata(designTimeViewElementMetadataKey, type);
1283
- if (!metadata) {
1284
- throw new Error(`Design time view element metadata was not found on '${type.name}' class`);
1285
- }
1286
- return metadata;
1287
- }
1288
- /**
1289
- * @internal
1290
- */
1291
- function hasInterfaceDesignerItemMetadata(type) {
1292
- return Reflect.hasOwnMetadata(interfaceDesignerItemMetadataKey, type);
1293
- }
1294
- /**
1295
- * @internal
1296
- */
1297
- function setRequestHandlerMetadata(metadata, type) {
1298
- Reflect.defineMetadata(requestHandlerMetadataKey, metadata, type);
1299
- }
1300
- /**
1301
- * @internal
1302
- */
1303
- function getRequestHandlerMetadata(type) {
1304
- const metadata = Reflect.getMetadata(requestHandlerMetadataKey, type);
1305
- if (!metadata) {
1306
- throw new Error(`Request handler metadata was not found on '${type.name}' class`);
1307
- }
1308
- return metadata;
1309
- }
1310
- /**
1311
- * @internal
1312
- */
1313
- function getHandlerChainServiceMetadata(typeRef) {
1314
- const requestType = Reflect.getMetadata('requestType', typeRef);
1315
- if (!requestType) {
1316
- throw new Error(`requestType was not found on '${typeRef.name}' class`);
1317
- }
1318
- return { requestType, typeRef };
1319
- }
1320
- /**
1321
- * @internal
1322
- */
1323
- function getCrtInputsMetadata(type) {
1324
- const keys = Reflect.getMetadataKeys(type);
1325
- const crtInputKeys = keys.filter((x) => x.startsWith(crtInputPrefix));
1326
- return Object.fromEntries(crtInputKeys.map((key) => {
1327
- const data = Reflect.getMetadata(key, type);
1328
- return [key.replace(crtInputPrefix, ''), data];
1329
- }));
1330
- }
1331
- /**
1332
- * @internal
1333
- */
1334
- function getCrtOutputsMetadata(type) {
1335
- const keys = Reflect.getMetadataKeys(type);
1336
- const crtOutputKeys = keys.filter((x) => x.startsWith(crtOutputPrefix));
1337
- return Object.fromEntries(crtOutputKeys.map((key) => {
1338
- const data = Reflect.getMetadata(key, type);
1339
- return [key.replace(crtOutputPrefix, ''), data];
1340
- }));
1341
- }
1342
- /**
1343
- * @internal
1344
- */
1345
- function getCrtValidationInputsMetadata(type) {
1346
- const keys = Reflect.getMetadataKeys(type);
1347
- const crtValidationInputKeys = keys.filter((x) => x.startsWith(crtValidationInputPrefix));
1348
- return Object.fromEntries(crtValidationInputKeys.map((key) => {
1349
- const data = Reflect.getMetadata(key, type);
1350
- return [key.replace(crtValidationInputPrefix, ''), data];
1351
- }));
1352
- }
1353
- /**
1354
- * @internal
1355
- */
1356
- function getCrtInjectMetadata(type) {
1357
- const keys = Reflect.getOwnMetadataKeys(type);
1358
- const crtInjectKeys = keys.filter((x) => x.startsWith(crtInjectPrefix));
1359
- return Object.fromEntries(crtInjectKeys.map((key) => {
1360
- const index = Number(key.replace(crtInjectPrefix, ''));
1361
- const data = Reflect.getMetadata(key, type);
1362
- return [index, data];
1363
- }));
1364
- }
1365
- /**
1366
- * @internal
1367
- */
1368
- function getParentType(type) {
1369
- const parentProto = type.prototype ? Object.getPrototypeOf(type.prototype) : null;
1370
- return parentProto ? parentProto.constructor : null;
1371
- }
1372
- /**
1373
- * @internal
1374
- */
1375
- function getTypeDependencies(type) {
1376
- const paramTypes = Reflect.getOwnMetadata('design:paramtypes', type);
1377
- if (!paramTypes) {
1378
- if (type.length > 0) {
1379
- throw new Error(`Dependency Injection error. Cannot read dependencies of class '${type.name}'. ` +
1380
- `Please make sure class '${type.name}' has decorator and ` +
1381
- "'emitDecoratorMetadata' option is enabled in your 'tsconfig.json' file.");
1382
- }
1383
- const parentType = getParentType(type);
1384
- return parentType && parentType !== Object ? getTypeDependencies(parentType) : [];
1385
- }
1386
- const crtInjectMetadata = getCrtInjectMetadata(type);
1387
- Object.entries(crtInjectMetadata).forEach(([index, token]) => (paramTypes[index] = token));
1388
- return paramTypes;
1389
- }
1390
-
1391
- /**
1392
- * @internal
1393
- */
1394
- function instantiate(type, resolveDependency) {
1395
- const deps = getTypeDependencies(type);
1396
- if (deps.length > 0) {
1397
- if (!resolveDependency) {
1398
- throw new Error(`Cannot resolve dependencies for ${type.name}. ` +
1399
- "Please provide 'resolveDependency' bootstrap option");
1400
- }
1401
- const depInstances = deps.map(resolveDependency);
1402
- return new type(...depInstances);
1403
- }
1404
- return new type();
1405
- }
1406
- /**
1407
- * @public
1408
- * @description For internal use only.
1409
- */
1410
- function ɵinstantiate(type, resolveDependency) {
1411
- return instantiate(type, resolveDependency);
1412
- }
1413
-
1414
- /**
1415
- * @public
1416
- */
1417
- class CrtInputRegistrationConfig {
1418
- }
1419
-
1420
- /**
1421
- * @public
1422
- * @class DataRequest
1423
- * @description Definition of data source request.
1424
- * @extends {ɵBaseRequest} {@link ɵBaseRequest}
1425
- * @property {string} dataSourceName - name of assigned data source.
1426
- */
1427
- class DataRequest extends ɵBaseRequest {
1428
- }
1429
-
1430
- /**
1431
- * @internal
1432
- */
1433
- // eslint-disable-next-line @typescript-eslint/naming-convention
1434
- function CrtRequest(config) {
1435
- return function (type) {
1436
- checkTypeNameFormat(config.type, 'RequestTypeName');
1437
- checkCrtTypeNamePascalCase(config.type);
1438
- RequestRegistryService.register(config, type);
1439
- };
1440
- }
1441
-
1442
- /**
1443
- * @hostPublicApi
1444
- * TODO: RND-55882
1445
- */
1446
- let HandleViewModelAttributeChangeRequest = class HandleViewModelAttributeChangeRequest extends ɵBaseRequest {
1447
- constructor(payload) {
1448
- super();
1449
- this.type = 'crt.HandleViewModelAttributeChangeRequest';
1450
- this.attributeName = payload.attributeName;
1451
- this.value = payload.value;
1452
- this.oldValue = payload.oldValue;
1453
- // eslint-disable-next-line sonar/deprecation
1454
- this.silent = Boolean(payload.silent);
1455
- this.preventAttributeChangeRequest = Boolean(payload.preventAttributeChangeRequest);
1456
- this.preventStateChange = Boolean(payload.preventStateChange);
1457
- this.preventRunBusinessRules = Boolean(payload.preventRunBusinessRules);
1458
- }
1459
- };
1460
- HandleViewModelAttributeChangeRequest = __decorate([
1461
- CrtRequest({
1462
- type: 'crt.HandleViewModelAttributeChangeRequest',
1463
- }),
1464
- __metadata("design:paramtypes", [Object])
1465
- ], HandleViewModelAttributeChangeRequest);
1466
-
1467
- /**
1468
- * @internal
1469
- */
1470
- var ViewElementReuseStrategy;
1471
- (function (ViewElementReuseStrategy) {
1472
- /**
1473
- * Reuse early created view element when it state changed
1474
- */
1475
- ViewElementReuseStrategy[ViewElementReuseStrategy["Reuse"] = 0] = "Reuse";
1476
- /**
1477
- * Rerender(recreate) view element when it state changed
1478
- */
1479
- ViewElementReuseStrategy[ViewElementReuseStrategy["Rerender"] = 1] = "Rerender";
1480
- })(ViewElementReuseStrategy || (ViewElementReuseStrategy = {}));
1481
-
1482
- /**
1483
- * @internal
1484
- * @description Visibility strategy for view element.
1485
- */
1486
- var ViewElementVisibilityStrategy;
1487
- (function (ViewElementVisibilityStrategy) {
1488
- /**
1489
- * @description Default visibility strategy.
1490
- */
1491
- ViewElementVisibilityStrategy["Default"] = "default";
1492
- /**
1493
- * @description On demand visibility strategy.
1494
- */
1495
- ViewElementVisibilityStrategy["OnDemand"] = "on-demand";
1496
- })(ViewElementVisibilityStrategy || (ViewElementVisibilityStrategy = {}));
1497
-
1498
- /**
1499
- * @public
1500
- * @description Abstract Base Validator class for designing custom validators.
1501
- * @example
1502
- * @CrtValidator({
1503
- * type: 'crt.Required',
1504
- * })
1505
- * export class RequiredValidator extends BaseValidator {
1506
- * protected override async = false;
1507
- * public validate(controlState: CrtControlState, params?: ValidatorParametersValues): CrtValidationErrors | null {
1508
- * Implementation here...
1509
- * }
1510
- * }
1511
- */
1512
- class BaseValidator {
1513
- /**
1514
- * @description getter for async/sync indicator
1515
- */
1516
- get isAsync() {
1517
- return this.async;
1518
- }
1519
- /**
1520
- * @description Function used for validation
1521
- */
1522
- get validateFn() {
1523
- return this.validate.bind(this);
1524
- }
1525
- /**
1526
- * @internal
1527
- */
1528
- static [Symbol.hasInstance](instance) {
1529
- var _a;
1530
- return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === BaseValidator._instanceOfKey;
1531
- }
1532
- }
1533
- /**
1534
- * @internal
1535
- * @dontChange
1536
- */
1537
- BaseValidator._instanceOfKey = 'devkit_BaseValidator';
1538
-
1539
- /**
1540
- * @public
1541
- */
1542
- class LocalizableValue {
1543
- constructor(key) {
1544
- this.key = key;
1545
- }
1546
- /**
1547
- * @internal
1548
- */
1549
- static [Symbol.hasInstance](instance) {
1550
- var _a;
1551
- return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === LocalizableValue._instanceOfKey;
1552
- }
1553
- }
1554
- /**
1555
- * @internal
1556
- * @dontChange
1557
- */
1558
- LocalizableValue._instanceOfKey = 'devkit_LocalizableValue';
1559
-
1560
- /**
1561
- * @internal
1562
- */
1563
- function applyLocalizeMetadataFn(obj, localizeMetadata) {
1564
- const localizableEntries = objectDeepKeys(obj)
1565
- .map((path) => ({ path, value: get(obj, path) }))
1566
- .filter(({ value }) => value instanceof LocalizableValue);
1567
- if (localizableEntries.length === 0) {
1568
- return obj;
1569
- }
1570
- const localized = cloneDeep(obj);
1571
- if (!localizeMetadata) {
1572
- console.error("Unable to localize metadata. 'localizeMetadata' bootstrap option was not provided.");
1573
- }
1574
- localizableEntries.forEach(({ path, value }) => {
1575
- var _a;
1576
- const localizedValue = (_a = localizeMetadata === null || localizeMetadata === void 0 ? void 0 : localizeMetadata(value.key)) !== null && _a !== void 0 ? _a : value.key;
1577
- set(localized, path, localizedValue);
1578
- });
1579
- return localized;
1580
- }
1581
-
1582
- /**
1583
- * @internal
1584
- */
1585
- // eslint-disable-next-line @typescript-eslint/naming-convention
1586
- function CrtDesignTimeViewElement(config) {
1587
- return function (type) {
1588
- const registrationConfig = Object.assign(Object.assign({}, config), { typeRef: type });
1589
- setDesignTimeViewElementMetadata(registrationConfig, type);
1590
- };
1591
- }
1592
-
1593
- /**
1594
- * @internal
1595
- * @hostPublicApi
1596
- */
1597
- class InterfaceDesignerItemRegistrationConfig {
1598
- }
1599
-
1600
- /**
1601
- * @internal
1602
- * @class MethodInvokeRequest
1603
- * @description Definition of invoke method request.
1604
- * @extends {ɵBaseRequest} {@link ɵBaseRequest}
1605
- * @property {string} method - method name.
1606
- * @property {unknown[]} args - arguments passing to the method.
1607
- */
1608
- class MethodInvokeRequest extends ɵBaseRequest {
1609
- }
1610
-
1611
- /**
1612
- * @internal
1613
- */
1614
- var RemoteEntryType;
1615
- (function (RemoteEntryType) {
1616
- RemoteEntryType["Script"] = "script";
1617
- RemoteEntryType["Module"] = "module";
1618
- })(RemoteEntryType || (RemoteEntryType = {}));
1619
-
1620
- /**
1621
- * @internal
1622
- */
1623
- class LazyModuleRef {
1624
- get typeRef() {
1625
- return this._typeRef;
1626
- }
1627
- constructor(_metadata, _bootstrapFn,
1628
- /** Name of source build ('host' or remote name) */
1629
- sourceName) {
1630
- this._metadata = _metadata;
1631
- this._bootstrapFn = _bootstrapFn;
1632
- this.sourceName = sourceName;
1633
- }
1634
- loadAndBootstrap() {
1635
- if (!this._modulePromise) {
1636
- this._modulePromise = this._metadata.load().then((type) => {
1637
- this._typeRef = type;
1638
- this._bootstrapFn(type);
1639
- return type;
1640
- });
1641
- }
1642
- return this._modulePromise;
1643
- }
1644
- }
1645
-
1646
- /**
1647
- * @public
1648
- * @description Creatio platform interacts with input's of user-defined component through CrtInput decorator.
1649
- * @param config {@link CrtInputRegistrationConfig}
1650
- *
1651
- * @example
1652
- * export class AppComponent {
1653
- * @CrtInput()
1654
- * public value!: string;
1655
- * }
1656
- */
1657
- // eslint-disable-next-line @typescript-eslint/naming-convention
1658
- function CrtInput(config) {
1659
- return function (target, propertyKey) {
1660
- if (!config) {
1661
- config = {
1662
- propertyBindable: false,
1663
- };
1664
- }
1665
- Reflect.defineMetadata(crtInputPrefix + propertyKey.toString(), config, target.constructor);
1666
- };
1667
- }
1668
-
1669
- /**
1670
- * @public
1671
- * @description User-defined components could notify Creatio platform about changes through CrtOutput decorator.
1672
- * @example
1673
- * export class AppComponent {
1674
- * @Input()
1675
- * @CrtOutput()
1676
- * public valueChange;
1677
- * }
1678
- */
1679
- // eslint-disable-next-line @typescript-eslint/naming-convention
1680
- function CrtOutput() {
1681
- return function (target, propertyKey) {
1682
- Reflect.defineMetadata(crtOutputPrefix + propertyKey.toString(), {}, target.constructor);
1683
- };
1684
- }
1685
-
1686
- /**
1687
- * @public
1688
- * @description User-defined components receive validationInfo changes through CrtValidationInput decorator.
1689
- * Make sure you have defined input for every validationInfo input.
1690
- * To properly declare validationInfo field:
1691
- * 1. Declare input field inside inputs section. For example `value`
1692
- * 2. In validationInputs section declare same field which ends with ValidationInfo.
1693
- * For previous example `valueValidationInfo`
1694
- *
1695
- * @example
1696
- * export class AppComponent {
1697
- * @CrtInput()
1698
- public value;
1699
- *
1700
- * @CrtValidationInput()
1701
- * public valueValidationInfo;
1702
- * }
1703
- */
1704
- // eslint-disable-next-line @typescript-eslint/naming-convention
1705
- function CrtValidationInput() {
1706
- return function (target, propertyKey) {
1707
- Reflect.defineMetadata(crtValidationInputPrefix + propertyKey.toString(), {}, target.constructor);
1708
- };
1709
- }
1710
-
1711
- /**
1712
- * @internal
1713
- */
1714
- // eslint-disable-next-line @typescript-eslint/naming-convention
1715
- function CrtViewElement(config) {
1716
- return function (type) {
1717
- var _a, _b;
1718
- checkTypeNamePascalCase(config.type);
1719
- const inputs = getCrtInputsMetadata(type);
1720
- const outputs = getCrtOutputsMetadata(type);
1721
- const validationInputs = getCrtValidationInputsMetadata(type);
1722
- const baseRegistrationConfig = Object.assign(Object.assign({}, config), { inputs,
1723
- outputs,
1724
- validationInputs });
1725
- const registrationConfig = 'selector' in config
1726
- ? Object.assign(Object.assign({}, baseRegistrationConfig), { selector: config.selector }) : Object.assign(Object.assign({}, baseRegistrationConfig), { typeRef: type });
1727
- registrationConfig.reuseStrategy = (_a = config === null || config === void 0 ? void 0 : config.reuseStrategy) !== null && _a !== void 0 ? _a : ViewElementReuseStrategy.Rerender;
1728
- registrationConfig.defaultSize = (_b = config.defaultSize) !== null && _b !== void 0 ? _b : {
1729
- height: VIEW_ELEMENT_DEFAULT_HEIGHT,
1730
- };
1731
- setViewElementMetadata(registrationConfig, type);
1732
- };
1733
- }
1734
-
1735
- /**
1736
- * @internal
1737
- */
1738
- function CrtModule(moduleDefinition) {
1739
- return (type) => setModuleMetadata(moduleDefinition, type);
1740
- }
1741
-
1742
- /**
1743
- * @internal
1744
- */
1745
- // eslint-disable-next-line @typescript-eslint/naming-convention
1746
- function CrtInterfaceDesignerItem(config) {
1747
- function _applyTypeCaption() {
1748
- if (!config.typeCaption && config.toolbarConfig) {
1749
- const toolbarConfig = Array.isArray(config.toolbarConfig)
1750
- ? config.toolbarConfig[0]
1751
- : config.toolbarConfig;
1752
- config.typeCaption = toolbarConfig.caption;
1753
- }
1754
- }
1755
- return function (type) {
1756
- var _a;
1757
- config.typeRef = type;
1758
- (_a = config.viewElementGroupType) !== null && _a !== void 0 ? _a : (config.viewElementGroupType = ViewElementGroupType.CustomElements);
1759
- _applyTypeCaption();
1760
- setInterfaceDesignerItemMetadata(config, type);
1761
- };
1762
- }
1763
-
1764
- /**
1765
- * @public
1766
- * @description
1767
- * Constructor parameter decorator.
1768
- * Mark parameter as dependency that should be obtained by token.
1769
- * @param token - token by which the dependency instance will be obtained
1770
- * @example
1771
- * class MyHandler {
1772
- * constructor(@CrtInject(USER_NAME_TOKEN) userName: string) {}
1773
- * }
1774
- */
1775
- function CrtInject(token) {
1776
- return function (target, paramKey, paramIndex) {
1777
- Reflect.defineMetadata(crtInjectPrefix + paramIndex, token, target);
1778
- };
1779
- }
1780
-
1781
- /**
1782
- * @internal
1783
- */
1784
- // eslint-disable-next-line @typescript-eslint/naming-convention
1785
- function CrtValidator(config) {
1786
- if (!config) {
1787
- return (type) => {
1788
- // the decorator won't do anything by itself,
1789
- // but will be used by the compiler to generate class metadata,
1790
- // which is required for DI
1791
- };
1792
- }
1793
- return function (type) {
1794
- checkTypeNameFormat(config.type, 'ValidatorTypeName');
1795
- const registrationConfig = Object.assign(Object.assign({}, config), { typeRef: type });
1796
- setValidatorMetadata(registrationConfig, type);
1797
- };
1798
- }
1799
-
1800
- /**
1801
- * @internal
1802
- */
1803
- // eslint-disable-next-line @typescript-eslint/naming-convention
1804
- function CrtRequestHandler(config) {
1805
- if (!config) {
1806
- return (type) => {
1807
- // the decorator won't do anything by itself,
1808
- // but will be used by the compiler to generate class metadata,
1809
- // which is required for DI
1810
- };
1811
- }
1812
- return function (type) {
1813
- checkTypeNameFormat(config.type, 'RequestHandlerTypeName');
1814
- checkCrtTypeNamePascalCase(config.type);
1815
- setRequestHandlerMetadata(config, type);
1816
- };
1817
- }
1818
-
1819
- /**
1820
- * @internal
1821
- */
1822
- // eslint-disable-next-line @typescript-eslint/naming-convention
1823
- function CrtConverter(config) {
1824
- if (!config) {
1825
- return (type) => { };
1826
- }
1827
- return function (typeRef) {
1828
- const type = typeof config === 'string' ? config : config.type;
1829
- checkTypeNameFormat(type, 'converterTypeName');
1830
- const registrationConfig = {
1831
- type: type,
1832
- typeRef: typeRef,
1833
- };
1834
- setConverterMetadata(registrationConfig, typeRef);
1835
- };
1836
- }
1837
-
1838
- /**
1839
- * @public
1840
- * @description CrtChatMessageType decorator allows user to register components as a message type in chat.
1841
- * @param config - registration config. {@link ChatMessageTypeRegistrationConfig}.
1842
- *
1843
- * @example
1844
- * @CrtChatMessageType({
1845
- * selector: 'usr-video-message',
1846
- * messageType: 'video',
1847
- * })
1848
- * export class AppComponent { }
1849
- */
1850
- // eslint-disable-next-line @typescript-eslint/naming-convention
1851
- function CrtChatMessageType(config) {
1852
- return function (type) {
1853
- ChatMessageTypeRegistry.register(config.messageType, config.selector);
1854
- };
1855
- }
1856
-
1857
- /**
1858
- * @internal
1859
- */
1860
- var DataSourceLoadType;
1861
- (function (DataSourceLoadType) {
1862
- DataSourceLoadType["LoadNext"] = "loadNext";
1863
- DataSourceLoadType["Load"] = "load";
1864
- DataSourceLoadType["Reload"] = "reload";
1865
- })(DataSourceLoadType || (DataSourceLoadType = {}));
1866
-
1867
- /**
1868
- * @internal
1869
- */
1870
- var ViewElementProperty;
1871
- (function (ViewElementProperty) {
1872
- ViewElementProperty["Readonly"] = "READONLY_PROPERTY";
1873
- ViewElementProperty["Disabled"] = "DISABLED_PROPERTY";
1874
- })(ViewElementProperty || (ViewElementProperty = {}));
1875
-
1876
- /**
1877
- * @public
1878
- * @description Function allows to register user-defined component as view element in Creatio platform.
1879
- * @param config - registration config. {@link ViewElementRegistrationConfig}
1880
- * @example
1881
- * sdk.registerViewElement({
1882
- * type: 'usr.Timeline',
1883
- * selector: 'usr-timeline',
1884
- * inputs: {
1885
- * primaryColumnValue: {},
1886
- * cardSchemaName: {},
1887
- * entitySchemaName: {}
1888
- * }
1889
- * });
1890
- */
1891
- function registerViewElement(config) {
1892
- ViewElementRegistry.validate(config);
1893
- ViewElementRegistry.register(config);
1894
- }
1895
-
1896
- /**
1897
- * @internal
1898
- * @description Function allows to register angular component as view element in Creatio platform.
1899
- */
1900
- function registerAngularViewElement(config, typeRef) {
1901
- ViewElementRegistry.validate(config);
1902
- ViewElementRegistry.register(Object.assign(Object.assign({}, config), { typeRef }));
1903
- }
1904
-
1905
- /**
1906
- * @internal
1907
- */
1908
- function checkRemoteName(remoteName) {
1909
- if (!RemoteEntriesRegistry.items.has(remoteName)) {
1910
- throw new Error(`Remote entry with name '${remoteName}' does not exist`);
1911
- }
1912
- }
1913
- /**
1914
- * @internal
1915
- */
1916
- function resistantForEach(items, callback) {
1917
- items.forEach((item) => {
1918
- try {
1919
- callback(item);
1920
- }
1921
- catch (error) {
1922
- console.error(error);
1923
- }
1924
- });
1925
- }
1926
- /**
1927
- * @internal
1928
- */
1929
- function registerViewElements(types) {
1930
- resistantForEach(types, (type) => {
1931
- const registrationConfig = getViewElementMetadata(type);
1932
- ViewElementRegistry.validate(registrationConfig);
1933
- ViewElementRegistry.register(registrationConfig);
1934
- });
1935
- }
1936
- /**
1937
- * @internal
1938
- */
1939
- function registerLazyViewElements(configs, lazyModuleRef) {
1940
- resistantForEach(configs, (config) => {
1941
- const registryItem = Object.assign(Object.assign({}, config), { lazy: true, lazyModuleRef });
1942
- ViewElementRegistry.validate(registryItem);
1943
- ViewElementRegistry.register(registryItem);
1944
- });
1945
- }
1946
- /**
1947
- * @internal
1948
- */
1949
- function registerInterfaceDesignerItems(types, localizeFn) {
1950
- resistantForEach(types, (type) => {
1951
- if (!hasInterfaceDesignerItemMetadata(type)) {
1952
- return;
1953
- }
1954
- let config = getInterfaceDesignerItemMetadata(type);
1955
- config = applyLocalizeMetadataFn(config, localizeFn);
1956
- const viewElementMetadata = getViewElementMetadata(type);
1957
- config.type = viewElementMetadata.type;
1958
- InterfaceDesignerItemRegistry.validate(config);
1959
- InterfaceDesignerItemRegistry.register(config);
1960
- });
1961
- }
1962
- /**
1963
- * @internal
1964
- */
1965
- function registerDesignTimeViewElements(types) {
1966
- resistantForEach(types, (type) => {
1967
- const registrationConfig = getDesignTimeViewElementMetadata(type);
1968
- DesignTimeViewElementRegistry.validate(registrationConfig);
1969
- DesignTimeViewElementRegistry.register(registrationConfig);
1970
- });
1971
- }
1972
- /**
1973
- * @internal
1974
- */
1975
- function registerValidators(types, options) {
1976
- resistantForEach(types, (type) => {
1977
- const metadata = getValidatorMetadata(type);
1978
- const registrationConfig = Object.assign(Object.assign({}, metadata), { instantiate: function (injectionContext) {
1979
- const resolveDependency = (options === null || options === void 0 ? void 0 : options.resolveDependency)
1980
- ? (token) => options.resolveDependency(token, injectionContext)
1981
- : null;
1982
- return instantiate(type, resolveDependency);
1983
- } });
1984
- ValidatorRegistry.validate(registrationConfig);
1985
- ValidatorRegistry.register(registrationConfig);
1986
- });
1987
- }
1988
- /**
1989
- * @internal
1990
- */
1991
- function registerLazyValidators(configs, lazyModuleRef) {
1992
- resistantForEach(configs, (config) => {
1993
- const registryItem = Object.assign(Object.assign({}, config), { lazy: true, lazyModuleRef });
1994
- ValidatorRegistry.validate(registryItem);
1995
- ValidatorRegistry.register(registryItem);
1996
- });
1997
- }
1998
- /**
1999
- * @internal
2000
- */
2001
- function registerConverters(types, options) {
2002
- resistantForEach(types, (type) => {
2003
- const metadata = getConverterMetadata(type);
2004
- const registrationConfig = Object.assign(Object.assign({}, metadata), { instantiate: function (injectionContext) {
2005
- const resolveDependency = (options === null || options === void 0 ? void 0 : options.resolveDependency)
2006
- ? (token) => options.resolveDependency(token, injectionContext)
2007
- : null;
2008
- return instantiate(type, resolveDependency);
2009
- } });
2010
- ConverterRegistry.register(registrationConfig);
2011
- });
2012
- }
2013
- /**
2014
- * @internal
2015
- */
2016
- function registerLazyConverters(descriptors, lazyModuleRef) {
2017
- resistantForEach(descriptors, (descriptor) => {
2018
- const registryItem = Object.assign(Object.assign({}, descriptor), { lazy: true, lazyModuleRef });
2019
- ConverterRegistry.register(registryItem);
2020
- });
2021
- }
2022
- /**
2023
- * @internal
2024
- */
2025
- function registerRequestHandlers(types, options, remoteName) {
2026
- if (options.moduleType === 'remote' && !remoteName) {
2027
- console.error("To use request handlers, 'remoteName' parameter should be specified.");
2028
- return;
2029
- }
2030
- resistantForEach(types, (type) => {
2031
- const metadata = getRequestHandlerMetadata(type);
2032
- let registrationConfig;
2033
- const createHandler = (injectionContext) => {
2034
- const resolveDependency = (options === null || options === void 0 ? void 0 : options.resolveDependency)
2035
- ? (token) => options.resolveDependency(token, injectionContext)
2036
- : null;
2037
- return instantiate(type, resolveDependency);
2038
- };
2039
- if (options.moduleType === 'host') {
2040
- registrationConfig = Object.assign(Object.assign({}, metadata), { source: { type: HandlerSourceType.Host }, createHandler });
2041
- }
2042
- else {
2043
- const remote = RemoteEntriesRegistry.items.get(remoteName);
2044
- registrationConfig = Object.assign(Object.assign({}, metadata), { source: {
2045
- type: HandlerSourceType.Remote,
2046
- packageName: remote.packageName,
2047
- }, createHandler });
2048
- }
2049
- RequestHandlerRegistryService.register(registrationConfig, type);
2050
- });
2051
- }
2052
- /**
2053
- * @internal
2054
- */
2055
- function registerLazyRequestHandlers(descriptors, options, remoteName, lazyModuleRef) {
2056
- resistantForEach(descriptors, (descriptor) => {
2057
- const registrationConfig = Object.assign(Object.assign({}, descriptor), { lazy: true, lazyModuleRef });
2058
- if (options.moduleType === 'host') {
2059
- registrationConfig.source = { type: HandlerSourceType.Host };
2060
- }
2061
- else {
2062
- const remote = RemoteEntriesRegistry.items.get(remoteName);
2063
- registrationConfig.source = {
2064
- type: HandlerSourceType.Remote,
2065
- packageName: remote.packageName,
2066
- };
2067
- }
2068
- RequestHandlerRegistryService.register(registrationConfig);
2069
- });
2070
- }
2071
- /**
2072
- * @internal
2073
- */
2074
- function bootstrapLazyCrtModule(name, descriptor, options, lazyModuleRef) {
2075
- var _a;
2076
- try {
2077
- if (descriptor.viewElements) {
2078
- registerLazyViewElements(descriptor.viewElements, lazyModuleRef);
2079
- }
2080
- if (descriptor.requestHandlers) {
2081
- registerLazyRequestHandlers(descriptor.requestHandlers, options, name, lazyModuleRef);
2082
- }
2083
- if (descriptor.validators) {
2084
- registerLazyValidators(descriptor.validators, lazyModuleRef);
2085
- }
2086
- if (descriptor.converters) {
2087
- registerLazyConverters(descriptor.converters, lazyModuleRef);
2088
- }
2089
- (_a = descriptor.includes) === null || _a === void 0 ? void 0 : _a.forEach((m) => {
2090
- bootstrapLazyCrtModule(name, m, options, lazyModuleRef);
2091
- });
2092
- }
2093
- catch (error) {
2094
- console.error(error);
2095
- }
2096
- }
2097
- /**
2098
- * @internal
2099
- */
2100
- function bootstrapDefaultCrtModule(name, type, options, root) {
2101
- var _a;
2102
- if (bootstrappedCrtModules.has(type)) {
2103
- return;
2104
- }
2105
- const source = options.moduleType === 'host' ? 'host' : name;
2106
- bootstrappedCrtModules.set(type, { source, root, options });
2107
- try {
2108
- const moduleDefinition = getModuleMetadata(type);
2109
- if (moduleDefinition.viewElements) {
2110
- registerViewElements(moduleDefinition.viewElements);
2111
- registerInterfaceDesignerItems(moduleDefinition.viewElements, options === null || options === void 0 ? void 0 : options.localizeMetadata);
2112
- }
2113
- if (moduleDefinition.designTimeViewElements) {
2114
- registerDesignTimeViewElements(moduleDefinition.designTimeViewElements);
2115
- }
2116
- if (moduleDefinition.requestHandlers) {
2117
- registerRequestHandlers(moduleDefinition.requestHandlers, options, name);
2118
- }
2119
- if (moduleDefinition.validators) {
2120
- registerValidators(moduleDefinition.validators, options);
2121
- }
2122
- if (moduleDefinition.converters) {
2123
- registerConverters(moduleDefinition.converters, options);
2124
- }
2125
- (_a = moduleDefinition.includes) === null || _a === void 0 ? void 0 : _a.forEach((t) => {
2126
- if (typeof t === 'function') {
2127
- bootstrapDefaultCrtModule(name, t, options, false);
2128
- bootstrapPredefinedModules(name, t, options);
2129
- }
2130
- else if (typeof t === 'object') {
2131
- if (options.moduleType === 'remote' && !name) {
2132
- console.error("To use lazy loading, 'remoteName' parameter should be specified.");
2133
- return;
2134
- }
2135
- const ref = new LazyModuleRef(t, (x) => bootstrapDefaultCrtModule(name, x, options, false), source);
2136
- bootstrapLazyCrtModule(name, t, options, ref);
2137
- LazyModulesManager.instance.add(ref);
2138
- }
2139
- });
2140
- }
2141
- catch (error) {
2142
- console.error(error);
2143
- }
2144
- }
2145
- /**
2146
- * @internal
2147
- */
2148
- function bootstrapPredefinedModules(name, type, options) {
2149
- const modulePrefix = 'module:';
2150
- const metadataKeys = Reflect.getOwnMetadataKeys(type);
2151
- for (const key of metadataKeys) {
2152
- if (typeof key === 'string' && key.startsWith(modulePrefix)) {
2153
- const moduleType = key.substring(modulePrefix.length);
2154
- const predefinedBootstrapper = Reflect.getOwnMetadata('moduleBootstrapper:' + moduleType, type);
2155
- try {
2156
- predefinedBootstrapper(name, type, options);
2157
- }
2158
- catch (error) {
2159
- console.error(error);
2160
- }
2161
- }
2162
- }
2163
- }
2164
- /**
2165
- * @internal
2166
- */
2167
- function bootstrapCrtModule(...args) {
2168
- var _a, _b;
2169
- const name = typeof args[0] === 'string' ? args.shift() : undefined;
2170
- const type = args[0];
2171
- const options = (_a = args[1]) !== null && _a !== void 0 ? _a : {};
2172
- (_b = options.moduleType) !== null && _b !== void 0 ? _b : (options.moduleType = 'remote');
2173
- if (name) {
2174
- if (options.moduleType === 'remote') {
2175
- checkRemoteName(name);
2176
- }
2177
- else {
2178
- throw new Error('Host module cannot have name');
2179
- }
2180
- }
2181
- bootstrapDefaultCrtModule(name, type, options, true);
2182
- bootstrapPredefinedModules(name, type, options);
2183
- if (options.moduleType === 'remote') {
2184
- BootstrapNotifier.instance.notify(type);
2185
- }
2186
- }
2187
-
2188
- /**
2189
- * @public
2190
- * @description Use this function in decorators to indicate that a value should be localized.
2191
- * Note that the "localizeMetadata" bootstrap option should be provided,
2192
- * otherwise the value cannot be localized.
2193
- *
2194
- * @example
2195
- *
2196
- * ### Using 'localize' in decorator
2197
- * ```ts
2198
- * @CrtInterfaceDesignerItem({
2199
- * toolbarConfig: {
2200
- * caption: localize('MyElement.Caption')
2201
- * }
2202
- * })
2203
- * class MyElement {}
2204
- * ```
2205
- * ### Passing 'localizeMetadata' bootstrap option
2206
- * ```ts
2207
- * bootstrapCrtModule(MyModule, {
2208
- * localizeMetadata: (key: string) => thirdPartyTranslateService.translate(key)
2209
- * });
2210
- * ```
2211
- */
2212
- function localize(key) {
2213
- return new LocalizableValue(key);
2214
- }
2215
-
2216
- /**
2217
- * @internal
2218
- */
2219
- function registerHandlerChainServices(types) {
2220
- types === null || types === void 0 ? void 0 : types.forEach((type) => {
2221
- const registrationConfig = getHandlerChainServiceMetadata(type);
2222
- HandlerChainServicesRegistry.register(registrationConfig);
2223
- });
2224
- }
2225
- /**
2226
- * @internal
2227
- */
2228
- function _bootstrapCrtModuleHandlerChainServices(type) {
2229
- var _a;
2230
- const moduleDefinition = getModuleMetadata(type);
2231
- if (moduleDefinition.handlerChainServices) {
2232
- registerHandlerChainServices(moduleDefinition.handlerChainServices);
2233
- }
2234
- (_a = moduleDefinition.includes) === null || _a === void 0 ? void 0 : _a.forEach((t) => {
2235
- if (typeof t === 'function') {
2236
- _bootstrapCrtModuleHandlerChainServices(t);
2237
- }
2238
- });
2239
- }
2240
- /**
2241
- * @internal
2242
- */
2243
- function bootstrapCrtModuleHandlerChainServices(type) {
2244
- _bootstrapCrtModuleHandlerChainServices(type);
2245
- }
2246
-
2247
- /**
2248
- * @internal
2249
- * Clears global registries, resets state of global services.
2250
- * Can be used in unit tests to clear global registries after bootstrapping module.
2251
- * @example
2252
- * beforeEach(() => {
2253
- * bootstrapCrtModule('test', TestModule);
2254
- * });
2255
- *
2256
- * afterEach(() => {
2257
- * resetGlobals();
2258
- * });
2259
- */
2260
- function resetGlobals() {
2261
- bootstrappedCrtModules.clear();
2262
- ViewElementRegistry.viewElements.clear();
2263
- InternalRequestHandlerRegistry.clear();
2264
- HandlerChainService.instance.clear();
2265
- ValidatorRegistry.items.clear();
2266
- ConverterRegistry.clear();
2267
- RemoteEntriesRegistry.items.clear();
2268
- PkgTopology.items.clear();
2269
- LazyModulesManager.instance.clear();
2270
- LazyModulesManager.instance.lazyLoadingDisabled = false;
2271
- DesignTimeViewElementRegistry.infos.clear();
2272
- }
2273
-
2274
- /**
2275
- * @public
2276
- * @abstract
2277
- * @classdesc Class for designing request handlers.
2278
- */
2279
- class BaseRequestHandler {
2280
- constructor() {
2281
- this.handlerChain = HandlerChainService.instance;
2282
- }
2283
- get next() {
2284
- return this._next;
2285
- }
2286
- /**
2287
- * @internal
2288
- */
2289
- static [Symbol.hasInstance](instance) {
2290
- var _a;
2291
- return ((_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a['_instanceOfKey']) === BaseRequestHandler._instanceOfKey;
2292
- }
2293
- /**
2294
- * @description Method to set request handler to handler chain.
2295
- * @param next - link for next request handler - {@link ɵRequestHandler}
2296
- */
2297
- setNext(next) {
2298
- if (this._next) {
2299
- throw new ɵNextHandlerAlreadySpecifiedException();
2300
- }
2301
- this._next = next;
2302
- }
2303
- }
2304
- /**
2305
- * @internal
2306
- * @dontChange
2307
- */
2308
- BaseRequestHandler._instanceOfKey = 'devkit_BaseRequestHandler';
2309
-
2310
- class BaseHandlerChainService {
2311
- }
2312
-
2313
- /**
2314
- * @public
2315
- * @classdesc Service to working with Creatio platform features using handler chain
2316
- * @extends {BaseHandlerChainService}
2317
- */
2318
- class FeatureService extends BaseHandlerChainService {
2319
- constructor() {
2320
- super(...arguments);
2321
- /**
2322
- * @internal
2323
- */
2324
- this.requestType = 'crt.FeatureService';
2325
- }
2326
- }
2327
- __decorate([
2328
- ImplementUsingHandlerChain(),
2329
- __metadata("design:type", Function)
2330
- ], FeatureService.prototype, "getFeatureState", void 0);
2331
- __decorate([
2332
- ImplementUsingHandlerChain(),
2333
- __metadata("design:type", Function)
2334
- ], FeatureService.prototype, "getFeaturesState", void 0);
2335
-
2336
- /**
2337
- * @public
2338
- * @classdesc Service to working rights using handler chain
2339
- * @extends {BaseHandlerChainService}
2340
- */
2341
- class RightsService extends BaseHandlerChainService {
2342
- constructor() {
2343
- super(...arguments);
2344
- /**
2345
- * @internal
2346
- */
2347
- this.requestType = 'crt.RightsService';
2348
- }
2349
- }
2350
- __decorate([
2351
- ImplementUsingHandlerChain(),
2352
- __metadata("design:type", Function)
2353
- ], RightsService.prototype, "getCanExecuteOperation", void 0);
2354
- __decorate([
2355
- ImplementUsingHandlerChain(),
2356
- __metadata("design:type", Function)
2357
- ], RightsService.prototype, "getCanExecuteOperations", void 0);
2358
-
2359
- /**
2360
- * @public
2361
- * @class SysSettingsService
2362
- * @classdesc Service to working with system settings using handler chain
2363
- * @extends {BaseHandlerChainService}
2364
- */
2365
- // TODO RND-45286 (implement BaseSysSettingsService)
2366
- class SysSettingsService extends BaseHandlerChainService {
2367
- constructor() {
2368
- super(...arguments);
2369
- /**
2370
- * @internal
2371
- */
2372
- this.requestType = 'crt.SysSettingsService';
2373
- }
2374
- }
2375
- __decorate([
2376
- ImplementUsingHandlerChain(),
2377
- __metadata("design:type", Function)
2378
- ], SysSettingsService.prototype, "getByCodes", void 0);
2379
- __decorate([
2380
- ImplementUsingHandlerChain(),
2381
- __metadata("design:type", Function)
2382
- ], SysSettingsService.prototype, "getByCode", void 0);
2383
- __decorate([
2384
- ImplementUsingHandlerChain(),
2385
- __metadata("design:type", Function)
2386
- ], SysSettingsService.prototype, "update", void 0);
2387
- __decorate([
2388
- ImplementUsingHandlerChain(),
2389
- __metadata("design:type", Function)
2390
- ], SysSettingsService.prototype, "updateMany", void 0);
2391
-
2392
- /**
2393
- * @public
2394
- * @class SysSetting
2395
- * @classdesc Class contains info related system setting
2396
- * @property {ɵGuid} id - id of system setting.
2397
- * @property {string} name - name of system setting.
2398
- * @property {string} code - code of system setting.
2399
- * @property {isCacheable} boolean - indicator whether system setting is cacheable
2400
- * @property {any} value - value of system setting
2401
- * @property {string} displayValue - display value of system setting
2402
- * @property {ɵDataValueType} ɵDataValueType - system setting {@link ɵDataValueType}
2403
- */
2404
- class SysSetting {
2405
- }
2406
- /**
2407
- * @public
2408
- * @class SysSettingValue
2409
- * @classdesc Shape to describe system setting value
2410
- * @property {string} code - code of system setting
2411
- * @property {any} value - value of system setting
2412
- */
2413
- class SysSettingValue {
2414
- }
2415
-
2416
- /**
2417
- * @public
2418
- * @classdesc
2419
- * @class SysValuesService Service to working with system values using handler chain
2420
- * @extends {BaseHandlerChainService}
2421
- */
2422
- class SysValuesService extends BaseHandlerChainService {
2423
- constructor() {
2424
- super(...arguments);
2425
- /**
2426
- * @internal
2427
- */
2428
- this.requestType = 'crt.SysValuesService';
2429
- }
2430
- }
2431
- __decorate([
2432
- ImplementUsingHandlerChain(),
2433
- __metadata("design:type", Function)
2434
- ], SysValuesService.prototype, "loadSysValues", void 0);
2435
-
2436
- /**
2437
- * @public
2438
- * @classdesc Http service to perform Http requests
2439
- * @extends {BaseHandlerChainService}
2440
- */
2441
- class HttpClientService extends BaseHandlerChainService {
2442
- constructor() {
2443
- super(...arguments);
2444
- /**
2445
- * @internal
2446
- */
2447
- this.requestType = 'crt.HttpClientService';
2448
- }
2449
- /**
2450
- * @description HTTP GET request.
2451
- * @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
2452
- */
2453
- get() {
2454
- // the method will be implemented dynamically by the decorator
2455
- }
2456
- /**
2457
- * @description HTTP POST request.
2458
- * @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
2459
- */
2460
- post() {
2461
- // the method will be implemented dynamically by the decorator
2462
- }
2463
- /**
2464
- * @description HTTP DELETE request.
2465
- * @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
2466
- */
2467
- delete() {
2468
- // the method will be implemented dynamically by the decorator
2469
- }
2470
- /**
2471
- * @description HTTP PUT request.
2472
- * @return `Promise<HttpResponse> | void`` {(Promise<HttpResponse> | void)}
2473
- */
2474
- put() {
2475
- // the method will be implemented dynamically by the decorator
2476
- }
2477
- /**
2478
- * @description HTTP PATCH request.
2479
- * @return `Promise<HttpResponse> | void` {(Promise<HttpResponse> | void)}
2480
- */
2481
- patch() {
2482
- // the method will be implemented dynamically by the decorator
2483
- }
2484
- }
2485
- __decorate([
2486
- ImplementUsingHandlerChain(),
2487
- __metadata("design:type", Function),
2488
- __metadata("design:paramtypes", []),
2489
- __metadata("design:returntype", Object)
2490
- ], HttpClientService.prototype, "get", null);
2491
- __decorate([
2492
- ImplementUsingHandlerChain(),
2493
- __metadata("design:type", Function),
2494
- __metadata("design:paramtypes", []),
2495
- __metadata("design:returntype", Object)
2496
- ], HttpClientService.prototype, "post", null);
2497
- __decorate([
2498
- ImplementUsingHandlerChain(),
2499
- __metadata("design:type", Function),
2500
- __metadata("design:paramtypes", []),
2501
- __metadata("design:returntype", Object)
2502
- ], HttpClientService.prototype, "delete", null);
2503
- __decorate([
2504
- ImplementUsingHandlerChain(),
2505
- __metadata("design:type", Function),
2506
- __metadata("design:paramtypes", []),
2507
- __metadata("design:returntype", Object)
2508
- ], HttpClientService.prototype, "put", null);
2509
- __decorate([
2510
- ImplementUsingHandlerChain(),
2511
- __metadata("design:type", Function),
2512
- __metadata("design:paramtypes", []),
2513
- __metadata("design:returntype", Object)
2514
- ], HttpClientService.prototype, "patch", null);
2515
-
2516
- /**
2517
- * @public
2518
- * @classdesc Represents a service to working with license restrictions.
2519
- * @extends {BaseHandlerChainService}
2520
- */
2521
- class LicenseService extends BaseHandlerChainService {
2522
- constructor() {
2523
- super(...arguments);
2524
- /**
2525
- * @internal
2526
- */
2527
- this.requestType = 'crt.LicenseService';
2528
- }
2529
- }
2530
- __decorate([
2531
- ImplementUsingHandlerChain(),
2532
- __metadata("design:type", Function)
2533
- ], LicenseService.prototype, "loadLicenseOperationStatuses", void 0);
2534
-
2535
- /**
2536
- * @public
2537
- * @classdesc Service to working with mask using handler chain
2538
- * @extends {BaseHandlerChainService}
2539
- */
2540
- class MaskService extends BaseHandlerChainService {
2541
- constructor() {
2542
- super(...arguments);
2543
- /**
2544
- * @internal
2545
- */
2546
- this.requestType = 'crt.MaskService';
2547
- }
2548
- /**
2549
- * @internal
2550
- * @param taskName
2551
- * @param context
2552
- */
2553
- showMask(taskName, context) {
2554
- return __awaiter(this, void 0, void 0, function* () {
2555
- const request = new ɵSchemaViewMaskRequest(ɵSchemaViewMaskRequestAction.AddTask, taskName, context);
2556
- yield HandlerChainService.instance.process(request);
2557
- });
2558
- }
2559
- /**
2560
- * @internal
2561
- * @param taskName
2562
- * @param context
2563
- */
2564
- hideMask(taskName, context) {
2565
- return __awaiter(this, void 0, void 0, function* () {
2566
- const request = new ɵSchemaViewMaskRequest(ɵSchemaViewMaskRequestAction.RemoveTask, taskName, context);
2567
- yield HandlerChainService.instance.process(request);
2568
- });
2569
- }
2570
- }
2571
- __decorate([
2572
- ImplementUsingHandlerChain(),
2573
- __metadata("design:type", Function)
2574
- ], MaskService.prototype, "showBodyMask", void 0);
2575
- __decorate([
2576
- ImplementUsingHandlerChain(),
2577
- __metadata("design:type", Function)
2578
- ], MaskService.prototype, "hideBodyMask", void 0);
2579
-
2580
- /**
2581
- * @internal
2582
- */
2583
- const _from = Symbol('CreateModelFrom');
2584
- /**
2585
- * @public
2586
- */
2587
- class Model extends BaseHandlerChainService {
2588
- constructor(crtModel) {
2589
- super();
2590
- /**
2591
- * @internal
2592
- */
2593
- this.requestType = 'crt.ModelGenerator';
2594
- this._crtModel = crtModel;
2595
- }
2596
- static get instance() {
2597
- if (!this._instance) {
2598
- this._instance = new Model();
2599
- }
2600
- return this._instance;
2601
- }
2602
- /**
2603
- * @internal
2604
- * Gets the model name.
2605
- */
2606
- get name() {
2607
- var _a;
2608
- return (_a = this._crtModel) === null || _a === void 0 ? void 0 : _a.name;
2609
- }
2610
- /**
2611
- * @internal
2612
- */
2613
- static [_from](crtModel) {
2614
- return new Model(crtModel);
2615
- }
2616
- static create(dataSchema) {
2617
- return __awaiter(this, void 0, void 0, function* () {
2618
- const crtModel = yield this.instance._create({
2619
- type: 'crt.EntityDataSource',
2620
- config: {
2621
- entitySchemaName: dataSchema,
2622
- },
2623
- }, '');
2624
- return new Model(crtModel);
2625
- });
2626
- }
2627
- getSchema() {
2628
- return this._crtModel._getAsyncResult(this._crtModel.getSchema());
2629
- }
2630
- load(config) {
2631
- if ((config === null || config === void 0 ? void 0 : config.loadOptions) && !(config === null || config === void 0 ? void 0 : config.options)) {
2632
- config.options = config.loadOptions;
2633
- }
2634
- return this._crtModel._getAsyncResult(this._crtModel.load(config));
2635
- }
2636
- insert(dto) {
2637
- return this._crtModel._getAsyncResult(this._crtModel.insert(dto));
2638
- }
2639
- update(dto, parameters) {
2640
- return this._crtModel._getAsyncResult(this._crtModel.update(dto, parameters));
2641
- }
2642
- copy(primaryColumnValue, data = {}) {
2643
- return this._crtModel._getAsyncResult(this._crtModel.copy(primaryColumnValue, data));
2644
- }
2645
- create(data = {}) {
2646
- return this._crtModel._getAsyncResult(this._crtModel.create(data));
2647
- }
2648
- delete(parameters) {
2649
- return this._crtModel._getAsyncResult(this._crtModel.delete(parameters));
2650
- }
2651
- canSave(params) {
2652
- return this._crtModel._getAsyncResult(this._crtModel.canSave(params));
2653
- }
2654
- canDelete(params) {
2655
- return this._crtModel._getAsyncResult(this._crtModel.canDelete(params));
2656
- }
2657
- }
2658
- __decorate([
2659
- ImplementUsingHandlerChain({
2660
- methodName: 'generateOne',
2661
- }),
2662
- __metadata("design:type", Function)
2663
- ], Model.prototype, "_create", void 0);
2664
-
2665
- /**
2666
- * @public
2667
- * @classdesc Service to handling a way of tasks execution in Creatio plaform
2668
- * @extends {BaseHandlerChainService}
2669
- */
2670
- class CrtZoneService extends BaseHandlerChainService {
2671
- constructor() {
2672
- super(...arguments);
2673
- /**
2674
- * @internal
2675
- */
2676
- this.requestType = 'crt.ZoneService';
2677
- }
2678
- }
2679
- __decorate([
2680
- ImplementUsingHandlerChain(),
2681
- __metadata("design:type", Function)
2682
- ], CrtZoneService.prototype, "runOutside", void 0);
2683
-
2684
- /**
2685
- * @public
2686
- * @classdesc Service to working with dialog using handler chain.
2687
- * @extends {BaseHandlerChainService}
2688
- */
2689
- class DialogService extends BaseHandlerChainService {
2690
- constructor() {
2691
- super(...arguments);
2692
- /**
2693
- * @internal
2694
- */
2695
- this.requestType = 'crt.DialogService';
2696
- }
2697
- }
2698
- __decorate([
2699
- ImplementUsingHandlerChain({
2700
- methodName: 'openDialog',
2701
- }),
2702
- __metadata("design:type", Function)
2703
- ], DialogService.prototype, "open", void 0);
2704
-
2705
- /**
2706
- * Generated bundle index. Do not edit.
2707
- */
2708
-
2709
- export { BaseRequestHandler, BaseValidator, BootstrapNotifier, ChatMessageTypeRegistry, ConverterRegistry, CrtChatMessageType, CrtConverter, CrtDesignTimeViewElement, CrtInject, CrtInput, CrtInputRegistrationConfig, CrtInterfaceDesignerItem, CrtModule, CrtOutput, CrtRequest, CrtRequestHandler, CrtValidationInput, CrtValidator, CrtViewElement, CrtZoneService, DataRequest, DataSourceLoadType, DesignTimeViewElementRegistry, DesignerToolGroupType, DialogService, FeatureService, HandleViewModelAttributeChangeRequest, HandlerChainService, HandlerChainServicesRegistry, HandlerSourceType, HandlersOrderComparer, HttpClientService, ImplementUsingHandlerChain, InterfaceDesignerItemRegistrationConfig, InterfaceDesignerItemRegistry, InternalRequestHandlerRegistry, InternalRequestHandlerRegistryType, LazyModuleRef, LazyModulesManager, LicenseService, LocalizableValue, MaskService, MethodInvokeRequest, Model, PkgTopology, RemoteEntriesRegistry, RemoteEntryType, RequestHandlerRegistryService, RequestRegistryService, RightsService, SysSetting, SysSettingValue, SysSettingsService, SysValuesService, VIEW_ELEMENT_DEFAULT_HEIGHT, ValidatorMapValue, ValidatorRegistry, ViewElementDataGroupType, ViewElementGroupType, ViewElementProperty, ViewElementRegistry, ViewElementReuseStrategy, ViewElementVisibilityStrategy, _from, applyLocalizeMetadataFn, bootstrapCrtModule, bootstrapCrtModuleHandlerChainServices, bootstrappedCrtModules, callOnContextCreateHooks, callOnContextDestroyHooks, callOnContextUpdateHooks, checkCrtTypeNamePascalCase, checkIfTypeRegistered, checkOnlyOneRegistration, checkTypeNameFormat, checkTypeNamePascalCase, crtInjectPrefix, crtInputPrefix, crtOutputPrefix, crtValidationInputPrefix, designTimeViewElementRegistryKey, getConverterMetadata, getCrtInputsMetadata, getCrtOutputsMetadata, getCrtValidationInputsMetadata, getDesignTimeViewElementMetadata, getHandlerChainServiceMetadata, getInterfaceDesignerItemMetadata, getModuleMetadata, getRequestHandlerMetadata, getTypeDependencies, getValidatorMetadata, getViewElementMetadata, hasInterfaceDesignerItemMetadata, instantiate, interfaceDesignerItemRegistryKey, isComponentPropertyBindable, localize, matchScopes, objectDeepKeys, registerAngularViewElement, registerViewElement, registryKey, resetGlobals, setConverterMetadata, setDesignTimeViewElementMetadata, setInterfaceDesignerItemMetadata, setModuleMetadata, setRequestHandlerMetadata, setValidatorMetadata, setViewElementMetadata, toAggregationEval, toAggregationEvalType, toAggregationFunction, toAggregationType, toDatePart, toDatePartType, toNumericFunctionType, toOrderDirection, toPascalCase, toSortDirection, toStringFunctionType, validatorRegistryKey, viewElementRegistryKey, ɵBaseRegistry, ɵcheckTypeNameFormat, ɵinstantiate };
2710
- //# sourceMappingURL=creatio-devkit-common.mjs.map