@creatio-devkit/common 0.812.0 → 0.814.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 +13 -2
- package/esm2020/lib/base-exports.mjs +4 -2
- package/esm2020/lib/internal/decorators/request/request.decorator.mjs +1 -1
- package/esm2020/lib/internal/models/converter/converter-registry-item.mjs +1 -1
- package/esm2020/lib/internal/models/index.mjs +3 -1
- package/esm2020/lib/internal/models/injection-context/injection-context.mjs +1 -1
- package/esm2020/lib/internal/models/internal-interface-designer-item-registration-config.model.mjs +1 -1
- package/esm2020/lib/internal/models/internal-module-definition.mjs +2 -0
- package/esm2020/lib/internal/models/lazy-module-metadata.mjs +2 -0
- package/esm2020/lib/internal/models/lazy-module-ref.mjs +26 -0
- package/esm2020/lib/internal/models/lazy-registry-item.mjs +2 -0
- package/esm2020/lib/internal/models/request-handler/handler-config.mjs +1 -1
- package/esm2020/lib/internal/models/request-handler/request-handler-registration-config.model.mjs +1 -1
- package/esm2020/lib/internal/models/validator/validator-registry-item.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-registry-item.mjs +1 -1
- package/esm2020/lib/internal/services/chat-message-type-registry/chat-message-type-registry.mjs +22 -0
- package/esm2020/lib/internal/services/chat-message-type-registry/index.mjs +2 -0
- package/esm2020/lib/internal/services/global-converters-registry/converter-registry.mjs +9 -2
- package/esm2020/lib/internal/services/index.mjs +3 -1
- package/esm2020/lib/internal/services/lazy-modules-manager/index.mjs +2 -0
- package/esm2020/lib/internal/services/lazy-modules-manager/lazy-modules-manager.mjs +35 -0
- package/esm2020/lib/internal/services/request-handler-registry/request-handler-registry.service.mjs +17 -4
- package/esm2020/lib/internal/services/request-registry/request-registry.service.mjs +1 -1
- package/esm2020/lib/internal/services/validator-registry/validator-registry.mjs +11 -3
- package/esm2020/lib/internal/services/view-element-registry/view-element-registry.mjs +14 -2
- package/esm2020/lib/internal/utils/index.mjs +2 -1
- package/esm2020/lib/internal/utils/metadata-utils.mjs +1 -1
- package/esm2020/lib/internal/utils/request-handler-scopes.mjs +10 -0
- package/esm2020/lib/public/decorators/chat-message-type/chat-message-type.decorator.mjs +20 -0
- package/esm2020/lib/public/decorators/chat-message-type/index.mjs +2 -0
- package/esm2020/lib/public/decorators/index.mjs +2 -1
- package/esm2020/lib/public/decorators/module/module.decorator.mjs +2 -18
- package/esm2020/lib/public/decorators/view-element/view-element.decorator.mjs +1 -1
- package/esm2020/lib/public/functions/bootstrap-crt-module-handler-chain-services.mjs +6 -2
- package/esm2020/lib/public/functions/bootstrap-crt-module.mjs +107 -6
- package/esm2020/lib/public/functions/bootstrapped-crt-modules.mjs +9 -0
- package/esm2020/lib/public/functions/crt-module-context-hooks.mjs +30 -0
- package/esm2020/lib/public/functions/index.mjs +4 -1
- package/esm2020/lib/public/functions/reset-globals.mjs +37 -0
- package/esm2020/lib/public/models/index.mjs +3 -1
- package/esm2020/lib/public/models/input/input-registration-config.model.mjs +1 -1
- package/esm2020/lib/public/models/item-creation-config.mjs +2 -0
- package/esm2020/lib/public/models/license/index.mjs +2 -0
- package/esm2020/lib/public/models/license/license-restriction-operation-values.model.mjs +2 -0
- package/esm2020/lib/public/models/request/handle-view-model-attribute-change.request.mjs +29 -0
- package/esm2020/lib/public/models/request/index.mjs +4 -2
- package/esm2020/lib/public/models/request/model-event.model.mjs +2 -0
- package/esm2020/lib/public/models/request/view-model-attribute-change-event-options.mjs +2 -0
- package/esm2020/lib/public/services/dialog-service/dialog.service.mjs +24 -0
- package/esm2020/lib/public/services/dialog-service/index.mjs +2 -0
- package/esm2020/lib/public/services/handler-chain/handler-chain.service.mjs +13 -1
- package/esm2020/lib/public/services/handler-chain/internal-handler-chain.mjs +50 -14
- package/esm2020/lib/public/services/index.mjs +3 -1
- package/esm2020/lib/public/services/license/index.mjs +2 -0
- package/esm2020/lib/public/services/license/license.service.mjs +22 -0
- package/esm2020/lib/public/services/mask-service/index.mjs +1 -2
- package/esm2020/lib/public/services/mask-service/mask.service.mjs +2 -2
- package/esm2020/lib/public/services/model/model.mjs +4 -1
- package/fesm2015/creatio-devkit-common.mjs +462 -79
- package/fesm2015/creatio-devkit-common.mjs.map +1 -1
- package/fesm2020/creatio-devkit-common.mjs +472 -78
- package/fesm2020/creatio-devkit-common.mjs.map +1 -1
- package/index.d.ts +188 -4
- package/package.json +2 -2
- package/esm2020/lib/public/models/request/request-registration-config.model.mjs +0 -2
- package/esm2020/lib/public/services/mask-service/schema-view-mask.request.mjs +0 -22
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ɵAggregationType, ɵAggregationFunction, ɵAggregationEvalType, ɵDatePartType, ɵFunctionType, ɵOrderDirection, ɵgenerateGuid, ɵNextHandlerAlreadySpecifiedException, ɵBaseRequest } from '@creatio/base';
|
|
2
|
-
export { ɵAggregationEvalType as AggregationEvalType, ɵAggregationFunction as AggregationFunction, ɵAggregationFunctionColumn as AggregationFunctionColumn, ɵAggregationFunctionExpression as AggregationFunctionExpression, ɵAggregationSubQueryColumn as AggregationSubQueryColumn, ɵAggregationSubQueryExpression as AggregationSubQueryExpression, ɵAggregationType as AggregationType, ɵArgumentEmptyException as ArgumentEmptyException, ɵArgumentFunctionExpression as ArgumentFunctionExpression, ɵArgumentOutOfRangeException as ArgumentOutOfRangeException, ɵArithmeticExpression as ArithmeticExpression, ɵArithmeticOperation as ArithmeticOperation, ɵArithmeticQueryColumn as ArithmeticQueryColumn, ɵBaseExpression as BaseExpression, ɵBaseExpressionParser as BaseExpressionParser, ɵBaseFilter as BaseFilter, ɵBaseFilterParser as BaseFilterParser, ɵBaseFilterableQuery as BaseFilterableQuery, ɵBaseQuery as BaseQuery, ɵBaseQueryColumn as BaseQueryColumn, ɵBaseRequest as BaseRequest, ɵBetweenFilter as BetweenFilter, ɵColumnExpression as ColumnExpression, ɵCompareFilter as CompareFilter, ɵComparisonType as ComparisonType, ɵDEFAULT_COLUMN_PLAIN_OBJ as DEFAULT_COLUMN_PLAIN_OBJ, ɵDEFAULT_FILTER_PLAIN_OBJ as DEFAULT_FILTER_PLAIN_OBJ, ɵDataSchemaAttributeType as DataSchemaAttributeType, ɵDataSchemaAttributeUsageType as DataSchemaAttributeUsageType, ɵDataSchemaType as DataSchemaType, ɵDataSourceScope as DataSourceScope, ɵDataValueType as DataValueType, ɵDatePartFunctionColumn as DatePartFunctionColumn, ɵDatePartFunctionExpression as DatePartFunctionExpression, ɵDatePartType as DatePartType, ɵDefaultValueSource as DefaultValueSource, ɵDeleteQuery as DeleteQuery, ɵEMPTY_GUID as EMPTY_GUID, ɵEntityQueryColumn as EntityQueryColumn, ɵEntitySchemaQuery as EntitySchemaQuery, ɵExistsFilter as ExistsFilter, ɵExpressionMock as ExpressionMock, ɵExpressionParser as ExpressionParser, ɵExpressionResolver as ExpressionResolver, ɵExpressionType as ExpressionType, ɵFilterGroup as FilterGroup, ɵFilterMock as FilterMock, ɵFilterParser as FilterParser, ɵFilterResolver as FilterResolver, ɵFilterType as FilterType, ɵFunctionExpression as FunctionExpression, ɵFunctionType as FunctionType, ɵInFilter as InFilter, ɵInsertQuery as InsertQuery, ɵIsNullFilter as IsNullFilter, ɵItemNotFoundException as ItemNotFoundException, ɵLengthFunctionColumn as LengthFunctionColumn, ɵLengthFunctionExpression as LengthFunctionExpression, ɵLogicalOperatorType as LogicalOperatorType, ɵMacrosFunctionColumn as MacrosFunctionColumn, ɵMacrosFunctionExpression as MacrosFunctionExpression, ɵModelInPageAction as ModelInPageAction, ɵModelParameterType as ModelParameterType, ɵNextHandlerAlreadySpecifiedException as NextHandlerAlreadySpecifiedException, ɵOrderDirection as OrderDirection, ɵParameterExpression as ParameterExpression, ɵParameterQueryColumn as ParameterQueryColumn, ɵQueryMacrosType as QueryMacrosType, ɵQueryOperationType as QueryOperationType, ɵSelectLocalizationQuery as SelectLocalizationQuery, ɵSingleFilter as SingleFilter, ɵSubQueryColumn as SubQueryColumn, ɵSubQueryExpression as SubQueryExpression, ɵUpdateQuery as UpdateQuery, ɵValidationUtilities as ValidationUtilities, ɵWindowFunctionColumn as WindowFunctionColumn, ɵWindowFunctionExpression as WindowFunctionExpression, ɵencodeDate as encodeDate, ɵgenerateGuid as generateGuid, ɵgetColumnPlainObj as getColumnPlainObj, ɵgetFilterPlainObj as getFilterPlainObj, ɵisEmptyGuid as isEmptyGuid, ɵisGuid as isGuid, ɵparserMock as parserMock, ɵtoLocalISOString as toLocalISOString } from '@creatio/base';
|
|
1
|
+
import { ɵAggregationType, ɵAggregationFunction, ɵAggregationEvalType, ɵDatePartType, ɵFunctionType, ɵOrderDirection, ɵgenerateGuid, ɵNextHandlerAlreadySpecifiedException, ɵBaseRequest, ɵSchemaViewMaskRequest, ɵSchemaViewMaskRequestAction } from '@creatio/base';
|
|
2
|
+
export { ɵAggregationEvalType as AggregationEvalType, ɵAggregationFunction as AggregationFunction, ɵAggregationFunctionColumn as AggregationFunctionColumn, ɵAggregationFunctionExpression as AggregationFunctionExpression, ɵAggregationSubQueryColumn as AggregationSubQueryColumn, ɵAggregationSubQueryExpression as AggregationSubQueryExpression, ɵAggregationType as AggregationType, ɵArgumentEmptyException as ArgumentEmptyException, ɵArgumentFunctionExpression as ArgumentFunctionExpression, ɵArgumentOutOfRangeException as ArgumentOutOfRangeException, ɵArithmeticExpression as ArithmeticExpression, ɵArithmeticOperation as ArithmeticOperation, ɵArithmeticQueryColumn as ArithmeticQueryColumn, ɵBaseExpression as BaseExpression, ɵBaseExpressionParser as BaseExpressionParser, ɵBaseFilter as BaseFilter, ɵBaseFilterParser as BaseFilterParser, ɵBaseFilterableQuery as BaseFilterableQuery, ɵBaseQuery as BaseQuery, ɵBaseQueryColumn as BaseQueryColumn, ɵBaseRequest as BaseRequest, ɵBetweenFilter as BetweenFilter, ɵColumnExpression as ColumnExpression, ɵCompareFilter as CompareFilter, ɵComparisonType as ComparisonType, ɵDEFAULT_COLUMN_PLAIN_OBJ as DEFAULT_COLUMN_PLAIN_OBJ, ɵDEFAULT_FILTER_PLAIN_OBJ as DEFAULT_FILTER_PLAIN_OBJ, ɵDataSchemaAttributeType as DataSchemaAttributeType, ɵDataSchemaAttributeUsageType as DataSchemaAttributeUsageType, ɵDataSchemaType as DataSchemaType, ɵDataSourceScope as DataSourceScope, ɵDataValueType as DataValueType, ɵDatePartFunctionColumn as DatePartFunctionColumn, ɵDatePartFunctionExpression as DatePartFunctionExpression, ɵDatePartType as DatePartType, ɵDefaultValueSource as DefaultValueSource, ɵDeleteQuery as DeleteQuery, ɵEMPTY_GUID as EMPTY_GUID, ɵEntityQueryColumn as EntityQueryColumn, ɵEntitySchemaQuery as EntitySchemaQuery, ɵExistsFilter as ExistsFilter, ɵExpressionMock as ExpressionMock, ɵExpressionParser as ExpressionParser, ɵExpressionResolver as ExpressionResolver, ɵExpressionType as ExpressionType, ɵFilterGroup as FilterGroup, ɵFilterMock as FilterMock, ɵFilterParser as FilterParser, ɵFilterResolver as FilterResolver, ɵFilterType as FilterType, ɵFunctionExpression as FunctionExpression, ɵFunctionType as FunctionType, ɵInFilter as InFilter, ɵInsertQuery as InsertQuery, ɵIsNullFilter as IsNullFilter, ɵItemNotFoundException as ItemNotFoundException, ɵLengthFunctionColumn as LengthFunctionColumn, ɵLengthFunctionExpression as LengthFunctionExpression, ɵLogicalOperatorType as LogicalOperatorType, ɵMacrosFunctionColumn as MacrosFunctionColumn, ɵMacrosFunctionExpression as MacrosFunctionExpression, ɵModelInPageAction as ModelInPageAction, ɵModelParameterType as ModelParameterType, ɵNextHandlerAlreadySpecifiedException as NextHandlerAlreadySpecifiedException, ɵOrderDirection as OrderDirection, ɵParameterExpression as ParameterExpression, ɵParameterQueryColumn as ParameterQueryColumn, ɵPlatformAPIs as PlatformAPIs, ɵQueryMacrosType as QueryMacrosType, ɵQueryOperationType as QueryOperationType, ɵSchemaViewMaskRequest as SchemaViewMaskRequest, ɵSchemaViewMaskRequestAction as SchemaViewMaskRequestAction, ɵSelectLocalizationQuery as SelectLocalizationQuery, ɵSingleFilter as SingleFilter, ɵSubQueryColumn as SubQueryColumn, ɵSubQueryExpression as SubQueryExpression, ɵUpdateQuery as UpdateQuery, ɵValidationUtilities as ValidationUtilities, ɵWindowFunctionColumn as WindowFunctionColumn, ɵWindowFunctionExpression as WindowFunctionExpression, ɵencodeDate as encodeDate, ɵgenerateGuid as generateGuid, ɵgetColumnPlainObj as getColumnPlainObj, ɵgetFilterPlainObj as getFilterPlainObj, ɵisEmptyGuid as isEmptyGuid, ɵisGuid as isGuid, ɵparserMock as parserMock, ɵtoLocalISOString as toLocalISOString } from '@creatio/base';
|
|
3
3
|
import { __awaiter, __decorate, __metadata } from 'tslib';
|
|
4
4
|
import { get, set, upperFirst, camelCase, isEqual, cloneDeep } from 'lodash';
|
|
5
5
|
import 'reflect-metadata';
|
|
@@ -196,6 +196,40 @@ const crtInjectPrefix = 'crtInject:';
|
|
|
196
196
|
*/
|
|
197
197
|
const VIEW_ELEMENT_DEFAULT_HEIGHT = '39px';
|
|
198
198
|
|
|
199
|
+
/**
|
|
200
|
+
* @internal
|
|
201
|
+
*/
|
|
202
|
+
class LazyModulesManager {
|
|
203
|
+
constructor() {
|
|
204
|
+
this._refs = new Set();
|
|
205
|
+
this.lazyLoadingDisabled = false;
|
|
206
|
+
}
|
|
207
|
+
static get instance() {
|
|
208
|
+
if (!this._instance) {
|
|
209
|
+
let globalInstance = get(window, this._globalInstancePath);
|
|
210
|
+
if (!globalInstance) {
|
|
211
|
+
globalInstance = new this();
|
|
212
|
+
set(window, this._globalInstancePath, globalInstance);
|
|
213
|
+
}
|
|
214
|
+
this._instance = globalInstance;
|
|
215
|
+
}
|
|
216
|
+
return this._instance;
|
|
217
|
+
}
|
|
218
|
+
add(ref) {
|
|
219
|
+
this._refs.add(ref);
|
|
220
|
+
}
|
|
221
|
+
size() {
|
|
222
|
+
return this._refs.size;
|
|
223
|
+
}
|
|
224
|
+
loadAll() {
|
|
225
|
+
return Promise.all(Array.from(this._refs).map((ref) => ref.loadAndBootstrap()));
|
|
226
|
+
}
|
|
227
|
+
clear() {
|
|
228
|
+
this._refs.clear();
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
LazyModulesManager._globalInstancePath = 'creatio._lazyModulesManager';
|
|
232
|
+
|
|
199
233
|
/**
|
|
200
234
|
* @internal
|
|
201
235
|
* @hostPublicApi
|
|
@@ -236,7 +270,7 @@ var HandlerSourceType;
|
|
|
236
270
|
HandlerSourceType[HandlerSourceType["Host"] = 2] = "Host";
|
|
237
271
|
})(HandlerSourceType || (HandlerSourceType = {}));
|
|
238
272
|
|
|
239
|
-
const global$
|
|
273
|
+
const global$4 = window;
|
|
240
274
|
/**
|
|
241
275
|
* @public
|
|
242
276
|
* @description For internal use only.
|
|
@@ -254,10 +288,10 @@ class ɵBaseRegistry {
|
|
|
254
288
|
}
|
|
255
289
|
static get store() {
|
|
256
290
|
if (!this._instance) {
|
|
257
|
-
let globalInstance = get(global$
|
|
291
|
+
let globalInstance = get(global$4, this._prefix + this.registryKey);
|
|
258
292
|
if (!globalInstance) {
|
|
259
293
|
globalInstance = new this();
|
|
260
|
-
set(global$
|
|
294
|
+
set(global$4, this._prefix + this.registryKey, globalInstance);
|
|
261
295
|
}
|
|
262
296
|
this._instance = globalInstance;
|
|
263
297
|
}
|
|
@@ -324,6 +358,55 @@ class HandlersOrderComparer {
|
|
|
324
358
|
}
|
|
325
359
|
}
|
|
326
360
|
|
|
361
|
+
/**
|
|
362
|
+
* @internal
|
|
363
|
+
*/
|
|
364
|
+
function matchScopes(handlerScopes, requestScopes) {
|
|
365
|
+
if (!(handlerScopes === null || handlerScopes === void 0 ? void 0 : handlerScopes.length)) {
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
368
|
+
return handlerScopes.some((s) => requestScopes === null || requestScopes === void 0 ? void 0 : requestScopes.includes(s));
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
var _b, _c;
|
|
372
|
+
var _a$1;
|
|
373
|
+
const global$3 = window;
|
|
374
|
+
(_b = global$3.creatio) !== null && _b !== void 0 ? _b : (global$3.creatio = {});
|
|
375
|
+
(_c = (_a$1 = global$3.creatio)._bootstrappedCrtModules) !== null && _c !== void 0 ? _c : (_a$1._bootstrappedCrtModules = new Map());
|
|
376
|
+
/**
|
|
377
|
+
* @internal
|
|
378
|
+
*/
|
|
379
|
+
const bootstrappedCrtModules = global$3.creatio._bootstrappedCrtModules;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* @internal
|
|
383
|
+
*/
|
|
384
|
+
function iterateRootModules(callback) {
|
|
385
|
+
bootstrappedCrtModules.forEach((info, type) => {
|
|
386
|
+
if (info.root) {
|
|
387
|
+
callback(info, type);
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* @internal
|
|
393
|
+
*/
|
|
394
|
+
function callOnContextCreateHooks(context) {
|
|
395
|
+
iterateRootModules((info) => { var _a, _b; return (_b = (_a = info.options) === null || _a === void 0 ? void 0 : _a.onContextCreate) === null || _b === void 0 ? void 0 : _b.call(_a, context); });
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* @internal
|
|
399
|
+
*/
|
|
400
|
+
function callOnContextUpdateHooks(context) {
|
|
401
|
+
iterateRootModules((info) => { var _a, _b; return (_b = (_a = info.options) === null || _a === void 0 ? void 0 : _a.onContextUpdate) === null || _b === void 0 ? void 0 : _b.call(_a, context); });
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* @internal
|
|
405
|
+
*/
|
|
406
|
+
function callOnContextDestroyHooks(context) {
|
|
407
|
+
iterateRootModules((info) => { var _a, _b; return (_b = (_a = info.options) === null || _a === void 0 ? void 0 : _a.onContextDestroy) === null || _b === void 0 ? void 0 : _b.call(_a, context); });
|
|
408
|
+
}
|
|
409
|
+
|
|
327
410
|
/**
|
|
328
411
|
* @internal
|
|
329
412
|
* @hostPublicApi available through window.handlerChain
|
|
@@ -342,7 +425,17 @@ class InternalHandlerChain {
|
|
|
342
425
|
* @hostPublicApi
|
|
343
426
|
*/
|
|
344
427
|
process: (request) => __awaiter(this, void 0, void 0, function* () {
|
|
345
|
-
|
|
428
|
+
let handler;
|
|
429
|
+
if (this._hasCacheHandler(request)) {
|
|
430
|
+
handler = this._getCacheHandler(request);
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
const handlers = this._getMatchedHandlers(request);
|
|
434
|
+
if (!LazyModulesManager.instance.lazyLoadingDisabled) {
|
|
435
|
+
yield this._loadLazyHandlers(request, handlers);
|
|
436
|
+
}
|
|
437
|
+
handler = this._buildHandlersChain(request, handlers);
|
|
438
|
+
}
|
|
346
439
|
this._requestListeners.forEach((listener) => listener === null || listener === void 0 ? void 0 : listener(request));
|
|
347
440
|
return handler === null || handler === void 0 ? void 0 : handler.handle(request);
|
|
348
441
|
}),
|
|
@@ -363,6 +456,15 @@ class InternalHandlerChain {
|
|
|
363
456
|
}
|
|
364
457
|
};
|
|
365
458
|
},
|
|
459
|
+
/**
|
|
460
|
+
* @hostPublicApi
|
|
461
|
+
*/
|
|
462
|
+
update: (updatedInfo) => {
|
|
463
|
+
const config = this._handlers.find((h) => h.type === updatedInfo.type);
|
|
464
|
+
if (config) {
|
|
465
|
+
config.createHandler = updatedInfo.createHandler;
|
|
466
|
+
}
|
|
467
|
+
},
|
|
366
468
|
/**
|
|
367
469
|
* @hostPublicApi
|
|
368
470
|
*/
|
|
@@ -389,8 +491,11 @@ class InternalHandlerChain {
|
|
|
389
491
|
const configs = (_a = this._handlersScopesByContextId.get(contextId)) !== null && _a !== void 0 ? _a : [];
|
|
390
492
|
return configs.every(({ requestType, scope }) => { var _a; return (_a = this._handlersCache.get(requestType)) === null || _a === void 0 ? void 0 : _a.delete(scope); });
|
|
391
493
|
}
|
|
392
|
-
|
|
393
|
-
|
|
494
|
+
clear() {
|
|
495
|
+
this._handlers.splice(0);
|
|
496
|
+
this._requestListeners.clear();
|
|
497
|
+
this._handlersCache.clear();
|
|
498
|
+
this._handlersScopesByContextId.clear();
|
|
394
499
|
}
|
|
395
500
|
_getCacheHandler(request) {
|
|
396
501
|
const map = this._handlersCache.get(request.type);
|
|
@@ -441,23 +546,35 @@ class InternalHandlerChain {
|
|
|
441
546
|
throw new Error('Handler should implement "BaseRequestHandler"');
|
|
442
547
|
}
|
|
443
548
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
549
|
+
_loadLazyHandlers(request, configs) {
|
|
550
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
551
|
+
const lazyModules = new Set();
|
|
552
|
+
configs.forEach((config) => {
|
|
553
|
+
if (config.lazy && !config.createHandler) {
|
|
554
|
+
lazyModules.add(config.lazyModuleRef);
|
|
555
|
+
}
|
|
556
|
+
});
|
|
557
|
+
yield Promise.all([...lazyModules].map((m) => m.loadAndBootstrap()));
|
|
558
|
+
const injectionContext = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context);
|
|
559
|
+
if (injectionContext && lazyModules.size) {
|
|
560
|
+
lazyModules.forEach((ref) => injectionContext.addLazyModule(ref.typeRef));
|
|
561
|
+
callOnContextUpdateHooks(injectionContext);
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
_getMatchedHandlers(request) {
|
|
566
|
+
return this._handlers.filter((h) => {
|
|
447
567
|
if (h.requestType !== request.type) {
|
|
448
568
|
return false;
|
|
449
569
|
}
|
|
450
|
-
|
|
451
|
-
return true;
|
|
452
|
-
}
|
|
453
|
-
return h.scopes.some((s) => { var _a; return (_a = request.scopes) === null || _a === void 0 ? void 0 : _a.includes(s); });
|
|
570
|
+
return matchScopes(h.scopes, request.scopes);
|
|
454
571
|
});
|
|
572
|
+
}
|
|
573
|
+
_buildHandlersChain(request, handlers) {
|
|
455
574
|
const comparer = new HandlersOrderComparer(request);
|
|
456
575
|
handlers.sort((a, b) => comparer.compare(a, b));
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
return handlerConfig.createHandler(injectionContext);
|
|
460
|
-
});
|
|
576
|
+
const injectionContext = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context);
|
|
577
|
+
const handlerInstances = handlers.map((handlerConfig) => handlerConfig.createHandler.call(handlerConfig, injectionContext));
|
|
461
578
|
handlerInstances.forEach((handler) => this._checkHandlerInstanceOf(handler));
|
|
462
579
|
this._joinHandlersInChain(handlerInstances);
|
|
463
580
|
const result = handlerInstances[0];
|
|
@@ -517,6 +634,12 @@ class HandlerChainService {
|
|
|
517
634
|
register(handlerConfig) {
|
|
518
635
|
return this._chain.handlerChain$.register(handlerConfig);
|
|
519
636
|
}
|
|
637
|
+
/**
|
|
638
|
+
* @internal
|
|
639
|
+
*/
|
|
640
|
+
update(handlerConfig) {
|
|
641
|
+
return this._chain.handlerChain$.update(handlerConfig);
|
|
642
|
+
}
|
|
520
643
|
/**
|
|
521
644
|
* @description Method to process passed request
|
|
522
645
|
* @param request - {@link ɵBaseRequest}
|
|
@@ -537,6 +660,12 @@ class HandlerChainService {
|
|
|
537
660
|
subscribe(callback, context) {
|
|
538
661
|
return this._chain.handlerChain$.subscribe(callback, context);
|
|
539
662
|
}
|
|
663
|
+
/**
|
|
664
|
+
* @internal
|
|
665
|
+
*/
|
|
666
|
+
clear() {
|
|
667
|
+
this._chain.clear();
|
|
668
|
+
}
|
|
540
669
|
}
|
|
541
670
|
|
|
542
671
|
/**
|
|
@@ -668,10 +797,16 @@ class InternalRequestHandlerRegistryType {
|
|
|
668
797
|
* @publicHostApi
|
|
669
798
|
*/
|
|
670
799
|
static addRequestHandler(handlerType, config) {
|
|
671
|
-
|
|
672
|
-
|
|
800
|
+
var _a, _b;
|
|
801
|
+
const existingHandler = this._requestHandlersMap.get(handlerType);
|
|
802
|
+
if (!existingHandler || (((_a = existingHandler.instanceConfig) === null || _a === void 0 ? void 0 : _a.lazy) && !existingHandler.instanceType)) {
|
|
803
|
+
const mergedConfig = {
|
|
804
|
+
instanceType: config.instanceType,
|
|
805
|
+
instanceConfig: Object.assign(Object.assign({}, ((_b = existingHandler === null || existingHandler === void 0 ? void 0 : existingHandler.instanceConfig) !== null && _b !== void 0 ? _b : {})), config.instanceConfig),
|
|
806
|
+
};
|
|
807
|
+
this._requestHandlersMap.set(handlerType, mergedConfig);
|
|
673
808
|
for (const listener of this._addItemListeners) {
|
|
674
|
-
listener(handlerType,
|
|
809
|
+
listener(handlerType, mergedConfig);
|
|
675
810
|
}
|
|
676
811
|
}
|
|
677
812
|
}
|
|
@@ -687,6 +822,11 @@ class InternalRequestHandlerRegistryType {
|
|
|
687
822
|
}
|
|
688
823
|
}
|
|
689
824
|
}
|
|
825
|
+
static clear() {
|
|
826
|
+
for (const type of this._requestHandlersMap.keys()) {
|
|
827
|
+
this.removeRequestHandler(type);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
690
830
|
}
|
|
691
831
|
InternalRequestHandlerRegistryType._addItemListeners = [];
|
|
692
832
|
InternalRequestHandlerRegistryType._removeItemListeners = [];
|
|
@@ -765,6 +905,9 @@ RequestRegistryService._requestsRegistrationInfos = new Map();
|
|
|
765
905
|
* @hostPublicApi available through window.creatio.registry.ConverterRegistry
|
|
766
906
|
*/
|
|
767
907
|
class ConverterRegistry extends ɵBaseRegistry {
|
|
908
|
+
static has(type) {
|
|
909
|
+
return this.store.typeInfos.has(type);
|
|
910
|
+
}
|
|
768
911
|
static get(type) {
|
|
769
912
|
if (!this.store.typeInfos.has(type)) {
|
|
770
913
|
throw new Error(`'${type}' converter doesn't exist`);
|
|
@@ -775,7 +918,8 @@ class ConverterRegistry extends ɵBaseRegistry {
|
|
|
775
918
|
checkTypeNameFormat(item.type, 'ConverterTypeName');
|
|
776
919
|
checkCrtTypeNamePascalCase(item.type);
|
|
777
920
|
// TODO RND-21723
|
|
778
|
-
this.store.typeInfos.
|
|
921
|
+
const existingItem = this.store.typeInfos.get(item.type);
|
|
922
|
+
this.store.typeInfos.set(item.type, Object.assign(Object.assign({}, (existingItem !== null && existingItem !== void 0 ? existingItem : {})), item));
|
|
779
923
|
}
|
|
780
924
|
static clear() {
|
|
781
925
|
this.store.typeInfos.clear();
|
|
@@ -794,13 +938,18 @@ const viewElementRegistryKey = 'ViewElementRegistry';
|
|
|
794
938
|
class ViewElementRegistry extends ɵBaseRegistry {
|
|
795
939
|
static validate(config) {
|
|
796
940
|
checkTypeNameFormat(config.type, 'ViewElementTypeName');
|
|
941
|
+
const existingItem = ViewElementRegistry.viewElements.get(config.type);
|
|
942
|
+
if ((existingItem === null || existingItem === void 0 ? void 0 : existingItem.lazy) && !('selector' in existingItem) && !existingItem.typeRef) {
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
797
945
|
checkOnlyOneRegistration(config.type, config, ViewElementRegistry.viewElements);
|
|
798
946
|
}
|
|
799
947
|
static get viewElements() {
|
|
800
948
|
return this.store.typeInfos;
|
|
801
949
|
}
|
|
802
950
|
static register(config) {
|
|
803
|
-
this.viewElements.
|
|
951
|
+
const existingConfig = this.viewElements.get(config.type);
|
|
952
|
+
this.viewElements.set(config.type, Object.assign(Object.assign({}, (existingConfig !== null && existingConfig !== void 0 ? existingConfig : {})), config));
|
|
804
953
|
}
|
|
805
954
|
static getFormControlRelatesAttribute(type) {
|
|
806
955
|
var _a;
|
|
@@ -812,6 +961,11 @@ class ViewElementRegistry extends ɵBaseRegistry {
|
|
|
812
961
|
const config = this.store.typeInfos.get(type);
|
|
813
962
|
return (_a = config === null || config === void 0 ? void 0 : config.inputs) !== null && _a !== void 0 ? _a : {};
|
|
814
963
|
}
|
|
964
|
+
static getViewElementOutputs(type) {
|
|
965
|
+
var _a;
|
|
966
|
+
const config = this.store.typeInfos.get(type);
|
|
967
|
+
return (_a = config === null || config === void 0 ? void 0 : config.outputs) !== null && _a !== void 0 ? _a : {};
|
|
968
|
+
}
|
|
815
969
|
static getViewElementPropertiesDefaultValues(type) {
|
|
816
970
|
var _a;
|
|
817
971
|
const config = this.store.typeInfos.get(type);
|
|
@@ -956,11 +1110,15 @@ const validatorRegistryKey = 'ValidatorRegistry';
|
|
|
956
1110
|
class ValidatorRegistry extends ɵBaseRegistry {
|
|
957
1111
|
static _has(configType, type) {
|
|
958
1112
|
var _a;
|
|
1113
|
+
const config = ValidatorRegistry.items.get(configType);
|
|
1114
|
+
if ((config === null || config === void 0 ? void 0 : config.lazy) && !(config === null || config === void 0 ? void 0 : config.typeRef)) {
|
|
1115
|
+
return false;
|
|
1116
|
+
}
|
|
959
1117
|
return ValidatorRegistry.items.has(configType) && ((_a = ValidatorRegistry.items.get(configType)) === null || _a === void 0 ? void 0 : _a.typeRef) !== type;
|
|
960
1118
|
}
|
|
961
1119
|
static validate(config) {
|
|
962
1120
|
checkTypeNameFormat(config.type, 'ValidatorTypeName');
|
|
963
|
-
if (ValidatorRegistry._has(config.type, config.typeRef)) {
|
|
1121
|
+
if (config.typeRef && ValidatorRegistry._has(config.type, config.typeRef)) {
|
|
964
1122
|
throw new Error(`Error when register ${config.type}. Element with this type has already exist`);
|
|
965
1123
|
}
|
|
966
1124
|
}
|
|
@@ -968,7 +1126,8 @@ class ValidatorRegistry extends ɵBaseRegistry {
|
|
|
968
1126
|
return this.store.typeInfos;
|
|
969
1127
|
}
|
|
970
1128
|
static register(config) {
|
|
971
|
-
this.items.
|
|
1129
|
+
const existingConfig = this.items.get(config.type);
|
|
1130
|
+
this.items.set(config.type, Object.assign(Object.assign({}, (existingConfig !== null && existingConfig !== void 0 ? existingConfig : {})), config));
|
|
972
1131
|
}
|
|
973
1132
|
}
|
|
974
1133
|
ValidatorRegistry.registryKey = validatorRegistryKey;
|
|
@@ -990,6 +1149,27 @@ class RemoteEntriesRegistry extends ɵBaseRegistry {
|
|
|
990
1149
|
*/
|
|
991
1150
|
RemoteEntriesRegistry.registryKey = 'remotes';
|
|
992
1151
|
|
|
1152
|
+
/**
|
|
1153
|
+
* @internal
|
|
1154
|
+
*/
|
|
1155
|
+
const registryKey = 'ChatMessageTypeRegistry';
|
|
1156
|
+
/**
|
|
1157
|
+
* @internal
|
|
1158
|
+
* @hostPublicApi available through window.creatio.registry.ChatMessageTypeRegistry
|
|
1159
|
+
*/
|
|
1160
|
+
class ChatMessageTypeRegistry extends ɵBaseRegistry {
|
|
1161
|
+
static get messageTypes() {
|
|
1162
|
+
return this.store.typeInfos;
|
|
1163
|
+
}
|
|
1164
|
+
static register(messageType, selector) {
|
|
1165
|
+
this.messageTypes.set(messageType, selector);
|
|
1166
|
+
}
|
|
1167
|
+
static getSelector(messageType) {
|
|
1168
|
+
return this.store.typeInfos.get(messageType);
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
ChatMessageTypeRegistry.registryKey = registryKey;
|
|
1172
|
+
|
|
993
1173
|
/**
|
|
994
1174
|
* @internal
|
|
995
1175
|
*/
|
|
@@ -1247,6 +1427,43 @@ class CrtInputRegistrationConfig {
|
|
|
1247
1427
|
class DataRequest extends ɵBaseRequest {
|
|
1248
1428
|
}
|
|
1249
1429
|
|
|
1430
|
+
/**
|
|
1431
|
+
* @internal
|
|
1432
|
+
*/
|
|
1433
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1434
|
+
function CrtRequest(config) {
|
|
1435
|
+
return function (type) {
|
|
1436
|
+
checkTypeNameFormat(config.type, 'RequestTypeName');
|
|
1437
|
+
checkCrtTypeNamePascalCase(config.type);
|
|
1438
|
+
RequestRegistryService.register(config, type);
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
/**
|
|
1443
|
+
* @hostPublicApi
|
|
1444
|
+
* TODO: RND-55882
|
|
1445
|
+
*/
|
|
1446
|
+
let HandleViewModelAttributeChangeRequest = class HandleViewModelAttributeChangeRequest extends ɵBaseRequest {
|
|
1447
|
+
constructor(payload) {
|
|
1448
|
+
super();
|
|
1449
|
+
this.type = 'crt.HandleViewModelAttributeChangeRequest';
|
|
1450
|
+
this.attributeName = payload.attributeName;
|
|
1451
|
+
this.value = payload.value;
|
|
1452
|
+
this.oldValue = payload.oldValue;
|
|
1453
|
+
// eslint-disable-next-line sonar/deprecation
|
|
1454
|
+
this.silent = Boolean(payload.silent);
|
|
1455
|
+
this.preventAttributeChangeRequest = Boolean(payload.preventAttributeChangeRequest);
|
|
1456
|
+
this.preventStateChange = Boolean(payload.preventStateChange);
|
|
1457
|
+
this.preventRunBusinessRules = Boolean(payload.preventRunBusinessRules);
|
|
1458
|
+
}
|
|
1459
|
+
};
|
|
1460
|
+
HandleViewModelAttributeChangeRequest = __decorate([
|
|
1461
|
+
CrtRequest({
|
|
1462
|
+
type: 'crt.HandleViewModelAttributeChangeRequest',
|
|
1463
|
+
}),
|
|
1464
|
+
__metadata("design:paramtypes", [Object])
|
|
1465
|
+
], HandleViewModelAttributeChangeRequest);
|
|
1466
|
+
|
|
1250
1467
|
/**
|
|
1251
1468
|
* @internal
|
|
1252
1469
|
*/
|
|
@@ -1373,18 +1590,6 @@ function CrtDesignTimeViewElement(config) {
|
|
|
1373
1590
|
};
|
|
1374
1591
|
}
|
|
1375
1592
|
|
|
1376
|
-
/**
|
|
1377
|
-
* @internal
|
|
1378
|
-
*/
|
|
1379
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1380
|
-
function CrtRequest(config) {
|
|
1381
|
-
return function (type) {
|
|
1382
|
-
checkTypeNameFormat(config.type, 'RequestTypeName');
|
|
1383
|
-
checkCrtTypeNamePascalCase(config.type);
|
|
1384
|
-
RequestRegistryService.register(config, type);
|
|
1385
|
-
};
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
1593
|
/**
|
|
1389
1594
|
* @internal
|
|
1390
1595
|
* @hostPublicApi
|
|
@@ -1412,6 +1617,32 @@ var RemoteEntryType;
|
|
|
1412
1617
|
RemoteEntryType["Module"] = "module";
|
|
1413
1618
|
})(RemoteEntryType || (RemoteEntryType = {}));
|
|
1414
1619
|
|
|
1620
|
+
/**
|
|
1621
|
+
* @internal
|
|
1622
|
+
*/
|
|
1623
|
+
class LazyModuleRef {
|
|
1624
|
+
get typeRef() {
|
|
1625
|
+
return this._typeRef;
|
|
1626
|
+
}
|
|
1627
|
+
constructor(_metadata, _bootstrapFn,
|
|
1628
|
+
/** Name of source build ('host' or remote name) */
|
|
1629
|
+
sourceName) {
|
|
1630
|
+
this._metadata = _metadata;
|
|
1631
|
+
this._bootstrapFn = _bootstrapFn;
|
|
1632
|
+
this.sourceName = sourceName;
|
|
1633
|
+
}
|
|
1634
|
+
loadAndBootstrap() {
|
|
1635
|
+
if (!this._modulePromise) {
|
|
1636
|
+
this._modulePromise = this._metadata.load().then((type) => {
|
|
1637
|
+
this._typeRef = type;
|
|
1638
|
+
this._bootstrapFn(type);
|
|
1639
|
+
return type;
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
1642
|
+
return this._modulePromise;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1415
1646
|
/**
|
|
1416
1647
|
* @public
|
|
1417
1648
|
* @description Creatio platform interacts with input's of user-defined component through CrtInput decorator.
|
|
@@ -1502,23 +1733,7 @@ function CrtViewElement(config) {
|
|
|
1502
1733
|
}
|
|
1503
1734
|
|
|
1504
1735
|
/**
|
|
1505
|
-
* @
|
|
1506
|
-
* @description CrtModule decorator is a 'container' where user actually setup elements.
|
|
1507
|
-
* In could contain viewElements, definitions of other CrtModules.
|
|
1508
|
-
* @param moduleDefinition - {@link ModuleDefinition}
|
|
1509
|
-
*
|
|
1510
|
-
* @example
|
|
1511
|
-
* @CrtModule({
|
|
1512
|
-
* viewElements: [AppComponent],
|
|
1513
|
-
* requestHandlers: [SomeRequestHandler],
|
|
1514
|
-
* validators: [SomeValidator],
|
|
1515
|
-
* })
|
|
1516
|
-
* @NgModule({
|
|
1517
|
-
* declarations: [AppComponent],
|
|
1518
|
-
* imports: [BrowserModule],
|
|
1519
|
-
* providers: [],
|
|
1520
|
-
* })
|
|
1521
|
-
* export class AppModule {}
|
|
1736
|
+
* @internal
|
|
1522
1737
|
*/
|
|
1523
1738
|
function CrtModule(moduleDefinition) {
|
|
1524
1739
|
return (type) => setModuleMetadata(moduleDefinition, type);
|
|
@@ -1620,6 +1835,25 @@ function CrtConverter(config) {
|
|
|
1620
1835
|
};
|
|
1621
1836
|
}
|
|
1622
1837
|
|
|
1838
|
+
/**
|
|
1839
|
+
* @public
|
|
1840
|
+
* @description CrtChatMessageType decorator allows user to register components as a message type in chat.
|
|
1841
|
+
* @param config - registration config. {@link ChatMessageTypeRegistrationConfig}.
|
|
1842
|
+
*
|
|
1843
|
+
* @example
|
|
1844
|
+
* @CrtChatMessageType({
|
|
1845
|
+
* selector: 'usr-video-message',
|
|
1846
|
+
* messageType: 'video',
|
|
1847
|
+
* })
|
|
1848
|
+
* export class AppComponent { }
|
|
1849
|
+
*/
|
|
1850
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1851
|
+
function CrtChatMessageType(config) {
|
|
1852
|
+
return function (type) {
|
|
1853
|
+
ChatMessageTypeRegistry.register(config.messageType, config.selector);
|
|
1854
|
+
};
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1623
1857
|
/**
|
|
1624
1858
|
* @internal
|
|
1625
1859
|
*/
|
|
@@ -1668,6 +1902,9 @@ function registerAngularViewElement(config, typeRef) {
|
|
|
1668
1902
|
ViewElementRegistry.register(Object.assign(Object.assign({}, config), { typeRef }));
|
|
1669
1903
|
}
|
|
1670
1904
|
|
|
1905
|
+
/**
|
|
1906
|
+
* @internal
|
|
1907
|
+
*/
|
|
1671
1908
|
function checkRemoteName(remoteName) {
|
|
1672
1909
|
if (!RemoteEntriesRegistry.items.has(remoteName)) {
|
|
1673
1910
|
throw new Error(`Remote entry with name '${remoteName}' does not exist`);
|
|
@@ -1696,6 +1933,16 @@ function registerViewElements(types) {
|
|
|
1696
1933
|
ViewElementRegistry.register(registrationConfig);
|
|
1697
1934
|
});
|
|
1698
1935
|
}
|
|
1936
|
+
/**
|
|
1937
|
+
* @internal
|
|
1938
|
+
*/
|
|
1939
|
+
function registerLazyViewElements(configs, lazyModuleRef) {
|
|
1940
|
+
resistantForEach(configs, (config) => {
|
|
1941
|
+
const registryItem = Object.assign(Object.assign({}, config), { lazy: true, lazyModuleRef });
|
|
1942
|
+
ViewElementRegistry.validate(registryItem);
|
|
1943
|
+
ViewElementRegistry.register(registryItem);
|
|
1944
|
+
});
|
|
1945
|
+
}
|
|
1699
1946
|
/**
|
|
1700
1947
|
* @internal
|
|
1701
1948
|
*/
|
|
@@ -1738,6 +1985,16 @@ function registerValidators(types, options) {
|
|
|
1738
1985
|
ValidatorRegistry.register(registrationConfig);
|
|
1739
1986
|
});
|
|
1740
1987
|
}
|
|
1988
|
+
/**
|
|
1989
|
+
* @internal
|
|
1990
|
+
*/
|
|
1991
|
+
function registerLazyValidators(configs, lazyModuleRef) {
|
|
1992
|
+
resistantForEach(configs, (config) => {
|
|
1993
|
+
const registryItem = Object.assign(Object.assign({}, config), { lazy: true, lazyModuleRef });
|
|
1994
|
+
ValidatorRegistry.validate(registryItem);
|
|
1995
|
+
ValidatorRegistry.register(registryItem);
|
|
1996
|
+
});
|
|
1997
|
+
}
|
|
1741
1998
|
/**
|
|
1742
1999
|
* @internal
|
|
1743
2000
|
*/
|
|
@@ -1753,6 +2010,15 @@ function registerConverters(types, options) {
|
|
|
1753
2010
|
ConverterRegistry.register(registrationConfig);
|
|
1754
2011
|
});
|
|
1755
2012
|
}
|
|
2013
|
+
/**
|
|
2014
|
+
* @internal
|
|
2015
|
+
*/
|
|
2016
|
+
function registerLazyConverters(descriptors, lazyModuleRef) {
|
|
2017
|
+
resistantForEach(descriptors, (descriptor) => {
|
|
2018
|
+
const registryItem = Object.assign(Object.assign({}, descriptor), { lazy: true, lazyModuleRef });
|
|
2019
|
+
ConverterRegistry.register(registryItem);
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
1756
2022
|
/**
|
|
1757
2023
|
* @internal
|
|
1758
2024
|
*/
|
|
@@ -1783,8 +2049,61 @@ function registerRequestHandlers(types, options, remoteName) {
|
|
|
1783
2049
|
RequestHandlerRegistryService.register(registrationConfig, type);
|
|
1784
2050
|
});
|
|
1785
2051
|
}
|
|
1786
|
-
|
|
2052
|
+
/**
|
|
2053
|
+
* @internal
|
|
2054
|
+
*/
|
|
2055
|
+
function registerLazyRequestHandlers(descriptors, options, remoteName, lazyModuleRef) {
|
|
2056
|
+
resistantForEach(descriptors, (descriptor) => {
|
|
2057
|
+
const registrationConfig = Object.assign(Object.assign({}, descriptor), { lazy: true, lazyModuleRef });
|
|
2058
|
+
if (options.moduleType === 'host') {
|
|
2059
|
+
registrationConfig.source = { type: HandlerSourceType.Host };
|
|
2060
|
+
}
|
|
2061
|
+
else {
|
|
2062
|
+
const remote = RemoteEntriesRegistry.items.get(remoteName);
|
|
2063
|
+
registrationConfig.source = {
|
|
2064
|
+
type: HandlerSourceType.Remote,
|
|
2065
|
+
packageName: remote.packageName,
|
|
2066
|
+
};
|
|
2067
|
+
}
|
|
2068
|
+
RequestHandlerRegistryService.register(registrationConfig);
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
/**
|
|
2072
|
+
* @internal
|
|
2073
|
+
*/
|
|
2074
|
+
function bootstrapLazyCrtModule(name, descriptor, options, lazyModuleRef) {
|
|
1787
2075
|
var _a;
|
|
2076
|
+
try {
|
|
2077
|
+
if (descriptor.viewElements) {
|
|
2078
|
+
registerLazyViewElements(descriptor.viewElements, lazyModuleRef);
|
|
2079
|
+
}
|
|
2080
|
+
if (descriptor.requestHandlers) {
|
|
2081
|
+
registerLazyRequestHandlers(descriptor.requestHandlers, options, name, lazyModuleRef);
|
|
2082
|
+
}
|
|
2083
|
+
if (descriptor.validators) {
|
|
2084
|
+
registerLazyValidators(descriptor.validators, lazyModuleRef);
|
|
2085
|
+
}
|
|
2086
|
+
if (descriptor.converters) {
|
|
2087
|
+
registerLazyConverters(descriptor.converters, lazyModuleRef);
|
|
2088
|
+
}
|
|
2089
|
+
(_a = descriptor.includes) === null || _a === void 0 ? void 0 : _a.forEach((m) => {
|
|
2090
|
+
bootstrapLazyCrtModule(name, m, options, lazyModuleRef);
|
|
2091
|
+
});
|
|
2092
|
+
}
|
|
2093
|
+
catch (error) {
|
|
2094
|
+
console.error(error);
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* @internal
|
|
2099
|
+
*/
|
|
2100
|
+
function bootstrapDefaultCrtModule(name, type, options, root) {
|
|
2101
|
+
var _a;
|
|
2102
|
+
if (bootstrappedCrtModules.has(type)) {
|
|
2103
|
+
return;
|
|
2104
|
+
}
|
|
2105
|
+
const source = options.moduleType === 'host' ? 'host' : name;
|
|
2106
|
+
bootstrappedCrtModules.set(type, { source, root, options });
|
|
1788
2107
|
try {
|
|
1789
2108
|
const moduleDefinition = getModuleMetadata(type);
|
|
1790
2109
|
if (moduleDefinition.viewElements) {
|
|
@@ -1804,8 +2123,19 @@ function bootstrapDefaultCrtModule(name, type, options) {
|
|
|
1804
2123
|
registerConverters(moduleDefinition.converters, options);
|
|
1805
2124
|
}
|
|
1806
2125
|
(_a = moduleDefinition.includes) === null || _a === void 0 ? void 0 : _a.forEach((t) => {
|
|
1807
|
-
|
|
1808
|
-
|
|
2126
|
+
if (typeof t === 'function') {
|
|
2127
|
+
bootstrapDefaultCrtModule(name, t, options, false);
|
|
2128
|
+
bootstrapPredefinedModules(name, t, options);
|
|
2129
|
+
}
|
|
2130
|
+
else if (typeof t === 'object') {
|
|
2131
|
+
if (options.moduleType === 'remote' && !name) {
|
|
2132
|
+
console.error("To use lazy loading, 'remoteName' parameter should be specified.");
|
|
2133
|
+
return;
|
|
2134
|
+
}
|
|
2135
|
+
const ref = new LazyModuleRef(t, (x) => bootstrapDefaultCrtModule(name, x, options, false), source);
|
|
2136
|
+
bootstrapLazyCrtModule(name, t, options, ref);
|
|
2137
|
+
LazyModulesManager.instance.add(ref);
|
|
2138
|
+
}
|
|
1809
2139
|
});
|
|
1810
2140
|
}
|
|
1811
2141
|
catch (error) {
|
|
@@ -1848,7 +2178,7 @@ function bootstrapCrtModule(...args) {
|
|
|
1848
2178
|
throw new Error('Host module cannot have name');
|
|
1849
2179
|
}
|
|
1850
2180
|
}
|
|
1851
|
-
bootstrapDefaultCrtModule(name, type, options);
|
|
2181
|
+
bootstrapDefaultCrtModule(name, type, options, true);
|
|
1852
2182
|
bootstrapPredefinedModules(name, type, options);
|
|
1853
2183
|
if (options.moduleType === 'remote') {
|
|
1854
2184
|
BootstrapNotifier.instance.notify(type);
|
|
@@ -1901,7 +2231,11 @@ function _bootstrapCrtModuleHandlerChainServices(type) {
|
|
|
1901
2231
|
if (moduleDefinition.handlerChainServices) {
|
|
1902
2232
|
registerHandlerChainServices(moduleDefinition.handlerChainServices);
|
|
1903
2233
|
}
|
|
1904
|
-
(_a = moduleDefinition.includes) === null || _a === void 0 ? void 0 : _a.forEach((t) =>
|
|
2234
|
+
(_a = moduleDefinition.includes) === null || _a === void 0 ? void 0 : _a.forEach((t) => {
|
|
2235
|
+
if (typeof t === 'function') {
|
|
2236
|
+
_bootstrapCrtModuleHandlerChainServices(t);
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
1905
2239
|
}
|
|
1906
2240
|
/**
|
|
1907
2241
|
* @internal
|
|
@@ -1910,6 +2244,33 @@ function bootstrapCrtModuleHandlerChainServices(type) {
|
|
|
1910
2244
|
_bootstrapCrtModuleHandlerChainServices(type);
|
|
1911
2245
|
}
|
|
1912
2246
|
|
|
2247
|
+
/**
|
|
2248
|
+
* @internal
|
|
2249
|
+
* Clears global registries, resets state of global services.
|
|
2250
|
+
* Can be used in unit tests to clear global registries after bootstrapping module.
|
|
2251
|
+
* @example
|
|
2252
|
+
* beforeEach(() => {
|
|
2253
|
+
* bootstrapCrtModule('test', TestModule);
|
|
2254
|
+
* });
|
|
2255
|
+
*
|
|
2256
|
+
* afterEach(() => {
|
|
2257
|
+
* resetGlobals();
|
|
2258
|
+
* });
|
|
2259
|
+
*/
|
|
2260
|
+
function resetGlobals() {
|
|
2261
|
+
bootstrappedCrtModules.clear();
|
|
2262
|
+
ViewElementRegistry.viewElements.clear();
|
|
2263
|
+
InternalRequestHandlerRegistry.clear();
|
|
2264
|
+
HandlerChainService.instance.clear();
|
|
2265
|
+
ValidatorRegistry.items.clear();
|
|
2266
|
+
ConverterRegistry.clear();
|
|
2267
|
+
RemoteEntriesRegistry.items.clear();
|
|
2268
|
+
PkgTopology.items.clear();
|
|
2269
|
+
LazyModulesManager.instance.clear();
|
|
2270
|
+
LazyModulesManager.instance.lazyLoadingDisabled = false;
|
|
2271
|
+
DesignTimeViewElementRegistry.infos.clear();
|
|
2272
|
+
}
|
|
2273
|
+
|
|
1913
2274
|
/**
|
|
1914
2275
|
* @public
|
|
1915
2276
|
* @abstract
|
|
@@ -2153,25 +2514,23 @@ __decorate([
|
|
|
2153
2514
|
], HttpClientService.prototype, "patch", null);
|
|
2154
2515
|
|
|
2155
2516
|
/**
|
|
2156
|
-
* @
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
(function (SchemaViewMaskRequestAction) {
|
|
2160
|
-
SchemaViewMaskRequestAction["AddTask"] = "addTask";
|
|
2161
|
-
SchemaViewMaskRequestAction["RemoveTask"] = "removeTask";
|
|
2162
|
-
})(SchemaViewMaskRequestAction || (SchemaViewMaskRequestAction = {}));
|
|
2163
|
-
/**
|
|
2164
|
-
* @internal
|
|
2517
|
+
* @public
|
|
2518
|
+
* @classdesc Represents a service to working with license restrictions.
|
|
2519
|
+
* @extends {BaseHandlerChainService}
|
|
2165
2520
|
*/
|
|
2166
|
-
class
|
|
2167
|
-
constructor(
|
|
2168
|
-
super();
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
this.
|
|
2521
|
+
class LicenseService extends BaseHandlerChainService {
|
|
2522
|
+
constructor() {
|
|
2523
|
+
super(...arguments);
|
|
2524
|
+
/**
|
|
2525
|
+
* @internal
|
|
2526
|
+
*/
|
|
2527
|
+
this.requestType = 'crt.LicenseService';
|
|
2173
2528
|
}
|
|
2174
2529
|
}
|
|
2530
|
+
__decorate([
|
|
2531
|
+
ImplementUsingHandlerChain(),
|
|
2532
|
+
__metadata("design:type", Function)
|
|
2533
|
+
], LicenseService.prototype, "loadLicenseOperationStatuses", void 0);
|
|
2175
2534
|
|
|
2176
2535
|
/**
|
|
2177
2536
|
* @public
|
|
@@ -2193,7 +2552,7 @@ class MaskService extends BaseHandlerChainService {
|
|
|
2193
2552
|
*/
|
|
2194
2553
|
showMask(taskName, context) {
|
|
2195
2554
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2196
|
-
const request = new
|
|
2555
|
+
const request = new ɵSchemaViewMaskRequest(ɵSchemaViewMaskRequestAction.AddTask, taskName, context);
|
|
2197
2556
|
yield HandlerChainService.instance.process(request);
|
|
2198
2557
|
});
|
|
2199
2558
|
}
|
|
@@ -2204,7 +2563,7 @@ class MaskService extends BaseHandlerChainService {
|
|
|
2204
2563
|
*/
|
|
2205
2564
|
hideMask(taskName, context) {
|
|
2206
2565
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2207
|
-
const request = new
|
|
2566
|
+
const request = new ɵSchemaViewMaskRequest(ɵSchemaViewMaskRequestAction.RemoveTask, taskName, context);
|
|
2208
2567
|
yield HandlerChainService.instance.process(request);
|
|
2209
2568
|
});
|
|
2210
2569
|
}
|
|
@@ -2269,6 +2628,9 @@ class Model extends BaseHandlerChainService {
|
|
|
2269
2628
|
return this._crtModel._getAsyncResult(this._crtModel.getSchema());
|
|
2270
2629
|
}
|
|
2271
2630
|
load(config) {
|
|
2631
|
+
if ((config === null || config === void 0 ? void 0 : config.loadOptions) && !(config === null || config === void 0 ? void 0 : config.options)) {
|
|
2632
|
+
config.options = config.loadOptions;
|
|
2633
|
+
}
|
|
2272
2634
|
return this._crtModel._getAsyncResult(this._crtModel.load(config));
|
|
2273
2635
|
}
|
|
2274
2636
|
insert(dto) {
|
|
@@ -2319,9 +2681,30 @@ __decorate([
|
|
|
2319
2681
|
__metadata("design:type", Function)
|
|
2320
2682
|
], CrtZoneService.prototype, "runOutside", void 0);
|
|
2321
2683
|
|
|
2684
|
+
/**
|
|
2685
|
+
* @public
|
|
2686
|
+
* @classdesc Service to working with dialog using handler chain.
|
|
2687
|
+
* @extends {BaseHandlerChainService}
|
|
2688
|
+
*/
|
|
2689
|
+
class DialogService extends BaseHandlerChainService {
|
|
2690
|
+
constructor() {
|
|
2691
|
+
super(...arguments);
|
|
2692
|
+
/**
|
|
2693
|
+
* @internal
|
|
2694
|
+
*/
|
|
2695
|
+
this.requestType = 'crt.DialogService';
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
__decorate([
|
|
2699
|
+
ImplementUsingHandlerChain({
|
|
2700
|
+
methodName: 'openDialog',
|
|
2701
|
+
}),
|
|
2702
|
+
__metadata("design:type", Function)
|
|
2703
|
+
], DialogService.prototype, "open", void 0);
|
|
2704
|
+
|
|
2322
2705
|
/**
|
|
2323
2706
|
* Generated bundle index. Do not edit.
|
|
2324
2707
|
*/
|
|
2325
2708
|
|
|
2326
|
-
export { BaseRequestHandler, BaseValidator, BootstrapNotifier, ConverterRegistry, CrtConverter, CrtDesignTimeViewElement, CrtInject, CrtInput, CrtInputRegistrationConfig, CrtInterfaceDesignerItem, CrtModule, CrtOutput, CrtRequest, CrtRequestHandler, CrtValidationInput, CrtValidator, CrtViewElement, CrtZoneService, DataRequest, DataSourceLoadType, DesignTimeViewElementRegistry, DesignerToolGroupType, FeatureService, HandlerChainService, HandlerChainServicesRegistry, HandlerSourceType, HandlersOrderComparer, HttpClientService, ImplementUsingHandlerChain, InterfaceDesignerItemRegistrationConfig, InterfaceDesignerItemRegistry, InternalRequestHandlerRegistry, InternalRequestHandlerRegistryType, LocalizableValue, MaskService, MethodInvokeRequest, Model, PkgTopology, RemoteEntriesRegistry, RemoteEntryType, RequestHandlerRegistryService, RequestRegistryService, RightsService,
|
|
2709
|
+
export { BaseRequestHandler, BaseValidator, BootstrapNotifier, ChatMessageTypeRegistry, ConverterRegistry, CrtChatMessageType, CrtConverter, CrtDesignTimeViewElement, CrtInject, CrtInput, CrtInputRegistrationConfig, CrtInterfaceDesignerItem, CrtModule, CrtOutput, CrtRequest, CrtRequestHandler, CrtValidationInput, CrtValidator, CrtViewElement, CrtZoneService, DataRequest, DataSourceLoadType, DesignTimeViewElementRegistry, DesignerToolGroupType, DialogService, FeatureService, HandleViewModelAttributeChangeRequest, HandlerChainService, HandlerChainServicesRegistry, HandlerSourceType, HandlersOrderComparer, HttpClientService, ImplementUsingHandlerChain, InterfaceDesignerItemRegistrationConfig, InterfaceDesignerItemRegistry, InternalRequestHandlerRegistry, InternalRequestHandlerRegistryType, LazyModuleRef, LazyModulesManager, LicenseService, LocalizableValue, MaskService, MethodInvokeRequest, Model, PkgTopology, RemoteEntriesRegistry, RemoteEntryType, RequestHandlerRegistryService, RequestRegistryService, RightsService, SysSetting, SysSettingValue, SysSettingsService, SysValuesService, VIEW_ELEMENT_DEFAULT_HEIGHT, ValidatorMapValue, ValidatorRegistry, ViewElementDataGroupType, ViewElementGroupType, ViewElementProperty, ViewElementRegistry, ViewElementReuseStrategy, ViewElementVisibilityStrategy, _from, applyLocalizeMetadataFn, bootstrapCrtModule, bootstrapCrtModuleHandlerChainServices, bootstrappedCrtModules, callOnContextCreateHooks, callOnContextDestroyHooks, callOnContextUpdateHooks, checkCrtTypeNamePascalCase, checkIfTypeRegistered, checkOnlyOneRegistration, checkTypeNameFormat, checkTypeNamePascalCase, crtInjectPrefix, crtInputPrefix, crtOutputPrefix, crtValidationInputPrefix, designTimeViewElementRegistryKey, getConverterMetadata, getCrtInputsMetadata, getCrtOutputsMetadata, getCrtValidationInputsMetadata, getDesignTimeViewElementMetadata, getHandlerChainServiceMetadata, getInterfaceDesignerItemMetadata, getModuleMetadata, getRequestHandlerMetadata, getTypeDependencies, getValidatorMetadata, getViewElementMetadata, hasInterfaceDesignerItemMetadata, instantiate, interfaceDesignerItemRegistryKey, isComponentPropertyBindable, localize, matchScopes, objectDeepKeys, registerAngularViewElement, registerViewElement, registryKey, resetGlobals, setConverterMetadata, setDesignTimeViewElementMetadata, setInterfaceDesignerItemMetadata, setModuleMetadata, setRequestHandlerMetadata, setValidatorMetadata, setViewElementMetadata, toAggregationEval, toAggregationEvalType, toAggregationFunction, toAggregationType, toDatePart, toDatePartType, toNumericFunctionType, toOrderDirection, toPascalCase, toSortDirection, toStringFunctionType, validatorRegistryKey, viewElementRegistryKey, ɵBaseRegistry, ɵcheckTypeNameFormat, ɵinstantiate };
|
|
2327
2710
|
//# sourceMappingURL=creatio-devkit-common.mjs.map
|