@acorex/platform 21.0.0-beta.7 → 21.0.0-beta.8
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/fesm2022/acorex-platform-auth.mjs +4 -0
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +375 -2
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +2 -2
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widgets.mjs +5 -5
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/package.json +1 -1
- package/types/acorex-platform-common.d.ts +1 -1
- package/types/acorex-platform-core.d.ts +1 -1
- package/types/acorex-platform-layout-entity.d.ts +126 -6
|
@@ -3215,6 +3215,24 @@ class AXPEntityDataProviderImpl {
|
|
|
3215
3215
|
insertOne(entity) {
|
|
3216
3216
|
return this.storageService.insertOne(this.entityName, entity);
|
|
3217
3217
|
}
|
|
3218
|
+
count(request) {
|
|
3219
|
+
return this.storageService.count(this.entityName, request);
|
|
3220
|
+
}
|
|
3221
|
+
queryAll(request, options) {
|
|
3222
|
+
return this.storageService.queryAll(this.entityName, request, options);
|
|
3223
|
+
}
|
|
3224
|
+
getMany(ids) {
|
|
3225
|
+
return this.storageService.getMany(this.entityName, ids);
|
|
3226
|
+
}
|
|
3227
|
+
exists(id) {
|
|
3228
|
+
return this.storageService.exists(this.entityName, id);
|
|
3229
|
+
}
|
|
3230
|
+
upsertOne(entity, options) {
|
|
3231
|
+
return this.storageService.upsertOne(this.entityName, entity, options);
|
|
3232
|
+
}
|
|
3233
|
+
aggregate(request, options) {
|
|
3234
|
+
return this.storageService.aggregate(this.entityName, request, options);
|
|
3235
|
+
}
|
|
3218
3236
|
}
|
|
3219
3237
|
class AXMEntityCrudService {
|
|
3220
3238
|
}
|
|
@@ -3316,6 +3334,24 @@ class AXMEntityCrudServiceImpl {
|
|
|
3316
3334
|
get storageService() {
|
|
3317
3335
|
return this._storageService;
|
|
3318
3336
|
}
|
|
3337
|
+
async count(request) {
|
|
3338
|
+
return this._entityDataProvider.count(request);
|
|
3339
|
+
}
|
|
3340
|
+
async queryAll(request, options) {
|
|
3341
|
+
return this._entityDataProvider.queryAll(request, options);
|
|
3342
|
+
}
|
|
3343
|
+
async getMany(ids) {
|
|
3344
|
+
return this._entityDataProvider.getMany(ids);
|
|
3345
|
+
}
|
|
3346
|
+
async exists(id) {
|
|
3347
|
+
return this._entityDataProvider.exists(id);
|
|
3348
|
+
}
|
|
3349
|
+
async upsertOne(entity, options) {
|
|
3350
|
+
return this._entityDataProvider.upsertOne(entity, options);
|
|
3351
|
+
}
|
|
3352
|
+
async aggregate(request, options) {
|
|
3353
|
+
return this._entityDataProvider.aggregate(request, options);
|
|
3354
|
+
}
|
|
3319
3355
|
async custom(request) { }
|
|
3320
3356
|
}
|
|
3321
3357
|
|
|
@@ -6343,6 +6379,225 @@ const AXPEntityPreloadFiltersViewModelResolver = async (route, state) => {
|
|
|
6343
6379
|
};
|
|
6344
6380
|
//#endregion
|
|
6345
6381
|
|
|
6382
|
+
//#region ---- Path / numeric helpers ----
|
|
6383
|
+
function getPath(obj, path) {
|
|
6384
|
+
if (obj == null || path.length === 0) {
|
|
6385
|
+
return undefined;
|
|
6386
|
+
}
|
|
6387
|
+
const parts = path.split('.');
|
|
6388
|
+
let cur = obj;
|
|
6389
|
+
for (const p of parts) {
|
|
6390
|
+
if (cur == null || typeof cur !== 'object') {
|
|
6391
|
+
return undefined;
|
|
6392
|
+
}
|
|
6393
|
+
cur = cur[p];
|
|
6394
|
+
}
|
|
6395
|
+
return cur;
|
|
6396
|
+
}
|
|
6397
|
+
function toNumber(value) {
|
|
6398
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
6399
|
+
return value;
|
|
6400
|
+
}
|
|
6401
|
+
if (typeof value === 'string' && value.trim().length > 0) {
|
|
6402
|
+
const n = Number(value);
|
|
6403
|
+
return Number.isFinite(n) ? n : null;
|
|
6404
|
+
}
|
|
6405
|
+
return null;
|
|
6406
|
+
}
|
|
6407
|
+
function defaultAlias(measure, index) {
|
|
6408
|
+
if (measure.alias?.trim()) {
|
|
6409
|
+
return measure.alias.trim();
|
|
6410
|
+
}
|
|
6411
|
+
if (measure.reducer === 'count') {
|
|
6412
|
+
return index === 0 ? 'count' : `count_${index}`;
|
|
6413
|
+
}
|
|
6414
|
+
const field = measure.field ?? 'value';
|
|
6415
|
+
const safeField = field.replace(/\./g, '_');
|
|
6416
|
+
return `${measure.reducer}_${safeField}`;
|
|
6417
|
+
}
|
|
6418
|
+
/**
|
|
6419
|
+
* Pure aggregation over already-filtered plain rows (e.g. outputs of {@link filterSortEntityRows}).
|
|
6420
|
+
*/
|
|
6421
|
+
function computeEntityAggregates(rows, request) {
|
|
6422
|
+
const groupBy = request.groupBy ?? [];
|
|
6423
|
+
const measures = request.measures ?? [];
|
|
6424
|
+
if (measures.length === 0) {
|
|
6425
|
+
return [];
|
|
6426
|
+
}
|
|
6427
|
+
const groups = new Map();
|
|
6428
|
+
const stableGroupKey = (row) => {
|
|
6429
|
+
const parts = groupBy.map((path) => getPath(row, path));
|
|
6430
|
+
return JSON.stringify(parts);
|
|
6431
|
+
};
|
|
6432
|
+
for (const row of rows) {
|
|
6433
|
+
const k = stableGroupKey(row);
|
|
6434
|
+
let bucket = groups.get(k);
|
|
6435
|
+
if (!bucket) {
|
|
6436
|
+
bucket = {
|
|
6437
|
+
keyParts: groupBy.map((path) => getPath(row, path)),
|
|
6438
|
+
rows: [],
|
|
6439
|
+
};
|
|
6440
|
+
groups.set(k, bucket);
|
|
6441
|
+
}
|
|
6442
|
+
bucket.rows.push(row);
|
|
6443
|
+
}
|
|
6444
|
+
const result = [];
|
|
6445
|
+
for (const bucket of groups.values()) {
|
|
6446
|
+
const out = {};
|
|
6447
|
+
groupBy.forEach((field, i) => {
|
|
6448
|
+
out[field] = bucket.keyParts[i];
|
|
6449
|
+
});
|
|
6450
|
+
measures.forEach((measure, index) => {
|
|
6451
|
+
const alias = defaultAlias(measure, index);
|
|
6452
|
+
const gRows = bucket.rows;
|
|
6453
|
+
if (measure.reducer === 'count') {
|
|
6454
|
+
out[alias] = gRows.length;
|
|
6455
|
+
return;
|
|
6456
|
+
}
|
|
6457
|
+
const fieldPath = measure.field;
|
|
6458
|
+
if (!fieldPath) {
|
|
6459
|
+
out[alias] = null;
|
|
6460
|
+
return;
|
|
6461
|
+
}
|
|
6462
|
+
const nums = gRows.map((r) => toNumber(getPath(r, fieldPath))).filter((n) => n !== null);
|
|
6463
|
+
switch (measure.reducer) {
|
|
6464
|
+
case 'sum':
|
|
6465
|
+
out[alias] = nums.reduce((a, b) => a + b, 0);
|
|
6466
|
+
break;
|
|
6467
|
+
case 'min':
|
|
6468
|
+
out[alias] = nums.length ? Math.min(...nums) : null;
|
|
6469
|
+
break;
|
|
6470
|
+
case 'max':
|
|
6471
|
+
out[alias] = nums.length ? Math.max(...nums) : null;
|
|
6472
|
+
break;
|
|
6473
|
+
case 'avg':
|
|
6474
|
+
out[alias] = nums.length ? nums.reduce((a, b) => a + b, 0) / nums.length : null;
|
|
6475
|
+
break;
|
|
6476
|
+
default:
|
|
6477
|
+
out[alias] = null;
|
|
6478
|
+
}
|
|
6479
|
+
});
|
|
6480
|
+
result.push(out);
|
|
6481
|
+
}
|
|
6482
|
+
return result;
|
|
6483
|
+
}
|
|
6484
|
+
//#endregion
|
|
6485
|
+
|
|
6486
|
+
//#endregion
|
|
6487
|
+
//#region ---- Pure helpers ----
|
|
6488
|
+
/**
|
|
6489
|
+
* Fields where `contains` means hierarchical category membership (expand to descendants).
|
|
6490
|
+
* Excludes e.g. `roleIds`, which uses array membership only and must use normal filter logic.
|
|
6491
|
+
*/
|
|
6492
|
+
function isCategoryContainsFieldName(field) {
|
|
6493
|
+
if (field === 'categoryIds') {
|
|
6494
|
+
return true;
|
|
6495
|
+
}
|
|
6496
|
+
if (typeof field === 'string' && field.endsWith('Ids') && field !== 'roleIds') {
|
|
6497
|
+
return true;
|
|
6498
|
+
}
|
|
6499
|
+
return false;
|
|
6500
|
+
}
|
|
6501
|
+
/**
|
|
6502
|
+
* Check if the entity is a category entity (ends with 'Category').
|
|
6503
|
+
*/
|
|
6504
|
+
function isCategoryEntity(entityName) {
|
|
6505
|
+
return entityName.endsWith('Category');
|
|
6506
|
+
}
|
|
6507
|
+
/**
|
|
6508
|
+
* Check if the filter is a category filter (contains operator on categoryIds field).
|
|
6509
|
+
* Handles both simple filters and compound filters.
|
|
6510
|
+
*/
|
|
6511
|
+
function isCategoryFilter(filter) {
|
|
6512
|
+
if (filter?.operator?.type === 'contains' && isCategoryContainsFieldName(filter.field)) {
|
|
6513
|
+
return true;
|
|
6514
|
+
}
|
|
6515
|
+
if (filter?.logic && filter?.filters && Array.isArray(filter.filters)) {
|
|
6516
|
+
return filter.filters.some((nestedFilter) => nestedFilter?.operator?.type === 'contains' && isCategoryContainsFieldName(nestedFilter.field));
|
|
6517
|
+
}
|
|
6518
|
+
return false;
|
|
6519
|
+
}
|
|
6520
|
+
//#endregion
|
|
6521
|
+
//#region ---- Query execution ----
|
|
6522
|
+
/**
|
|
6523
|
+
* Apply recursive category filtering: entities that belong to the category or any of its children.
|
|
6524
|
+
*/
|
|
6525
|
+
async function applyRecursiveCategoryFilter(result, filter, entityName, getAllChildCategoryIds) {
|
|
6526
|
+
let categoryFilter = filter;
|
|
6527
|
+
let otherFilters = [];
|
|
6528
|
+
if (filter?.logic && filter?.filters && Array.isArray(filter.filters)) {
|
|
6529
|
+
const categoryFilterIndex = filter.filters.findIndex((f) => f?.operator?.type === 'contains' && isCategoryContainsFieldName(f.field));
|
|
6530
|
+
if (categoryFilterIndex !== -1) {
|
|
6531
|
+
categoryFilter = filter.filters[categoryFilterIndex];
|
|
6532
|
+
otherFilters = filter.filters.filter((_, index) => index !== categoryFilterIndex);
|
|
6533
|
+
}
|
|
6534
|
+
}
|
|
6535
|
+
if (!categoryFilter) {
|
|
6536
|
+
return applyFilterArray(result, [filter]);
|
|
6537
|
+
}
|
|
6538
|
+
const categoryId = categoryFilter.value;
|
|
6539
|
+
const categoryField = categoryFilter.field;
|
|
6540
|
+
const allCategoryIds = await getAllChildCategoryIds(categoryId, entityName);
|
|
6541
|
+
let filteredResult = result.filter((item) => {
|
|
6542
|
+
const categoryIds = item[categoryField];
|
|
6543
|
+
if (!categoryIds)
|
|
6544
|
+
return false;
|
|
6545
|
+
const itemCategoryIds = Array.isArray(categoryIds) ? categoryIds : [categoryIds];
|
|
6546
|
+
return itemCategoryIds.some((itemCategoryId) => allCategoryIds.includes(itemCategoryId));
|
|
6547
|
+
});
|
|
6548
|
+
if (otherFilters.length > 0) {
|
|
6549
|
+
filteredResult = applyFilterArray(filteredResult, otherFilters);
|
|
6550
|
+
}
|
|
6551
|
+
return filteredResult;
|
|
6552
|
+
}
|
|
6553
|
+
/**
|
|
6554
|
+
* Calculate childrenCount for each category entity when missing.
|
|
6555
|
+
*/
|
|
6556
|
+
async function calculateChildrenCounts(items, entityName, getDirectChildCount) {
|
|
6557
|
+
return Promise.all(items.map(async (item) => {
|
|
6558
|
+
if (typeof item.childrenCount === 'number') {
|
|
6559
|
+
return { ...item };
|
|
6560
|
+
}
|
|
6561
|
+
const childrenCount = await getDirectChildCount(item.id, entityName);
|
|
6562
|
+
return { ...item, childrenCount };
|
|
6563
|
+
}));
|
|
6564
|
+
}
|
|
6565
|
+
/**
|
|
6566
|
+
* Loads raw rows for an entity and applies the same sorting and filtering as {@link runEntityQuery},
|
|
6567
|
+
* without pagination.
|
|
6568
|
+
*/
|
|
6569
|
+
async function filterSortEntityRows(entityName, request, adapters) {
|
|
6570
|
+
let result = await adapters.getRawAll(entityName);
|
|
6571
|
+
if (request.sort && request.sort.length) {
|
|
6572
|
+
result = applySortArray(result, request.sort);
|
|
6573
|
+
}
|
|
6574
|
+
if (request.filter && isCategoryFilter(request.filter)) {
|
|
6575
|
+
result = await applyRecursiveCategoryFilter(result, request.filter, entityName, adapters.getAllChildCategoryIds);
|
|
6576
|
+
}
|
|
6577
|
+
else {
|
|
6578
|
+
result = applyFilterArray(result, request.filter ? [request.filter] : []);
|
|
6579
|
+
}
|
|
6580
|
+
if (isCategoryEntity(entityName)) {
|
|
6581
|
+
result = await calculateChildrenCounts(result, entityName, adapters.getDirectChildCount);
|
|
6582
|
+
}
|
|
6583
|
+
return result;
|
|
6584
|
+
}
|
|
6585
|
+
/**
|
|
6586
|
+
* Shared entity query logic: sort, filter (including recursive category filter), childrenCount, pagination.
|
|
6587
|
+
*/
|
|
6588
|
+
async function runEntityQuery(entityName, request, adapters) {
|
|
6589
|
+
const rows = await filterSortEntityRows(entityName, request, adapters);
|
|
6590
|
+
const skip = request.skip ?? 0;
|
|
6591
|
+
const take = request.take ?? 0;
|
|
6592
|
+
return {
|
|
6593
|
+
total: rows.length,
|
|
6594
|
+
items: rows.slice(skip, skip + take),
|
|
6595
|
+
};
|
|
6596
|
+
}
|
|
6597
|
+
//#endregion
|
|
6598
|
+
|
|
6599
|
+
//#endregion
|
|
6600
|
+
|
|
6346
6601
|
//#region ---- Imports ----
|
|
6347
6602
|
//#endregion
|
|
6348
6603
|
//#region ---- Constants ----
|
|
@@ -7082,7 +7337,7 @@ class AXPEntityCategoryTreeSelectorComponent extends AXBasePageComponent {
|
|
|
7082
7337
|
// Use setTimeout to ensure DOM is updated after tree reload
|
|
7083
7338
|
setTimeout(() => {
|
|
7084
7339
|
if (this.searchValue().trim()) {
|
|
7085
|
-
this.highlightService.highlight('ax-tree-view .
|
|
7340
|
+
this.highlightService.highlight('ax-tree-view .truncate', this.searchValue().trim());
|
|
7086
7341
|
}
|
|
7087
7342
|
}, 100);
|
|
7088
7343
|
}
|
|
@@ -19388,6 +19643,9 @@ function getDedupKey(op, entityName, init) {
|
|
|
19388
19643
|
if (op === 'getOne' && init?.id !== undefined) {
|
|
19389
19644
|
return `getOne:${entityName}:${String(init.id)}`;
|
|
19390
19645
|
}
|
|
19646
|
+
if (op === 'exists' && init?.id !== undefined) {
|
|
19647
|
+
return `exists:${entityName}:${String(init.id)}`;
|
|
19648
|
+
}
|
|
19391
19649
|
if (op === 'getAll') {
|
|
19392
19650
|
return `getAll:${entityName}`;
|
|
19393
19651
|
}
|
|
@@ -19395,6 +19653,20 @@ function getDedupKey(op, entityName, init) {
|
|
|
19395
19653
|
const r = init.request;
|
|
19396
19654
|
return `query:${entityName}:${r.skip ?? 0}:${r.take ?? 0}:${JSON.stringify(r.filter ?? null)}:${JSON.stringify(r.sort ?? null)}:${JSON.stringify(r.params ?? null)}`;
|
|
19397
19655
|
}
|
|
19656
|
+
if (op === 'count' && init?.request) {
|
|
19657
|
+
const r = init.request;
|
|
19658
|
+
return `count:${entityName}:${JSON.stringify(r.filter ?? null)}:${JSON.stringify(r.sort ?? null)}`;
|
|
19659
|
+
}
|
|
19660
|
+
if (op === 'queryAll' && init?.request) {
|
|
19661
|
+
const r = init.request;
|
|
19662
|
+
return `queryAll:${entityName}:${JSON.stringify(r.filter ?? null)}:${JSON.stringify(r.sort ?? null)}:${JSON.stringify(init.queryAllOptions ?? null)}`;
|
|
19663
|
+
}
|
|
19664
|
+
if (op === 'getMany' && init?.ids) {
|
|
19665
|
+
return `getMany:${entityName}:${init.ids.map(String).join(',')}`;
|
|
19666
|
+
}
|
|
19667
|
+
if (op === 'aggregate' && init?.aggregateRequest) {
|
|
19668
|
+
return `aggregate:${entityName}:${JSON.stringify(init.aggregateRequest)}:${JSON.stringify(init.aggregateOptions ?? null)}`;
|
|
19669
|
+
}
|
|
19398
19670
|
return '';
|
|
19399
19671
|
}
|
|
19400
19672
|
class AXPMiddlewareEntityStorageService extends AXPEntityStorageService {
|
|
@@ -19454,6 +19726,13 @@ class AXPMiddlewareEntityStorageService extends AXPEntityStorageService {
|
|
|
19454
19726
|
insertOne: (name, e) => this.backend.insertOne(name, e),
|
|
19455
19727
|
query: (name, request) => this.backend.query(name, request),
|
|
19456
19728
|
updateOne: (name, id, data) => this.backend.updateOne(name, id, data),
|
|
19729
|
+
deleteOne: (name, id) => this.backend.deleteOne(name, id),
|
|
19730
|
+
count: (name, request) => this.backend.count(name, request),
|
|
19731
|
+
queryAll: (name, request, options) => this.backend.queryAll(name, request, options),
|
|
19732
|
+
getMany: (name, ids) => this.backend.getMany(name, ids),
|
|
19733
|
+
exists: (name, id) => this.backend.exists(name, id),
|
|
19734
|
+
upsertOne: (name, entity, options) => this.backend.upsertOne(name, entity, options),
|
|
19735
|
+
aggregate: (name, request, options) => this.backend.aggregate(name, request, options),
|
|
19457
19736
|
},
|
|
19458
19737
|
...init,
|
|
19459
19738
|
};
|
|
@@ -19525,6 +19804,100 @@ class AXPMiddlewareEntityStorageService extends AXPEntityStorageService {
|
|
|
19525
19804
|
const ctx = this.createCtx('query', entityName, { request });
|
|
19526
19805
|
return this.run(ctx, () => this.backend.query(ctx.entityName, request));
|
|
19527
19806
|
}
|
|
19807
|
+
async count(entityName, request) {
|
|
19808
|
+
const filterSortRequest = { ...request, skip: 0, take: 0 };
|
|
19809
|
+
const key = getDedupKey('count', entityName, { request: filterSortRequest });
|
|
19810
|
+
if (key) {
|
|
19811
|
+
const existing = this.inFlight.get(key);
|
|
19812
|
+
if (existing) {
|
|
19813
|
+
return existing;
|
|
19814
|
+
}
|
|
19815
|
+
const promise = this.runWithDedup(key, () => {
|
|
19816
|
+
const ctx = this.createCtx('count', entityName, { request: filterSortRequest });
|
|
19817
|
+
return this.run(ctx, () => this.backend.count(ctx.entityName, request));
|
|
19818
|
+
});
|
|
19819
|
+
this.inFlight.set(key, promise);
|
|
19820
|
+
return promise;
|
|
19821
|
+
}
|
|
19822
|
+
const ctx = this.createCtx('count', entityName, { request: filterSortRequest });
|
|
19823
|
+
return this.run(ctx, () => this.backend.count(ctx.entityName, request));
|
|
19824
|
+
}
|
|
19825
|
+
async queryAll(entityName, request, options) {
|
|
19826
|
+
const filterSortRequest = { ...request, skip: 0, take: 0 };
|
|
19827
|
+
const key = getDedupKey('queryAll', entityName, { request: filterSortRequest, queryAllOptions: options });
|
|
19828
|
+
if (key) {
|
|
19829
|
+
const existing = this.inFlight.get(key);
|
|
19830
|
+
if (existing) {
|
|
19831
|
+
return existing;
|
|
19832
|
+
}
|
|
19833
|
+
const promise = this.runWithDedup(key, () => {
|
|
19834
|
+
const ctx = this.createCtx('queryAll', entityName, { request: filterSortRequest });
|
|
19835
|
+
return this.run(ctx, () => this.backend.queryAll(ctx.entityName, request, options));
|
|
19836
|
+
});
|
|
19837
|
+
this.inFlight.set(key, promise);
|
|
19838
|
+
return promise;
|
|
19839
|
+
}
|
|
19840
|
+
const ctx = this.createCtx('queryAll', entityName, { request: filterSortRequest });
|
|
19841
|
+
return this.run(ctx, () => this.backend.queryAll(ctx.entityName, request, options));
|
|
19842
|
+
}
|
|
19843
|
+
async getMany(entityName, ids) {
|
|
19844
|
+
const key = getDedupKey('getMany', entityName, { ids: ids });
|
|
19845
|
+
if (key) {
|
|
19846
|
+
const existing = this.inFlight.get(key);
|
|
19847
|
+
if (existing) {
|
|
19848
|
+
return existing;
|
|
19849
|
+
}
|
|
19850
|
+
const promise = this.runWithDedup(key, () => {
|
|
19851
|
+
const ctx = this.createCtx('getMany', entityName);
|
|
19852
|
+
return this.run(ctx, () => this.backend.getMany(ctx.entityName, ids));
|
|
19853
|
+
});
|
|
19854
|
+
this.inFlight.set(key, promise);
|
|
19855
|
+
return promise;
|
|
19856
|
+
}
|
|
19857
|
+
const ctx = this.createCtx('getMany', entityName);
|
|
19858
|
+
return this.run(ctx, () => this.backend.getMany(ctx.entityName, ids));
|
|
19859
|
+
}
|
|
19860
|
+
async exists(entityName, id) {
|
|
19861
|
+
const key = getDedupKey('exists', entityName, { id });
|
|
19862
|
+
if (key) {
|
|
19863
|
+
const existing = this.inFlight.get(key);
|
|
19864
|
+
if (existing) {
|
|
19865
|
+
return existing;
|
|
19866
|
+
}
|
|
19867
|
+
const promise = this.runWithDedup(key, () => {
|
|
19868
|
+
const ctx = this.createCtx('exists', entityName, { id });
|
|
19869
|
+
return this.run(ctx, () => this.backend.exists(ctx.entityName, id));
|
|
19870
|
+
});
|
|
19871
|
+
this.inFlight.set(key, promise);
|
|
19872
|
+
return promise;
|
|
19873
|
+
}
|
|
19874
|
+
const ctx = this.createCtx('exists', entityName, { id });
|
|
19875
|
+
return this.run(ctx, () => this.backend.exists(ctx.entityName, id));
|
|
19876
|
+
}
|
|
19877
|
+
async upsertOne(entityName, entity, options) {
|
|
19878
|
+
const ctx = this.createCtx('upsertOne', entityName, { data: entity });
|
|
19879
|
+
ctx.locals.set('upsertOptions', options);
|
|
19880
|
+
return this.run(ctx, () => this.backend.upsertOne(ctx.entityName, entity, options));
|
|
19881
|
+
}
|
|
19882
|
+
async aggregate(entityName, request, options) {
|
|
19883
|
+
const key = getDedupKey('aggregate', entityName, { aggregateRequest: request, aggregateOptions: options });
|
|
19884
|
+
if (key) {
|
|
19885
|
+
const existing = this.inFlight.get(key);
|
|
19886
|
+
if (existing) {
|
|
19887
|
+
return existing;
|
|
19888
|
+
}
|
|
19889
|
+
const promise = this.runWithDedup(key, () => {
|
|
19890
|
+
const ctx = this.createCtx('aggregate', entityName);
|
|
19891
|
+
ctx.locals.set('aggregateRequest', request);
|
|
19892
|
+
ctx.locals.set('aggregateOptions', options);
|
|
19893
|
+
return this.run(ctx, () => this.backend.aggregate(ctx.entityName, request, options));
|
|
19894
|
+
});
|
|
19895
|
+
this.inFlight.set(key, promise);
|
|
19896
|
+
return promise;
|
|
19897
|
+
}
|
|
19898
|
+
const ctx = this.createCtx('aggregate', entityName);
|
|
19899
|
+
return this.run(ctx, () => this.backend.aggregate(ctx.entityName, request, options));
|
|
19900
|
+
}
|
|
19528
19901
|
async runWithDedup(key, fn) {
|
|
19529
19902
|
try {
|
|
19530
19903
|
return await fn();
|
|
@@ -20485,5 +20858,5 @@ var getEntityDetails_query = /*#__PURE__*/Object.freeze({
|
|
|
20485
20858
|
* Generated bundle index. Do not edit.
|
|
20486
20859
|
*/
|
|
20487
20860
|
|
|
20488
|
-
export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCategoryTreeService, AXPCreateEntityCommand, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntitiesListDataSourceDefinition, AXPEntityApplyUpdatesAction, AXPEntityCategoryTreeSelectorComponent, AXPEntityCategoryWidget, AXPEntityCategoryWidgetColumnComponent, AXPEntityCategoryWidgetEditComponent, AXPEntityCategoryWidgetViewComponent, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDataSelectorService, AXPEntityDefinitionProviderWidget, AXPEntityDefinitionProviderWidgetEditComponent, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityEventDispatcherService, AXPEntityEventsKeys, AXPEntityFormBuilderService, AXPEntityListTableService, AXPEntityListToolbarService, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityListWidget, AXPEntityListWidgetViewComponent, AXPEntityMasterCreateViewModel, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityPreloadFiltersContainerComponent, AXPEntityPreloadFiltersViewModel, AXPEntityPreloadFiltersViewModelResolver, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPEntityUpdateViewSectionViewModel, AXPGetEntityDetailsQuery, AXPLayoutOrderingConfigService, AXPLookupWidget, AXPLookupWidgetColumnComponent, AXPLookupWidgetEditComponent, AXPLookupWidgetViewComponent, AXPMiddlewareAbortError, AXPMiddlewareEntityStorageService, AXPModifyEntitySectionWorkflow, AXPMultiSourceDefinitionProviderContext, AXPMultiSourceDefinitionProviderService, AXPMultiSourceFederatedSearchService, AXPMultiSourceSelectorComponent, AXPMultiSourceSelectorService, AXPMultiSourceSelectorWidget, AXPMultiSourceSelectorWidgetColumnComponent, AXPMultiSourceSelectorWidgetEditComponent, AXPMultiSourceSelectorWidgetViewComponent, AXPMultiSourceType, AXPOpenEntityDetailsCommand, AXPQuickEntityModifyPopupAction, AXPQuickModifyEntityWorkflow, AXPRelatedColumnEnrichmentService, AXPRelatedColumnMetadataResolver, AXPSelectorStructureWidget, AXPSelectorStructureWidgetColumnComponent, AXPSelectorStructureWidgetEditComponent, AXPSelectorStructureWidgetViewComponent, AXPShowDetailViewAction, AXPShowDetailsViewWorkflow, AXPShowListViewAction, AXPShowListViewWorkflow, AXPTruncatedBreadcrumbComponent, AXPUpdateEntityCommand, AXPViewEntityDetailsCommand, AXP_CATEGORY_TREE_ROOT_TITLE_I18N_KEY, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_MODIFIER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE, AXP_MULTI_SOURCE_DEFINITION_PROVIDER, DEFAULT_COLUMN_ORDER, DEFAULT_PAIR_SPAN_RULES, DEFAULT_PROPERTY_ORDER, DEFAULT_SECTION_ORDER, EntityBuilder, EntityDataAccessor, actionExists, axpCreateEntityAiToolInputDefaults, axpCreateEntityCommandDefinition, cloneLayoutArrays, collectEntityQuickSearchFieldPaths, collectNestedCreateHiddenProperties, collectNestedFieldPathsFromEntityColumns, collectQuickSearchPathsFromSingleEntityDefinition, columnOrderingMiddleware, columnOrderingMiddlewareProvider, columnWidthMiddleware, columnWidthMiddlewareProvider, createColumnOrderingMiddlewareProvider, createLayoutOrderingMiddlewareProvider, createModifierContext, defaultMultiLanguageMiddleware, defaultMultiLanguageMiddlewareProvider, detectEntityChanges, ensureLayoutPropertyView, ensureLayoutSection, ensureListActions, entityDetailsCreateActions, entityDetailsCreateActionsDeferredParent, entityDetailsCrudActions, entityDetailsEditAction, entityDetailsNewEditAction, entityDetailsReferenceCondition, entityDetailsReferenceCreateActions, entityDetailsSimpleCondition, entityMasterBulkDeleteAction, entityMasterCreateAction, entityMasterCrudActions, entityMasterDeleteAction, entityMasterEditAction, entityMasterRecordActions, entityMasterViewAction, entityOverrideDetailsViewAction, eventDispatchMiddleware, getMasterInterfacePropertySortKey, isAXPMiddlewareAbortError, layoutOrderingMiddlewareFactory, layoutOrderingMiddlewareProvider, mergeForeignKeyFieldIntoCreateActions, provideEntity, resolveEntityPluginDetailPageOrder, searchResultDescriptionMiddleware, searchResultDescriptionMiddlewareProvider };
|
|
20861
|
+
export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCategoryTreeService, AXPCreateEntityCommand, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntitiesListDataSourceDefinition, AXPEntityApplyUpdatesAction, AXPEntityCategoryTreeSelectorComponent, AXPEntityCategoryWidget, AXPEntityCategoryWidgetColumnComponent, AXPEntityCategoryWidgetEditComponent, AXPEntityCategoryWidgetViewComponent, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDataSelectorService, AXPEntityDefinitionProviderWidget, AXPEntityDefinitionProviderWidgetEditComponent, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityEventDispatcherService, AXPEntityEventsKeys, AXPEntityFormBuilderService, AXPEntityListTableService, AXPEntityListToolbarService, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityListWidget, AXPEntityListWidgetViewComponent, AXPEntityMasterCreateViewModel, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityPreloadFiltersContainerComponent, AXPEntityPreloadFiltersViewModel, AXPEntityPreloadFiltersViewModelResolver, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPEntityUpdateViewSectionViewModel, AXPGetEntityDetailsQuery, AXPLayoutOrderingConfigService, AXPLookupWidget, AXPLookupWidgetColumnComponent, AXPLookupWidgetEditComponent, AXPLookupWidgetViewComponent, AXPMiddlewareAbortError, AXPMiddlewareEntityStorageService, AXPModifyEntitySectionWorkflow, AXPMultiSourceDefinitionProviderContext, AXPMultiSourceDefinitionProviderService, AXPMultiSourceFederatedSearchService, AXPMultiSourceSelectorComponent, AXPMultiSourceSelectorService, AXPMultiSourceSelectorWidget, AXPMultiSourceSelectorWidgetColumnComponent, AXPMultiSourceSelectorWidgetEditComponent, AXPMultiSourceSelectorWidgetViewComponent, AXPMultiSourceType, AXPOpenEntityDetailsCommand, AXPQuickEntityModifyPopupAction, AXPQuickModifyEntityWorkflow, AXPRelatedColumnEnrichmentService, AXPRelatedColumnMetadataResolver, AXPSelectorStructureWidget, AXPSelectorStructureWidgetColumnComponent, AXPSelectorStructureWidgetEditComponent, AXPSelectorStructureWidgetViewComponent, AXPShowDetailViewAction, AXPShowDetailsViewWorkflow, AXPShowListViewAction, AXPShowListViewWorkflow, AXPTruncatedBreadcrumbComponent, AXPUpdateEntityCommand, AXPViewEntityDetailsCommand, AXP_CATEGORY_TREE_ROOT_TITLE_I18N_KEY, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_MODIFIER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE, AXP_MULTI_SOURCE_DEFINITION_PROVIDER, DEFAULT_COLUMN_ORDER, DEFAULT_PAIR_SPAN_RULES, DEFAULT_PROPERTY_ORDER, DEFAULT_SECTION_ORDER, EntityBuilder, EntityDataAccessor, actionExists, axpCreateEntityAiToolInputDefaults, axpCreateEntityCommandDefinition, cloneLayoutArrays, collectEntityQuickSearchFieldPaths, collectNestedCreateHiddenProperties, collectNestedFieldPathsFromEntityColumns, collectQuickSearchPathsFromSingleEntityDefinition, columnOrderingMiddleware, columnOrderingMiddlewareProvider, columnWidthMiddleware, columnWidthMiddlewareProvider, computeEntityAggregates, createColumnOrderingMiddlewareProvider, createLayoutOrderingMiddlewareProvider, createModifierContext, defaultMultiLanguageMiddleware, defaultMultiLanguageMiddlewareProvider, detectEntityChanges, ensureLayoutPropertyView, ensureLayoutSection, ensureListActions, entityDetailsCreateActions, entityDetailsCreateActionsDeferredParent, entityDetailsCrudActions, entityDetailsEditAction, entityDetailsNewEditAction, entityDetailsReferenceCondition, entityDetailsReferenceCreateActions, entityDetailsSimpleCondition, entityMasterBulkDeleteAction, entityMasterCreateAction, entityMasterCrudActions, entityMasterDeleteAction, entityMasterEditAction, entityMasterRecordActions, entityMasterViewAction, entityOverrideDetailsViewAction, eventDispatchMiddleware, filterSortEntityRows, getMasterInterfacePropertySortKey, isAXPMiddlewareAbortError, isCategoryEntity, isCategoryFilter, layoutOrderingMiddlewareFactory, layoutOrderingMiddlewareProvider, mergeForeignKeyFieldIntoCreateActions, provideEntity, resolveEntityPluginDetailPageOrder, runEntityQuery, searchResultDescriptionMiddleware, searchResultDescriptionMiddlewareProvider };
|
|
20489
20862
|
//# sourceMappingURL=acorex-platform-layout-entity.mjs.map
|