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