vona-module-a-orm 5.0.49 → 5.0.50
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/cli/model/metadata/generate.ts +2 -1
- package/dist/bean/bean.model/bean.model_cache.d.ts +2 -1
- package/dist/config/config.d.ts +8 -0
- package/dist/index.js +161 -62
- package/dist/lib/dto/dto.d.ts +6 -0
- package/dist/lib/dto/dtoQuery.d.ts +3 -0
- package/dist/lib/dto/dtoQueryPage.d.ts +3 -0
- package/dist/lib/dto/dtoSelectAndCount.d.ts +6 -0
- package/dist/types/dto/dtoQueryBase.d.ts +5 -0
- package/dist/types/dto/dtoQueryPageBase.d.ts +5 -0
- package/dist/types/dto/dtoSelectAndCount.d.ts +8 -0
- package/dist/types/dto/index.d.ts +3 -0
- package/dist/types/model.d.ts +2 -1
- package/dist/types/modelWhere.d.ts +1 -1
- package/dist/types/relations.d.ts +5 -0
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ export default async function (options: IMetadataCustomGenerateOptions): Promise
|
|
|
28
28
|
[SymbolKeyModelOptions]: ${opionsName};
|
|
29
29
|
get<T extends IModelGetOptions<${entityName},${className}>>(where: TypeModelWhere<${entityName}>, options?: T): Promise<TypeModelRelationResult<${entityName}, ${className}, T> | undefined>;
|
|
30
30
|
mget<T extends IModelGetOptions<${entityName},${className}>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<${entityName}, ${className}, T>[]>;
|
|
31
|
+
selectAndCount<T extends IModelSelectParams<${entityName},${className},ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<${entityName}, ${className}, T>>;
|
|
31
32
|
select<T extends IModelSelectParams<${entityName},${className},ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<${entityName}, ${className}, T>[]>;
|
|
32
33
|
insert<T extends IModelInsertOptions<${entityName},${className}>>(data?: TypeModelMutateRelationData<${entityName},${className}, T>, options?: T): Promise<TypeModelMutateRelationData<${entityName},${className}, T, true>>;
|
|
33
34
|
insertBulk<T extends IModelInsertOptions<${entityName},${className}>>(items: TypeModelMutateRelationData<${entityName},${className}, T>[], options?: T): Promise<TypeModelMutateRelationData<${entityName},${className}, T, true>[]>;
|
|
@@ -52,7 +53,7 @@ export default async function (options: IMetadataCustomGenerateOptions): Promise
|
|
|
52
53
|
if (contentRelations.length === 0 && contentRecords.length === 0 && contentModels.length === 0) return '';
|
|
53
54
|
// combine
|
|
54
55
|
const content = `/** ${sceneName}: begin */
|
|
55
|
-
import type { IModelGetOptions, IModelMethodOptions, IModelSelectParams, TableIdentity, TypeModelRelationResult, TypeModelWhere, IModelInsertOptions, TypeModelMutateRelationData, IModelDeleteOptions, IModelUpdateOptions, IModelMutateOptions, IModelSelectCountParams, IModelSelectAggrParams, TypeModelAggrRelationResult, IModelSelectGroupParams, TypeModelGroupRelationResult } from 'vona-module-a-orm';
|
|
56
|
+
import type { IModelGetOptions, IModelMethodOptions, IModelSelectParams, TableIdentity, TypeModelSelectAndCount, TypeModelRelationResult, TypeModelWhere, IModelInsertOptions, TypeModelMutateRelationData, IModelDeleteOptions, IModelUpdateOptions, IModelMutateOptions, IModelSelectCountParams, IModelSelectAggrParams, TypeModelAggrRelationResult, IModelSelectGroupParams, TypeModelGroupRelationResult } from 'vona-module-a-orm';
|
|
56
57
|
import { SymbolKeyEntity, SymbolKeyEntityMeta, SymbolKeyModelOptions } from 'vona-module-a-orm';
|
|
57
58
|
declare module 'vona-module-${moduleName}' {
|
|
58
59
|
${contentRelations.join('\n')}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type BigNumber from 'bignumber.js';
|
|
2
1
|
import type { ServiceDb } from '../../service/db_.ts';
|
|
3
2
|
import type { IDatabaseClientRecord, IModelDeleteOptions, IModelGetOptions, IModelInsertOptions, IModelMethodOptions, IModelMethodOptionsGeneral, IModelMutateOptions, IModelRecord, IModelSelectAggrParams, IModelSelectCountParams, IModelSelectGroupParams, IModelSelectParams, IModelUpdateOptions, ITableRecord, TableIdentity, TypeModelAggrRelationResult, TypeModelClassLikeGeneral, TypeModelGroupRelationResult, TypeModelsClassLikeGeneral, TypeModelWhere } from '../../types/index.ts';
|
|
3
|
+
import BigNumber from 'bignumber.js';
|
|
4
4
|
import { ServiceCacheEntity } from '../../service/cacheEntity_.ts';
|
|
5
5
|
import { ServiceCacheQuery } from '../../service/cacheQuery_.ts';
|
|
6
6
|
import { ServiceRelations } from '../../service/relations_.ts';
|
|
@@ -25,6 +25,7 @@ export declare class BeanModelCache<TRecord extends {} = {}> extends BeanModelCr
|
|
|
25
25
|
private __aggregate_raw;
|
|
26
26
|
group<T extends IModelSelectGroupParams<TRecord>, ModelJoins extends TypeModelsClassLikeGeneral | undefined>(params?: T, options?: IModelMethodOptions, _modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<TRecord, T>[]>;
|
|
27
27
|
private __group_raw;
|
|
28
|
+
selectAndCount<T extends IModelSelectParams<TRecord>, ModelJoins extends TypeModelsClassLikeGeneral | undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<any>;
|
|
28
29
|
select<T extends IModelSelectParams<TRecord>, ModelJoins extends TypeModelsClassLikeGeneral | undefined>(params?: T, options?: IModelMethodOptions, _modelJoins?: ModelJoins): Promise<any[]>;
|
|
29
30
|
private __select_raw;
|
|
30
31
|
private __select_cache;
|
package/dist/config/config.d.ts
CHANGED
|
@@ -5,6 +5,14 @@ import type { IDatabaseClientDialectRecord } from '../types/database.ts';
|
|
|
5
5
|
import type { TableIdentityType } from '../types/tableIdentity.ts';
|
|
6
6
|
export type TypeDataBaseConfigDialects = Record<keyof IDatabaseClientDialectRecord, TypeBeanRecordGeneralSelectorKeys<'databaseDialect'>>;
|
|
7
7
|
export declare function config(_app: VonaApplication): {
|
|
8
|
+
rest: {
|
|
9
|
+
query: {
|
|
10
|
+
pageSize: {
|
|
11
|
+
default: number;
|
|
12
|
+
max: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
8
16
|
table: {
|
|
9
17
|
identityType: TableIdentityType;
|
|
10
18
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BigNumber } from 'bignumber.js';
|
|
1
|
+
import BigNumber$1, { BigNumber } from 'bignumber.js';
|
|
2
2
|
import { BeanInfo, BeanAopMethodBase, BeanBase, deepExtend, Virtual, appResource, beanFullNameFromOnionName, cast, appMetadata, useApp, BeanSimple, combineConfigDefault, BeanScopeBase, createBeanDecorator, PickClassInner, $Class } from 'vona';
|
|
3
3
|
import { AopMethod, Aspect } from 'vona-module-a-aspect';
|
|
4
4
|
import { Service, Bean, Scope } from 'vona-module-a-bean';
|
|
@@ -9,6 +9,7 @@ import { swapDeps } from '@cabloy/deps';
|
|
|
9
9
|
import { prepareClassType, getTargetDecoratorRules, Api, v, OrderMaxBase, OrderCoreBase, getSchemaDynamic, SymbolSchemaDynamicRefId, addSchemaDynamic, mergeFieldsOpenapiMetadata } from 'vona-module-a-openapi';
|
|
10
10
|
import { ZodMetadata } from '@cabloy/zod-query';
|
|
11
11
|
import { SymbolDecoratorRuleColumn } from 'vona-module-a-openapiutils';
|
|
12
|
+
import z from 'zod';
|
|
12
13
|
export * from 'table-identity';
|
|
13
14
|
import { Broadcast, BeanBroadcastBase } from 'vona-module-a-broadcast';
|
|
14
15
|
import { Event, BeanEventBase } from 'vona-module-a-event';
|
|
@@ -16,23 +17,22 @@ import { Schedule } from 'vona-module-a-schedule';
|
|
|
16
17
|
import { configAllWithIgnoreNull, configAll, configRedisWithIgnoreNull, configRedis } from 'vona-module-a-summer';
|
|
17
18
|
import { ServiceDatabaseAsyncLocalStorage as ServiceDatabaseAsyncLocalStorage$1, ServiceTransactionConsistency as ServiceTransactionConsistency_ } from 'vona-module-a-orm';
|
|
18
19
|
import { mutate } from 'mutate-on-copy';
|
|
19
|
-
import z from 'zod';
|
|
20
20
|
|
|
21
|
-
var _dec$
|
|
22
|
-
let AopMethodTransaction = (_dec$
|
|
21
|
+
var _dec$w, _dec2$w, _class$w;
|
|
22
|
+
let AopMethodTransaction = (_dec$w = AopMethod(), _dec2$w = BeanInfo({
|
|
23
23
|
module: "a-orm"
|
|
24
|
-
}), _dec$
|
|
24
|
+
}), _dec$w(_class$w = _dec2$w(_class$w = class AopMethodTransaction extends BeanAopMethodBase {
|
|
25
25
|
execute(options, _args, next, _receiver, _prop) {
|
|
26
26
|
return this.bean.database.current.transaction.begin(() => {
|
|
27
27
|
return next();
|
|
28
28
|
}, options);
|
|
29
29
|
}
|
|
30
|
-
}) || _class$
|
|
30
|
+
}) || _class$w) || _class$w);
|
|
31
31
|
|
|
32
|
-
var _dec$
|
|
33
|
-
let ServiceDatabaseAsyncLocalStorage = (_dec$
|
|
32
|
+
var _dec$v, _dec2$v, _class$v;
|
|
33
|
+
let ServiceDatabaseAsyncLocalStorage = (_dec$v = Service(), _dec2$v = BeanInfo({
|
|
34
34
|
module: "a-orm"
|
|
35
|
-
}), _dec$
|
|
35
|
+
}), _dec$v(_class$v = _dec2$v(_class$v = class ServiceDatabaseAsyncLocalStorage extends BeanBase {
|
|
36
36
|
constructor(...args) {
|
|
37
37
|
super(...args);
|
|
38
38
|
this.dbStorage = void 0;
|
|
@@ -51,14 +51,14 @@ let ServiceDatabaseAsyncLocalStorage = (_dec$t = Service(), _dec2$t = BeanInfo({
|
|
|
51
51
|
return fn();
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
}) || _class$
|
|
54
|
+
}) || _class$v) || _class$v);
|
|
55
55
|
|
|
56
|
-
var _dec$
|
|
56
|
+
var _dec$u, _dec2$u, _class$u;
|
|
57
57
|
const SymbolColumnsCache = Symbol('SymbolColumnsCache');
|
|
58
58
|
const SymbolColumnsDefaultCache = Symbol('SymbolColumnsDefaultCache');
|
|
59
|
-
let ServiceColumnsCache = (_dec$
|
|
59
|
+
let ServiceColumnsCache = (_dec$u = Service(), _dec2$u = BeanInfo({
|
|
60
60
|
module: "a-orm"
|
|
61
|
-
}), _dec$
|
|
61
|
+
}), _dec$u(_class$u = _dec2$u(_class$u = class ServiceColumnsCache extends BeanBase {
|
|
62
62
|
constructor(...args) {
|
|
63
63
|
super(...args);
|
|
64
64
|
this.clientName = void 0;
|
|
@@ -113,12 +113,12 @@ let ServiceColumnsCache = (_dec$s = Service(), _dec2$s = BeanInfo({
|
|
|
113
113
|
return exists;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
}) || _class$
|
|
116
|
+
}) || _class$u) || _class$u);
|
|
117
117
|
|
|
118
|
-
var _dec$
|
|
119
|
-
let ServiceColumns = (_dec$
|
|
118
|
+
var _dec$t, _dec2$t, _class$t;
|
|
119
|
+
let ServiceColumns = (_dec$t = Service(), _dec2$t = BeanInfo({
|
|
120
120
|
module: "a-orm"
|
|
121
|
-
}), _dec$
|
|
121
|
+
}), _dec$t(_class$t = _dec2$t(_class$t = class ServiceColumns extends BeanBase {
|
|
122
122
|
constructor(...args) {
|
|
123
123
|
super(...args);
|
|
124
124
|
this._db = void 0;
|
|
@@ -169,7 +169,7 @@ let ServiceColumns = (_dec$r = Service(), _dec2$r = BeanInfo({
|
|
|
169
169
|
columnsClear(tableName) {
|
|
170
170
|
return this.scope.service.database.columnsClear(this.db.clientName, tableName);
|
|
171
171
|
}
|
|
172
|
-
}) || _class$
|
|
172
|
+
}) || _class$t) || _class$t);
|
|
173
173
|
|
|
174
174
|
const TransactionIsolationLevelsMap = {
|
|
175
175
|
DEFAULT: undefined,
|
|
@@ -182,10 +182,10 @@ const TransactionIsolationLevelsMap = {
|
|
|
182
182
|
|
|
183
183
|
// export type TransactionPropagation=''
|
|
184
184
|
|
|
185
|
-
var _dec$
|
|
186
|
-
let ServiceDatabase = (_dec$
|
|
185
|
+
var _dec$s, _dec2$s, _class$s;
|
|
186
|
+
let ServiceDatabase = (_dec$s = Service(), _dec2$s = BeanInfo({
|
|
187
187
|
module: "a-orm"
|
|
188
|
-
}), _dec$
|
|
188
|
+
}), _dec$s(_class$s = _dec2$s(_class$s = class ServiceDatabase extends BeanBase {
|
|
189
189
|
getDialect(client) {
|
|
190
190
|
if (!client) throw new Error('database dialect not specified');
|
|
191
191
|
const beanFullName = this.scope.config.dialects[client];
|
|
@@ -271,12 +271,12 @@ let ServiceDatabase = (_dec$q = Service(), _dec2$q = BeanInfo({
|
|
|
271
271
|
});
|
|
272
272
|
this.__columnsClearRaw(clientName);
|
|
273
273
|
}
|
|
274
|
-
}) || _class$
|
|
274
|
+
}) || _class$s) || _class$s);
|
|
275
275
|
|
|
276
|
-
var _dec$
|
|
277
|
-
let ServiceTransactionConsistency = (_dec$
|
|
276
|
+
var _dec$r, _dec2$r, _class$r;
|
|
277
|
+
let ServiceTransactionConsistency = (_dec$r = Service(), _dec2$r = BeanInfo({
|
|
278
278
|
module: "a-orm"
|
|
279
|
-
}), _dec$
|
|
279
|
+
}), _dec$r(_class$r = _dec2$r(_class$r = class ServiceTransactionConsistency extends BeanBase {
|
|
280
280
|
constructor(...args) {
|
|
281
281
|
super(...args);
|
|
282
282
|
this._commitCallbacks = [];
|
|
@@ -304,12 +304,12 @@ let ServiceTransactionConsistency = (_dec$p = Service(), _dec2$p = BeanInfo({
|
|
|
304
304
|
}
|
|
305
305
|
this._commitCallbacks = [];
|
|
306
306
|
}
|
|
307
|
-
}) || _class$
|
|
307
|
+
}) || _class$r) || _class$r);
|
|
308
308
|
|
|
309
|
-
var _dec$
|
|
310
|
-
let ServiceTransactionFiber = (_dec$
|
|
309
|
+
var _dec$q, _dec2$q, _class$q;
|
|
310
|
+
let ServiceTransactionFiber = (_dec$q = Service(), _dec2$q = BeanInfo({
|
|
311
311
|
module: "a-orm"
|
|
312
|
-
}), _dec$
|
|
312
|
+
}), _dec$q(_class$q = _dec2$q(_class$q = class ServiceTransactionFiber extends BeanBase {
|
|
313
313
|
constructor(...args) {
|
|
314
314
|
super(...args);
|
|
315
315
|
this._connection = void 0;
|
|
@@ -338,12 +338,12 @@ let ServiceTransactionFiber = (_dec$o = Service(), _dec2$o = BeanInfo({
|
|
|
338
338
|
await this._transactionConsistency.compensateDone();
|
|
339
339
|
this._connection = undefined;
|
|
340
340
|
}
|
|
341
|
-
}) || _class$
|
|
341
|
+
}) || _class$q) || _class$q);
|
|
342
342
|
|
|
343
|
-
var _dec$
|
|
344
|
-
let ServiceTransactionState = (_dec$
|
|
343
|
+
var _dec$p, _dec2$p, _class$p;
|
|
344
|
+
let ServiceTransactionState = (_dec$p = Service(), _dec2$p = BeanInfo({
|
|
345
345
|
module: "a-orm"
|
|
346
|
-
}), _dec$
|
|
346
|
+
}), _dec$p(_class$p = _dec2$p(_class$p = class ServiceTransactionState extends BeanBase {
|
|
347
347
|
constructor(...args) {
|
|
348
348
|
super(...args);
|
|
349
349
|
this._fibers = {};
|
|
@@ -365,12 +365,12 @@ let ServiceTransactionState = (_dec$n = Service(), _dec2$n = BeanInfo({
|
|
|
365
365
|
const selector = this.serviceDatabase.prepareClientNameSelector(dbInfo);
|
|
366
366
|
delete this._fibers[selector];
|
|
367
367
|
}
|
|
368
|
-
}) || _class$
|
|
368
|
+
}) || _class$p) || _class$p);
|
|
369
369
|
|
|
370
|
-
var _dec$
|
|
371
|
-
let ServiceTransactionAsyncLocalStorage = (_dec$
|
|
370
|
+
var _dec$o, _dec2$o, _class$o;
|
|
371
|
+
let ServiceTransactionAsyncLocalStorage = (_dec$o = Service(), _dec2$o = BeanInfo({
|
|
372
372
|
module: "a-orm"
|
|
373
|
-
}), _dec$
|
|
373
|
+
}), _dec$o(_class$o = _dec2$o(_class$o = class ServiceTransactionAsyncLocalStorage extends BeanBase {
|
|
374
374
|
constructor(...args) {
|
|
375
375
|
super(...args);
|
|
376
376
|
this.transactionStorage = void 0;
|
|
@@ -391,12 +391,12 @@ let ServiceTransactionAsyncLocalStorage = (_dec$m = Service(), _dec2$m = BeanInf
|
|
|
391
391
|
return fn();
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
|
-
}) || _class$
|
|
394
|
+
}) || _class$o) || _class$o);
|
|
395
395
|
|
|
396
|
-
var _dec$
|
|
397
|
-
let ServiceTransaction = (_dec$
|
|
396
|
+
var _dec$n, _dec2$n, _class$n;
|
|
397
|
+
let ServiceTransaction = (_dec$n = Service(), _dec2$n = BeanInfo({
|
|
398
398
|
module: "a-orm"
|
|
399
|
-
}), _dec$
|
|
399
|
+
}), _dec$n(_class$n = _dec2$n(_class$n = class ServiceTransaction extends BeanBase {
|
|
400
400
|
constructor(...args) {
|
|
401
401
|
super(...args);
|
|
402
402
|
this._db = void 0;
|
|
@@ -517,7 +517,7 @@ let ServiceTransaction = (_dec$l = Service(), _dec2$l = BeanInfo({
|
|
|
517
517
|
}
|
|
518
518
|
return res;
|
|
519
519
|
}
|
|
520
|
-
}) || _class$
|
|
520
|
+
}) || _class$n) || _class$n);
|
|
521
521
|
function _translateTransactionOptions(options) {
|
|
522
522
|
if (!options) return undefined;
|
|
523
523
|
return {
|
|
@@ -526,10 +526,10 @@ function _translateTransactionOptions(options) {
|
|
|
526
526
|
};
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
var _dec$
|
|
530
|
-
let ServiceDb = (_dec$
|
|
529
|
+
var _dec$m, _dec2$m, _class$m;
|
|
530
|
+
let ServiceDb = (_dec$m = Service(), _dec2$m = BeanInfo({
|
|
531
531
|
module: "a-orm"
|
|
532
|
-
}), _dec$
|
|
532
|
+
}), _dec$m(_class$m = _dec2$m(_class$m = class ServiceDb extends BeanBase {
|
|
533
533
|
constructor(...args) {
|
|
534
534
|
super(...args);
|
|
535
535
|
this._client = void 0;
|
|
@@ -584,12 +584,12 @@ let ServiceDb = (_dec$k = Service(), _dec2$k = BeanInfo({
|
|
|
584
584
|
compensate(cb) {
|
|
585
585
|
return this.transaction.compensate(cb);
|
|
586
586
|
}
|
|
587
|
-
}) || _class$
|
|
587
|
+
}) || _class$m) || _class$m);
|
|
588
588
|
|
|
589
|
-
var _dec$
|
|
590
|
-
let ServiceDatabaseClient = (_dec$
|
|
589
|
+
var _dec$l, _dec2$l, _class$l;
|
|
590
|
+
let ServiceDatabaseClient = (_dec$l = Service(), _dec2$l = BeanInfo({
|
|
591
591
|
module: "a-orm"
|
|
592
|
-
}), _dec$
|
|
592
|
+
}), _dec$l(_class$l = _dec2$l(_class$l = class ServiceDatabaseClient extends BeanBase {
|
|
593
593
|
constructor(...args) {
|
|
594
594
|
super(...args);
|
|
595
595
|
this.level = void 0;
|
|
@@ -695,12 +695,12 @@ let ServiceDatabaseClient = (_dec$j = Service(), _dec2$j = BeanInfo({
|
|
|
695
695
|
// reload
|
|
696
696
|
await this.reload(config);
|
|
697
697
|
}
|
|
698
|
-
}) || _class$
|
|
698
|
+
}) || _class$l) || _class$l);
|
|
699
699
|
|
|
700
|
-
var _dec$
|
|
701
|
-
let BeanDatabase = (_dec$
|
|
700
|
+
var _dec$k, _dec2$k, _class$k;
|
|
701
|
+
let BeanDatabase = (_dec$k = Bean(), _dec2$k = BeanInfo({
|
|
702
702
|
module: "a-orm"
|
|
703
|
-
}), _dec$
|
|
703
|
+
}), _dec$k(_class$k = _dec2$k(_class$k = class BeanDatabase extends BeanBase {
|
|
704
704
|
get current() {
|
|
705
705
|
return this.bean._getBean(ServiceDatabaseAsyncLocalStorage).current;
|
|
706
706
|
}
|
|
@@ -730,12 +730,12 @@ let BeanDatabase = (_dec$i = Bean(), _dec2$i = BeanInfo({
|
|
|
730
730
|
return this.bean._getBean(ServiceTransactionAsyncLocalStorage).run(fn);
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
|
-
}) || _class$
|
|
733
|
+
}) || _class$k) || _class$k);
|
|
734
734
|
|
|
735
|
-
var _dec$
|
|
736
|
-
let BeanDatabaseDialectBase = (_dec$
|
|
735
|
+
var _dec$j, _dec2$j, _dec3$7, _class$j;
|
|
736
|
+
let BeanDatabaseDialectBase = (_dec$j = Bean(), _dec2$j = Virtual(), _dec3$7 = BeanInfo({
|
|
737
737
|
module: "a-orm"
|
|
738
|
-
}), _dec$
|
|
738
|
+
}), _dec$j(_class$j = _dec2$j(_class$j = _dec3$7(_class$j = class BeanDatabaseDialectBase extends BeanBase {
|
|
739
739
|
getConfigBase() {
|
|
740
740
|
return undefined;
|
|
741
741
|
}
|
|
@@ -795,7 +795,7 @@ let BeanDatabaseDialectBase = (_dec$h = Bean(), _dec2$h = Virtual(), _dec3$5 = B
|
|
|
795
795
|
_columnTypePrefixes(type, prefixes) {
|
|
796
796
|
return prefixes.some(prefix => type.includes(prefix));
|
|
797
797
|
}
|
|
798
|
-
}) || _class$
|
|
798
|
+
}) || _class$j) || _class$j) || _class$j);
|
|
799
799
|
|
|
800
800
|
const OpAggrs = ['count', 'sum', 'avg', 'max', 'min'];
|
|
801
801
|
const OpJoint = {
|
|
@@ -1161,8 +1161,6 @@ function _prepareClassEntity(classEntity) {
|
|
|
1161
1161
|
return isClass(classEntity) ? classEntity : cast(classEntity)();
|
|
1162
1162
|
}
|
|
1163
1163
|
|
|
1164
|
-
const SymbolKeyFieldsMore = Symbol('$fieldsMore');
|
|
1165
|
-
|
|
1166
1164
|
function _applyDecoratedDescriptor(i, e, r, n, l) {
|
|
1167
1165
|
var a = {};
|
|
1168
1166
|
return Object.keys(n).forEach(function (i) {
|
|
@@ -1180,6 +1178,57 @@ function _initializerDefineProperty(e, i, r, l) {
|
|
|
1180
1178
|
});
|
|
1181
1179
|
}
|
|
1182
1180
|
|
|
1181
|
+
var _dec$i, _dec2$i, _dec3$6, _dec4$4, _dec5$1, _dec6$1, _class$i, _descriptor$4, _descriptor2$2, _descriptor3$1;
|
|
1182
|
+
let DtoQueryBase = (_dec$i = Api.field(v.optional(), v.array(String, {
|
|
1183
|
+
separator: ','
|
|
1184
|
+
})), _dec2$i = Reflect.metadata("design:type", Array), _dec3$6 = Api.field(v.optional(), z.object({}).passthrough()), _dec4$4 = Reflect.metadata("design:type", Object), _dec5$1 = Api.field(v.optional(), z.union([z.string(), z.array(z.array(z.string()))])), _dec6$1 = Reflect.metadata("design:type", Object), _class$i = class DtoQueryBase {
|
|
1185
|
+
constructor() {
|
|
1186
|
+
_initializerDefineProperty(this, "columns", _descriptor$4, this);
|
|
1187
|
+
_initializerDefineProperty(this, "where", _descriptor2$2, this);
|
|
1188
|
+
_initializerDefineProperty(this, "orders", _descriptor3$1, this);
|
|
1189
|
+
}
|
|
1190
|
+
}, _descriptor$4 = _applyDecoratedDescriptor(_class$i.prototype, "columns", [_dec$i, _dec2$i], {
|
|
1191
|
+
configurable: true,
|
|
1192
|
+
enumerable: true,
|
|
1193
|
+
writable: true,
|
|
1194
|
+
initializer: null
|
|
1195
|
+
}), _descriptor2$2 = _applyDecoratedDescriptor(_class$i.prototype, "where", [_dec3$6, _dec4$4], {
|
|
1196
|
+
configurable: true,
|
|
1197
|
+
enumerable: true,
|
|
1198
|
+
writable: true,
|
|
1199
|
+
initializer: null
|
|
1200
|
+
}), _descriptor3$1 = _applyDecoratedDescriptor(_class$i.prototype, "orders", [_dec5$1, _dec6$1], {
|
|
1201
|
+
configurable: true,
|
|
1202
|
+
enumerable: true,
|
|
1203
|
+
writable: true,
|
|
1204
|
+
initializer: null
|
|
1205
|
+
}), _class$i);
|
|
1206
|
+
|
|
1207
|
+
var _dec$h, _dec2$h, _dec3$5, _dec4$3, _class$h, _descriptor$3, _descriptor2$1;
|
|
1208
|
+
const app = useApp();
|
|
1209
|
+
const ormConfig = app.util.getModuleConfigRaw('a-orm');
|
|
1210
|
+
const pageSizeDefault = ormConfig?.rest?.query?.pageSize?.default ?? 20;
|
|
1211
|
+
const pageSizeMax = ormConfig?.rest?.query?.pageSize?.max ?? 100;
|
|
1212
|
+
let DtoQueryPageBase = (_dec$h = Api.field(z.number().min(1).default(1)), _dec2$h = Reflect.metadata("design:type", Number), _dec3$5 = Api.field(z.number().min(1).max(pageSizeMax).default(pageSizeDefault)), _dec4$3 = Reflect.metadata("design:type", Number), _class$h = class DtoQueryPageBase extends DtoQueryBase {
|
|
1213
|
+
constructor(...args) {
|
|
1214
|
+
super(...args);
|
|
1215
|
+
_initializerDefineProperty(this, "pageNo", _descriptor$3, this);
|
|
1216
|
+
_initializerDefineProperty(this, "pageSize", _descriptor2$1, this);
|
|
1217
|
+
}
|
|
1218
|
+
}, _descriptor$3 = _applyDecoratedDescriptor(_class$h.prototype, "pageNo", [_dec$h, _dec2$h], {
|
|
1219
|
+
configurable: true,
|
|
1220
|
+
enumerable: true,
|
|
1221
|
+
writable: true,
|
|
1222
|
+
initializer: null
|
|
1223
|
+
}), _descriptor2$1 = _applyDecoratedDescriptor(_class$h.prototype, "pageSize", [_dec3$5, _dec4$3], {
|
|
1224
|
+
configurable: true,
|
|
1225
|
+
enumerable: true,
|
|
1226
|
+
writable: true,
|
|
1227
|
+
initializer: null
|
|
1228
|
+
}), _class$h);
|
|
1229
|
+
|
|
1230
|
+
const SymbolKeyFieldsMore = Symbol('$fieldsMore');
|
|
1231
|
+
|
|
1183
1232
|
class EntityBaseEmpty {}
|
|
1184
1233
|
|
|
1185
1234
|
var _dec$g, _dec2$g, _dec3$4, _dec4$2, _dec5, _dec6, _dec7, _dec8, _class$g, _descriptor$2, _descriptor2, _descriptor3, _descriptor4;
|
|
@@ -2912,6 +2961,29 @@ class BeanModelCache extends BeanModelCrud {
|
|
|
2912
2961
|
const items = await this.__select_cache(table, params, options);
|
|
2913
2962
|
return this.convertItemsToBigNumber(items);
|
|
2914
2963
|
}
|
|
2964
|
+
async selectAndCount(params, options, modelJoins) {
|
|
2965
|
+
// count
|
|
2966
|
+
const paramsCount = Object.assign({}, params, {
|
|
2967
|
+
columns: undefined,
|
|
2968
|
+
orders: undefined,
|
|
2969
|
+
limit: undefined,
|
|
2970
|
+
offset: undefined
|
|
2971
|
+
});
|
|
2972
|
+
let count = await this.count(paramsCount, options, modelJoins);
|
|
2973
|
+
if (!count) count = BigNumber$1(0);
|
|
2974
|
+
// list
|
|
2975
|
+
let list;
|
|
2976
|
+
if (count.eq(0)) {
|
|
2977
|
+
list = [];
|
|
2978
|
+
} else {
|
|
2979
|
+
list = await this.select(params, options, modelJoins);
|
|
2980
|
+
}
|
|
2981
|
+
// ok
|
|
2982
|
+
return {
|
|
2983
|
+
list,
|
|
2984
|
+
total: count
|
|
2985
|
+
};
|
|
2986
|
+
}
|
|
2915
2987
|
async select(params, options, _modelJoins) {
|
|
2916
2988
|
const items = await this.__select_raw(undefined, params, options);
|
|
2917
2989
|
return await this.relations.handleRelationsMany(items, params, options);
|
|
@@ -3399,6 +3471,14 @@ let ScheduleSoftDeletionPrune = (_dec$1 = Schedule({
|
|
|
3399
3471
|
|
|
3400
3472
|
function config(_app) {
|
|
3401
3473
|
return {
|
|
3474
|
+
rest: {
|
|
3475
|
+
query: {
|
|
3476
|
+
pageSize: {
|
|
3477
|
+
default: 20,
|
|
3478
|
+
max: 100
|
|
3479
|
+
}
|
|
3480
|
+
}
|
|
3481
|
+
},
|
|
3402
3482
|
table: {
|
|
3403
3483
|
identityType: 'string'
|
|
3404
3484
|
},
|
|
@@ -3922,6 +4002,22 @@ function DtoCreate(modelLike, params) {
|
|
|
3922
4002
|
return _DtoMutate_raw(modelLike, params, 'create', ['id', 'iid', 'deleted', 'createdAt', 'updatedAt'], true);
|
|
3923
4003
|
}
|
|
3924
4004
|
|
|
4005
|
+
function DtoQuery(classRef, keys) {
|
|
4006
|
+
return $Class.mixin(DtoQueryBase, $Class.partial($Class.pick(classRef, keys)));
|
|
4007
|
+
}
|
|
4008
|
+
|
|
4009
|
+
function DtoQueryPage(classRef, keys) {
|
|
4010
|
+
return $Class.mixin(DtoQueryPageBase, $Class.partial($Class.pick(classRef, keys)));
|
|
4011
|
+
}
|
|
4012
|
+
|
|
4013
|
+
function DtoSelectAndCount(modelLike, params) {
|
|
4014
|
+
class TargetClass {}
|
|
4015
|
+
const DtoGetResult = DtoGet(modelLike, params);
|
|
4016
|
+
Api.field(v.array(DtoGetResult))(TargetClass.prototype, 'list');
|
|
4017
|
+
Api.field(v.bigNumber())(TargetClass.prototype, 'total');
|
|
4018
|
+
return TargetClass;
|
|
4019
|
+
}
|
|
4020
|
+
|
|
3925
4021
|
function DtoUpdate(modelLike, params) {
|
|
3926
4022
|
return _DtoMutate_raw(modelLike, params, 'update', ['id', 'iid', 'deleted', 'createdAt', 'updatedAt'], true);
|
|
3927
4023
|
}
|
|
@@ -3933,7 +4029,10 @@ const $Dto = {
|
|
|
3933
4029
|
update: DtoUpdate,
|
|
3934
4030
|
get: DtoGet,
|
|
3935
4031
|
aggregate: DtoAggregate,
|
|
3936
|
-
group: DtoGroup
|
|
4032
|
+
group: DtoGroup,
|
|
4033
|
+
query: DtoQuery,
|
|
4034
|
+
queryPage: DtoQueryPage,
|
|
4035
|
+
selectAndCount: DtoSelectAndCount
|
|
3937
4036
|
};
|
|
3938
4037
|
|
|
3939
4038
|
// const __tableNames = new Set();
|
|
@@ -4143,4 +4242,4 @@ const $relationMutate = {
|
|
|
4143
4242
|
belongsToMany
|
|
4144
4243
|
};
|
|
4145
4244
|
|
|
4146
|
-
export { $Dto, $column, $columns, $columnsAll, $locale, $relation, $relationDynamic, $relationMutate, $tableColumns, $tableComments, $tableDefaults, $tableName, AopMethodTransaction, BeanDatabase, BeanDatabaseDialectBase, BeanModel, BeanModelBase, BeanModelMeta, BroadcastColumnsClear, BroadcastDatabaseClientReload, Database, DatabaseDialect, Entity, EntityBase, EntityBaseEmpty, EntityBaseInner, EntityBaseSimple, Errors, EventClientNameReal, EventColumnsClear, EventDatabaseClientReload, ExtendKnex, ExtendSchemaBuilder, ExtendTableBuilder, Main, Model, Op, OpAggrs, OpJoint, OpJointValues, OpNormal, OpNormalValues, OpValues, ScheduleSoftDeletionPrune, ScopeModuleAOrm, ServiceCacheEntity, ServiceCacheQuery, ServiceColumns, ServiceColumnsCache, ServiceDatabase, ServiceDatabaseAsyncLocalStorage, ServiceDatabaseClient, ServiceDb, ServiceEntityResolver, ServiceModelResolver, ServiceRelations, ServiceTransaction, ServiceTransactionAsyncLocalStorage, ServiceTransactionConsistency, ServiceTransactionFiber, ServiceTransactionState, SymbolKeyEntity, SymbolKeyEntityMeta, SymbolKeyFieldsMore, SymbolKeyModelOptions, TransactionIsolationLevelsMap, buildWhere, config, configDefault, getClassEntityFromClassModel, getTableOrTableAlias, getTargetColumnName, isAggrColumn, isRaw, isRef, locales, prepareClassModel, prepareColumns };
|
|
4245
|
+
export { $Dto, $column, $columns, $columnsAll, $locale, $relation, $relationDynamic, $relationMutate, $tableColumns, $tableComments, $tableDefaults, $tableName, AopMethodTransaction, BeanDatabase, BeanDatabaseDialectBase, BeanModel, BeanModelBase, BeanModelMeta, BroadcastColumnsClear, BroadcastDatabaseClientReload, Database, DatabaseDialect, DtoQueryBase, DtoQueryPageBase, Entity, EntityBase, EntityBaseEmpty, EntityBaseInner, EntityBaseSimple, Errors, EventClientNameReal, EventColumnsClear, EventDatabaseClientReload, ExtendKnex, ExtendSchemaBuilder, ExtendTableBuilder, Main, Model, Op, OpAggrs, OpJoint, OpJointValues, OpNormal, OpNormalValues, OpValues, ScheduleSoftDeletionPrune, ScopeModuleAOrm, ServiceCacheEntity, ServiceCacheQuery, ServiceColumns, ServiceColumnsCache, ServiceDatabase, ServiceDatabaseAsyncLocalStorage, ServiceDatabaseClient, ServiceDb, ServiceEntityResolver, ServiceModelResolver, ServiceRelations, ServiceTransaction, ServiceTransactionAsyncLocalStorage, ServiceTransactionConsistency, ServiceTransactionFiber, ServiceTransactionState, SymbolKeyEntity, SymbolKeyEntityMeta, SymbolKeyFieldsMore, SymbolKeyModelOptions, TransactionIsolationLevelsMap, buildWhere, config, configDefault, getClassEntityFromClassModel, getTableOrTableAlias, getTargetColumnName, isAggrColumn, isRaw, isRef, locales, prepareClassModel, prepareColumns };
|
package/dist/lib/dto/dto.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import { DtoAggregate } from './dtoAggregate.ts';
|
|
|
2
2
|
import { DtoCreate } from './dtoCreate.ts';
|
|
3
3
|
import { DtoGet } from './dtoGet.ts';
|
|
4
4
|
import { DtoGroup } from './dtoGroup.ts';
|
|
5
|
+
import { DtoQuery } from './dtoQuery.ts';
|
|
6
|
+
import { DtoQueryPage } from './dtoQueryPage.ts';
|
|
7
|
+
import { DtoSelectAndCount } from './dtoSelectAndCount.ts';
|
|
5
8
|
import { DtoUpdate } from './dtoUpdate.ts';
|
|
6
9
|
export declare const $Dto: {
|
|
7
10
|
create: typeof DtoCreate;
|
|
@@ -9,4 +12,7 @@ export declare const $Dto: {
|
|
|
9
12
|
get: typeof DtoGet;
|
|
10
13
|
aggregate: typeof DtoAggregate;
|
|
11
14
|
group: typeof DtoGroup;
|
|
15
|
+
query: typeof DtoQuery;
|
|
16
|
+
queryPage: typeof DtoQueryPage;
|
|
17
|
+
selectAndCount: typeof DtoSelectAndCount;
|
|
12
18
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Constructable } from 'vona';
|
|
2
|
+
import { DtoQueryBase } from '../../types/dto/dtoQueryBase.ts';
|
|
3
|
+
export declare function DtoQuery<T, K extends keyof T>(classRef: Constructable<T>, keys: K[]): new (...args: any[]) => ((k: DtoQueryBase) => void) | (Partial<Pick<T, K>> extends infer T_1 ? T_1 extends Partial<Pick<T, K>> ? T_1 extends any ? (k: T_1) => void : never : never : never) extends (k: infer I) => void ? I : never;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Constructable } from 'vona';
|
|
2
|
+
import { DtoQueryPageBase } from '../../types/dto/dtoQueryPageBase.ts';
|
|
3
|
+
export declare function DtoQueryPage<T, KEYS extends Array<keyof T>>(classRef: Constructable<T>, keys: KEYS): new (...args: any[]) => ((k: DtoQueryPageBase) => void) | (Partial<Pick<T, KEYS[number]>> extends infer T_1 ? T_1 extends Partial<Pick<T, KEYS[number]>> ? T_1 extends any ? (k: T_1) => void : never : never : never) extends (k: infer I) => void ? I : never;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Constructable } from 'vona';
|
|
2
|
+
import type { BeanModelMeta } from '../../bean/bean.model/bean.model_meta.ts';
|
|
3
|
+
import type { IDtoGetParams } from '../../types/dto/dtoGet.ts';
|
|
4
|
+
import type { TypeDtoSelectAndCountResult } from '../../types/dto/dtoSelectAndCount.ts';
|
|
5
|
+
import type { IModelClassRecord } from '../../types/onion/model.ts';
|
|
6
|
+
export declare function DtoSelectAndCount<ModelLike extends BeanModelMeta | (keyof IModelClassRecord), T extends IDtoGetParams<ModelLike> | undefined = undefined>(modelLike: ModelLike extends BeanModelMeta ? ((() => Constructable<ModelLike>) | Constructable<ModelLike>) : ModelLike, params?: T): Constructable<TypeDtoSelectAndCountResult<ModelLike, T>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type BigNumber from 'bignumber.js';
|
|
2
|
+
import type { BeanModelMeta } from '../../bean/bean.model/bean.model_meta.ts';
|
|
3
|
+
import type { IModelClassRecord } from '../onion/model.ts';
|
|
4
|
+
import type { TypeDtoGetResult } from './dtoGet.ts';
|
|
5
|
+
export interface TypeDtoSelectAndCountResult<ModelLike extends BeanModelMeta | (keyof IModelClassRecord), TOptionsRelation> {
|
|
6
|
+
list: TypeDtoGetResult<ModelLike, TOptionsRelation>[];
|
|
7
|
+
total: BigNumber;
|
|
8
|
+
}
|
package/dist/types/model.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Knex } from 'knex';
|
|
2
2
|
import type { BeanModelMeta } from '../bean/bean.model/bean.model_meta.ts';
|
|
3
3
|
import type { TypeModelColumn, TypeModelColumns, TypeModelColumnsPatch, TypeModelWhere } from './modelWhere.ts';
|
|
4
|
-
import type { TypeModelParamsInclude, TypeModelsClassLikeGeneral } from './relations.ts';
|
|
4
|
+
import type { TypeModelOfModelLike, TypeModelParamsInclude, TypeModelsClassLikeGeneral, TypeSymbolKeyEntity } from './relations.ts';
|
|
5
5
|
import type { TypeEntityTableColumnNamesOfGeneral, TypeEntityTableColumnsOfGeneral } from './relationsColumns.ts';
|
|
6
6
|
import type { TypeModelMutateParamsInclude } from './relationsMutate.ts';
|
|
7
7
|
import type { TypeEntityTableNamesOfGeneral } from './relationsTables.ts';
|
|
@@ -29,6 +29,7 @@ export interface IBuildModelSelectParamsBasic<TRecord, COLUMNS extends TypeModel
|
|
|
29
29
|
limit?: number;
|
|
30
30
|
offset?: number;
|
|
31
31
|
}
|
|
32
|
+
export type IQueryParams<Model extends BeanModelMeta = BeanModelMeta, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined> = IModelSelectParams<TypeModelOfModelLike<Model>[TypeSymbolKeyEntity], Model, ModelJoins>;
|
|
32
33
|
export type IModelSelectParams<TRecord, Model extends BeanModelMeta = BeanModelMeta, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined> = IBuildModelSelectParams<TRecord, Model, TypeEntityTableNamesOfGeneral<ModelJoins, Model>, TypeEntityTableColumnNamesOfGeneral<ModelJoins, Model>, TypeEntityTableColumnsOfGeneral<ModelJoins, Model>>;
|
|
33
34
|
export interface IBuildModelCountParams<TRecord, _Model extends BeanModelMeta | undefined = undefined, TableNames = undefined, ColumnNames = keyof TRecord, Columns extends {} | undefined = undefined> {
|
|
34
35
|
distinct?: boolean | (keyof TRecord) | (keyof TRecord)[];
|
|
@@ -57,7 +57,7 @@ export declare const Op: {
|
|
|
57
57
|
};
|
|
58
58
|
export declare const OpJointValues: ("_and_" | "_or_" | "_not_" | "_exists_" | "_notExists_")[];
|
|
59
59
|
export declare const OpNormalValues: ("_eq_" | "_notEq_" | "_gt_" | "_gte_" | "_lt_" | "_lte_" | "_in_" | "_notIn_" | "_is_" | "_isNot_" | "_between_" | "_notBetween_" | "_startsWith_" | "_endsWith_" | "_includes_" | "_startsWithI_" | "_endsWithI_" | "_includesI_" | "_ref_")[];
|
|
60
|
-
export declare const OpValues: ("
|
|
60
|
+
export declare const OpValues: ("_eq_" | "_notEq_" | "_gt_" | "_gte_" | "_lt_" | "_lte_" | "_in_" | "_notIn_" | "_is_" | "_isNot_" | "_between_" | "_notBetween_" | "_startsWith_" | "_endsWith_" | "_includes_" | "_startsWithI_" | "_endsWithI_" | "_includesI_" | "_ref_" | "_and_" | "_or_" | "_not_" | "_exists_" | "_notExists_" | "_skip_")[];
|
|
61
61
|
export type TypeOpsJointPostfix<Op> = {
|
|
62
62
|
[KEY in keyof Op]: Op[KEY] | (KEY extends string ? `_${KEY}_${number}` : never);
|
|
63
63
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type BigNumber from 'bignumber.js';
|
|
1
2
|
import type { Constructable, OmitNever } from 'vona';
|
|
2
3
|
import type { BeanModelMeta } from '../bean/bean.model/bean.model_meta.ts';
|
|
3
4
|
import type { TypeDepthPrev, TypeDepthPrevMax } from './depth.ts';
|
|
@@ -94,6 +95,10 @@ export type TypeUtilEntityPartial<TRecord, TColumns> = [
|
|
|
94
95
|
TColumns
|
|
95
96
|
] extends [keyof TRecord] ? Partial<Pick<TRecord, TColumns>> & Omit<TRecord, TColumns> : TRecord;
|
|
96
97
|
export type TypeUtilGetColumnsFromRelationAndIncludeWrapper<Relation, IncludeWrapper extends {} | undefined | unknown> = TypeUtilGetParamsColumns<IncludeWrapper> extends string | string[] ? TypeUtilGetParamsColumns<IncludeWrapper> : TypeUtilGetRelationOptionsColumns<Relation>;
|
|
98
|
+
export interface TypeModelSelectAndCount<TRecord, TModel extends BeanModelMeta | undefined, TOptionsRelation, TColumns = undefined, Aggrs = undefined, Groups = undefined, Depth extends TypeDepthPrev[number] = TypeDepthPrevMax> {
|
|
99
|
+
list: TypeModelRelationResult<TRecord, TModel, TOptionsRelation, TColumns, Aggrs, Groups, Depth>[];
|
|
100
|
+
total: BigNumber;
|
|
101
|
+
}
|
|
97
102
|
export type TypeModelRelationResult<TRecord, TModel extends BeanModelMeta | undefined, TOptionsRelation, TColumns = undefined, Aggrs = undefined, Groups = undefined, Depth extends TypeDepthPrev[number] = TypeDepthPrevMax> = Groups extends string | string[] ? TypeModelGroupRelationResultGroups<TRecord, Aggrs, Groups, TColumns> : Aggrs extends {} ? TypeModelAggrRelationResultAggrs<Aggrs> : TypeModelRelationResult_Normal<TRecord, TModel, TOptionsRelation, TColumns, Depth>;
|
|
98
103
|
export type TypeModelRelationResult_Normal<TRecord, TModel extends BeanModelMeta | undefined, TOptionsRelation, TColumns = undefined, Depth extends TypeDepthPrev[number] = TypeDepthPrevMax> = TypeUtilEntitySelector<TRecord, TypeUtilPrepareColumns<TColumns extends string | string[] ? TColumns : TypeUtilGetParamsColumns<TOptionsRelation>>> & (TModel extends BeanModelMeta ? (OmitNever<TypeModelRelationResultMergeInclude<TypeUtilGetModelOptions<TModel>, TypeUtilGetParamsInlcude<TOptionsRelation>, Depth>> & OmitNever<TypeModelRelationResultMergeWith<TypeUtilGetParamsWith<TOptionsRelation>, Depth>>) : {});
|
|
99
104
|
export type TypeModelRelationResultMergeInclude<TModelOptions extends IDecoratorModelOptions, TInclude extends {} | undefined | unknown, Depth extends TypeDepthPrev[number] = TypeDepthPrevMax> = {
|