@creatio-devkit/common 0.832.1 → 0.834.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.
- package/AI_GUIDES_INDEX.md +38 -0
- package/CHANGELOG.md +20 -0
- package/DEFERRED_REMOTE_MIGRATION_AI_GUIDE.md +1338 -0
- package/ICON_REQUIREMENTS_AI_GUIDE.md +586 -0
- package/LICENSE.md +1 -1
- package/REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md +1568 -0
- package/WCAG_ACCESSIBILITY_AI_GUIDE.md +1002 -0
- package/fesm2022/creatio-devkit-common.mjs +616 -89
- package/fesm2022/creatio-devkit-common.mjs.map +1 -1
- package/index.d.ts +3573 -2914
- package/package.json +3 -7
- 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,4 +1,4 @@
|
|
|
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';
|
|
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
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';
|
|
3
3
|
import { get, set, upperFirst, camelCase, isEqual, cloneDeep, isEmpty } from 'lodash';
|
|
4
4
|
import 'reflect-metadata';
|
|
@@ -33,36 +33,182 @@ 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
|
+
#activationPromise;
|
|
88
|
+
#activated = false;
|
|
89
|
+
#activate;
|
|
90
|
+
/**
|
|
91
|
+
* Initializes a feature activation reference.
|
|
92
|
+
*
|
|
93
|
+
* @param id - Stable feature identifier.
|
|
94
|
+
* @param sourceName - Name of the source build that owns the feature.
|
|
95
|
+
* @param activate - Callback that performs feature activation.
|
|
96
|
+
*/
|
|
97
|
+
constructor(id, sourceName, activate) {
|
|
98
|
+
this.id = id;
|
|
99
|
+
this.sourceName = sourceName;
|
|
100
|
+
this.#activate = activate;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Indicates whether the activation callback has completed successfully.
|
|
104
|
+
*/
|
|
105
|
+
get activated() {
|
|
106
|
+
return this.#activated;
|
|
107
|
+
}
|
|
108
|
+
async #ensureActivated() {
|
|
109
|
+
const releaseActivationTracking = trackRemoteFeatureActivation(this.sourceName);
|
|
110
|
+
try {
|
|
111
|
+
await this.#activate();
|
|
112
|
+
this.#activated = true;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
this.#activationPromise = undefined;
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
releaseActivationTracking();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Activates the feature if it hasn't been activated yet.
|
|
124
|
+
*/
|
|
125
|
+
ensureActivated() {
|
|
126
|
+
if (!this.#activationPromise) {
|
|
127
|
+
this.#activationPromise = this.#ensureActivated();
|
|
128
|
+
}
|
|
129
|
+
return this.#activationPromise;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Determines whether a lazy reference represents feature activation rather than module bootstrap.
|
|
135
|
+
*
|
|
136
|
+
* @param ref - Lazy reference to inspect.
|
|
137
|
+
* @returns `true` when the reference is a feature activation ref.
|
|
138
|
+
*
|
|
139
|
+
*/
|
|
140
|
+
function isFeatureActivationRef(ref) {
|
|
141
|
+
return ref instanceof ɵFeatureActivationRef;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Loads a lazy reference and returns the resolved module type if applicable.
|
|
145
|
+
* @param ref - Lazy reference to resolve.
|
|
146
|
+
*/
|
|
147
|
+
async function loadLazyRefType(ref) {
|
|
148
|
+
if (isFeatureActivationRef(ref)) {
|
|
149
|
+
await ref.ensureActivated();
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
return ref.loadAndBootstrap();
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Loads a lazy ref for its side effects.
|
|
156
|
+
*
|
|
157
|
+
* @param ref - Lazy reference to resolve.
|
|
158
|
+
*
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
async function ɵloadLazyRef(ref) {
|
|
162
|
+
await loadLazyRefType(ref);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Loads multiple lazy references and collects their resolved module types.
|
|
166
|
+
*
|
|
167
|
+
* @param refs - Lazy references to resolve.
|
|
168
|
+
* @returns List of resolved module types.
|
|
169
|
+
*
|
|
170
|
+
* @internal
|
|
171
|
+
*/
|
|
172
|
+
async function ɵloadLazyRefs(refs) {
|
|
173
|
+
const loadedTypes = await Promise.all(Array.from(refs, (ref) => loadLazyRefType(ref)));
|
|
174
|
+
return loadedTypes.filter((typeRef) => Boolean(typeRef));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @internal
|
|
179
|
+
*/
|
|
180
|
+
class LazyLoadRefsManager {
|
|
39
181
|
constructor() {
|
|
40
|
-
this
|
|
182
|
+
this.#refs = new Set();
|
|
41
183
|
this.lazyLoadingDisabled = false;
|
|
42
184
|
}
|
|
43
|
-
static
|
|
185
|
+
static #globalInstancePath = 'creatio._lazyLoadRefsManager';
|
|
186
|
+
static #instance;
|
|
187
|
+
#refs;
|
|
44
188
|
static get instance() {
|
|
45
|
-
|
|
46
|
-
|
|
189
|
+
let instance = LazyLoadRefsManager.#instance;
|
|
190
|
+
if (!instance) {
|
|
191
|
+
let globalInstance = get(window, LazyLoadRefsManager.#globalInstancePath);
|
|
47
192
|
if (!globalInstance) {
|
|
48
|
-
globalInstance = new
|
|
49
|
-
set(window,
|
|
193
|
+
globalInstance = new LazyLoadRefsManager();
|
|
194
|
+
set(window, LazyLoadRefsManager.#globalInstancePath, globalInstance);
|
|
50
195
|
}
|
|
51
|
-
|
|
196
|
+
LazyLoadRefsManager.#instance = globalInstance;
|
|
197
|
+
instance = globalInstance;
|
|
52
198
|
}
|
|
53
|
-
return
|
|
199
|
+
return instance;
|
|
54
200
|
}
|
|
55
201
|
add(ref) {
|
|
56
|
-
this.
|
|
202
|
+
this.#refs.add(ref);
|
|
57
203
|
}
|
|
58
204
|
size() {
|
|
59
|
-
return this.
|
|
205
|
+
return this.#refs.size;
|
|
60
206
|
}
|
|
61
207
|
loadAll() {
|
|
62
|
-
return
|
|
208
|
+
return ɵloadLazyRefs(this.#refs);
|
|
63
209
|
}
|
|
64
210
|
clear() {
|
|
65
|
-
this.
|
|
211
|
+
this.#refs.clear();
|
|
66
212
|
}
|
|
67
213
|
}
|
|
68
214
|
|
|
@@ -557,7 +703,7 @@ class InternalHandlerChain {
|
|
|
557
703
|
}
|
|
558
704
|
else {
|
|
559
705
|
const handlers = this._getMatchedHandlers(request);
|
|
560
|
-
if (!
|
|
706
|
+
if (!LazyLoadRefsManager.instance.lazyLoadingDisabled) {
|
|
561
707
|
await this._loadLazyHandlers(request, handlers);
|
|
562
708
|
}
|
|
563
709
|
handler = this._buildHandlersChain(request, handlers);
|
|
@@ -609,19 +755,6 @@ class InternalHandlerChain {
|
|
|
609
755
|
},
|
|
610
756
|
};
|
|
611
757
|
}
|
|
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
758
|
_getCacheHandler(request) {
|
|
626
759
|
const map = this._handlersCache.get(request.type);
|
|
627
760
|
const key = this._getCacheScopesKey(request);
|
|
@@ -669,17 +802,19 @@ class InternalHandlerChain {
|
|
|
669
802
|
}
|
|
670
803
|
}
|
|
671
804
|
async _loadLazyHandlers(request, configs) {
|
|
672
|
-
const
|
|
805
|
+
const lazyLoadRefs = new Set();
|
|
673
806
|
configs.forEach((config) => {
|
|
674
807
|
if (config.lazy && !config.createHandler) {
|
|
675
|
-
|
|
808
|
+
const lazyRef = config.lazyLoadRef;
|
|
809
|
+
if (lazyRef) {
|
|
810
|
+
lazyLoadRefs.add(lazyRef);
|
|
811
|
+
}
|
|
676
812
|
}
|
|
677
813
|
});
|
|
678
|
-
const
|
|
679
|
-
await Promise.all(lazyModuleRefs.map((m) => m.loadAndBootstrap()));
|
|
814
|
+
const typeRefs = await ɵloadLazyRefs(lazyLoadRefs);
|
|
680
815
|
const injectionContext = this._getInjectionContext(request?.$context);
|
|
681
|
-
if (injectionContext &&
|
|
682
|
-
const deepModuleDependencies =
|
|
816
|
+
if (injectionContext && typeRefs.length) {
|
|
817
|
+
const deepModuleDependencies = getDeepModuleDependencies(typeRefs);
|
|
683
818
|
for (const type of deepModuleDependencies) {
|
|
684
819
|
injectionContext.addLazyModule(type);
|
|
685
820
|
}
|
|
@@ -720,6 +855,19 @@ class InternalHandlerChain {
|
|
|
720
855
|
}
|
|
721
856
|
}
|
|
722
857
|
}
|
|
858
|
+
/**
|
|
859
|
+
* @hostPublicApi
|
|
860
|
+
*/
|
|
861
|
+
clearContextedHandlersCache(contextId) {
|
|
862
|
+
const configs = this._handlersScopesByContextId.get(contextId) ?? [];
|
|
863
|
+
return configs.every(({ requestType, scope }) => this._handlersCache.get(requestType)?.delete(scope));
|
|
864
|
+
}
|
|
865
|
+
clear() {
|
|
866
|
+
this._handlers.splice(0);
|
|
867
|
+
this._requestListeners.clear();
|
|
868
|
+
this._handlersCache.clear();
|
|
869
|
+
this._handlersScopesByContextId.clear();
|
|
870
|
+
}
|
|
723
871
|
}
|
|
724
872
|
|
|
725
873
|
const global$2 = window;
|
|
@@ -1594,13 +1742,13 @@ class RemoteEntriesRegistry extends ɵBaseRegistry {
|
|
|
1594
1742
|
/**
|
|
1595
1743
|
* @internal
|
|
1596
1744
|
*/
|
|
1597
|
-
const registryKey = 'ChatMessageTypeRegistry';
|
|
1745
|
+
const registryKey$1 = 'ChatMessageTypeRegistry';
|
|
1598
1746
|
/**
|
|
1599
1747
|
* @internal
|
|
1600
1748
|
* @hostPublicApi available through window.creatio.registry.ChatMessageTypeRegistry
|
|
1601
1749
|
*/
|
|
1602
1750
|
class ChatMessageTypeRegistry extends ɵBaseRegistry {
|
|
1603
|
-
static { this.registryKey = registryKey; }
|
|
1751
|
+
static { this.registryKey = registryKey$1; }
|
|
1604
1752
|
static get messageTypes() {
|
|
1605
1753
|
return this.store.typeInfos;
|
|
1606
1754
|
}
|
|
@@ -1633,6 +1781,38 @@ class RequestsResolver extends BaseRequestsResolver {
|
|
|
1633
1781
|
}
|
|
1634
1782
|
}
|
|
1635
1783
|
|
|
1784
|
+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
1785
|
+
const registryKey = 'BaseItemRendererRegistry';
|
|
1786
|
+
/**
|
|
1787
|
+
* @internal
|
|
1788
|
+
* @description DI-friendly instance wrapper over the shared static registry store from base registry.
|
|
1789
|
+
*/
|
|
1790
|
+
class BaseItemRendererRegistry extends ɵBaseRegistry {
|
|
1791
|
+
static { this.registryKey = registryKey; }
|
|
1792
|
+
/** Base registry store uses the generic `typeInfos` key for historical reasons. */
|
|
1793
|
+
get _rendererConfigs() {
|
|
1794
|
+
return this.constructor.store.typeInfos;
|
|
1795
|
+
}
|
|
1796
|
+
/**
|
|
1797
|
+
* @internal
|
|
1798
|
+
* @description Registers renderer config by item type in the registry store.
|
|
1799
|
+
* @param type - Item type key.
|
|
1800
|
+
* @param config - Renderer config for the specified type.
|
|
1801
|
+
*/
|
|
1802
|
+
registerItem(type, config) {
|
|
1803
|
+
this._rendererConfigs.set(type, config);
|
|
1804
|
+
}
|
|
1805
|
+
/**
|
|
1806
|
+
* @internal
|
|
1807
|
+
* @description Returns renderer config by item type or null when no registration exists.
|
|
1808
|
+
* @param type - Item type key.
|
|
1809
|
+
* @returns Renderer config for the type or `null`.
|
|
1810
|
+
*/
|
|
1811
|
+
getItem(type) {
|
|
1812
|
+
return this._rendererConfigs.get(type) ?? null;
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1636
1816
|
/**
|
|
1637
1817
|
* @public
|
|
1638
1818
|
* @description Function allows to register user-defined component as view element in Creatio platform.
|
|
@@ -1668,26 +1848,35 @@ function registerAngularViewElement(config, typeRef) {
|
|
|
1668
1848
|
/**
|
|
1669
1849
|
* @internal
|
|
1670
1850
|
*/
|
|
1671
|
-
class
|
|
1851
|
+
class ɵLazyModuleRef {
|
|
1852
|
+
#modulePromise;
|
|
1853
|
+
#typeRef;
|
|
1854
|
+
#moduleDefinition;
|
|
1855
|
+
#bootstrapFn;
|
|
1672
1856
|
get typeRef() {
|
|
1673
|
-
return this
|
|
1857
|
+
return this.#typeRef;
|
|
1674
1858
|
}
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1859
|
+
/**
|
|
1860
|
+
* Initializes the lazy module reference.
|
|
1861
|
+
*
|
|
1862
|
+
* @param moduleDefinition - Lazy module definition with the loader function.
|
|
1863
|
+
* @param bootstrapFn - Function to call after module is loaded.
|
|
1864
|
+
* @param sourceName - Name of source build ('host' or remote name).
|
|
1865
|
+
*/
|
|
1866
|
+
constructor(moduleDefinition, bootstrapFn, sourceName) {
|
|
1680
1867
|
this.sourceName = sourceName;
|
|
1868
|
+
this.#moduleDefinition = moduleDefinition;
|
|
1869
|
+
this.#bootstrapFn = bootstrapFn;
|
|
1681
1870
|
}
|
|
1682
1871
|
loadAndBootstrap() {
|
|
1683
|
-
if (!this
|
|
1684
|
-
this
|
|
1685
|
-
this
|
|
1686
|
-
this
|
|
1872
|
+
if (!this.#modulePromise) {
|
|
1873
|
+
this.#modulePromise = this.#moduleDefinition.load().then((type) => {
|
|
1874
|
+
this.#typeRef = type;
|
|
1875
|
+
this.#bootstrapFn(type);
|
|
1687
1876
|
return type;
|
|
1688
1877
|
});
|
|
1689
1878
|
}
|
|
1690
|
-
return this
|
|
1879
|
+
return this.#modulePromise;
|
|
1691
1880
|
}
|
|
1692
1881
|
}
|
|
1693
1882
|
|
|
@@ -1965,11 +2154,28 @@ function registerViewElements(types) {
|
|
|
1965
2154
|
*/
|
|
1966
2155
|
function registerLazyViewElements(configs, lazyModuleRef) {
|
|
1967
2156
|
resistantForEach(configs, (config) => {
|
|
1968
|
-
const registryItem = { ...config, lazy: true, lazyModuleRef };
|
|
2157
|
+
const registryItem = { ...config, lazy: true, lazyLoadRef: lazyModuleRef };
|
|
1969
2158
|
ViewElementRegistry.validate(registryItem);
|
|
1970
2159
|
ViewElementRegistry.register(registryItem);
|
|
1971
2160
|
});
|
|
1972
2161
|
}
|
|
2162
|
+
/**
|
|
2163
|
+
* @internal
|
|
2164
|
+
*/
|
|
2165
|
+
function validateRemoteViewElements(types, remoteName) {
|
|
2166
|
+
const invalidTypes = types.filter((type) => hasInterfaceDesignerItemMetadata(type) || hasMobileInterfaceDesignerItemMetadata(type));
|
|
2167
|
+
if (invalidTypes.length === 0) {
|
|
2168
|
+
return;
|
|
2169
|
+
}
|
|
2170
|
+
const invalidTypeNames = invalidTypes.map((type) => `"${type.name}"`).join(', ');
|
|
2171
|
+
throw new Error('Remote module "' +
|
|
2172
|
+
remoteName +
|
|
2173
|
+
'" cannot bootstrap view elements decorated with ' +
|
|
2174
|
+
'"CrtInterfaceDesignerItem" or "CrtMobileInterfaceDesignerItem". ' +
|
|
2175
|
+
'Use "RemoteFeatureDefinition.loadDesignerDefinitions" instead. ' +
|
|
2176
|
+
'Offending types: ' +
|
|
2177
|
+
invalidTypeNames);
|
|
2178
|
+
}
|
|
1973
2179
|
/**
|
|
1974
2180
|
* @internal
|
|
1975
2181
|
*/
|
|
@@ -2020,7 +2226,7 @@ function registerValidators(types, options) {
|
|
|
2020
2226
|
};
|
|
2021
2227
|
if (skipLazyModuleIfItemIsNonLazy(options) && !options.lazy) {
|
|
2022
2228
|
registrationConfig.lazy = false;
|
|
2023
|
-
registrationConfig.
|
|
2229
|
+
registrationConfig.lazyLoadRef = null;
|
|
2024
2230
|
}
|
|
2025
2231
|
ValidatorRegistry.validate(registrationConfig);
|
|
2026
2232
|
ValidatorRegistry.register(registrationConfig);
|
|
@@ -2037,7 +2243,7 @@ function registerLazyValidators(configs, options, lazyModuleRef) {
|
|
|
2037
2243
|
return;
|
|
2038
2244
|
}
|
|
2039
2245
|
}
|
|
2040
|
-
const registryItem = { ...config, lazy: true, lazyModuleRef };
|
|
2246
|
+
const registryItem = { ...config, lazy: true, lazyLoadRef: lazyModuleRef };
|
|
2041
2247
|
ValidatorRegistry.validate(registryItem);
|
|
2042
2248
|
ValidatorRegistry.register(registryItem);
|
|
2043
2249
|
});
|
|
@@ -2059,7 +2265,7 @@ function registerConverters(types, options) {
|
|
|
2059
2265
|
};
|
|
2060
2266
|
if (skipLazyModuleIfItemIsNonLazy(options) && !options.lazy) {
|
|
2061
2267
|
registrationConfig.lazy = false;
|
|
2062
|
-
registrationConfig.
|
|
2268
|
+
registrationConfig.lazyLoadRef = null;
|
|
2063
2269
|
}
|
|
2064
2270
|
ConverterRegistry.register(registrationConfig);
|
|
2065
2271
|
});
|
|
@@ -2075,7 +2281,7 @@ function registerLazyConverters(descriptors, options, lazyModuleRef) {
|
|
|
2075
2281
|
return;
|
|
2076
2282
|
}
|
|
2077
2283
|
}
|
|
2078
|
-
const registryItem = { ...descriptor, lazy: true, lazyModuleRef };
|
|
2284
|
+
const registryItem = { ...descriptor, lazy: true, lazyLoadRef: lazyModuleRef };
|
|
2079
2285
|
ConverterRegistry.register(registryItem);
|
|
2080
2286
|
});
|
|
2081
2287
|
}
|
|
@@ -2116,7 +2322,7 @@ function registerRequestHandlers(types, options, remoteName) {
|
|
|
2116
2322
|
}
|
|
2117
2323
|
if (skipLazyModuleIfItemIsNonLazy(options) && !options.lazy) {
|
|
2118
2324
|
registrationConfig.lazy = false;
|
|
2119
|
-
registrationConfig.
|
|
2325
|
+
registrationConfig.lazyLoadRef = null;
|
|
2120
2326
|
}
|
|
2121
2327
|
RequestHandlerRegistryService.register(registrationConfig, type);
|
|
2122
2328
|
});
|
|
@@ -2135,7 +2341,7 @@ function registerLazyRequestHandlers(descriptors, options, remoteName, lazyModul
|
|
|
2135
2341
|
const registrationConfig = {
|
|
2136
2342
|
...descriptor,
|
|
2137
2343
|
lazy: true,
|
|
2138
|
-
lazyModuleRef,
|
|
2344
|
+
lazyLoadRef: lazyModuleRef,
|
|
2139
2345
|
};
|
|
2140
2346
|
if (options.moduleType === 'host') {
|
|
2141
2347
|
registrationConfig.source = { type: HandlerSourceType.Host };
|
|
@@ -2187,6 +2393,9 @@ function bootstrapDefaultCrtModule(name, type, options, root) {
|
|
|
2187
2393
|
try {
|
|
2188
2394
|
const moduleDefinition = getModuleMetadata(type);
|
|
2189
2395
|
if (moduleDefinition.viewElements) {
|
|
2396
|
+
if (options.moduleType === 'remote' && name && ɵisRemoteFeatureActivationInProgress(name)) {
|
|
2397
|
+
validateRemoteViewElements(moduleDefinition.viewElements, name);
|
|
2398
|
+
}
|
|
2190
2399
|
registerViewElements(moduleDefinition.viewElements);
|
|
2191
2400
|
registerInterfaceDesignerItems(moduleDefinition.viewElements, options?.localizeMetadata);
|
|
2192
2401
|
}
|
|
@@ -2212,9 +2421,9 @@ function bootstrapDefaultCrtModule(name, type, options, root) {
|
|
|
2212
2421
|
console.error("To use lazy loading, 'remoteName' parameter should be specified.");
|
|
2213
2422
|
return;
|
|
2214
2423
|
}
|
|
2215
|
-
const ref = new
|
|
2424
|
+
const ref = new ɵLazyModuleRef(includedModuleMetadata, (x) => bootstrapDefaultCrtModule(name, x, { ...options, lazy: true }, false), source);
|
|
2216
2425
|
bootstrapLazyCrtModule(name, includedModuleMetadata, options, ref);
|
|
2217
|
-
|
|
2426
|
+
LazyLoadRefsManager.instance.add(ref);
|
|
2218
2427
|
}
|
|
2219
2428
|
});
|
|
2220
2429
|
}
|
|
@@ -2339,15 +2548,19 @@ function bootstrapCrtModuleHandlerChainServices(type) {
|
|
|
2339
2548
|
function resetGlobals() {
|
|
2340
2549
|
bootstrappedCrtModules.clear();
|
|
2341
2550
|
ViewElementRegistry.viewElements.clear();
|
|
2551
|
+
MobileViewElementRegistry.viewElements.clear();
|
|
2552
|
+
InterfaceDesignerItemRegistry.clear();
|
|
2553
|
+
MobileInterfaceDesignerItemRegistry.clear();
|
|
2342
2554
|
InternalRequestHandlerRegistry.clear();
|
|
2343
2555
|
HandlerChainService.instance.clear();
|
|
2344
2556
|
ValidatorRegistry.items.clear();
|
|
2345
2557
|
ConverterRegistry.clear();
|
|
2346
2558
|
RemoteEntriesRegistry.items.clear();
|
|
2347
2559
|
PkgTopology.items.clear();
|
|
2348
|
-
|
|
2349
|
-
|
|
2560
|
+
LazyLoadRefsManager.instance.clear();
|
|
2561
|
+
LazyLoadRefsManager.instance.lazyLoadingDisabled = false;
|
|
2350
2562
|
DesignTimeViewElementRegistry.infos.clear();
|
|
2563
|
+
ɵresetRemoteFeatureActivationTracking();
|
|
2351
2564
|
}
|
|
2352
2565
|
|
|
2353
2566
|
/**
|
|
@@ -2380,33 +2593,6 @@ function CrtDesignTimeViewElement(config) {
|
|
|
2380
2593
|
};
|
|
2381
2594
|
}
|
|
2382
2595
|
|
|
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
2596
|
/**
|
|
2411
2597
|
* @public
|
|
2412
2598
|
* @description Creatio platform interacts with input's of user-defined component through CrtInput decorator.
|
|
@@ -2553,7 +2739,43 @@ function interfaceDesignerItemRegister(config, platform) {
|
|
|
2553
2739
|
|
|
2554
2740
|
// noinspection ES6PreferShortImport
|
|
2555
2741
|
/**
|
|
2556
|
-
* @
|
|
2742
|
+
* @public
|
|
2743
|
+
* @description (Deprecated) Decorator to declare design time configuration for a view element that is
|
|
2744
|
+
* registered eagerly during module bootstrap.
|
|
2745
|
+
*
|
|
2746
|
+
* @deprecated For new remote integrations, publish interface-designer metadata through
|
|
2747
|
+
* {@link RemoteFeatureDefinition.loadDesignerDefinitions} instead of using this decorator.
|
|
2748
|
+
* Existing remotes may keep using this decorator for backward compatibility, but should migrate
|
|
2749
|
+
* to {@link RemoteEntryDefinition} and {@link RemoteFeatureDefinition} when updated.
|
|
2750
|
+
*
|
|
2751
|
+
* @param config - registration config {@link InterfaceDesignerItemDefinition}.
|
|
2752
|
+
*
|
|
2753
|
+
* @example
|
|
2754
|
+
* @CrtViewElement({
|
|
2755
|
+
* type: "usr.Example',
|
|
2756
|
+
* selector: 'usr-example',
|
|
2757
|
+
* })
|
|
2758
|
+
* @CrtInterfaceDesignerItem({
|
|
2759
|
+
* toolbarConfig: {
|
|
2760
|
+
* caption: 'usrExampleCaption',
|
|
2761
|
+
* icon: require(`!!raw-loader?{esModule:false}!../assets/icon.svg`)
|
|
2762
|
+
* hint: 'usrExampleHint',
|
|
2763
|
+
* defaultPropertyValues: {
|
|
2764
|
+
* value: 'This is default value',
|
|
2765
|
+
* },
|
|
2766
|
+
* },
|
|
2767
|
+
* })
|
|
2768
|
+
* @Component({
|
|
2769
|
+
* selector: 'usr-example',
|
|
2770
|
+
* templateUrl: './app.component.html',
|
|
2771
|
+
* styleUrls: ['./app.component.scss'],
|
|
2772
|
+
* encapsulation: ViewEncapsulation.ShadowDom,
|
|
2773
|
+
* })
|
|
2774
|
+
* export class AppComponent {
|
|
2775
|
+
* @Input()
|
|
2776
|
+
* @CrtInput()
|
|
2777
|
+
* public value!: string;
|
|
2778
|
+
* }
|
|
2557
2779
|
*/
|
|
2558
2780
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2559
2781
|
function CrtInterfaceDesignerItem(config) {
|
|
@@ -2562,7 +2784,43 @@ function CrtInterfaceDesignerItem(config) {
|
|
|
2562
2784
|
|
|
2563
2785
|
// noinspection ES6PreferShortImport
|
|
2564
2786
|
/**
|
|
2565
|
-
* @
|
|
2787
|
+
* @public
|
|
2788
|
+
* @description (Deprecated) Decorator to declare design time configuration for a mobile view element that is
|
|
2789
|
+
* registered eagerly during module bootstrap.
|
|
2790
|
+
*
|
|
2791
|
+
* @deprecated For new remote integrations, publish interface-designer metadata through
|
|
2792
|
+
* {@link RemoteFeatureDefinition.loadDesignerDefinitions} instead of using this decorator.
|
|
2793
|
+
* Existing remotes may keep using this decorator for backward compatibility, but should migrate
|
|
2794
|
+
* to {@link RemoteEntryDefinition} and {@link RemoteFeatureDefinition} when updated.
|
|
2795
|
+
*
|
|
2796
|
+
* @param config - registration config {@link InterfaceDesignerItemDefinition}.
|
|
2797
|
+
*
|
|
2798
|
+
* @example
|
|
2799
|
+
* @CrtMobileViewElement({
|
|
2800
|
+
* type: "usr.Example',
|
|
2801
|
+
* selector: 'usr-example',
|
|
2802
|
+
* })
|
|
2803
|
+
* @CrtMobileInterfaceDesignerItem({
|
|
2804
|
+
* toolbarConfig: {
|
|
2805
|
+
* caption: 'usrExampleCaption',
|
|
2806
|
+
* icon: require(`!!raw-loader?{esModule:false}!../assets/icon.svg`)
|
|
2807
|
+
* hint: 'usrExampleHint',
|
|
2808
|
+
* defaultPropertyValues: {
|
|
2809
|
+
* value: 'This is default value',
|
|
2810
|
+
* },
|
|
2811
|
+
* },
|
|
2812
|
+
* })
|
|
2813
|
+
* @Component({
|
|
2814
|
+
* selector: 'usr-example',
|
|
2815
|
+
* templateUrl: './app.component.html',
|
|
2816
|
+
* styleUrls: ['./app.component.scss'],
|
|
2817
|
+
* encapsulation: ViewEncapsulation.ShadowDom,
|
|
2818
|
+
* })
|
|
2819
|
+
* export class AppComponent {
|
|
2820
|
+
* @Input()
|
|
2821
|
+
* @CrtInput()
|
|
2822
|
+
* public value!: string;
|
|
2823
|
+
* }
|
|
2566
2824
|
*/
|
|
2567
2825
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2568
2826
|
function CrtMobileInterfaceDesignerItem(config) {
|
|
@@ -2665,6 +2923,49 @@ function CrtChatMessageType(config) {
|
|
|
2665
2923
|
};
|
|
2666
2924
|
}
|
|
2667
2925
|
|
|
2926
|
+
/**
|
|
2927
|
+
* @internal
|
|
2928
|
+
*/
|
|
2929
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2930
|
+
function ɵCrtInterfaceDesignerItem(config) {
|
|
2931
|
+
return interfaceDesignerItemRegister(config, 'web');
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
/**
|
|
2935
|
+
* @internal
|
|
2936
|
+
*/
|
|
2937
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2938
|
+
function ɵCrtMobileInterfaceDesignerItem(config) {
|
|
2939
|
+
return interfaceDesignerItemRegister(config, 'mobile');
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
/**
|
|
2943
|
+
* @internal
|
|
2944
|
+
* @hostPublicApi
|
|
2945
|
+
*/
|
|
2946
|
+
class InterfaceDesignerItemRegistrationConfig {
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
/**
|
|
2950
|
+
* @internal
|
|
2951
|
+
* @class MethodInvokeRequest
|
|
2952
|
+
* @description Definition of invoke method request.
|
|
2953
|
+
* @extends {ɵBaseRequest} {@link ɵBaseRequest}
|
|
2954
|
+
* @property {string} method - method name.
|
|
2955
|
+
* @property {unknown[]} args - arguments passing to the method.
|
|
2956
|
+
*/
|
|
2957
|
+
class MethodInvokeRequest extends _BaseRequest {
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
/**
|
|
2961
|
+
* @internal
|
|
2962
|
+
*/
|
|
2963
|
+
var RemoteEntryType;
|
|
2964
|
+
(function (RemoteEntryType) {
|
|
2965
|
+
RemoteEntryType["Script"] = "script";
|
|
2966
|
+
RemoteEntryType["Module"] = "module";
|
|
2967
|
+
})(RemoteEntryType || (RemoteEntryType = {}));
|
|
2968
|
+
|
|
2668
2969
|
/**
|
|
2669
2970
|
* @internal
|
|
2670
2971
|
*/
|
|
@@ -3095,6 +3396,45 @@ __decorate([
|
|
|
3095
3396
|
__metadata("design:type", Function)
|
|
3096
3397
|
], MessageChannelService.prototype, "sendMessage", void 0);
|
|
3097
3398
|
|
|
3399
|
+
/**
|
|
3400
|
+
* @public
|
|
3401
|
+
* @description Checks whether hierarchy configuration is client-side.
|
|
3402
|
+
* @param hierarchyConfig Hierarchy configuration to check.
|
|
3403
|
+
* @returns `true` if configuration is of type `ClientSideDataSourceHierarchyConfig`.
|
|
3404
|
+
*/
|
|
3405
|
+
function isClientSideDataSourceHierarchyConfig(hierarchyConfig) {
|
|
3406
|
+
return hierarchyConfig?.type === 'ClientSide';
|
|
3407
|
+
}
|
|
3408
|
+
/**
|
|
3409
|
+
* @public
|
|
3410
|
+
* @description Checks whether hierarchy configuration is server-side.
|
|
3411
|
+
* @param hierarchyConfig Hierarchy configuration to check.
|
|
3412
|
+
* @returns `true` if configuration is of type `ServerSideDataSourceHierarchyConfig`.
|
|
3413
|
+
*/
|
|
3414
|
+
function isServerSideDataSourceHierarchyConfig(hierarchyConfig) {
|
|
3415
|
+
return hierarchyConfig?.type !== 'ClientSide';
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
/**
|
|
3419
|
+
* @public
|
|
3420
|
+
* @description Determines whether the hierarchy node with the specified identifier is expanded
|
|
3421
|
+
* based on the provided hierarchy state.
|
|
3422
|
+
* @param hierarchyState Hierarchy state object.
|
|
3423
|
+
* @param itemId Identifier of the hierarchy node.
|
|
3424
|
+
* @returns True if the node is expanded; otherwise, false.
|
|
3425
|
+
* @remarks If the hierarchy state is not provided or does not contain necessary information,
|
|
3426
|
+
* the function returns false.
|
|
3427
|
+
*/
|
|
3428
|
+
function isHierarchicalItemExpanded(hierarchyState, itemId) {
|
|
3429
|
+
if (hierarchyState?.mode === 'collapsed') {
|
|
3430
|
+
return hierarchyState.expandedIds?.includes(itemId) ?? false;
|
|
3431
|
+
}
|
|
3432
|
+
if (hierarchyState?.mode === 'expanded') {
|
|
3433
|
+
return !(hierarchyState.collapsedIds?.includes(itemId) ?? false);
|
|
3434
|
+
}
|
|
3435
|
+
return false;
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3098
3438
|
/**
|
|
3099
3439
|
* @internal
|
|
3100
3440
|
*/
|
|
@@ -3375,9 +3715,196 @@ __decorate([
|
|
|
3375
3715
|
__metadata("design:type", Function)
|
|
3376
3716
|
], TransactionFactoryService.prototype, "create", void 0);
|
|
3377
3717
|
|
|
3718
|
+
/**
|
|
3719
|
+
* @public
|
|
3720
|
+
* @class UserConsentService
|
|
3721
|
+
* @classdesc Service to work with consents of the current user.
|
|
3722
|
+
*/
|
|
3723
|
+
class UserConsentService {
|
|
3724
|
+
constructor() {
|
|
3725
|
+
this._consentSchemaName = 'Consent';
|
|
3726
|
+
this._userConsentHistorySchemaName = 'UserConsentHistory';
|
|
3727
|
+
this._sysValuesService = new SysValuesService();
|
|
3728
|
+
}
|
|
3729
|
+
/**
|
|
3730
|
+
* @description Gets shared service instance.
|
|
3731
|
+
* @returns Shared `UserConsentService` instance.
|
|
3732
|
+
*/
|
|
3733
|
+
static get instance() {
|
|
3734
|
+
return UserConsentService._instance || (UserConsentService._instance = new UserConsentService());
|
|
3735
|
+
}
|
|
3736
|
+
/**
|
|
3737
|
+
* Retrieves the current user's contact ID.
|
|
3738
|
+
* @returns Current user contact id. Cached after first retrieval.
|
|
3739
|
+
*/
|
|
3740
|
+
async _getCurrentUserContactId() {
|
|
3741
|
+
if (this._currentUserContactId) {
|
|
3742
|
+
return this._currentUserContactId;
|
|
3743
|
+
}
|
|
3744
|
+
const sysValues = await this._sysValuesService.loadSysValues();
|
|
3745
|
+
const userContactId = sysValues?.userContact?.value ?? sysValues?.userContact?.['Id'];
|
|
3746
|
+
if (!userContactId) {
|
|
3747
|
+
throw new Error('Error while getting user consent status');
|
|
3748
|
+
}
|
|
3749
|
+
this._currentUserContactId = userContactId;
|
|
3750
|
+
return userContactId;
|
|
3751
|
+
}
|
|
3752
|
+
/**
|
|
3753
|
+
* Maps a JSON record to a UserConsent object.
|
|
3754
|
+
* @param record - JSON record to map.
|
|
3755
|
+
* @param code - Consent code associated with the user consent.
|
|
3756
|
+
* @returns User consent object.
|
|
3757
|
+
*/
|
|
3758
|
+
_mapToUserConsent(record, code) {
|
|
3759
|
+
const source = (record ?? {});
|
|
3760
|
+
const createdOn = source['CreatedOn'];
|
|
3761
|
+
const expirationDate = source['ExpirationDate'];
|
|
3762
|
+
return {
|
|
3763
|
+
id: source['Id'],
|
|
3764
|
+
dateOfConsent: new Date(createdOn),
|
|
3765
|
+
expirationDate: expirationDate ? new Date(expirationDate) : null,
|
|
3766
|
+
consentCode: code,
|
|
3767
|
+
};
|
|
3768
|
+
}
|
|
3769
|
+
/**
|
|
3770
|
+
* Creates filter parameters for model loading based on the provided filters.
|
|
3771
|
+
* @param filters - Filter values by column name.
|
|
3772
|
+
* @returns Model filter parameters.
|
|
3773
|
+
*/
|
|
3774
|
+
_createFilterParameters(filters) {
|
|
3775
|
+
const filterGroup = new _FilterGroup();
|
|
3776
|
+
Object.entries(filters).forEach(([columnName, value]) => {
|
|
3777
|
+
filterGroup.addSchemaColumnFilterWithParameter(_ComparisonType.Equal, columnName, value);
|
|
3778
|
+
});
|
|
3779
|
+
return [
|
|
3780
|
+
{
|
|
3781
|
+
type: _ModelParameterType.Filter,
|
|
3782
|
+
value: filterGroup,
|
|
3783
|
+
},
|
|
3784
|
+
];
|
|
3785
|
+
}
|
|
3786
|
+
/**
|
|
3787
|
+
* Selects a consent record from the provided JSON records.
|
|
3788
|
+
* @param records - Records to select from.
|
|
3789
|
+
* @param code - Consent code associated with the consent.
|
|
3790
|
+
* @returns Consent object or `null` if not found.
|
|
3791
|
+
*/
|
|
3792
|
+
_selectConsent(records, code) {
|
|
3793
|
+
if (!records.length) {
|
|
3794
|
+
return null;
|
|
3795
|
+
}
|
|
3796
|
+
const record = records[0];
|
|
3797
|
+
if (!record) {
|
|
3798
|
+
return null;
|
|
3799
|
+
}
|
|
3800
|
+
const source = record;
|
|
3801
|
+
return {
|
|
3802
|
+
id: source['Id'],
|
|
3803
|
+
consentText: source['ConsentText'],
|
|
3804
|
+
name: source['Name'],
|
|
3805
|
+
code,
|
|
3806
|
+
};
|
|
3807
|
+
}
|
|
3808
|
+
/**
|
|
3809
|
+
* Selects a user consent record from the provided JSON records.
|
|
3810
|
+
* @param records - Records to select from.
|
|
3811
|
+
* @param code - Consent code associated with the user consent.
|
|
3812
|
+
* @returns User consent object or `null` if no valid user consent is found.
|
|
3813
|
+
*/
|
|
3814
|
+
_selectUserConsent(records, code) {
|
|
3815
|
+
const normalizedRecords = records.filter((record) => Boolean(record));
|
|
3816
|
+
if (!normalizedRecords.length) {
|
|
3817
|
+
return null;
|
|
3818
|
+
}
|
|
3819
|
+
const perpetualConsent = normalizedRecords.find((record) => !record['ExpirationDate']);
|
|
3820
|
+
if (perpetualConsent) {
|
|
3821
|
+
return this._mapToUserConsent(perpetualConsent, code);
|
|
3822
|
+
}
|
|
3823
|
+
const currentDate = new Date();
|
|
3824
|
+
const validConsent = normalizedRecords.find((record) => {
|
|
3825
|
+
const expirationDate = record['ExpirationDate'];
|
|
3826
|
+
return expirationDate && new Date(expirationDate) > currentDate;
|
|
3827
|
+
});
|
|
3828
|
+
return validConsent ? this._mapToUserConsent(validConsent, code) : null;
|
|
3829
|
+
}
|
|
3830
|
+
/**
|
|
3831
|
+
* Loads the consent model.
|
|
3832
|
+
* @returns Loaded consent model.
|
|
3833
|
+
*/
|
|
3834
|
+
_loadConsentModel() {
|
|
3835
|
+
return Model.create(this._consentSchemaName);
|
|
3836
|
+
}
|
|
3837
|
+
/**
|
|
3838
|
+
* Loads the user consent history model.
|
|
3839
|
+
* @returns Loaded user consent history model.
|
|
3840
|
+
*/
|
|
3841
|
+
_loadUserConsentModel() {
|
|
3842
|
+
return Model.create(this._userConsentHistorySchemaName);
|
|
3843
|
+
}
|
|
3844
|
+
/**
|
|
3845
|
+
* Creates a new user consent record in the user consent history model.
|
|
3846
|
+
* @param consentId - Identifier of the consent record.
|
|
3847
|
+
* @param expirationDate - Optional expiration date of the user consent.
|
|
3848
|
+
*/
|
|
3849
|
+
async _insertUserConsent(consentId, expirationDate) {
|
|
3850
|
+
const model = await this._loadUserConsentModel();
|
|
3851
|
+
await model.insert({
|
|
3852
|
+
ConsentCode: consentId,
|
|
3853
|
+
...(expirationDate ? { ExpirationDate: expirationDate.toISOString() } : {}),
|
|
3854
|
+
});
|
|
3855
|
+
}
|
|
3856
|
+
/**
|
|
3857
|
+
* @description Gets consent by code.
|
|
3858
|
+
* @param code - Consent code.
|
|
3859
|
+
* @returns Consent record or `null` if not found.
|
|
3860
|
+
*/
|
|
3861
|
+
async getConsent(code) {
|
|
3862
|
+
const model = await this._loadConsentModel();
|
|
3863
|
+
const records = await model.load({
|
|
3864
|
+
attributes: ['Id', 'Name', 'ConsentText'],
|
|
3865
|
+
parameters: this._createFilterParameters({ Code: code }),
|
|
3866
|
+
});
|
|
3867
|
+
return this._selectConsent(records, code);
|
|
3868
|
+
}
|
|
3869
|
+
/**
|
|
3870
|
+
* @description Gets current user consent by code.
|
|
3871
|
+
* @param code - Consent code.
|
|
3872
|
+
* @returns User consent record or `null` if no active or perpetual consent exists.
|
|
3873
|
+
*/
|
|
3874
|
+
async getCurrentUserConsent(code) {
|
|
3875
|
+
const createdBy = await this._getCurrentUserContactId();
|
|
3876
|
+
const model = await this._loadUserConsentModel();
|
|
3877
|
+
const records = await model.load({
|
|
3878
|
+
attributes: ['Id', 'CreatedOn', 'ExpirationDate'],
|
|
3879
|
+
parameters: this._createFilterParameters({
|
|
3880
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3881
|
+
'ConsentCode.Code': code,
|
|
3882
|
+
CreatedBy: createdBy,
|
|
3883
|
+
}),
|
|
3884
|
+
});
|
|
3885
|
+
return this._selectUserConsent(records, code);
|
|
3886
|
+
}
|
|
3887
|
+
/**
|
|
3888
|
+
* @description Gives current user consent by code.
|
|
3889
|
+
* @param code - Consent code.
|
|
3890
|
+
* @param expirationDate - Optional expiration date for the user consent.
|
|
3891
|
+
*/
|
|
3892
|
+
async giveCurrentUserConsent(code, expirationDate) {
|
|
3893
|
+
const consent = await this.getConsent(code);
|
|
3894
|
+
if (!consent) {
|
|
3895
|
+
return;
|
|
3896
|
+
}
|
|
3897
|
+
const userConsent = await this.getCurrentUserConsent(code);
|
|
3898
|
+
if (userConsent) {
|
|
3899
|
+
return;
|
|
3900
|
+
}
|
|
3901
|
+
await this._insertUserConsent(consent.id, expirationDate);
|
|
3902
|
+
}
|
|
3903
|
+
}
|
|
3904
|
+
|
|
3378
3905
|
/**
|
|
3379
3906
|
* Generated bundle index. Do not edit.
|
|
3380
3907
|
*/
|
|
3381
3908
|
|
|
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,
|
|
3909
|
+
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, 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
3910
|
//# sourceMappingURL=creatio-devkit-common.mjs.map
|