@creatio-devkit/common 0.833.0 → 0.1000.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI_GUIDES_INDEX.md +38 -0
- package/CHANGELOG.md +25 -1
- package/DEFERRED_REMOTE_MIGRATION_AI_GUIDE.md +1338 -0
- package/ICON_REQUIREMENTS_AI_GUIDE.md +107 -74
- package/LICENSE.md +5 -6
- package/REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md +357 -4
- package/THIRD_PARTY_LICENSES.txt +160 -0
- package/fesm2022/creatio-devkit-common.mjs +674 -96
- package/fesm2022/creatio-devkit-common.mjs.map +1 -1
- package/index.d.ts +786 -14
- package/package.json +6 -19
- package/types/creatio-devkit-common.d.ts +4509 -0
- package/esm2022/creatio-devkit-common.mjs +0 -5
- package/esm2022/index.mjs +0 -2
- package/esm2022/lib/base-exports.mjs +0 -5
- package/esm2022/lib/external/file-viewer/file-viewer-factory.service.mjs +0 -26
- package/esm2022/lib/external/file-viewer/file-viewer-instance.model.mjs +0 -51
- package/esm2022/lib/external/file-viewer/file-viewer-options.model.mjs +0 -2
- package/esm2022/lib/external/file-viewer/index.mjs +0 -4
- package/esm2022/lib/external/functions/aggregation-adapter.mjs +0 -72
- package/esm2022/lib/external/functions/date-part-type-adapter.mjs +0 -48
- package/esm2022/lib/external/functions/function-type-adapter.mjs +0 -28
- package/esm2022/lib/external/functions/index.mjs +0 -5
- package/esm2022/lib/external/functions/order-direction-adapter.mjs +0 -28
- package/esm2022/lib/external/models/attribute-value-config.mjs +0 -2
- package/esm2022/lib/external/models/date-time/grouped-date-value.mjs +0 -2
- package/esm2022/lib/external/models/date-time/index.mjs +0 -2
- package/esm2022/lib/external/models/file-value.model.mjs +0 -2
- package/esm2022/lib/external/models/index.mjs +0 -4
- package/esm2022/lib/index.mjs +0 -18
- package/esm2022/lib/internal/constants/default-size.const.mjs +0 -5
- package/esm2022/lib/internal/constants/index.mjs +0 -3
- package/esm2022/lib/internal/constants/metadata.const.mjs +0 -17
- package/esm2022/lib/internal/decorators/design-time-view-element/design-time-view-element.decorator.mjs +0 -19
- package/esm2022/lib/internal/decorators/design-time-view-element/index.mjs +0 -2
- package/esm2022/lib/internal/decorators/implement-using-handler-chain/implement-using-handler-chain.decorator.mjs +0 -25
- package/esm2022/lib/internal/decorators/implement-using-handler-chain/index.mjs +0 -2
- package/esm2022/lib/internal/decorators/index.mjs +0 -4
- package/esm2022/lib/internal/decorators/request/index.mjs +0 -2
- package/esm2022/lib/internal/decorators/request/request.decorator.mjs +0 -15
- package/esm2022/lib/internal/enums/designer-group-type.enum.mjs +0 -16
- package/esm2022/lib/internal/enums/handler-source-type.enum.mjs +0 -12
- package/esm2022/lib/internal/enums/index.mjs +0 -4
- package/esm2022/lib/internal/enums/view-element-group-type.enum.mjs +0 -13
- package/esm2022/lib/internal/models/attribute-property-config.interface.mjs +0 -2
- package/esm2022/lib/internal/models/converter/converter-registry-item.mjs +0 -2
- package/esm2022/lib/internal/models/converter/index.mjs +0 -2
- package/esm2022/lib/internal/models/data-source-load-parameters.mjs +0 -2
- package/esm2022/lib/internal/models/design-time-view-element-registry-item.mjs +0 -2
- package/esm2022/lib/internal/models/handler-chain-service-registry-item.mjs +0 -2
- package/esm2022/lib/internal/models/index.mjs +0 -20
- package/esm2022/lib/internal/models/injection-context/index.mjs +0 -2
- package/esm2022/lib/internal/models/injection-context/injection-context.mjs +0 -2
- package/esm2022/lib/internal/models/interface-designer-item/base-interface-designer-item-registration-config.mjs +0 -2
- package/esm2022/lib/internal/models/interface-designer-item/index.mjs +0 -4
- package/esm2022/lib/internal/models/interface-designer-item/interface-designer-item-registration-config.model.mjs +0 -7
- package/esm2022/lib/internal/models/interface-designer-item/toolbar-view-element-config.mjs +0 -2
- package/esm2022/lib/internal/models/interface-designer-registry-item.mjs +0 -2
- package/esm2022/lib/internal/models/internal-interface-designer-item-registration-config.model.mjs +0 -2
- package/esm2022/lib/internal/models/internal-module-definition.mjs +0 -2
- package/esm2022/lib/internal/models/lazy-module-metadata.mjs +0 -2
- package/esm2022/lib/internal/models/lazy-module-ref.mjs +0 -26
- package/esm2022/lib/internal/models/lazy-registry-item.mjs +0 -2
- package/esm2022/lib/internal/models/remote-build-info.mjs +0 -9
- package/esm2022/lib/internal/models/request/index.mjs +0 -2
- package/esm2022/lib/internal/models/request/method-invoke-request.mjs +0 -12
- package/esm2022/lib/internal/models/request-handler/contexed-handler-scope-config.mjs +0 -2
- package/esm2022/lib/internal/models/request-handler/handler-config.mjs +0 -2
- package/esm2022/lib/internal/models/request-handler/handler-source.mjs +0 -2
- package/esm2022/lib/internal/models/request-handler/index.mjs +0 -6
- package/esm2022/lib/internal/models/request-handler/request-handler-factory.mjs +0 -2
- package/esm2022/lib/internal/models/request-handler/request-handler-registration-config.model.mjs +0 -2
- package/esm2022/lib/internal/models/transaction/index.mjs +0 -4
- package/esm2022/lib/internal/models/transaction/transaction-factory.mjs +0 -2
- package/esm2022/lib/internal/models/transaction/transaction-operation.mjs +0 -2
- package/esm2022/lib/internal/models/transaction/transaction.mjs +0 -2
- package/esm2022/lib/internal/models/validator/index.mjs +0 -4
- package/esm2022/lib/internal/models/validator/validator-parameters.mjs +0 -2
- package/esm2022/lib/internal/models/validator/validator-registry-item.mjs +0 -2
- package/esm2022/lib/internal/models/validator/validator-schema-config.model.mjs +0 -2
- package/esm2022/lib/internal/models/view-element/angular-view-element-registration-config.model.mjs +0 -2
- package/esm2022/lib/internal/models/view-element/index.mjs +0 -2
- package/esm2022/lib/internal/models/view-element-registry-item.mjs +0 -2
- package/esm2022/lib/internal/services/base-handler-chain.service.mjs +0 -3
- package/esm2022/lib/internal/services/base-registry/base-registry.mjs +0 -31
- package/esm2022/lib/internal/services/base-registry/index.mjs +0 -2
- package/esm2022/lib/internal/services/bootstrap-notifier/bootstrap-notifier.mjs +0 -28
- package/esm2022/lib/internal/services/bootstrap-notifier/index.mjs +0 -2
- package/esm2022/lib/internal/services/chat-message-type-registry/chat-message-type-registry.mjs +0 -22
- package/esm2022/lib/internal/services/chat-message-type-registry/index.mjs +0 -2
- package/esm2022/lib/internal/services/design-time-view-element-registry/design-time-view-element-registry.mjs +0 -32
- package/esm2022/lib/internal/services/design-time-view-element-registry/index.mjs +0 -2
- package/esm2022/lib/internal/services/element-registration-checker/element-registration-checker.mjs +0 -60
- package/esm2022/lib/internal/services/element-registration-checker/index.mjs +0 -2
- package/esm2022/lib/internal/services/global-converters-registry/converter-registry.mjs +0 -36
- package/esm2022/lib/internal/services/global-converters-registry/index.mjs +0 -2
- package/esm2022/lib/internal/services/handler-chain-services-registry/handler-chain-services-registry.mjs +0 -26
- package/esm2022/lib/internal/services/handler-chain-services-registry/index.mjs +0 -2
- package/esm2022/lib/internal/services/index.mjs +0 -17
- package/esm2022/lib/internal/services/interface-designer-item-registry/index.mjs +0 -3
- package/esm2022/lib/internal/services/interface-designer-item-registry/interface-designer-item-registry.mjs +0 -53
- package/esm2022/lib/internal/services/interface-designer-item-registry/mobile-interface-designer-item-registry.mjs +0 -12
- package/esm2022/lib/internal/services/lazy-modules-manager/index.mjs +0 -2
- package/esm2022/lib/internal/services/lazy-modules-manager/lazy-modules-manager.mjs +0 -35
- package/esm2022/lib/internal/services/pkg-topology-registry/index.mjs +0 -2
- package/esm2022/lib/internal/services/pkg-topology-registry/pkg-topology-registry.mjs +0 -18
- package/esm2022/lib/internal/services/remote-entries-registry/index.mjs +0 -2
- package/esm2022/lib/internal/services/remote-entries-registry/remote-entries-registry.mjs +0 -18
- package/esm2022/lib/internal/services/request-handler-registry/index.mjs +0 -2
- package/esm2022/lib/internal/services/request-handler-registry/request-handler-registry.service.mjs +0 -131
- package/esm2022/lib/internal/services/request-registry/index.mjs +0 -2
- package/esm2022/lib/internal/services/request-registry/request-registry.service.mjs +0 -33
- package/esm2022/lib/internal/services/request-resolver/base-requests-resolver.mjs +0 -6
- package/esm2022/lib/internal/services/request-resolver/index.mjs +0 -3
- package/esm2022/lib/internal/services/request-resolver/requests-resolver.mjs +0 -17
- package/esm2022/lib/internal/services/validator-registry/index.mjs +0 -2
- package/esm2022/lib/internal/services/validator-registry/validator-registry.mjs +0 -45
- package/esm2022/lib/internal/services/view-element-registry/base-view-element-registry.mjs +0 -74
- package/esm2022/lib/internal/services/view-element-registry/index.mjs +0 -4
- package/esm2022/lib/internal/services/view-element-registry/mobile-view-element-registry.mjs +0 -13
- package/esm2022/lib/internal/services/view-element-registry/view-element-registry.mjs +0 -12
- package/esm2022/lib/internal/types/index.mjs +0 -3
- package/esm2022/lib/internal/types/internal-resolve-dependency-fn.type.mjs +0 -2
- package/esm2022/lib/internal/types/localizable-values.type.mjs +0 -2
- package/esm2022/lib/internal/utils/handlers-order-comparer.mjs +0 -42
- package/esm2022/lib/internal/utils/index.mjs +0 -8
- package/esm2022/lib/internal/utils/instantiate.mjs +0 -24
- package/esm2022/lib/internal/utils/localization-utils.mjs +0 -24
- package/esm2022/lib/internal/utils/metadata-utils.mjs +0 -236
- package/esm2022/lib/internal/utils/module-utils.mjs +0 -38
- package/esm2022/lib/internal/utils/object-deep-keys/index.mjs +0 -2
- package/esm2022/lib/internal/utils/object-deep-keys/object-deep-keys.mjs +0 -13
- package/esm2022/lib/internal/utils/request-handler-scopes.mjs +0 -10
- package/esm2022/lib/public/decorators/chat-message-type/chat-message-type.decorator.mjs +0 -20
- package/esm2022/lib/public/decorators/chat-message-type/index.mjs +0 -2
- package/esm2022/lib/public/decorators/converter/converter.decorator.mjs +0 -21
- package/esm2022/lib/public/decorators/converter/index.mjs +0 -2
- package/esm2022/lib/public/decorators/index.mjs +0 -12
- package/esm2022/lib/public/decorators/inject/index.mjs +0 -2
- package/esm2022/lib/public/decorators/inject/inject.decorator.mjs +0 -19
- package/esm2022/lib/public/decorators/input/index.mjs +0 -2
- package/esm2022/lib/public/decorators/input/input.decorator.mjs +0 -25
- package/esm2022/lib/public/decorators/interface-designer-item/index.mjs +0 -4
- package/esm2022/lib/public/decorators/interface-designer-item/interface-designer-item-decorator-utils.mjs +0 -29
- package/esm2022/lib/public/decorators/interface-designer-item/interface-designer-item.decorator.mjs +0 -10
- package/esm2022/lib/public/decorators/interface-designer-item/mobile-interface-designer-item.decorator.mjs +0 -10
- package/esm2022/lib/public/decorators/module/index.mjs +0 -2
- package/esm2022/lib/public/decorators/module/module.decorator.mjs +0 -9
- package/esm2022/lib/public/decorators/output/index.mjs +0 -2
- package/esm2022/lib/public/decorators/output/output.decorator.mjs +0 -19
- package/esm2022/lib/public/decorators/request-handler/index.mjs +0 -2
- package/esm2022/lib/public/decorators/request-handler/request-handler.decorator.mjs +0 -22
- package/esm2022/lib/public/decorators/validation-input/index.mjs +0 -2
- package/esm2022/lib/public/decorators/validation-input/validation-input.decorator.mjs +0 -27
- package/esm2022/lib/public/decorators/validator/index.mjs +0 -2
- package/esm2022/lib/public/decorators/validator/validator.decorator.mjs +0 -25
- package/esm2022/lib/public/decorators/view-element/index.mjs +0 -4
- package/esm2022/lib/public/decorators/view-element/mobile-view-element.decorator.mjs +0 -9
- package/esm2022/lib/public/decorators/view-element/view-element-decorator-utils.mjs +0 -33
- package/esm2022/lib/public/decorators/view-element/view-element.decorator.mjs +0 -10
- package/esm2022/lib/public/enums/data-source-load-type.enum.mjs +0 -10
- package/esm2022/lib/public/enums/index.mjs +0 -5
- package/esm2022/lib/public/enums/process-status.enum.mjs +0 -28
- package/esm2022/lib/public/enums/view-element-property.enum.mjs +0 -9
- package/esm2022/lib/public/enums/view-model-collection-action-type.enum.mjs +0 -24
- package/esm2022/lib/public/functions/bootstrap-crt-module-handler-chain-services.mjs +0 -32
- package/esm2022/lib/public/functions/bootstrap-crt-module.mjs +0 -357
- package/esm2022/lib/public/functions/bootstrapped-crt-modules.mjs +0 -8
- package/esm2022/lib/public/functions/crt-module-context-hooks.mjs +0 -30
- package/esm2022/lib/public/functions/define-render-config.mjs +0 -16
- package/esm2022/lib/public/functions/index.mjs +0 -10
- package/esm2022/lib/public/functions/localize.mjs +0 -29
- package/esm2022/lib/public/functions/register-angular-view-element.mjs +0 -13
- package/esm2022/lib/public/functions/register-view-element.mjs +0 -21
- package/esm2022/lib/public/functions/reset-globals.mjs +0 -37
- package/esm2022/lib/public/handlers/base-request-handler.mjs +0 -37
- package/esm2022/lib/public/handlers/index.mjs +0 -2
- package/esm2022/lib/public/models/ai-context/ai-context-part.mjs +0 -2
- package/esm2022/lib/public/models/ai-context/index.mjs +0 -2
- package/esm2022/lib/public/models/base-response.model.mjs +0 -2
- package/esm2022/lib/public/models/converter/converter-config.mjs +0 -2
- package/esm2022/lib/public/models/converter/index.mjs +0 -2
- package/esm2022/lib/public/models/converter.model.mjs +0 -2
- package/esm2022/lib/public/models/entity.model.mjs +0 -2
- package/esm2022/lib/public/models/error-info.model.mjs +0 -2
- package/esm2022/lib/public/models/image-value.model.mjs +0 -2
- package/esm2022/lib/public/models/index.mjs +0 -21
- package/esm2022/lib/public/models/input/index.mjs +0 -2
- package/esm2022/lib/public/models/input/input-registration-config.model.mjs +0 -6
- package/esm2022/lib/public/models/interface-designer-item/index.mjs +0 -2
- package/esm2022/lib/public/models/interface-designer-item/interface-designer-item-definition.mjs +0 -2
- package/esm2022/lib/public/models/item-creation-config.mjs +0 -2
- package/esm2022/lib/public/models/license/index.mjs +0 -2
- package/esm2022/lib/public/models/license/license-restriction-operation-values.model.mjs +0 -2
- package/esm2022/lib/public/models/localizable-value.mjs +0 -20
- package/esm2022/lib/public/models/mask-settings.mjs +0 -2
- package/esm2022/lib/public/models/module-definition.mjs +0 -2
- package/esm2022/lib/public/models/process-engine/index.mjs +0 -4
- package/esm2022/lib/public/models/process-engine/process-parameter-value.model.mjs +0 -2
- package/esm2022/lib/public/models/process-engine/run-process-request.model.mjs +0 -12
- package/esm2022/lib/public/models/process-engine/run-process-response.model.mjs +0 -2
- package/esm2022/lib/public/models/request/base-request-config.mjs +0 -8
- package/esm2022/lib/public/models/request/data-source-request.mjs +0 -11
- package/esm2022/lib/public/models/request/handle-view-model-attribute-change.request.mjs +0 -29
- package/esm2022/lib/public/models/request/index.mjs +0 -6
- package/esm2022/lib/public/models/request/model-event.model.mjs +0 -2
- package/esm2022/lib/public/models/request/view-model-attribute-change-event-options.mjs +0 -2
- package/esm2022/lib/public/models/request-handler/index.mjs +0 -2
- package/esm2022/lib/public/models/request-handler/request-handler-definition.mjs +0 -2
- package/esm2022/lib/public/models/validation/base-validator.mjs +0 -40
- package/esm2022/lib/public/models/validation/crt-control-state.mjs +0 -2
- package/esm2022/lib/public/models/validation/crt-validation-errors.mjs +0 -2
- package/esm2022/lib/public/models/validation/crt-validator-fn.mjs +0 -2
- package/esm2022/lib/public/models/validation/index.mjs +0 -8
- package/esm2022/lib/public/models/validation/validation-info.mjs +0 -2
- package/esm2022/lib/public/models/validation/validator-config.mjs +0 -2
- package/esm2022/lib/public/models/validation/validator-parameter-values.mjs +0 -2
- package/esm2022/lib/public/models/view-element/base-view-element-registration-config.mjs +0 -2
- package/esm2022/lib/public/models/view-element/index.mjs +0 -6
- package/esm2022/lib/public/models/view-element/view-element-registration-config.mjs +0 -2
- package/esm2022/lib/public/models/view-element/view-element-render-strategy.mjs +0 -18
- package/esm2022/lib/public/models/view-element/view-element-reuse-strategy.enum.mjs +0 -15
- package/esm2022/lib/public/models/view-element/view-element-slot-definition.mjs +0 -2
- package/esm2022/lib/public/models/view-model-collection/index.mjs +0 -3
- package/esm2022/lib/public/models/view-model-collection/view-model-collection-change.model.mjs +0 -2
- package/esm2022/lib/public/models/view-model-collection/view-model-collection.model.mjs +0 -2
- package/esm2022/lib/public/services/ai-context/ai-context.service.mjs +0 -86
- package/esm2022/lib/public/services/ai-context/index.mjs +0 -2
- package/esm2022/lib/public/services/crt-zone/crt-zone.service.mjs +0 -22
- package/esm2022/lib/public/services/crt-zone/index.mjs +0 -2
- package/esm2022/lib/public/services/dialog-service/dialog.service.mjs +0 -24
- package/esm2022/lib/public/services/dialog-service/index.mjs +0 -2
- package/esm2022/lib/public/services/feature/feature.service.mjs +0 -26
- package/esm2022/lib/public/services/feature/index.mjs +0 -2
- package/esm2022/lib/public/services/handler-chain/handler-chain.service.mjs +0 -71
- package/esm2022/lib/public/services/handler-chain/index.mjs +0 -2
- package/esm2022/lib/public/services/handler-chain/internal-handler-chain.mjs +0 -195
- package/esm2022/lib/public/services/http-client/http-client.service.mjs +0 -83
- package/esm2022/lib/public/services/http-client/http-headers.mjs +0 -2
- package/esm2022/lib/public/services/http-client/http-response.mjs +0 -2
- package/esm2022/lib/public/services/http-client/index.mjs +0 -4
- package/esm2022/lib/public/services/index.mjs +0 -17
- package/esm2022/lib/public/services/license/index.mjs +0 -2
- package/esm2022/lib/public/services/license/license.service.mjs +0 -30
- package/esm2022/lib/public/services/mask-service/index.mjs +0 -2
- package/esm2022/lib/public/services/mask-service/mask.service.mjs +0 -46
- package/esm2022/lib/public/services/message-channel/index.mjs +0 -2
- package/esm2022/lib/public/services/message-channel/message-channel.service.mjs +0 -27
- package/esm2022/lib/public/services/model/index.mjs +0 -2
- package/esm2022/lib/public/services/model/model.mjs +0 -102
- package/esm2022/lib/public/services/process-engine/index.mjs +0 -2
- package/esm2022/lib/public/services/process-engine/process-engine.service.mjs +0 -27
- package/esm2022/lib/public/services/rights/index.mjs +0 -2
- package/esm2022/lib/public/services/rights/rights.service.mjs +0 -26
- package/esm2022/lib/public/services/schema-modal/index.mjs +0 -3
- package/esm2022/lib/public/services/schema-modal/schema-modal-config.model.mjs +0 -2
- package/esm2022/lib/public/services/schema-modal/schema-modal.service.mjs +0 -23
- package/esm2022/lib/public/services/sys-settings/index.mjs +0 -3
- package/esm2022/lib/public/services/sys-settings/sys-setting.model.mjs +0 -24
- package/esm2022/lib/public/services/sys-settings/sys-settings.service.mjs +0 -36
- package/esm2022/lib/public/services/sys-values/index.mjs +0 -3
- package/esm2022/lib/public/services/sys-values/sys-values.mjs +0 -2
- package/esm2022/lib/public/services/sys-values/sys-values.service.mjs +0 -23
- package/esm2022/lib/public/services/transaction-factory/index.mjs +0 -2
- package/esm2022/lib/public/services/transaction-factory/transaction-factory.service.mjs +0 -40
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ɵgenerateGuid as _generateGuid, ɵNextHandlerAlreadySpecifiedException as _NextHandlerAlreadySpecifiedException, ɵAggregationType as _AggregationType, ɵAggregationFunction as _AggregationFunction, ɵAggregationEvalType as _AggregationEvalType, ɵDatePartType as _DatePartType, ɵFunctionType as _FunctionType, ɵOrderDirection as _OrderDirection, ɵBaseRequest as _BaseRequest, ɵSchemaViewMaskRequest as _SchemaViewMaskRequest, ɵSchemaViewMaskRequestAction as _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, ɵ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, ɵMessageChannelType as MessageChannelType, ɵ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, ɵSubscription as Subscription, ɵUpdateQuery as UpdateQuery, ɵValidationUtilities as ValidationUtilities, ɵWindowFunctionColumn as WindowFunctionColumn, ɵWindowFunctionExpression as WindowFunctionExpression, ɵencodeDate as encodeDate, ɵgenerateGuid as generateGuid, ɵisEmptyGuid as isEmptyGuid, ɵisGuid as isGuid, ɵtoLocalISOString as toLocalISOString } from '@creatio/base';
|
|
1
|
+
import { ɵgenerateGuid as _generateGuid, ɵNextHandlerAlreadySpecifiedException as _NextHandlerAlreadySpecifiedException, ɵAggregationType as _AggregationType, ɵAggregationFunction as _AggregationFunction, ɵAggregationEvalType as _AggregationEvalType, ɵDatePartType as _DatePartType, ɵFunctionType as _FunctionType, ɵOrderDirection as _OrderDirection, ɵBaseRequest as _BaseRequest, ɵSchemaViewMaskRequest as _SchemaViewMaskRequest, ɵSchemaViewMaskRequestAction as _SchemaViewMaskRequestAction, ɵFilterGroup as _FilterGroup, ɵComparisonType as _ComparisonType, ɵModelParameterType as _ModelParameterType } 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, ɵ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, ɵFilterGroupOriginType as FilterGroupOriginType, ɵ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, ɵMessageChannelType as MessageChannelType, ɵ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, ɵSegmentFilter as SegmentFilter, ɵSelectLocalizationQuery as SelectLocalizationQuery, ɵSingleFilter as SingleFilter, ɵSubQueryColumn as SubQueryColumn, ɵSubQueryExpression as SubQueryExpression, ɵSubscription as Subscription, ɵUpdateQuery as UpdateQuery, ɵValidationUtilities as ValidationUtilities, ɵWindowFunctionColumn as WindowFunctionColumn, ɵWindowFunctionExpression as WindowFunctionExpression, ɵencodeDate as encodeDate, ɵgenerateGuid as generateGuid, ɵisEmptyGuid as isEmptyGuid, ɵisGuid as isGuid, ɵtoLocalISOString as toLocalISOString } from '@creatio/base';
|
|
3
3
|
import { get, set, upperFirst, camelCase, isEqual, cloneDeep, isEmpty } from 'lodash';
|
|
4
4
|
import 'reflect-metadata';
|
|
5
5
|
import { __decorate, __metadata } from 'tslib';
|
|
@@ -33,36 +33,199 @@ class FileViewerFactory {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
+
* Tracks the number of deferred feature activations currently running per remote build.
|
|
37
|
+
*/
|
|
38
|
+
const activeRemoteFeatureActivations = new Map();
|
|
39
|
+
/**
|
|
40
|
+
* Marks the remote activation as in progress and returns a disposer that releases that mark.
|
|
41
|
+
*
|
|
42
|
+
* Multiple deferred features from the same remote can activate concurrently, so the tracking is
|
|
43
|
+
* reference-counted instead of boolean.
|
|
44
|
+
*
|
|
45
|
+
* @param remoteName - Name of the remote build.
|
|
46
|
+
* @returns Function that decrements the activation counter for the remote.
|
|
47
|
+
*/
|
|
48
|
+
function trackRemoteFeatureActivation(remoteName) {
|
|
49
|
+
activeRemoteFeatureActivations.set(remoteName, (activeRemoteFeatureActivations.get(remoteName) ?? 0) + 1);
|
|
50
|
+
return () => {
|
|
51
|
+
const nextActivationCount = (activeRemoteFeatureActivations.get(remoteName) ?? 1) - 1;
|
|
52
|
+
if (nextActivationCount <= 0) {
|
|
53
|
+
activeRemoteFeatureActivations.delete(remoteName);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
activeRemoteFeatureActivations.set(remoteName, nextActivationCount);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Indicates whether at least one deferred feature activation is currently running for the remote.
|
|
61
|
+
*
|
|
62
|
+
* @param remoteName - Name of the remote build.
|
|
63
|
+
* @returns `true` when the remote has an active feature activation in progress.
|
|
64
|
+
*
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
function ɵisRemoteFeatureActivationInProgress(remoteName) {
|
|
68
|
+
return activeRemoteFeatureActivations.has(remoteName);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Clears tracked remote feature activations.
|
|
72
|
+
*
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
function ɵresetRemoteFeatureActivationTracking() {
|
|
76
|
+
activeRemoteFeatureActivations.clear();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Represents a deferred feature activation boundary.
|
|
80
|
+
*
|
|
81
|
+
* The instance guarantees at-most-once activation per feature while keeping remote-level
|
|
82
|
+
* activation tracking balanced for the entire activation lifetime.
|
|
83
|
+
*
|
|
36
84
|
* @internal
|
|
37
85
|
*/
|
|
38
|
-
class
|
|
86
|
+
class ɵFeatureActivationRef {
|
|
87
|
+
/**
|
|
88
|
+
* @internal
|
|
89
|
+
* @dontChange
|
|
90
|
+
*/
|
|
91
|
+
static { this._instanceOfKey = 'devkit_FeatureActivationRef'; }
|
|
92
|
+
#activationPromise;
|
|
93
|
+
#activated = false;
|
|
94
|
+
#activate;
|
|
95
|
+
/**
|
|
96
|
+
* Initializes a feature activation reference.
|
|
97
|
+
*
|
|
98
|
+
* @param id - Stable feature identifier.
|
|
99
|
+
* @param sourceName - Name of the source build that owns the feature.
|
|
100
|
+
* @param activate - Callback that performs feature activation.
|
|
101
|
+
*/
|
|
102
|
+
constructor(id, sourceName, activate) {
|
|
103
|
+
this.id = id;
|
|
104
|
+
this.sourceName = sourceName;
|
|
105
|
+
this.#activate = activate;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
static [Symbol.hasInstance](instance) {
|
|
111
|
+
const ref = instance;
|
|
112
|
+
const instanceOfKey = ref?.constructor?.['_instanceOfKey'];
|
|
113
|
+
// Bundles are rebuilt independently, so a reference can come from a bundle that predates the
|
|
114
|
+
// key. Such references are matched by their activation method instead.
|
|
115
|
+
return instanceOfKey
|
|
116
|
+
? instanceOfKey === ɵFeatureActivationRef._instanceOfKey
|
|
117
|
+
: typeof ref?.ensureActivated === 'function';
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Indicates whether the activation callback has completed successfully.
|
|
121
|
+
*/
|
|
122
|
+
get activated() {
|
|
123
|
+
return this.#activated;
|
|
124
|
+
}
|
|
125
|
+
async #ensureActivated() {
|
|
126
|
+
const releaseActivationTracking = trackRemoteFeatureActivation(this.sourceName);
|
|
127
|
+
try {
|
|
128
|
+
await this.#activate();
|
|
129
|
+
this.#activated = true;
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
this.#activationPromise = undefined;
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
releaseActivationTracking();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Activates the feature if it hasn't been activated yet.
|
|
141
|
+
*/
|
|
142
|
+
ensureActivated() {
|
|
143
|
+
if (!this.#activationPromise) {
|
|
144
|
+
this.#activationPromise = this.#ensureActivated();
|
|
145
|
+
}
|
|
146
|
+
return this.#activationPromise;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Determines whether a lazy reference represents feature activation rather than module bootstrap.
|
|
152
|
+
*
|
|
153
|
+
* @param ref - Lazy reference to inspect.
|
|
154
|
+
* @returns `true` when the reference is a feature activation ref.
|
|
155
|
+
*
|
|
156
|
+
*/
|
|
157
|
+
function isFeatureActivationRef(ref) {
|
|
158
|
+
return ref instanceof ɵFeatureActivationRef;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Loads a lazy reference and returns the resolved module type if applicable.
|
|
162
|
+
* @param ref - Lazy reference to resolve.
|
|
163
|
+
*/
|
|
164
|
+
async function loadLazyRefType(ref) {
|
|
165
|
+
if (isFeatureActivationRef(ref)) {
|
|
166
|
+
await ref.ensureActivated();
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
return ref.loadAndBootstrap();
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Loads a lazy ref for its side effects.
|
|
173
|
+
*
|
|
174
|
+
* @param ref - Lazy reference to resolve.
|
|
175
|
+
*
|
|
176
|
+
* @internal
|
|
177
|
+
*/
|
|
178
|
+
async function ɵloadLazyRef(ref) {
|
|
179
|
+
await loadLazyRefType(ref);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Loads multiple lazy references and collects their resolved module types.
|
|
183
|
+
*
|
|
184
|
+
* @param refs - Lazy references to resolve.
|
|
185
|
+
* @returns List of resolved module types.
|
|
186
|
+
*
|
|
187
|
+
* @internal
|
|
188
|
+
*/
|
|
189
|
+
async function ɵloadLazyRefs(refs) {
|
|
190
|
+
const loadedTypes = await Promise.all(Array.from(refs, (ref) => loadLazyRefType(ref)));
|
|
191
|
+
return loadedTypes.filter((typeRef) => Boolean(typeRef));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @internal
|
|
196
|
+
*/
|
|
197
|
+
class LazyLoadRefsManager {
|
|
39
198
|
constructor() {
|
|
40
|
-
this
|
|
199
|
+
this.#refs = new Set();
|
|
41
200
|
this.lazyLoadingDisabled = false;
|
|
42
201
|
}
|
|
43
|
-
static
|
|
202
|
+
static #globalInstancePath = 'creatio._lazyLoadRefsManager';
|
|
203
|
+
static #instance;
|
|
204
|
+
#refs;
|
|
44
205
|
static get instance() {
|
|
45
|
-
|
|
46
|
-
|
|
206
|
+
let instance = LazyLoadRefsManager.#instance;
|
|
207
|
+
if (!instance) {
|
|
208
|
+
let globalInstance = get(window, LazyLoadRefsManager.#globalInstancePath);
|
|
47
209
|
if (!globalInstance) {
|
|
48
|
-
globalInstance = new
|
|
49
|
-
set(window,
|
|
210
|
+
globalInstance = new LazyLoadRefsManager();
|
|
211
|
+
set(window, LazyLoadRefsManager.#globalInstancePath, globalInstance);
|
|
50
212
|
}
|
|
51
|
-
|
|
213
|
+
LazyLoadRefsManager.#instance = globalInstance;
|
|
214
|
+
instance = globalInstance;
|
|
52
215
|
}
|
|
53
|
-
return
|
|
216
|
+
return instance;
|
|
54
217
|
}
|
|
55
218
|
add(ref) {
|
|
56
|
-
this.
|
|
219
|
+
this.#refs.add(ref);
|
|
57
220
|
}
|
|
58
221
|
size() {
|
|
59
|
-
return this.
|
|
222
|
+
return this.#refs.size;
|
|
60
223
|
}
|
|
61
224
|
loadAll() {
|
|
62
|
-
return
|
|
225
|
+
return ɵloadLazyRefs(this.#refs);
|
|
63
226
|
}
|
|
64
227
|
clear() {
|
|
65
|
-
this.
|
|
228
|
+
this.#refs.clear();
|
|
66
229
|
}
|
|
67
230
|
}
|
|
68
231
|
|
|
@@ -557,7 +720,7 @@ class InternalHandlerChain {
|
|
|
557
720
|
}
|
|
558
721
|
else {
|
|
559
722
|
const handlers = this._getMatchedHandlers(request);
|
|
560
|
-
if (!
|
|
723
|
+
if (!LazyLoadRefsManager.instance.lazyLoadingDisabled) {
|
|
561
724
|
await this._loadLazyHandlers(request, handlers);
|
|
562
725
|
}
|
|
563
726
|
handler = this._buildHandlersChain(request, handlers);
|
|
@@ -609,19 +772,6 @@ class InternalHandlerChain {
|
|
|
609
772
|
},
|
|
610
773
|
};
|
|
611
774
|
}
|
|
612
|
-
/**
|
|
613
|
-
* @hostPublicApi
|
|
614
|
-
*/
|
|
615
|
-
clearContextedHandlersCache(contextId) {
|
|
616
|
-
const configs = this._handlersScopesByContextId.get(contextId) ?? [];
|
|
617
|
-
return configs.every(({ requestType, scope }) => this._handlersCache.get(requestType)?.delete(scope));
|
|
618
|
-
}
|
|
619
|
-
clear() {
|
|
620
|
-
this._handlers.splice(0);
|
|
621
|
-
this._requestListeners.clear();
|
|
622
|
-
this._handlersCache.clear();
|
|
623
|
-
this._handlersScopesByContextId.clear();
|
|
624
|
-
}
|
|
625
775
|
_getCacheHandler(request) {
|
|
626
776
|
const map = this._handlersCache.get(request.type);
|
|
627
777
|
const key = this._getCacheScopesKey(request);
|
|
@@ -669,17 +819,19 @@ class InternalHandlerChain {
|
|
|
669
819
|
}
|
|
670
820
|
}
|
|
671
821
|
async _loadLazyHandlers(request, configs) {
|
|
672
|
-
const
|
|
822
|
+
const lazyLoadRefs = new Set();
|
|
673
823
|
configs.forEach((config) => {
|
|
674
824
|
if (config.lazy && !config.createHandler) {
|
|
675
|
-
|
|
825
|
+
const lazyRef = config.lazyLoadRef;
|
|
826
|
+
if (lazyRef) {
|
|
827
|
+
lazyLoadRefs.add(lazyRef);
|
|
828
|
+
}
|
|
676
829
|
}
|
|
677
830
|
});
|
|
678
|
-
const
|
|
679
|
-
await Promise.all(lazyModuleRefs.map((m) => m.loadAndBootstrap()));
|
|
831
|
+
const typeRefs = await ɵloadLazyRefs(lazyLoadRefs);
|
|
680
832
|
const injectionContext = this._getInjectionContext(request?.$context);
|
|
681
|
-
if (injectionContext &&
|
|
682
|
-
const deepModuleDependencies =
|
|
833
|
+
if (injectionContext && typeRefs.length) {
|
|
834
|
+
const deepModuleDependencies = getDeepModuleDependencies(typeRefs);
|
|
683
835
|
for (const type of deepModuleDependencies) {
|
|
684
836
|
injectionContext.addLazyModule(type);
|
|
685
837
|
}
|
|
@@ -720,6 +872,19 @@ class InternalHandlerChain {
|
|
|
720
872
|
}
|
|
721
873
|
}
|
|
722
874
|
}
|
|
875
|
+
/**
|
|
876
|
+
* @hostPublicApi
|
|
877
|
+
*/
|
|
878
|
+
clearContextedHandlersCache(contextId) {
|
|
879
|
+
const configs = this._handlersScopesByContextId.get(contextId) ?? [];
|
|
880
|
+
return configs.every(({ requestType, scope }) => this._handlersCache.get(requestType)?.delete(scope));
|
|
881
|
+
}
|
|
882
|
+
clear() {
|
|
883
|
+
this._handlers.splice(0);
|
|
884
|
+
this._requestListeners.clear();
|
|
885
|
+
this._handlersCache.clear();
|
|
886
|
+
this._handlersScopesByContextId.clear();
|
|
887
|
+
}
|
|
723
888
|
}
|
|
724
889
|
|
|
725
890
|
const global$2 = window;
|
|
@@ -1594,13 +1759,13 @@ class RemoteEntriesRegistry extends ɵBaseRegistry {
|
|
|
1594
1759
|
/**
|
|
1595
1760
|
* @internal
|
|
1596
1761
|
*/
|
|
1597
|
-
const registryKey = 'ChatMessageTypeRegistry';
|
|
1762
|
+
const registryKey$1 = 'ChatMessageTypeRegistry';
|
|
1598
1763
|
/**
|
|
1599
1764
|
* @internal
|
|
1600
1765
|
* @hostPublicApi available through window.creatio.registry.ChatMessageTypeRegistry
|
|
1601
1766
|
*/
|
|
1602
1767
|
class ChatMessageTypeRegistry extends ɵBaseRegistry {
|
|
1603
|
-
static { this.registryKey = registryKey; }
|
|
1768
|
+
static { this.registryKey = registryKey$1; }
|
|
1604
1769
|
static get messageTypes() {
|
|
1605
1770
|
return this.store.typeInfos;
|
|
1606
1771
|
}
|
|
@@ -1633,6 +1798,38 @@ class RequestsResolver extends BaseRequestsResolver {
|
|
|
1633
1798
|
}
|
|
1634
1799
|
}
|
|
1635
1800
|
|
|
1801
|
+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
1802
|
+
const registryKey = 'BaseItemRendererRegistry';
|
|
1803
|
+
/**
|
|
1804
|
+
* @internal
|
|
1805
|
+
* @description DI-friendly instance wrapper over the shared static registry store from base registry.
|
|
1806
|
+
*/
|
|
1807
|
+
class BaseItemRendererRegistry extends ɵBaseRegistry {
|
|
1808
|
+
static { this.registryKey = registryKey; }
|
|
1809
|
+
/** Base registry store uses the generic `typeInfos` key for historical reasons. */
|
|
1810
|
+
get _rendererConfigs() {
|
|
1811
|
+
return this.constructor.store.typeInfos;
|
|
1812
|
+
}
|
|
1813
|
+
/**
|
|
1814
|
+
* @internal
|
|
1815
|
+
* @description Registers renderer config by item type in the registry store.
|
|
1816
|
+
* @param type - Item type key.
|
|
1817
|
+
* @param config - Renderer config for the specified type.
|
|
1818
|
+
*/
|
|
1819
|
+
registerItem(type, config) {
|
|
1820
|
+
this._rendererConfigs.set(type, config);
|
|
1821
|
+
}
|
|
1822
|
+
/**
|
|
1823
|
+
* @internal
|
|
1824
|
+
* @description Returns renderer config by item type or null when no registration exists.
|
|
1825
|
+
* @param type - Item type key.
|
|
1826
|
+
* @returns Renderer config for the type or `null`.
|
|
1827
|
+
*/
|
|
1828
|
+
getItem(type) {
|
|
1829
|
+
return this._rendererConfigs.get(type) ?? null;
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1636
1833
|
/**
|
|
1637
1834
|
* @public
|
|
1638
1835
|
* @description Function allows to register user-defined component as view element in Creatio platform.
|
|
@@ -1668,26 +1865,35 @@ function registerAngularViewElement(config, typeRef) {
|
|
|
1668
1865
|
/**
|
|
1669
1866
|
* @internal
|
|
1670
1867
|
*/
|
|
1671
|
-
class
|
|
1868
|
+
class ɵLazyModuleRef {
|
|
1869
|
+
#modulePromise;
|
|
1870
|
+
#typeRef;
|
|
1871
|
+
#moduleDefinition;
|
|
1872
|
+
#bootstrapFn;
|
|
1672
1873
|
get typeRef() {
|
|
1673
|
-
return this
|
|
1874
|
+
return this.#typeRef;
|
|
1674
1875
|
}
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1876
|
+
/**
|
|
1877
|
+
* Initializes the lazy module reference.
|
|
1878
|
+
*
|
|
1879
|
+
* @param moduleDefinition - Lazy module definition with the loader function.
|
|
1880
|
+
* @param bootstrapFn - Function to call after module is loaded.
|
|
1881
|
+
* @param sourceName - Name of source build ('host' or remote name).
|
|
1882
|
+
*/
|
|
1883
|
+
constructor(moduleDefinition, bootstrapFn, sourceName) {
|
|
1680
1884
|
this.sourceName = sourceName;
|
|
1885
|
+
this.#moduleDefinition = moduleDefinition;
|
|
1886
|
+
this.#bootstrapFn = bootstrapFn;
|
|
1681
1887
|
}
|
|
1682
1888
|
loadAndBootstrap() {
|
|
1683
|
-
if (!this
|
|
1684
|
-
this
|
|
1685
|
-
this
|
|
1686
|
-
this
|
|
1889
|
+
if (!this.#modulePromise) {
|
|
1890
|
+
this.#modulePromise = this.#moduleDefinition.load().then((type) => {
|
|
1891
|
+
this.#typeRef = type;
|
|
1892
|
+
this.#bootstrapFn(type);
|
|
1687
1893
|
return type;
|
|
1688
1894
|
});
|
|
1689
1895
|
}
|
|
1690
|
-
return this
|
|
1896
|
+
return this.#modulePromise;
|
|
1691
1897
|
}
|
|
1692
1898
|
}
|
|
1693
1899
|
|
|
@@ -1965,11 +2171,28 @@ function registerViewElements(types) {
|
|
|
1965
2171
|
*/
|
|
1966
2172
|
function registerLazyViewElements(configs, lazyModuleRef) {
|
|
1967
2173
|
resistantForEach(configs, (config) => {
|
|
1968
|
-
const registryItem = { ...config, lazy: true, lazyModuleRef };
|
|
2174
|
+
const registryItem = { ...config, lazy: true, lazyLoadRef: lazyModuleRef };
|
|
1969
2175
|
ViewElementRegistry.validate(registryItem);
|
|
1970
2176
|
ViewElementRegistry.register(registryItem);
|
|
1971
2177
|
});
|
|
1972
2178
|
}
|
|
2179
|
+
/**
|
|
2180
|
+
* @internal
|
|
2181
|
+
*/
|
|
2182
|
+
function validateRemoteViewElements(types, remoteName) {
|
|
2183
|
+
const invalidTypes = types.filter((type) => hasInterfaceDesignerItemMetadata(type) || hasMobileInterfaceDesignerItemMetadata(type));
|
|
2184
|
+
if (invalidTypes.length === 0) {
|
|
2185
|
+
return;
|
|
2186
|
+
}
|
|
2187
|
+
const invalidTypeNames = invalidTypes.map((type) => `"${type.name}"`).join(', ');
|
|
2188
|
+
throw new Error('Remote module "' +
|
|
2189
|
+
remoteName +
|
|
2190
|
+
'" cannot bootstrap view elements decorated with ' +
|
|
2191
|
+
'"CrtInterfaceDesignerItem" or "CrtMobileInterfaceDesignerItem". ' +
|
|
2192
|
+
'Use "RemoteFeatureDefinition.loadDesignerDefinitions" instead. ' +
|
|
2193
|
+
'Offending types: ' +
|
|
2194
|
+
invalidTypeNames);
|
|
2195
|
+
}
|
|
1973
2196
|
/**
|
|
1974
2197
|
* @internal
|
|
1975
2198
|
*/
|
|
@@ -2020,7 +2243,7 @@ function registerValidators(types, options) {
|
|
|
2020
2243
|
};
|
|
2021
2244
|
if (skipLazyModuleIfItemIsNonLazy(options) && !options.lazy) {
|
|
2022
2245
|
registrationConfig.lazy = false;
|
|
2023
|
-
registrationConfig.
|
|
2246
|
+
registrationConfig.lazyLoadRef = null;
|
|
2024
2247
|
}
|
|
2025
2248
|
ValidatorRegistry.validate(registrationConfig);
|
|
2026
2249
|
ValidatorRegistry.register(registrationConfig);
|
|
@@ -2037,7 +2260,7 @@ function registerLazyValidators(configs, options, lazyModuleRef) {
|
|
|
2037
2260
|
return;
|
|
2038
2261
|
}
|
|
2039
2262
|
}
|
|
2040
|
-
const registryItem = { ...config, lazy: true, lazyModuleRef };
|
|
2263
|
+
const registryItem = { ...config, lazy: true, lazyLoadRef: lazyModuleRef };
|
|
2041
2264
|
ValidatorRegistry.validate(registryItem);
|
|
2042
2265
|
ValidatorRegistry.register(registryItem);
|
|
2043
2266
|
});
|
|
@@ -2059,7 +2282,7 @@ function registerConverters(types, options) {
|
|
|
2059
2282
|
};
|
|
2060
2283
|
if (skipLazyModuleIfItemIsNonLazy(options) && !options.lazy) {
|
|
2061
2284
|
registrationConfig.lazy = false;
|
|
2062
|
-
registrationConfig.
|
|
2285
|
+
registrationConfig.lazyLoadRef = null;
|
|
2063
2286
|
}
|
|
2064
2287
|
ConverterRegistry.register(registrationConfig);
|
|
2065
2288
|
});
|
|
@@ -2075,7 +2298,7 @@ function registerLazyConverters(descriptors, options, lazyModuleRef) {
|
|
|
2075
2298
|
return;
|
|
2076
2299
|
}
|
|
2077
2300
|
}
|
|
2078
|
-
const registryItem = { ...descriptor, lazy: true, lazyModuleRef };
|
|
2301
|
+
const registryItem = { ...descriptor, lazy: true, lazyLoadRef: lazyModuleRef };
|
|
2079
2302
|
ConverterRegistry.register(registryItem);
|
|
2080
2303
|
});
|
|
2081
2304
|
}
|
|
@@ -2116,7 +2339,7 @@ function registerRequestHandlers(types, options, remoteName) {
|
|
|
2116
2339
|
}
|
|
2117
2340
|
if (skipLazyModuleIfItemIsNonLazy(options) && !options.lazy) {
|
|
2118
2341
|
registrationConfig.lazy = false;
|
|
2119
|
-
registrationConfig.
|
|
2342
|
+
registrationConfig.lazyLoadRef = null;
|
|
2120
2343
|
}
|
|
2121
2344
|
RequestHandlerRegistryService.register(registrationConfig, type);
|
|
2122
2345
|
});
|
|
@@ -2135,7 +2358,7 @@ function registerLazyRequestHandlers(descriptors, options, remoteName, lazyModul
|
|
|
2135
2358
|
const registrationConfig = {
|
|
2136
2359
|
...descriptor,
|
|
2137
2360
|
lazy: true,
|
|
2138
|
-
lazyModuleRef,
|
|
2361
|
+
lazyLoadRef: lazyModuleRef,
|
|
2139
2362
|
};
|
|
2140
2363
|
if (options.moduleType === 'host') {
|
|
2141
2364
|
registrationConfig.source = { type: HandlerSourceType.Host };
|
|
@@ -2187,6 +2410,9 @@ function bootstrapDefaultCrtModule(name, type, options, root) {
|
|
|
2187
2410
|
try {
|
|
2188
2411
|
const moduleDefinition = getModuleMetadata(type);
|
|
2189
2412
|
if (moduleDefinition.viewElements) {
|
|
2413
|
+
if (options.moduleType === 'remote' && name && ɵisRemoteFeatureActivationInProgress(name)) {
|
|
2414
|
+
validateRemoteViewElements(moduleDefinition.viewElements, name);
|
|
2415
|
+
}
|
|
2190
2416
|
registerViewElements(moduleDefinition.viewElements);
|
|
2191
2417
|
registerInterfaceDesignerItems(moduleDefinition.viewElements, options?.localizeMetadata);
|
|
2192
2418
|
}
|
|
@@ -2212,9 +2438,9 @@ function bootstrapDefaultCrtModule(name, type, options, root) {
|
|
|
2212
2438
|
console.error("To use lazy loading, 'remoteName' parameter should be specified.");
|
|
2213
2439
|
return;
|
|
2214
2440
|
}
|
|
2215
|
-
const ref = new
|
|
2441
|
+
const ref = new ɵLazyModuleRef(includedModuleMetadata, (x) => bootstrapDefaultCrtModule(name, x, { ...options, lazy: true }, false), source);
|
|
2216
2442
|
bootstrapLazyCrtModule(name, includedModuleMetadata, options, ref);
|
|
2217
|
-
|
|
2443
|
+
LazyLoadRefsManager.instance.add(ref);
|
|
2218
2444
|
}
|
|
2219
2445
|
});
|
|
2220
2446
|
}
|
|
@@ -2339,15 +2565,19 @@ function bootstrapCrtModuleHandlerChainServices(type) {
|
|
|
2339
2565
|
function resetGlobals() {
|
|
2340
2566
|
bootstrappedCrtModules.clear();
|
|
2341
2567
|
ViewElementRegistry.viewElements.clear();
|
|
2568
|
+
MobileViewElementRegistry.viewElements.clear();
|
|
2569
|
+
InterfaceDesignerItemRegistry.clear();
|
|
2570
|
+
MobileInterfaceDesignerItemRegistry.clear();
|
|
2342
2571
|
InternalRequestHandlerRegistry.clear();
|
|
2343
2572
|
HandlerChainService.instance.clear();
|
|
2344
2573
|
ValidatorRegistry.items.clear();
|
|
2345
2574
|
ConverterRegistry.clear();
|
|
2346
2575
|
RemoteEntriesRegistry.items.clear();
|
|
2347
2576
|
PkgTopology.items.clear();
|
|
2348
|
-
|
|
2349
|
-
|
|
2577
|
+
LazyLoadRefsManager.instance.clear();
|
|
2578
|
+
LazyLoadRefsManager.instance.lazyLoadingDisabled = false;
|
|
2350
2579
|
DesignTimeViewElementRegistry.infos.clear();
|
|
2580
|
+
ɵresetRemoteFeatureActivationTracking();
|
|
2351
2581
|
}
|
|
2352
2582
|
|
|
2353
2583
|
/**
|
|
@@ -2380,33 +2610,6 @@ function CrtDesignTimeViewElement(config) {
|
|
|
2380
2610
|
};
|
|
2381
2611
|
}
|
|
2382
2612
|
|
|
2383
|
-
/**
|
|
2384
|
-
* @internal
|
|
2385
|
-
* @hostPublicApi
|
|
2386
|
-
*/
|
|
2387
|
-
class InterfaceDesignerItemRegistrationConfig {
|
|
2388
|
-
}
|
|
2389
|
-
|
|
2390
|
-
/**
|
|
2391
|
-
* @internal
|
|
2392
|
-
* @class MethodInvokeRequest
|
|
2393
|
-
* @description Definition of invoke method request.
|
|
2394
|
-
* @extends {ɵBaseRequest} {@link ɵBaseRequest}
|
|
2395
|
-
* @property {string} method - method name.
|
|
2396
|
-
* @property {unknown[]} args - arguments passing to the method.
|
|
2397
|
-
*/
|
|
2398
|
-
class MethodInvokeRequest extends _BaseRequest {
|
|
2399
|
-
}
|
|
2400
|
-
|
|
2401
|
-
/**
|
|
2402
|
-
* @internal
|
|
2403
|
-
*/
|
|
2404
|
-
var RemoteEntryType;
|
|
2405
|
-
(function (RemoteEntryType) {
|
|
2406
|
-
RemoteEntryType["Script"] = "script";
|
|
2407
|
-
RemoteEntryType["Module"] = "module";
|
|
2408
|
-
})(RemoteEntryType || (RemoteEntryType = {}));
|
|
2409
|
-
|
|
2410
2613
|
/**
|
|
2411
2614
|
* @public
|
|
2412
2615
|
* @description Creatio platform interacts with input's of user-defined component through CrtInput decorator.
|
|
@@ -2553,7 +2756,43 @@ function interfaceDesignerItemRegister(config, platform) {
|
|
|
2553
2756
|
|
|
2554
2757
|
// noinspection ES6PreferShortImport
|
|
2555
2758
|
/**
|
|
2556
|
-
* @
|
|
2759
|
+
* @public
|
|
2760
|
+
* @description (Deprecated) Decorator to declare design time configuration for a view element that is
|
|
2761
|
+
* registered eagerly during module bootstrap.
|
|
2762
|
+
*
|
|
2763
|
+
* @deprecated For new remote integrations, publish interface-designer metadata through
|
|
2764
|
+
* {@link RemoteFeatureDefinition.loadDesignerDefinitions} instead of using this decorator.
|
|
2765
|
+
* Existing remotes may keep using this decorator for backward compatibility, but should migrate
|
|
2766
|
+
* to {@link RemoteEntryDefinition} and {@link RemoteFeatureDefinition} when updated.
|
|
2767
|
+
*
|
|
2768
|
+
* @param config - registration config {@link InterfaceDesignerItemDefinition}.
|
|
2769
|
+
*
|
|
2770
|
+
* @example
|
|
2771
|
+
* @CrtViewElement({
|
|
2772
|
+
* type: "usr.Example',
|
|
2773
|
+
* selector: 'usr-example',
|
|
2774
|
+
* })
|
|
2775
|
+
* @CrtInterfaceDesignerItem({
|
|
2776
|
+
* toolbarConfig: {
|
|
2777
|
+
* caption: 'usrExampleCaption',
|
|
2778
|
+
* icon: require(`!!raw-loader?{esModule:false}!../assets/icon.svg`)
|
|
2779
|
+
* hint: 'usrExampleHint',
|
|
2780
|
+
* defaultPropertyValues: {
|
|
2781
|
+
* value: 'This is default value',
|
|
2782
|
+
* },
|
|
2783
|
+
* },
|
|
2784
|
+
* })
|
|
2785
|
+
* @Component({
|
|
2786
|
+
* selector: 'usr-example',
|
|
2787
|
+
* templateUrl: './app.component.html',
|
|
2788
|
+
* styleUrls: ['./app.component.scss'],
|
|
2789
|
+
* encapsulation: ViewEncapsulation.ShadowDom,
|
|
2790
|
+
* })
|
|
2791
|
+
* export class AppComponent {
|
|
2792
|
+
* @Input()
|
|
2793
|
+
* @CrtInput()
|
|
2794
|
+
* public value!: string;
|
|
2795
|
+
* }
|
|
2557
2796
|
*/
|
|
2558
2797
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2559
2798
|
function CrtInterfaceDesignerItem(config) {
|
|
@@ -2562,7 +2801,43 @@ function CrtInterfaceDesignerItem(config) {
|
|
|
2562
2801
|
|
|
2563
2802
|
// noinspection ES6PreferShortImport
|
|
2564
2803
|
/**
|
|
2565
|
-
* @
|
|
2804
|
+
* @public
|
|
2805
|
+
* @description (Deprecated) Decorator to declare design time configuration for a mobile view element that is
|
|
2806
|
+
* registered eagerly during module bootstrap.
|
|
2807
|
+
*
|
|
2808
|
+
* @deprecated For new remote integrations, publish interface-designer metadata through
|
|
2809
|
+
* {@link RemoteFeatureDefinition.loadDesignerDefinitions} instead of using this decorator.
|
|
2810
|
+
* Existing remotes may keep using this decorator for backward compatibility, but should migrate
|
|
2811
|
+
* to {@link RemoteEntryDefinition} and {@link RemoteFeatureDefinition} when updated.
|
|
2812
|
+
*
|
|
2813
|
+
* @param config - registration config {@link InterfaceDesignerItemDefinition}.
|
|
2814
|
+
*
|
|
2815
|
+
* @example
|
|
2816
|
+
* @CrtMobileViewElement({
|
|
2817
|
+
* type: "usr.Example',
|
|
2818
|
+
* selector: 'usr-example',
|
|
2819
|
+
* })
|
|
2820
|
+
* @CrtMobileInterfaceDesignerItem({
|
|
2821
|
+
* toolbarConfig: {
|
|
2822
|
+
* caption: 'usrExampleCaption',
|
|
2823
|
+
* icon: require(`!!raw-loader?{esModule:false}!../assets/icon.svg`)
|
|
2824
|
+
* hint: 'usrExampleHint',
|
|
2825
|
+
* defaultPropertyValues: {
|
|
2826
|
+
* value: 'This is default value',
|
|
2827
|
+
* },
|
|
2828
|
+
* },
|
|
2829
|
+
* })
|
|
2830
|
+
* @Component({
|
|
2831
|
+
* selector: 'usr-example',
|
|
2832
|
+
* templateUrl: './app.component.html',
|
|
2833
|
+
* styleUrls: ['./app.component.scss'],
|
|
2834
|
+
* encapsulation: ViewEncapsulation.ShadowDom,
|
|
2835
|
+
* })
|
|
2836
|
+
* export class AppComponent {
|
|
2837
|
+
* @Input()
|
|
2838
|
+
* @CrtInput()
|
|
2839
|
+
* public value!: string;
|
|
2840
|
+
* }
|
|
2566
2841
|
*/
|
|
2567
2842
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2568
2843
|
function CrtMobileInterfaceDesignerItem(config) {
|
|
@@ -2665,6 +2940,49 @@ function CrtChatMessageType(config) {
|
|
|
2665
2940
|
};
|
|
2666
2941
|
}
|
|
2667
2942
|
|
|
2943
|
+
/**
|
|
2944
|
+
* @internal
|
|
2945
|
+
*/
|
|
2946
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2947
|
+
function ɵCrtInterfaceDesignerItem(config) {
|
|
2948
|
+
return interfaceDesignerItemRegister(config, 'web');
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
/**
|
|
2952
|
+
* @internal
|
|
2953
|
+
*/
|
|
2954
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2955
|
+
function ɵCrtMobileInterfaceDesignerItem(config) {
|
|
2956
|
+
return interfaceDesignerItemRegister(config, 'mobile');
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
/**
|
|
2960
|
+
* @internal
|
|
2961
|
+
* @hostPublicApi
|
|
2962
|
+
*/
|
|
2963
|
+
class InterfaceDesignerItemRegistrationConfig {
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
/**
|
|
2967
|
+
* @internal
|
|
2968
|
+
* @class MethodInvokeRequest
|
|
2969
|
+
* @description Definition of invoke method request.
|
|
2970
|
+
* @extends {ɵBaseRequest} {@link ɵBaseRequest}
|
|
2971
|
+
* @property {string} method - method name.
|
|
2972
|
+
* @property {unknown[]} args - arguments passing to the method.
|
|
2973
|
+
*/
|
|
2974
|
+
class MethodInvokeRequest extends _BaseRequest {
|
|
2975
|
+
}
|
|
2976
|
+
|
|
2977
|
+
/**
|
|
2978
|
+
* @internal
|
|
2979
|
+
*/
|
|
2980
|
+
var RemoteEntryType;
|
|
2981
|
+
(function (RemoteEntryType) {
|
|
2982
|
+
RemoteEntryType["Script"] = "script";
|
|
2983
|
+
RemoteEntryType["Module"] = "module";
|
|
2984
|
+
})(RemoteEntryType || (RemoteEntryType = {}));
|
|
2985
|
+
|
|
2668
2986
|
/**
|
|
2669
2987
|
* @internal
|
|
2670
2988
|
*/
|
|
@@ -2771,6 +3089,7 @@ class BaseRequestHandler {
|
|
|
2771
3089
|
}
|
|
2772
3090
|
}
|
|
2773
3091
|
|
|
3092
|
+
const instanceKey = 'AiContextServiceInstance';
|
|
2774
3093
|
/**
|
|
2775
3094
|
* Service for managing AI context parts and providing a unified context.
|
|
2776
3095
|
* This service allows adding, retrieving, and removing context parts, which can be
|
|
@@ -2785,7 +3104,8 @@ class AiContextService {
|
|
|
2785
3104
|
* If the instance does not exist, it will be created.
|
|
2786
3105
|
*/
|
|
2787
3106
|
static get instance() {
|
|
2788
|
-
return
|
|
3107
|
+
return (window[instanceKey] ||
|
|
3108
|
+
(window[instanceKey] = new AiContextService()));
|
|
2789
3109
|
}
|
|
2790
3110
|
/**
|
|
2791
3111
|
* Generates a unique identifier for a context part.
|
|
@@ -2825,15 +3145,16 @@ class AiContextService {
|
|
|
2825
3145
|
if (!this._contextParts || this._contextParts.length === 0) {
|
|
2826
3146
|
return [];
|
|
2827
3147
|
}
|
|
2828
|
-
const resolved = await Promise.all(this._contextParts.map((c) => c.provider()));
|
|
3148
|
+
const resolved = await Promise.all(this._contextParts.map(async (c) => ({ id: c.id, value: await c.provider() })));
|
|
2829
3149
|
return resolved
|
|
2830
|
-
.filter((e) => e !== null)
|
|
2831
|
-
.map((
|
|
2832
|
-
const type =
|
|
3150
|
+
.filter((e) => e.value !== null)
|
|
3151
|
+
.map(({ id, value }) => {
|
|
3152
|
+
const type = value.type;
|
|
2833
3153
|
if (!type || type === 'CreatioPageContextPart' || type === 'ConstantValuesContextPart') {
|
|
2834
3154
|
return {
|
|
2835
|
-
...
|
|
3155
|
+
...value,
|
|
2836
3156
|
type,
|
|
3157
|
+
contextId: id,
|
|
2837
3158
|
};
|
|
2838
3159
|
}
|
|
2839
3160
|
throw new Error(`Invalid context part type: ${type}`);
|
|
@@ -3095,6 +3416,45 @@ __decorate([
|
|
|
3095
3416
|
__metadata("design:type", Function)
|
|
3096
3417
|
], MessageChannelService.prototype, "sendMessage", void 0);
|
|
3097
3418
|
|
|
3419
|
+
/**
|
|
3420
|
+
* @public
|
|
3421
|
+
* @description Checks whether hierarchy configuration is client-side.
|
|
3422
|
+
* @param hierarchyConfig Hierarchy configuration to check.
|
|
3423
|
+
* @returns `true` if configuration is of type `ClientSideDataSourceHierarchyConfig`.
|
|
3424
|
+
*/
|
|
3425
|
+
function isClientSideDataSourceHierarchyConfig(hierarchyConfig) {
|
|
3426
|
+
return hierarchyConfig?.type === 'ClientSide';
|
|
3427
|
+
}
|
|
3428
|
+
/**
|
|
3429
|
+
* @public
|
|
3430
|
+
* @description Checks whether hierarchy configuration is server-side.
|
|
3431
|
+
* @param hierarchyConfig Hierarchy configuration to check.
|
|
3432
|
+
* @returns `true` if configuration is of type `ServerSideDataSourceHierarchyConfig`.
|
|
3433
|
+
*/
|
|
3434
|
+
function isServerSideDataSourceHierarchyConfig(hierarchyConfig) {
|
|
3435
|
+
return hierarchyConfig?.type !== 'ClientSide';
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3438
|
+
/**
|
|
3439
|
+
* @public
|
|
3440
|
+
* @description Determines whether the hierarchy node with the specified identifier is expanded
|
|
3441
|
+
* based on the provided hierarchy state.
|
|
3442
|
+
* @param hierarchyState Hierarchy state object.
|
|
3443
|
+
* @param itemId Identifier of the hierarchy node.
|
|
3444
|
+
* @returns True if the node is expanded; otherwise, false.
|
|
3445
|
+
* @remarks If the hierarchy state is not provided or does not contain necessary information,
|
|
3446
|
+
* the function returns false.
|
|
3447
|
+
*/
|
|
3448
|
+
function isHierarchicalItemExpanded(hierarchyState, itemId) {
|
|
3449
|
+
if (hierarchyState?.mode === 'collapsed') {
|
|
3450
|
+
return hierarchyState.expandedIds?.includes(itemId) ?? false;
|
|
3451
|
+
}
|
|
3452
|
+
if (hierarchyState?.mode === 'expanded') {
|
|
3453
|
+
return !(hierarchyState.collapsedIds?.includes(itemId) ?? false);
|
|
3454
|
+
}
|
|
3455
|
+
return false;
|
|
3456
|
+
}
|
|
3457
|
+
|
|
3098
3458
|
/**
|
|
3099
3459
|
* @internal
|
|
3100
3460
|
*/
|
|
@@ -3338,6 +3698,37 @@ __decorate([
|
|
|
3338
3698
|
__metadata("design:type", Function)
|
|
3339
3699
|
], SysValuesService.prototype, "loadSysValues", void 0);
|
|
3340
3700
|
|
|
3701
|
+
/**
|
|
3702
|
+
* @public
|
|
3703
|
+
* @classdesc Service to retrieve available themes using handler chain.
|
|
3704
|
+
* @extends {BaseHandlerChainService}
|
|
3705
|
+
*/
|
|
3706
|
+
class ThemeService extends BaseHandlerChainService {
|
|
3707
|
+
constructor() {
|
|
3708
|
+
super(...arguments);
|
|
3709
|
+
/**
|
|
3710
|
+
* @internal
|
|
3711
|
+
*/
|
|
3712
|
+
this.requestType = 'crt.ThemeService';
|
|
3713
|
+
}
|
|
3714
|
+
}
|
|
3715
|
+
__decorate([
|
|
3716
|
+
ImplementUsingHandlerChain(),
|
|
3717
|
+
__metadata("design:type", Function)
|
|
3718
|
+
], ThemeService.prototype, "getAvailableThemes", void 0);
|
|
3719
|
+
__decorate([
|
|
3720
|
+
ImplementUsingHandlerChain(),
|
|
3721
|
+
__metadata("design:type", Function)
|
|
3722
|
+
], ThemeService.prototype, "applyTheme", void 0);
|
|
3723
|
+
__decorate([
|
|
3724
|
+
ImplementUsingHandlerChain(),
|
|
3725
|
+
__metadata("design:type", Function)
|
|
3726
|
+
], ThemeService.prototype, "canCustomizeBranding", void 0);
|
|
3727
|
+
__decorate([
|
|
3728
|
+
ImplementUsingHandlerChain(),
|
|
3729
|
+
__metadata("design:type", Function)
|
|
3730
|
+
], ThemeService.prototype, "canChangeOwnTheme", void 0);
|
|
3731
|
+
|
|
3341
3732
|
/**
|
|
3342
3733
|
* @public
|
|
3343
3734
|
* @class TransactionFactoryService
|
|
@@ -3375,9 +3766,196 @@ __decorate([
|
|
|
3375
3766
|
__metadata("design:type", Function)
|
|
3376
3767
|
], TransactionFactoryService.prototype, "create", void 0);
|
|
3377
3768
|
|
|
3769
|
+
/**
|
|
3770
|
+
* @public
|
|
3771
|
+
* @class UserConsentService
|
|
3772
|
+
* @classdesc Service to work with consents of the current user.
|
|
3773
|
+
*/
|
|
3774
|
+
class UserConsentService {
|
|
3775
|
+
constructor() {
|
|
3776
|
+
this._consentSchemaName = 'Consent';
|
|
3777
|
+
this._userConsentHistorySchemaName = 'UserConsentHistory';
|
|
3778
|
+
this._sysValuesService = new SysValuesService();
|
|
3779
|
+
}
|
|
3780
|
+
/**
|
|
3781
|
+
* @description Gets shared service instance.
|
|
3782
|
+
* @returns Shared `UserConsentService` instance.
|
|
3783
|
+
*/
|
|
3784
|
+
static get instance() {
|
|
3785
|
+
return UserConsentService._instance || (UserConsentService._instance = new UserConsentService());
|
|
3786
|
+
}
|
|
3787
|
+
/**
|
|
3788
|
+
* Retrieves the current user's contact ID.
|
|
3789
|
+
* @returns Current user contact id. Cached after first retrieval.
|
|
3790
|
+
*/
|
|
3791
|
+
async _getCurrentUserContactId() {
|
|
3792
|
+
if (this._currentUserContactId) {
|
|
3793
|
+
return this._currentUserContactId;
|
|
3794
|
+
}
|
|
3795
|
+
const sysValues = await this._sysValuesService.loadSysValues();
|
|
3796
|
+
const userContactId = sysValues?.userContact?.value ?? sysValues?.userContact?.['Id'];
|
|
3797
|
+
if (!userContactId) {
|
|
3798
|
+
throw new Error('Error while getting user consent status');
|
|
3799
|
+
}
|
|
3800
|
+
this._currentUserContactId = userContactId;
|
|
3801
|
+
return userContactId;
|
|
3802
|
+
}
|
|
3803
|
+
/**
|
|
3804
|
+
* Maps a JSON record to a UserConsent object.
|
|
3805
|
+
* @param record - JSON record to map.
|
|
3806
|
+
* @param code - Consent code associated with the user consent.
|
|
3807
|
+
* @returns User consent object.
|
|
3808
|
+
*/
|
|
3809
|
+
_mapToUserConsent(record, code) {
|
|
3810
|
+
const source = (record ?? {});
|
|
3811
|
+
const createdOn = source['CreatedOn'];
|
|
3812
|
+
const expirationDate = source['ExpirationDate'];
|
|
3813
|
+
return {
|
|
3814
|
+
id: source['Id'],
|
|
3815
|
+
dateOfConsent: new Date(createdOn),
|
|
3816
|
+
expirationDate: expirationDate ? new Date(expirationDate) : null,
|
|
3817
|
+
consentCode: code,
|
|
3818
|
+
};
|
|
3819
|
+
}
|
|
3820
|
+
/**
|
|
3821
|
+
* Creates filter parameters for model loading based on the provided filters.
|
|
3822
|
+
* @param filters - Filter values by column name.
|
|
3823
|
+
* @returns Model filter parameters.
|
|
3824
|
+
*/
|
|
3825
|
+
_createFilterParameters(filters) {
|
|
3826
|
+
const filterGroup = new _FilterGroup();
|
|
3827
|
+
Object.entries(filters).forEach(([columnName, value]) => {
|
|
3828
|
+
filterGroup.addSchemaColumnFilterWithParameter(_ComparisonType.Equal, columnName, value);
|
|
3829
|
+
});
|
|
3830
|
+
return [
|
|
3831
|
+
{
|
|
3832
|
+
type: _ModelParameterType.Filter,
|
|
3833
|
+
value: filterGroup,
|
|
3834
|
+
},
|
|
3835
|
+
];
|
|
3836
|
+
}
|
|
3837
|
+
/**
|
|
3838
|
+
* Selects a consent record from the provided JSON records.
|
|
3839
|
+
* @param records - Records to select from.
|
|
3840
|
+
* @param code - Consent code associated with the consent.
|
|
3841
|
+
* @returns Consent object or `null` if not found.
|
|
3842
|
+
*/
|
|
3843
|
+
_selectConsent(records, code) {
|
|
3844
|
+
if (!records.length) {
|
|
3845
|
+
return null;
|
|
3846
|
+
}
|
|
3847
|
+
const record = records[0];
|
|
3848
|
+
if (!record) {
|
|
3849
|
+
return null;
|
|
3850
|
+
}
|
|
3851
|
+
const source = record;
|
|
3852
|
+
return {
|
|
3853
|
+
id: source['Id'],
|
|
3854
|
+
consentText: source['ConsentText'],
|
|
3855
|
+
name: source['Name'],
|
|
3856
|
+
code,
|
|
3857
|
+
};
|
|
3858
|
+
}
|
|
3859
|
+
/**
|
|
3860
|
+
* Selects a user consent record from the provided JSON records.
|
|
3861
|
+
* @param records - Records to select from.
|
|
3862
|
+
* @param code - Consent code associated with the user consent.
|
|
3863
|
+
* @returns User consent object or `null` if no valid user consent is found.
|
|
3864
|
+
*/
|
|
3865
|
+
_selectUserConsent(records, code) {
|
|
3866
|
+
const normalizedRecords = records.filter((record) => Boolean(record));
|
|
3867
|
+
if (!normalizedRecords.length) {
|
|
3868
|
+
return null;
|
|
3869
|
+
}
|
|
3870
|
+
const perpetualConsent = normalizedRecords.find((record) => !record['ExpirationDate']);
|
|
3871
|
+
if (perpetualConsent) {
|
|
3872
|
+
return this._mapToUserConsent(perpetualConsent, code);
|
|
3873
|
+
}
|
|
3874
|
+
const currentDate = new Date();
|
|
3875
|
+
const validConsent = normalizedRecords.find((record) => {
|
|
3876
|
+
const expirationDate = record['ExpirationDate'];
|
|
3877
|
+
return expirationDate && new Date(expirationDate) > currentDate;
|
|
3878
|
+
});
|
|
3879
|
+
return validConsent ? this._mapToUserConsent(validConsent, code) : null;
|
|
3880
|
+
}
|
|
3881
|
+
/**
|
|
3882
|
+
* Loads the consent model.
|
|
3883
|
+
* @returns Loaded consent model.
|
|
3884
|
+
*/
|
|
3885
|
+
_loadConsentModel() {
|
|
3886
|
+
return Model.create(this._consentSchemaName);
|
|
3887
|
+
}
|
|
3888
|
+
/**
|
|
3889
|
+
* Loads the user consent history model.
|
|
3890
|
+
* @returns Loaded user consent history model.
|
|
3891
|
+
*/
|
|
3892
|
+
_loadUserConsentModel() {
|
|
3893
|
+
return Model.create(this._userConsentHistorySchemaName);
|
|
3894
|
+
}
|
|
3895
|
+
/**
|
|
3896
|
+
* Creates a new user consent record in the user consent history model.
|
|
3897
|
+
* @param consentId - Identifier of the consent record.
|
|
3898
|
+
* @param expirationDate - Optional expiration date of the user consent.
|
|
3899
|
+
*/
|
|
3900
|
+
async _insertUserConsent(consentId, expirationDate) {
|
|
3901
|
+
const model = await this._loadUserConsentModel();
|
|
3902
|
+
await model.insert({
|
|
3903
|
+
ConsentCode: consentId,
|
|
3904
|
+
...(expirationDate ? { ExpirationDate: expirationDate.toISOString() } : {}),
|
|
3905
|
+
});
|
|
3906
|
+
}
|
|
3907
|
+
/**
|
|
3908
|
+
* @description Gets consent by code.
|
|
3909
|
+
* @param code - Consent code.
|
|
3910
|
+
* @returns Consent record or `null` if not found.
|
|
3911
|
+
*/
|
|
3912
|
+
async getConsent(code) {
|
|
3913
|
+
const model = await this._loadConsentModel();
|
|
3914
|
+
const records = await model.load({
|
|
3915
|
+
attributes: ['Id', 'Name', 'ConsentText'],
|
|
3916
|
+
parameters: this._createFilterParameters({ Code: code }),
|
|
3917
|
+
});
|
|
3918
|
+
return this._selectConsent(records, code);
|
|
3919
|
+
}
|
|
3920
|
+
/**
|
|
3921
|
+
* @description Gets current user consent by code.
|
|
3922
|
+
* @param code - Consent code.
|
|
3923
|
+
* @returns User consent record or `null` if no active or perpetual consent exists.
|
|
3924
|
+
*/
|
|
3925
|
+
async getCurrentUserConsent(code) {
|
|
3926
|
+
const createdBy = await this._getCurrentUserContactId();
|
|
3927
|
+
const model = await this._loadUserConsentModel();
|
|
3928
|
+
const records = await model.load({
|
|
3929
|
+
attributes: ['Id', 'CreatedOn', 'ExpirationDate'],
|
|
3930
|
+
parameters: this._createFilterParameters({
|
|
3931
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3932
|
+
'ConsentCode.Code': code,
|
|
3933
|
+
CreatedBy: createdBy,
|
|
3934
|
+
}),
|
|
3935
|
+
});
|
|
3936
|
+
return this._selectUserConsent(records, code);
|
|
3937
|
+
}
|
|
3938
|
+
/**
|
|
3939
|
+
* @description Gives current user consent by code.
|
|
3940
|
+
* @param code - Consent code.
|
|
3941
|
+
* @param expirationDate - Optional expiration date for the user consent.
|
|
3942
|
+
*/
|
|
3943
|
+
async giveCurrentUserConsent(code, expirationDate) {
|
|
3944
|
+
const consent = await this.getConsent(code);
|
|
3945
|
+
if (!consent) {
|
|
3946
|
+
return;
|
|
3947
|
+
}
|
|
3948
|
+
const userConsent = await this.getCurrentUserConsent(code);
|
|
3949
|
+
if (userConsent) {
|
|
3950
|
+
return;
|
|
3951
|
+
}
|
|
3952
|
+
await this._insertUserConsent(consent.id, expirationDate);
|
|
3953
|
+
}
|
|
3954
|
+
}
|
|
3955
|
+
|
|
3378
3956
|
/**
|
|
3379
3957
|
* Generated bundle index. Do not edit.
|
|
3380
3958
|
*/
|
|
3381
3959
|
|
|
3382
|
-
export { AiContextService, BaseInterfaceDesignerItemRegistry, BaseRequestHandler, BaseRequestsResolver, BaseValidator, BaseViewElementRegistry, BootstrapNotifier, ChatMessageTypeRegistry, ConverterRegistry, CrtChatMessageType, CrtConverter, CrtDesignTimeViewElement, CrtInject, CrtInput, CrtInputRegistrationConfig, CrtInterfaceDesignerItem, CrtMobileInterfaceDesignerItem, CrtMobileViewElement, CrtModule, CrtOutput, CrtRequest, CrtRequestHandler, CrtValidationInput, CrtValidator, CrtViewElement, CrtZoneService, DataRequest, DataSourceLoadType, DesignTimeViewElementRegistry, DesignerToolGroupType, DialogService, FeatureService, FileViewerFactory, FileViewerInstance, HandleViewModelAttributeChangeRequest, HandlerChainService, HandlerChainServicesRegistry, HandlerSourceType, HandlersOrderComparer, HttpClientService, ImplementUsingHandlerChain, InterfaceDesignerItemRegistrationConfig, InterfaceDesignerItemRegistry, InternalRequestHandlerRegistry, InternalRequestHandlerRegistryType,
|
|
3960
|
+
export { AiContextService, BaseInterfaceDesignerItemRegistry, BaseItemRendererRegistry, BaseRequestHandler, BaseRequestsResolver, BaseValidator, BaseViewElementRegistry, BootstrapNotifier, ChatMessageTypeRegistry, ConverterRegistry, CrtChatMessageType, CrtConverter, CrtDesignTimeViewElement, CrtInject, CrtInput, CrtInputRegistrationConfig, CrtInterfaceDesignerItem, CrtMobileInterfaceDesignerItem, CrtMobileViewElement, CrtModule, CrtOutput, CrtRequest, CrtRequestHandler, CrtValidationInput, CrtValidator, CrtViewElement, CrtZoneService, DataRequest, DataSourceLoadType, DesignTimeViewElementRegistry, DesignerToolGroupType, DialogService, FeatureService, FileViewerFactory, FileViewerInstance, HandleViewModelAttributeChangeRequest, HandlerChainService, HandlerChainServicesRegistry, HandlerSourceType, HandlersOrderComparer, HttpClientService, ImplementUsingHandlerChain, InterfaceDesignerItemRegistrationConfig, InterfaceDesignerItemRegistry, InternalRequestHandlerRegistry, InternalRequestHandlerRegistryType, LazyLoadRefsManager, LicenseService, LocalizableValue, MaskService, MessageChannelService, MethodInvokeRequest, MobileInterfaceDesignerItemRegistry, MobileViewElementRegistry, Model, PkgTopology, ProcessEngineService, ProcessStatus, RemoteEntriesRegistry, RemoteEntryType, RequestHandlerRegistryService, RequestRegistryService, RequestsResolver, RightsService, RunProcessRequest, SchemaModalService, SysSetting, SysSettingValue, SysSettingsService, SysValuesService, ThemeService, TransactionFactoryService, UserConsentService, VIEW_ELEMENT_DEFAULT_HEIGHT, ValidatorMapValue, ValidatorRegistry, ViewElementDataGroupType, ViewElementGroupType, ViewElementProperty, ViewElementRegistry, ViewElementRenderStrategy, ViewElementReuseStrategy, ViewModelCollectionActionType, _from, applyLocalizeMetadataFn, bootstrapCrtModule, bootstrapCrtModuleHandlerChainServices, bootstrappedCrtModules, callOnContextCreateHooks, callOnContextDestroyHooks, callOnContextUpdateHooks, checkCrtTypeNamePascalCase, checkIfTypeRegistered, checkOnlyOneRegistration, checkTypeNameFormat, checkTypeNamePascalCase, crtInjectPrefix, crtInputPrefix, crtOutputPrefix, crtValidationInputPrefix, defineRenderConfig, designTimeViewElementRegistryKey, getConverterMetadata, getCrtInputsMetadata, getCrtOutputsMetadata, getCrtValidationInputsMetadata, getDeepModuleDependencies, getDesignTimeViewElementMetadata, getHandlerChainServiceMetadata, getInterfaceDesignerItemMetadata, getMobileInterfaceDesignerItemMetadata, getMobileViewElementMetadata, getModuleMetadata, getRequestHandlerMetadata, getTypeDependencies, getValidatorMetadata, getViewElementMetadata, hasInterfaceDesignerItemMetadata, hasMobileInterfaceDesignerItemMetadata, instantiate, interfaceDesignerItemRegister, interfaceDesignerItemRegistryKey, isClientSideDataSourceHierarchyConfig, isHierarchicalItemExpanded, isServerSideDataSourceHierarchyConfig, localize, matchScopes, mobileInterfaceDesignerItemRegistryKey, mobileViewElementRegistryKey, objectDeepKeys, registerAngularViewElement, registerViewElement, registryKey$1 as registryKey, resetGlobals, setConverterMetadata, setDesignTimeViewElementMetadata, setInterfaceDesignerItemMetadata, setMobileInterfaceDesignerItemMetadata, setMobileViewElementMetadata, setModuleMetadata, setRequestHandlerMetadata, setValidatorMetadata, setViewElementMetadata, toAggregationEval, toAggregationEvalType, toAggregationFunction, toAggregationType, toDatePart, toDatePartType, toNumericFunctionType, toOrderDirection, toPascalCase, toSortDirection, toStringFunctionType, validatorRegistryKey, viewElementRegister, viewElementRegistryKey, ɵBaseRegistry, ɵCrtInterfaceDesignerItem, ɵCrtMobileInterfaceDesignerItem, ɵFeatureActivationRef, ɵLazyModuleRef, ɵcheckTypeNameFormat, ɵinstantiate, ɵloadLazyRef, ɵloadLazyRefs };
|
|
3383
3961
|
//# sourceMappingURL=creatio-devkit-common.mjs.map
|