vona-module-a-orm 5.0.37

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.
Files changed (116) hide show
  1. package/LICENSE +21 -0
  2. package/cli/databaseDialect/boilerplate/{{sceneName}}.{{beanName}}.ts_ +4 -0
  3. package/cli/entity/boilerplate/{{beanName}}.ts_ +7 -0
  4. package/cli/entity/metadata/generate.ts +52 -0
  5. package/cli/model/boilerplate/{{beanName}}.ts_ +8 -0
  6. package/cli/model/metadata/generate.ts +285 -0
  7. package/dist/.metadata/index.d.ts +246 -0
  8. package/dist/.metadata/this.d.ts +2 -0
  9. package/dist/bean/aopMethod.transaction.d.ts +9 -0
  10. package/dist/bean/bean.database.d.ts +12 -0
  11. package/dist/bean/bean.databaseDialectBase.d.ts +20 -0
  12. package/dist/bean/bean.model/bean.model_cache.d.ts +56 -0
  13. package/dist/bean/bean.model/bean.model_crud.d.ts +13 -0
  14. package/dist/bean/bean.model/bean.model_crud_inner.d.ts +15 -0
  15. package/dist/bean/bean.model/bean.model_crud_table.d.ts +13 -0
  16. package/dist/bean/bean.model/bean.model_knex.d.ts +15 -0
  17. package/dist/bean/bean.model/bean.model_meta.d.ts +40 -0
  18. package/dist/bean/bean.model/bean.model_utils.d.ts +39 -0
  19. package/dist/bean/bean.model/bean.model_view.d.ts +14 -0
  20. package/dist/bean/bean.model.d.ts +3 -0
  21. package/dist/bean/bean.modelBase.d.ts +3 -0
  22. package/dist/bean/broadcast.columnsClear.d.ts +10 -0
  23. package/dist/bean/broadcast.databaseClientReload.d.ts +12 -0
  24. package/dist/bean/event.clientNameReal.d.ts +6 -0
  25. package/dist/bean/event.columnsClear.d.ts +9 -0
  26. package/dist/bean/event.databaseClientReload.d.ts +11 -0
  27. package/dist/bean/schedule.softDeletionPrune.d.ts +6 -0
  28. package/dist/common/buildWhere.d.ts +4 -0
  29. package/dist/common/checkWhere.d.ts +1 -0
  30. package/dist/common/index.d.ts +3 -0
  31. package/dist/common/utils.d.ts +10 -0
  32. package/dist/config/config.d.ts +72 -0
  33. package/dist/config/errors.d.ts +3 -0
  34. package/dist/config/locale/en-us.d.ts +9 -0
  35. package/dist/config/locale/zh-cn.d.ts +9 -0
  36. package/dist/extend/index.d.ts +4 -0
  37. package/dist/extend/schemaBuilder.d.ts +13 -0
  38. package/dist/extend/tableBuilder.d.ts +22 -0
  39. package/dist/index.d.ts +7 -0
  40. package/dist/index.js +4085 -0
  41. package/dist/lib/columns.d.ts +9 -0
  42. package/dist/lib/database.d.ts +6 -0
  43. package/dist/lib/databaseDialect.d.ts +1 -0
  44. package/dist/lib/dto/dto.d.ts +12 -0
  45. package/dist/lib/dto/dtoAggregate.d.ts +8 -0
  46. package/dist/lib/dto/dtoCreate.d.ts +5 -0
  47. package/dist/lib/dto/dtoGet.d.ts +8 -0
  48. package/dist/lib/dto/dtoGroup.d.ts +8 -0
  49. package/dist/lib/dto/dtoMutate.d.ts +8 -0
  50. package/dist/lib/dto/dtoUpdate.d.ts +5 -0
  51. package/dist/lib/dto/index.d.ts +1 -0
  52. package/dist/lib/entity.d.ts +3 -0
  53. package/dist/lib/index.d.ts +10 -0
  54. package/dist/lib/model.d.ts +2 -0
  55. package/dist/lib/modelCacheBase.d.ts +20 -0
  56. package/dist/lib/relations.d.ts +15 -0
  57. package/dist/lib/relationsDynamic.d.ts +15 -0
  58. package/dist/lib/relationsMutate.d.ts +14 -0
  59. package/dist/lib/relationsStatic.d.ts +9 -0
  60. package/dist/main.d.ts +9 -0
  61. package/dist/service/cacheEntity_.d.ts +10 -0
  62. package/dist/service/cacheQuery_.d.ts +7 -0
  63. package/dist/service/columnsCache_.d.ts +22 -0
  64. package/dist/service/columns_.d.ts +13 -0
  65. package/dist/service/database.d.ts +17 -0
  66. package/dist/service/databaseAsyncLocalStorage_.d.ts +10 -0
  67. package/dist/service/databaseClient_.d.ts +30 -0
  68. package/dist/service/db_.d.ts +26 -0
  69. package/dist/service/entityResolver_.d.ts +9 -0
  70. package/dist/service/modelResolver_.d.ts +8 -0
  71. package/dist/service/relations_.d.ts +19 -0
  72. package/dist/service/transactionAsyncLocalStorage_.d.ts +10 -0
  73. package/dist/service/transactionConsistency/342/200/214_.d.ts +10 -0
  74. package/dist/service/transactionFiber_.d.ts +13 -0
  75. package/dist/service/transactionState_.d.ts +11 -0
  76. package/dist/service/transaction_.d.ts +18 -0
  77. package/dist/types/columns.d.ts +6 -0
  78. package/dist/types/config.d.ts +14 -0
  79. package/dist/types/database.d.ts +47 -0
  80. package/dist/types/dialect.d.ts +6 -0
  81. package/dist/types/dto/dtoAggregate.d.ts +2 -0
  82. package/dist/types/dto/dtoGet.d.ts +12 -0
  83. package/dist/types/dto/dtoGroup.d.ts +2 -0
  84. package/dist/types/dto/dtoMutate.d.ts +14 -0
  85. package/dist/types/dto/index.d.ts +4 -0
  86. package/dist/types/entity.d.ts +15 -0
  87. package/dist/types/entityBase.d.ts +5 -0
  88. package/dist/types/entityBaseEmpty.d.ts +2 -0
  89. package/dist/types/entityBaseInner.d.ts +7 -0
  90. package/dist/types/entityBaseSimple.d.ts +4 -0
  91. package/dist/types/extra.d.ts +11 -0
  92. package/dist/types/index.d.ts +30 -0
  93. package/dist/types/logger.d.ts +7 -0
  94. package/dist/types/model.d.ts +79 -0
  95. package/dist/types/modelAggr.d.ts +26 -0
  96. package/dist/types/modelCount.d.ts +15 -0
  97. package/dist/types/modelGeneral.d.ts +23 -0
  98. package/dist/types/modelGroup.d.ts +23 -0
  99. package/dist/types/modelWhere.d.ts +86 -0
  100. package/dist/types/onion/databaseDialect.d.ts +17 -0
  101. package/dist/types/onion/entity.d.ts +26 -0
  102. package/dist/types/onion/index.d.ts +4 -0
  103. package/dist/types/onion/model.d.ts +55 -0
  104. package/dist/types/onion/table.d.ts +2 -0
  105. package/dist/types/relations.d.ts +102 -0
  106. package/dist/types/relationsAggr.d.ts +16 -0
  107. package/dist/types/relationsColumns.d.ts +45 -0
  108. package/dist/types/relationsDef.d.ts +59 -0
  109. package/dist/types/relationsDefDynamic.d.ts +56 -0
  110. package/dist/types/relationsDefMutate.d.ts +9 -0
  111. package/dist/types/relationsGroup.d.ts +21 -0
  112. package/dist/types/relationsMutate.d.ts +25 -0
  113. package/dist/types/relationsTables.d.ts +15 -0
  114. package/dist/types/tableIdentity.d.ts +1 -0
  115. package/dist/types/transaction.d.ts +18 -0
  116. package/package.json +74 -0
@@ -0,0 +1,9 @@
1
+ import type { Constructable } from 'vona';
2
+ import type { ITableRecord, TypeEntityMeta } from '../types/index.ts';
3
+ export declare function $column<T>(key: keyof T): keyof T;
4
+ export declare function $columns<T>(key?: (keyof T) | Array<keyof T> | undefined): (keyof T) | Array<keyof T> | undefined;
5
+ export declare function $columnsAll<T, TableName extends boolean, Meta extends boolean>(classEntity: (() => Constructable<T>) | Constructable<T>, withTableName?: TableName, withMeta?: Meta): TableName extends true ? (Meta extends true ? TypeEntityMeta<T> : Omit<TypeEntityMeta<T>, '$comment' | '$default'>) : (Meta extends true ? Omit<TypeEntityMeta<T>, '$table'> : Omit<TypeEntityMeta<T>, '$table' | '$comment' | '$default'>);
6
+ export declare function $tableColumns<T>(classEntity: (() => Constructable<T>) | Constructable<T>, key?: (keyof T) | Array<keyof T> | undefined): Record<keyof ITableRecord, (keyof T) | Array<keyof T> | undefined>;
7
+ export declare function $tableName<T>(classEntity: (() => Constructable<T>) | Constructable<T>): keyof ITableRecord;
8
+ export declare function $tableComments<T>(classEntity: (() => Constructable<T>) | Constructable<T>): Record<string, string>;
9
+ export declare function $tableDefaults<T>(classEntity: (() => Constructable<T>) | Constructable<T>): Record<string, any>;
@@ -0,0 +1,6 @@
1
+ import type { IAopMethodOptionsTransaction } from '../bean/aopMethod.transaction.ts';
2
+ declare function Transaction(options?: Partial<IAopMethodOptionsTransaction>): MethodDecorator;
3
+ export declare const Database: {
4
+ transaction: typeof Transaction;
5
+ };
6
+ export {};
@@ -0,0 +1 @@
1
+ export declare function DatabaseDialect(): ClassDecorator;
@@ -0,0 +1,12 @@
1
+ import { DtoAggregate } from './dtoAggregate.ts';
2
+ import { DtoCreate } from './dtoCreate.ts';
3
+ import { DtoGet } from './dtoGet.ts';
4
+ import { DtoGroup } from './dtoGroup.ts';
5
+ import { DtoUpdate } from './dtoUpdate.ts';
6
+ export declare const $Dto: {
7
+ create: typeof DtoCreate;
8
+ update: typeof DtoUpdate;
9
+ get: typeof DtoGet;
10
+ aggregate: typeof DtoAggregate;
11
+ group: typeof DtoGroup;
12
+ };
@@ -0,0 +1,8 @@
1
+ import type { Constructable } from 'vona';
2
+ import type { BeanModelMeta } from '../../bean/bean.model/bean.model_meta.ts';
3
+ import type { TypeDtoAggrResult } from '../../types/dto/dtoAggregate.ts';
4
+ import type { TypeModelSelectAggrParamsAggrs } from '../../types/modelAggr.ts';
5
+ import type { IModelClassRecord } from '../../types/onion/model.ts';
6
+ import type { TypeModelOfModelLike, TypeSymbolKeyEntity } from '../../types/relations.ts';
7
+ export declare function DtoAggregate<Aggrs extends TypeModelSelectAggrParamsAggrs<TypeModelOfModelLike<ModelLike>[TypeSymbolKeyEntity]>, ModelLike extends BeanModelMeta | (keyof IModelClassRecord)>(modelLike: ModelLike extends BeanModelMeta ? ((() => Constructable<ModelLike>) | Constructable<ModelLike>) : ModelLike, aggrs: Aggrs): Constructable<TypeDtoAggrResult<Aggrs>>;
8
+ export declare function _DtoAggregate_inner<Aggrs extends TypeModelSelectAggrParamsAggrs<TypeModelOfModelLike<ModelLike>[TypeSymbolKeyEntity]>, ModelLike extends BeanModelMeta | (keyof IModelClassRecord)>(classTarget: Constructable, _modelLike: ModelLike extends BeanModelMeta ? ((() => Constructable<ModelLike>) | Constructable<ModelLike>) : ModelLike, aggrs: Aggrs): Constructable<TypeDtoAggrResult<Aggrs>>;
@@ -0,0 +1,5 @@
1
+ import type { Constructable } from 'vona';
2
+ import type { BeanModelMeta } from '../../bean/bean.model/bean.model_meta.ts';
3
+ import type { IDtoMutateParams, TypeDtoMutateResult } from '../../types/dto/dtoMutate.ts';
4
+ import type { IModelClassRecord } from '../../types/onion/model.ts';
5
+ export declare function DtoCreate<T extends IDtoMutateParams<ModelLike>, ModelLike extends BeanModelMeta | (keyof IModelClassRecord)>(modelLike: ModelLike extends BeanModelMeta ? ((() => Constructable<ModelLike>) | Constructable<ModelLike>) : ModelLike, params?: T): Constructable<TypeDtoMutateResult<ModelLike, T>>;
@@ -0,0 +1,8 @@
1
+ import type { Constructable } from 'vona';
2
+ import type { BeanModelMeta } from '../../bean/bean.model/bean.model_meta.ts';
3
+ import type { IDtoGetParams, TypeDtoGetResult } from '../../types/dto/dtoGet.ts';
4
+ import type { TypeDtoMutateType } from '../../types/dto/dtoMutate.ts';
5
+ import type { IModelRelationIncludeWrapper } from '../../types/model.ts';
6
+ import type { IModelClassRecord } from '../../types/onion/model.ts';
7
+ export declare function DtoGet<T extends IDtoGetParams<ModelLike>, ModelLike extends BeanModelMeta | (keyof IModelClassRecord)>(modelLike: ModelLike extends BeanModelMeta ? ((() => Constructable<ModelLike>) | Constructable<ModelLike>) : ModelLike, params?: T): Constructable<TypeDtoGetResult<ModelLike, T>>;
8
+ export declare function _DtoGet_relations<TRecord extends {}, TModel extends BeanModelMeta>(modelClass: Constructable<TModel>, entityClass: Constructable<TRecord>, includeWrapper?: IModelRelationIncludeWrapper, mutateTypeTopLevel?: TypeDtoMutateType): void;
@@ -0,0 +1,8 @@
1
+ import type { Constructable } from 'vona';
2
+ import type { BeanModelMeta } from '../../bean/bean.model/bean.model_meta.ts';
3
+ import type { TypeDtoGroupResult } from '../../types/dto/dtoGroup.ts';
4
+ import type { TypeModelSelectAggrParamsAggrs } from '../../types/modelAggr.ts';
5
+ import type { TypeModelColumnsStrict } from '../../types/modelWhere.ts';
6
+ import type { IModelClassRecord } from '../../types/onion/model.ts';
7
+ import type { TypeModelOfModelLike, TypeSymbolKeyEntity } from '../../types/relations.ts';
8
+ export declare function DtoGroup<Groups extends TypeModelColumnsStrict<TypeModelOfModelLike<ModelLike>[TypeSymbolKeyEntity]>, Aggrs extends TypeModelSelectAggrParamsAggrs<TypeModelOfModelLike<ModelLike>[TypeSymbolKeyEntity]>, Columns extends TypeModelColumnsStrict<TypeModelOfModelLike<ModelLike>[TypeSymbolKeyEntity]>, ModelLike extends BeanModelMeta | (keyof IModelClassRecord)>(modelLike: ModelLike extends BeanModelMeta ? ((() => Constructable<ModelLike>) | Constructable<ModelLike>) : ModelLike, groups: Groups, aggrs?: Aggrs, columns?: Columns): Constructable<TypeDtoGroupResult<TypeModelOfModelLike<ModelLike>[TypeSymbolKeyEntity], Aggrs, Groups, Columns>>;
@@ -0,0 +1,8 @@
1
+ import type { Constructable } from 'vona';
2
+ import type { BeanModelMeta } from '../../bean/bean.model/bean.model_meta.ts';
3
+ import type { IDtoMutateParams, TypeDtoMutateResult, TypeDtoMutateType } from '../../types/dto/dtoMutate.ts';
4
+ import type { TypeModelColumnsStrict } from '../../types/modelWhere.ts';
5
+ import type { IModelClassRecord } from '../../types/onion/model.ts';
6
+ import type { TypeModelOfModelLike, TypeSymbolKeyEntity } from '../../types/relations.ts';
7
+ export declare function DtoMutate<T extends IDtoMutateParams<ModelLike>, ModelLike extends BeanModelMeta | (keyof IModelClassRecord)>(modelLike: ModelLike extends BeanModelMeta ? ((() => Constructable<ModelLike>) | Constructable<ModelLike>) : ModelLike, params?: T): Constructable<TypeDtoMutateResult<ModelLike, T>>;
8
+ export declare function _DtoMutate_raw<T extends IDtoMutateParams<ModelLike>, ModelLike extends BeanModelMeta | (keyof IModelClassRecord), ColumnsOmitDefault extends TypeModelColumnsStrict<TypeModelOfModelLike<ModelLike>[TypeSymbolKeyEntity]> | undefined = undefined>(modelLike: ModelLike extends BeanModelMeta ? ((() => Constructable<ModelLike>) | Constructable<ModelLike>) : ModelLike, params?: T, mutateTypeTopLevel?: TypeDtoMutateType, columnsOmitDefault?: ColumnsOmitDefault, topLevel?: boolean): Constructable<TypeDtoMutateResult<ModelLike, T>>;
@@ -0,0 +1,5 @@
1
+ import type { Constructable } from 'vona';
2
+ import type { BeanModelMeta } from '../../bean/bean.model/bean.model_meta.ts';
3
+ import type { IDtoMutateParams, TypeDtoMutateResult } from '../../types/dto/dtoMutate.ts';
4
+ import type { IModelClassRecord } from '../../types/onion/model.ts';
5
+ export declare function DtoUpdate<T extends IDtoMutateParams<ModelLike>, ModelLike extends BeanModelMeta | (keyof IModelClassRecord)>(modelLike: ModelLike extends BeanModelMeta ? ((() => Constructable<ModelLike>) | Constructable<ModelLike>) : ModelLike, params?: T): Constructable<Partial<TypeDtoMutateResult<ModelLike, T>>>;
@@ -0,0 +1 @@
1
+ export * from './dto.ts';
@@ -0,0 +1,3 @@
1
+ import type { IDecoratorEntityOptions } from '../types/onion/entity.ts';
2
+ export declare function Entity<T extends IDecoratorEntityOptions<any>>(options?: T): ClassDecorator;
3
+ export declare function Entity<T extends IDecoratorEntityOptions<any>>(table?: string, options?: Omit<T, 'table'>): ClassDecorator;
@@ -0,0 +1,10 @@
1
+ export * from './columns.ts';
2
+ export * from './database.ts';
3
+ export * from './databaseDialect.ts';
4
+ export * from './dto/index.ts';
5
+ export * from './entity.ts';
6
+ export * from './model.ts';
7
+ export * from './relations.ts';
8
+ export * from './relationsDynamic.ts';
9
+ export * from './relationsMutate.ts';
10
+ export * from './relationsStatic.ts';
@@ -0,0 +1,2 @@
1
+ import type { IDecoratorModelOptions } from '../types/onion/model.ts';
2
+ export declare function Model<T extends IDecoratorModelOptions>(options?: T): ClassDecorator;
@@ -0,0 +1,20 @@
1
+ import type { IDecoratorSummerCacheOptions } from 'vona-module-a-summer';
2
+ import type { BeanModelCache } from '../bean/bean.model/bean.model_cache.ts';
3
+ import type { TypeModelCacheType } from '../types/model.ts';
4
+ import type { ITableRecord } from '../types/onion/table.ts';
5
+ import { BeanBase } from 'vona';
6
+ declare const SymbolCacheOptions: unique symbol;
7
+ export declare class ModelCacheBase extends BeanBase {
8
+ private [SymbolCacheOptions];
9
+ protected _model: BeanModelCache;
10
+ private _cacheType;
11
+ protected __init__(model: BeanModelCache, cacheType: TypeModelCacheType): void;
12
+ private get scopeOrm();
13
+ getInstance(table: keyof ITableRecord): import("vona-module-a-summer").BeanSummerCacheBase<any, any>;
14
+ getName(table: keyof ITableRecord): string;
15
+ get options(): false | IDecoratorSummerCacheOptions;
16
+ get enabled(): any;
17
+ private _getCacheEnabledInner;
18
+ private _getCacheOptionsInner;
19
+ }
20
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { BeanModelMeta } from '../bean/bean.model/bean.model_meta.ts';
2
+ import type { IModelClassRecord } from '../types/onion/model.ts';
3
+ import type { TypeModelClassLike, TypeModelOfModelLike, TypeModelsClassLikeGeneral, TypeSymbolKeyEntity } from '../types/relations.ts';
4
+ import type { IModelRelationOptionsManyStatic, IModelRelationOptionsOneStatic } from './relationsStatic.ts';
5
+ declare function hasOne<MODEL extends BeanModelMeta | (keyof IModelClassRecord), OPTIONS extends IModelRelationOptionsOneStatic<TypeModelOfModelLike<MODEL>>>(classModel: TypeModelClassLike<MODEL>, key: keyof TypeModelOfModelLike<MODEL>[TypeSymbolKeyEntity], options?: OPTIONS): any;
6
+ declare function belongsTo<MODELSelf extends BeanModelMeta | (keyof IModelClassRecord), MODEL extends BeanModelMeta | (keyof IModelClassRecord), OPTIONS extends IModelRelationOptionsOneStatic<TypeModelOfModelLike<MODEL>>>(_classModelSelf: TypeModelClassLike<MODELSelf>, classModel: TypeModelClassLike<MODEL>, key: keyof TypeModelOfModelLike<MODELSelf>[TypeSymbolKeyEntity], options?: OPTIONS): any;
7
+ declare function hasMany<MODEL extends BeanModelMeta | (keyof IModelClassRecord), OPTIONS extends IModelRelationOptionsManyStatic<TypeModelOfModelLike<MODEL>, ModelJoins, Group>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined, Group extends boolean | undefined = undefined>(classModel: TypeModelClassLike<MODEL>, key: keyof TypeModelOfModelLike<MODEL>[TypeSymbolKeyEntity], options?: OPTIONS, _modelJoins?: ModelJoins, _group?: Group): any;
8
+ declare function belongsToMany<MODELMiddle extends BeanModelMeta | (keyof IModelClassRecord), MODEL extends BeanModelMeta | (keyof IModelClassRecord), OPTIONS extends IModelRelationOptionsManyStatic<TypeModelOfModelLike<MODEL>, ModelJoins, Group>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined, Group extends boolean | undefined = undefined>(classModelMiddle: TypeModelClassLike<MODELMiddle>, classModel: TypeModelClassLike<MODEL>, keyFrom: keyof TypeModelOfModelLike<MODELMiddle>[TypeSymbolKeyEntity], keyTo: keyof TypeModelOfModelLike<MODELMiddle>[TypeSymbolKeyEntity], options?: OPTIONS, _modelJoins?: ModelJoins, _group?: Group): any;
9
+ export declare const $relation: {
10
+ hasOne: typeof hasOne;
11
+ belongsTo: typeof belongsTo;
12
+ hasMany: typeof hasMany;
13
+ belongsToMany: typeof belongsToMany;
14
+ };
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { BeanModelMeta } from '../bean/bean.model/bean.model_meta.ts';
2
+ import type { IModelClassRecord } from '../types/onion/model.ts';
3
+ import type { TypeModelClassLike, TypeModelOfModelLike, TypeModelsClassLikeGeneral, TypeSymbolKeyEntity } from '../types/relations.ts';
4
+ import type { IModelRelationBelongsToDynamic, IModelRelationBelongsToManyDynamic, IModelRelationHasManyDynamic, IModelRelationHasOneDynamic, IModelRelationOptionsManyDynamic, IModelRelationOptionsOneDynamic } from '../types/relationsDefDynamic.ts';
5
+ declare function hasOne<MODEL extends BeanModelMeta | (keyof IModelClassRecord), OPTIONS extends IModelRelationOptionsOneDynamic<TypeModelOfModelLike<MODEL>>>(classModel: TypeModelClassLike<MODEL>, key: keyof TypeModelOfModelLike<MODEL>[TypeSymbolKeyEntity], options?: OPTIONS): IModelRelationHasOneDynamic<MODEL, OPTIONS>;
6
+ declare function belongsTo<MODELSelf extends BeanModelMeta | (keyof IModelClassRecord), MODEL extends BeanModelMeta | (keyof IModelClassRecord), OPTIONS extends IModelRelationOptionsOneDynamic<TypeModelOfModelLike<MODEL>>>(_classModelSelf: TypeModelClassLike<MODELSelf>, classModel: TypeModelClassLike<MODEL>, key: keyof TypeModelOfModelLike<MODELSelf>[TypeSymbolKeyEntity], options?: OPTIONS): IModelRelationBelongsToDynamic<MODELSelf, MODEL, OPTIONS>;
7
+ declare function hasMany<MODEL extends BeanModelMeta | (keyof IModelClassRecord), OPTIONS extends IModelRelationOptionsManyDynamic<TypeModelOfModelLike<MODEL>, ModelJoins, Group>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined, Group extends boolean | undefined = undefined>(classModel: TypeModelClassLike<MODEL>, key: keyof TypeModelOfModelLike<MODEL>[TypeSymbolKeyEntity], options?: OPTIONS, _modelJoins?: ModelJoins, _group?: Group): IModelRelationHasManyDynamic<MODEL, OPTIONS, ModelJoins, Group>;
8
+ declare function belongsToMany<MODELMiddle extends BeanModelMeta | (keyof IModelClassRecord), MODEL extends BeanModelMeta | (keyof IModelClassRecord), OPTIONS extends IModelRelationOptionsManyDynamic<TypeModelOfModelLike<MODEL>, ModelJoins, Group>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined, Group extends boolean | undefined = undefined>(classModelMiddle: TypeModelClassLike<MODELMiddle>, classModel: TypeModelClassLike<MODEL>, keyFrom: keyof TypeModelOfModelLike<MODELMiddle>[TypeSymbolKeyEntity], keyTo: keyof TypeModelOfModelLike<MODELMiddle>[TypeSymbolKeyEntity], options?: OPTIONS, _modelJoins?: ModelJoins, _group?: Group): IModelRelationBelongsToManyDynamic<MODELMiddle, MODEL, OPTIONS, ModelJoins, Group>;
9
+ export declare const $relationDynamic: {
10
+ hasOne: typeof hasOne;
11
+ belongsTo: typeof belongsTo;
12
+ hasMany: typeof hasMany;
13
+ belongsToMany: typeof belongsToMany;
14
+ };
15
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { BeanModelMeta } from '../bean/bean.model/bean.model_meta.ts';
2
+ import type { IModelClassRecord } from '../types/onion/model.ts';
3
+ import type { TypeModelClassLike, TypeModelOfModelLike, TypeSymbolKeyEntity } from '../types/relations.ts';
4
+ import type { IModelRelationBelongsToManyDynamic, IModelRelationHasManyDynamic, IModelRelationHasOneDynamic } from '../types/relationsDefDynamic.ts';
5
+ import type { IModelRelationOptionsBelongsToManyMutate, IModelRelationOptionsManyMutate, IModelRelationOptionsOneMutate } from '../types/relationsDefMutate.ts';
6
+ declare function hasOne<MODEL extends BeanModelMeta | (keyof IModelClassRecord), OPTIONS extends IModelRelationOptionsOneMutate<TypeModelOfModelLike<MODEL>>>(classModel: TypeModelClassLike<MODEL>, key: keyof TypeModelOfModelLike<MODEL>[TypeSymbolKeyEntity], options?: OPTIONS): IModelRelationHasOneDynamic<MODEL, OPTIONS>;
7
+ declare function hasMany<MODEL extends BeanModelMeta | (keyof IModelClassRecord), OPTIONS extends IModelRelationOptionsManyMutate<TypeModelOfModelLike<MODEL>>>(classModel: TypeModelClassLike<MODEL>, key: keyof TypeModelOfModelLike<MODEL>[TypeSymbolKeyEntity], options?: OPTIONS): IModelRelationHasManyDynamic<MODEL, OPTIONS>;
8
+ declare function belongsToMany<MODELMiddle extends BeanModelMeta | (keyof IModelClassRecord), MODEL extends BeanModelMeta | (keyof IModelClassRecord), OPTIONS extends IModelRelationOptionsBelongsToManyMutate<TypeModelOfModelLike<MODEL>>>(classModelMiddle: TypeModelClassLike<MODELMiddle>, classModel: TypeModelClassLike<MODEL>, keyFrom: keyof TypeModelOfModelLike<MODELMiddle>[TypeSymbolKeyEntity], keyTo: keyof TypeModelOfModelLike<MODELMiddle>[TypeSymbolKeyEntity], options?: OPTIONS): IModelRelationBelongsToManyDynamic<MODELMiddle, MODEL, OPTIONS>;
9
+ export declare const $relationMutate: {
10
+ hasOne: typeof hasOne;
11
+ hasMany: typeof hasMany;
12
+ belongsToMany: typeof belongsToMany;
13
+ };
14
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { BeanModelMeta } from '../bean/bean.model/bean.model_meta.ts';
2
+ import type { TypeModelsClassLikeGeneral } from '../types/relations.ts';
3
+ import type { IModelRelationOptionsManyDynamic, IModelRelationOptionsOneDynamic } from '../types/relationsDefDynamic.ts';
4
+ export interface IModelRelationOptionsManyStatic<MODEL extends BeanModelMeta, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined, Group extends boolean | undefined = undefined> extends Omit<IModelRelationOptionsManyDynamic<MODEL, ModelJoins, Group>, 'include' | 'with'> {
5
+ autoload?: boolean;
6
+ }
7
+ export interface IModelRelationOptionsOneStatic<MODEL extends BeanModelMeta> extends Omit<IModelRelationOptionsOneDynamic<MODEL>, 'include' | 'with'> {
8
+ autoload?: boolean;
9
+ }
package/dist/main.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import type { IModuleMain, PowerPartial, VonaApplication } from 'vona';
2
+ import type { ConfigDatabase } from './types/config.ts';
3
+ import { BeanSimple } from 'vona';
4
+ export declare class Main extends BeanSimple implements IModuleMain {
5
+ moduleLoading(): Promise<void>;
6
+ moduleLoaded(): Promise<void>;
7
+ configLoaded(_config: any): Promise<void>;
8
+ }
9
+ export declare function configDefault(app: VonaApplication): Promise<PowerPartial<ConfigDatabase>>;
@@ -0,0 +1,10 @@
1
+ import type { BeanModelCache } from '../bean/bean.model/bean.model_cache.ts';
2
+ import type { ITableRecord } from '../types/onion/table.ts';
3
+ import type { TableIdentity } from '../types/tableIdentity.ts';
4
+ import { ModelCacheBase } from '../lib/modelCacheBase.ts';
5
+ export declare class ServiceCacheEntity extends ModelCacheBase {
6
+ protected __init__(model: BeanModelCache): void;
7
+ clear(table?: keyof ITableRecord): Promise<void>;
8
+ del(id: TableIdentity | TableIdentity[], table?: keyof ITableRecord): Promise<void>;
9
+ get keysAux(): import("vona-module-a-orm").TypeModelColumnsStrict<any> | undefined;
10
+ }
@@ -0,0 +1,7 @@
1
+ import type { BeanModelCache } from '../bean/bean.model/bean.model_cache.ts';
2
+ import type { ITableRecord } from '../types/onion/table.ts';
3
+ import { ModelCacheBase } from '../lib/modelCacheBase.ts';
4
+ export declare class ServiceCacheQuery extends ModelCacheBase {
5
+ protected __init__(model: BeanModelCache): void;
6
+ clear(table?: keyof ITableRecord): Promise<void>;
7
+ }
@@ -0,0 +1,22 @@
1
+ import type { ITableColumns, ITableColumnsDefault } from '../types/columns.ts';
2
+ import type { IDatabaseClientRecord } from '../types/database.ts';
3
+ import { BeanBase } from 'vona';
4
+ declare const SymbolColumnsCache: unique symbol;
5
+ declare const SymbolColumnsDefaultCache: unique symbol;
6
+ export declare class ServiceColumnsCache extends BeanBase {
7
+ clientName: keyof IDatabaseClientRecord;
8
+ protected [SymbolColumnsCache]: Record<string, ITableColumns>;
9
+ protected [SymbolColumnsDefaultCache]: Record<string, ITableColumnsDefault>;
10
+ private _onColumnsClearCancel?;
11
+ /** real client name */
12
+ protected __init__(clientName: keyof IDatabaseClientRecord): void;
13
+ protected __dispose__(): Promise<void>;
14
+ getColumnsDefaultCache(table: string): ITableColumnsDefault;
15
+ setColumnsDefaultCache(table: string, data: ITableColumnsDefault): void;
16
+ deleteColumnsDefaultCache(table: string): void;
17
+ getColumnsCache(table: string): ITableColumns;
18
+ setColumnsCache(table: string, columns: ITableColumns): void;
19
+ deleteColumnsCache(table: string): void;
20
+ columnsClear(tableName?: string): boolean | ITableColumns;
21
+ }
22
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { ITableColumns, ITableColumnsDefault } from '../types/columns.ts';
2
+ import type { ServiceDb } from './db_.ts';
3
+ import { BeanBase } from 'vona';
4
+ export declare class ServiceColumns extends BeanBase {
5
+ private _db;
6
+ private _serviceColumnsCache;
7
+ protected __init__(db: ServiceDb): void;
8
+ private get db();
9
+ private get serviceColumnsCache();
10
+ columns(tableName?: string): Promise<ITableColumns>;
11
+ defaultData(tableName?: string): Promise<ITableColumnsDefault>;
12
+ columnsClear(tableName?: string): void;
13
+ }
@@ -0,0 +1,17 @@
1
+ import type { BeanDatabaseDialectBase } from '../bean/bean.databaseDialectBase.ts';
2
+ import type { ConfigDatabaseClient } from '../types/config.ts';
3
+ import type { IDatabaseClientDialectRecord, IDatabaseClientRecord, IDbInfo } from '../types/database.ts';
4
+ import { BeanBase } from 'vona';
5
+ export declare class ServiceDatabase extends BeanBase {
6
+ getDialect(client: keyof IDatabaseClientDialectRecord): BeanDatabaseDialectBase;
7
+ prepareDbInfo(dbInfoOrClientName?: Partial<IDbInfo> | keyof IDatabaseClientRecord): IDbInfo;
8
+ prepareClientNameSelector(dbInfo: IDbInfo): string;
9
+ parseClientNameSelector(clientNameSelector: string): IDbInfo;
10
+ prepareClientName(clientName?: keyof IDatabaseClientRecord): keyof IDatabaseClientRecord;
11
+ getDefaultClientName(): keyof IDatabaseClientRecord;
12
+ prepareClientNameReal(clientName?: keyof IDatabaseClientRecord): keyof IDatabaseClientRecord;
13
+ columnsClear(clientName?: keyof IDatabaseClientRecord, tableName?: string): void;
14
+ private __columnsClearRaw;
15
+ reloadClients(clientName?: keyof IDatabaseClientRecord, clientConfig?: ConfigDatabaseClient, extraData?: any): Promise<void>;
16
+ private __reloadAllClientsRaw;
17
+ }
@@ -0,0 +1,10 @@
1
+ import type { FunctionAsync } from 'vona';
2
+ import { AsyncLocalStorage } from 'node:async_hooks';
3
+ import { BeanBase } from 'vona';
4
+ import { ServiceDb } from '../service/db_.ts';
5
+ export declare class ServiceDatabaseAsyncLocalStorage extends BeanBase {
6
+ dbStorage: AsyncLocalStorage<ServiceDb>;
7
+ protected __init__(): void;
8
+ get current(): ServiceDb;
9
+ run<RESULT>(store: ServiceDb, fn: FunctionAsync<RESULT>): Promise<RESULT>;
10
+ }
@@ -0,0 +1,30 @@
1
+ import type { Knex } from 'knex';
2
+ import type { ConfigDatabaseClient } from '../types/config.ts';
3
+ import type { IDatabaseClientRecord } from '../types/database.ts';
4
+ import { BeanBase } from 'vona';
5
+ import { ServiceDb } from './db_.ts';
6
+ export interface IPrepareDatabaseNameResult {
7
+ database?: string;
8
+ filename?: string;
9
+ }
10
+ export declare class ServiceDatabaseClient extends BeanBase {
11
+ level: number;
12
+ clientName: keyof IDatabaseClientRecord;
13
+ clientNameSelector: string;
14
+ clientConfig: ConfigDatabaseClient;
15
+ private _knex;
16
+ private _db;
17
+ private _onDatabaseClientReloadCancel?;
18
+ get configDatabase(): import("../types/config.ts").ConfigDatabase;
19
+ get connection(): Knex;
20
+ get db(): ServiceDb;
21
+ protected __init__(clientNameSelector: string, clientConfig?: ConfigDatabaseClient): void;
22
+ protected __dispose__(): Promise<void>;
23
+ private __load;
24
+ private __close;
25
+ reload(clientConfig?: ConfigDatabaseClient): Promise<void>;
26
+ getClientConfig(clientName: keyof IDatabaseClientRecord, original?: boolean): ConfigDatabaseClient;
27
+ getDatabaseName(): string;
28
+ private _prepareDatabaseName;
29
+ changeConfigAndReload(databaseName: string): Promise<void>;
30
+ }
@@ -0,0 +1,26 @@
1
+ import type { FunctionAny } from 'vona';
2
+ import type { BeanDatabaseDialectBase } from '../bean/bean.databaseDialectBase.ts';
3
+ import type { IDatabaseClientDialectRecord, IDbInfo } from '../types/database.ts';
4
+ import type { ITransactionConsistencyCommitOptions } from '../types/transaction.ts';
5
+ import type { ServiceDatabaseClient } from './databaseClient_.ts';
6
+ import { BeanBase } from 'vona';
7
+ import { ServiceColumns } from './columns_.ts';
8
+ import { ServiceTransaction } from './transaction_.ts';
9
+ export declare class ServiceDb extends BeanBase {
10
+ private _client;
11
+ private _columns;
12
+ private _transaction;
13
+ protected __init__(client: ServiceDatabaseClient): void;
14
+ get info(): IDbInfo;
15
+ get level(): number;
16
+ get clientName(): keyof import("../types/database.ts").IDatabaseClientRecord;
17
+ get client(): ServiceDatabaseClient;
18
+ get columns(): ServiceColumns;
19
+ get transaction(): ServiceTransaction;
20
+ get inTransaction(): boolean;
21
+ get connection(): import("knex").Knex<any, any[]>;
22
+ get dialectName(): keyof IDatabaseClientDialectRecord;
23
+ get dialect(): BeanDatabaseDialectBase;
24
+ commit(cb: FunctionAny, options?: ITransactionConsistencyCommitOptions): void;
25
+ compensate(cb: FunctionAny): void;
26
+ }
@@ -0,0 +1,9 @@
1
+ import { BeanBase } from 'vona';
2
+ declare const SymbolModuleScope: unique symbol;
3
+ export declare class ServiceEntityResolver extends BeanBase {
4
+ protected [SymbolModuleScope]: string;
5
+ private __instances;
6
+ constructor(moduleScope: string);
7
+ protected __get__(prop: string): any;
8
+ }
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import { BeanBase } from 'vona';
2
+ declare const SymbolModuleScope: unique symbol;
3
+ export declare class ServiceModelResolver extends BeanBase {
4
+ protected [SymbolModuleScope]: string;
5
+ constructor(moduleScope: string);
6
+ protected __get__(prop: string): any;
7
+ }
8
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { BeanModelCache } from '../bean/bean.model/bean.model_cache.ts';
2
+ import type { IModelMethodOptions, IModelRelationIncludeWrapper } from '../types/model.ts';
3
+ import type { TableIdentity } from '../types/tableIdentity.ts';
4
+ import { BeanBase } from 'vona';
5
+ export declare class ServiceRelations extends BeanBase {
6
+ protected _model: BeanModelCache;
7
+ protected __init__(model: BeanModelCache): void;
8
+ handleRelationsOne<TRecord extends {}>(entity: TRecord | undefined, includeWrapper?: IModelRelationIncludeWrapper, methodOptions?: IModelMethodOptions): Promise<TRecord | undefined>;
9
+ handleRelationsMany<TRecord extends {}>(entities: TRecord[], includeWrapper?: IModelRelationIncludeWrapper, methodOptions?: IModelMethodOptions): Promise<TRecord[]>;
10
+ handleRelationsMutate<TRecord extends {}>(entitiesResult: TRecord[], entities: TRecord[], includeWrapper: IModelRelationIncludeWrapper | undefined, methodOptions: IModelMethodOptions | undefined): Promise<TRecord[]>;
11
+ handleRelationsDelete(ids: TableIdentity[], includeWrapper?: IModelRelationIncludeWrapper, methodOptions?: IModelMethodOptions): Promise<void>;
12
+ private __handleRelationOne;
13
+ private __handleRelationMany;
14
+ private __handleRelationMutate;
15
+ private __handleRelationDelete;
16
+ private __prepareColumnsAndKey;
17
+ private __getModelTarget;
18
+ private __handleRelationsCollection;
19
+ }
@@ -0,0 +1,10 @@
1
+ import type { FunctionAsync } from 'vona';
2
+ import { AsyncLocalStorage } from 'node:async_hooks';
3
+ import { BeanBase } from 'vona';
4
+ import { ServiceTransactionState } from './transactionState_.ts';
5
+ export declare class ServiceTransactionAsyncLocalStorage extends BeanBase {
6
+ transactionStorage: AsyncLocalStorage<ServiceTransactionState>;
7
+ protected __init__(): void;
8
+ get transactionState(): ServiceTransactionState;
9
+ run<RESULT>(fn: FunctionAsync<RESULT>): Promise<RESULT>;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { FunctionAny } from 'vona';
2
+ import { BeanBase } from 'vona';
3
+ export declare class ServiceTransactionConsistency‌ extends BeanBase {
4
+ private _commitCallbacks;
5
+ private _compensateCallbacks;
6
+ commit(cb: FunctionAny): void;
7
+ compensate(cb: FunctionAny): void;
8
+ commitDone(): Promise<void>;
9
+ compensateDone(): Promise<void>;
10
+ }
@@ -0,0 +1,13 @@
1
+ import type knex from 'knex';
2
+ import type { FunctionAny } from 'vona';
3
+ import { BeanBase } from 'vona';
4
+ export declare class ServiceTransactionFiber extends BeanBase {
5
+ private _connection;
6
+ private _transactionConsistency;
7
+ protected __init__(connection: knex.Knex.Transaction): void;
8
+ get connection(): knex.Knex.Transaction<any, any[]>;
9
+ commit(cb: FunctionAny): void;
10
+ compensate(cb: FunctionAny): void;
11
+ doCommit(): Promise<void>;
12
+ doRollback(): Promise<void>;
13
+ }
@@ -0,0 +1,11 @@
1
+ import type knex from 'knex';
2
+ import type { IDbInfo } from '../types/index.ts';
3
+ import { BeanBase } from 'vona';
4
+ import { ServiceTransactionFiber } from './transactionFiber_.ts';
5
+ export declare class ServiceTransactionState extends BeanBase {
6
+ private _fibers;
7
+ private get serviceDatabase();
8
+ get(dbInfo: IDbInfo): ServiceTransactionFiber | undefined;
9
+ add(dbInfo: IDbInfo, connection: knex.Knex.Transaction): ServiceTransactionFiber;
10
+ remove(dbInfo: IDbInfo): void;
11
+ }
@@ -0,0 +1,18 @@
1
+ import type knex from 'knex';
2
+ import type { FunctionAny, FunctionAsync } from 'vona';
3
+ import type { ITransactionConsistencyCommitOptions, ITransactionOptions } from '../types/transaction.ts';
4
+ import type { ServiceDb } from './db_.ts';
5
+ import type { ServiceTransactionFiber } from './transactionFiber_.ts';
6
+ import { BeanBase } from 'vona';
7
+ export declare class ServiceTransaction extends BeanBase {
8
+ private _db;
9
+ protected __init__(db: ServiceDb): void;
10
+ get transactionState(): import("vona-module-a-orm").ServiceTransactionState;
11
+ get transactionFiber(): ServiceTransactionFiber | undefined;
12
+ get inTransaction(): boolean;
13
+ get connection(): knex.Knex.Transaction | undefined;
14
+ commit(cb: FunctionAny, options?: ITransactionConsistencyCommitOptions): void;
15
+ compensate(cb: FunctionAny): void;
16
+ begin<RESULT>(fn: FunctionAsync<RESULT>, options?: ITransactionOptions): Promise<RESULT>;
17
+ private _isolationLevelRequired;
18
+ }
@@ -0,0 +1,6 @@
1
+ export interface ITableColumn {
2
+ type: string;
3
+ default: any;
4
+ }
5
+ export type ITableColumns = Record<string, ITableColumn>;
6
+ export type ITableColumnsDefault = Record<string, any>;
@@ -0,0 +1,14 @@
1
+ import type { Knex } from 'knex';
2
+ import type { VonaContext } from 'vona';
3
+ import type { IDatabaseClientDialectRecord, IDatabaseClientRecord } from './database.ts';
4
+ export type TypeDefaultClientNameFn = (ctx: VonaContext) => keyof IDatabaseClientRecord;
5
+ export type TypeDefaultClientName = TypeDefaultClientNameFn | keyof IDatabaseClientRecord;
6
+ export interface ConfigDatabaseClient extends Omit<Knex.Config, 'client'> {
7
+ client: keyof IDatabaseClientDialectRecord;
8
+ }
9
+ export interface ConfigDatabase {
10
+ testDatabase: boolean;
11
+ defaultClient: TypeDefaultClientName;
12
+ clients: Record<keyof IDatabaseClientRecord, ConfigDatabaseClient>;
13
+ base: ConfigDatabaseClient;
14
+ }
@@ -0,0 +1,47 @@
1
+ import type { FunctionAny } from 'vona';
2
+ import type { BeanModel } from '../bean/bean.model.ts';
3
+ import type { ServiceDb } from '../service/db_.ts';
4
+ import type { ConfigDatabase } from './config.ts';
5
+ export interface IDbInfo {
6
+ level: number;
7
+ clientName: keyof IDatabaseClientRecord;
8
+ }
9
+ export interface IDatabaseClientRecord {
10
+ default: never;
11
+ pg: never;
12
+ mysql: never;
13
+ }
14
+ export interface IDatabaseClientDialectRecord {
15
+ pg: never;
16
+ mysql: never;
17
+ mysql2: never;
18
+ }
19
+ export interface IDatabaseSwitchOptions {
20
+ clientName?: keyof IDatabaseClientRecord;
21
+ }
22
+ declare module 'vona' {
23
+ interface IBeanRecordGlobal {
24
+ model: BeanModel;
25
+ }
26
+ interface VonaConfig {
27
+ database: ConfigDatabase;
28
+ }
29
+ interface VonaContext {
30
+ get db(): ServiceDb;
31
+ commit(cb: FunctionAny): void;
32
+ commitDone(): Promise<void>;
33
+ }
34
+ interface VonaConfigEnv {
35
+ DATABASE_DEFAULT_CLIENT: string | undefined;
36
+ DATABASE_CLIENT_PG_HOST: string | undefined;
37
+ DATABASE_CLIENT_PG_PORT: string | undefined;
38
+ DATABASE_CLIENT_PG_USER: string | undefined;
39
+ DATABASE_CLIENT_PG_PASSWORD: string | undefined;
40
+ DATABASE_CLIENT_PG_DATABASE: string | undefined;
41
+ DATABASE_CLIENT_MYSQL_HOST: string | undefined;
42
+ DATABASE_CLIENT_MYSQL_PORT: string | undefined;
43
+ DATABASE_CLIENT_MYSQL_USER: string | undefined;
44
+ DATABASE_CLIENT_MYSQL_PASSWORD: string | undefined;
45
+ DATABASE_CLIENT_MYSQL_DATABASE: string | undefined;
46
+ }
47
+ }
@@ -0,0 +1,6 @@
1
+ export interface IFetchDatabasesResultItem {
2
+ name: string;
3
+ }
4
+ export interface IFetchIndexesResultItem {
5
+ indexName: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ import type { TypeModelAggrRelationResultAggrs } from '../relationsAggr.ts';
2
+ export type TypeDtoAggrResult<Aggrs> = TypeModelAggrRelationResultAggrs<Aggrs>;
@@ -0,0 +1,12 @@
1
+ import type { BeanModelMeta } from '../../bean/bean.model/bean.model_meta.ts';
2
+ import type { IModelRelationIncludeWrapper } from '../model.ts';
3
+ import type { TypeModelColumns } from '../modelWhere.ts';
4
+ import type { IModelClassRecord } from '../onion/model.ts';
5
+ import type { TypeModelOfModelLike, TypeModelRelationResult, TypeSymbolKeyEntity } from '../relations.ts';
6
+ export type IDtoGetParams<ModelLike extends BeanModelMeta | (keyof IModelClassRecord)> = IBuildDtoGetParams<TypeModelOfModelLike<ModelLike>[TypeSymbolKeyEntity], TypeModelOfModelLike<ModelLike>>;
7
+ export interface IBuildDtoGetParams<TRecord, Model extends BeanModelMeta> extends IModelRelationIncludeWrapper<Model>, IBuildDtoGetParamsBasic<TRecord> {
8
+ }
9
+ export interface IBuildDtoGetParamsBasic<TRecord> {
10
+ columns?: TypeModelColumns<TRecord>;
11
+ }
12
+ export type TypeDtoGetResult<ModelLike extends BeanModelMeta | (keyof IModelClassRecord), TOptionsRelation> = TypeModelRelationResult<TypeModelOfModelLike<ModelLike>[TypeSymbolKeyEntity], TypeModelOfModelLike<ModelLike>, TOptionsRelation>;
@@ -0,0 +1,2 @@
1
+ import type { TypeModelGroupRelationResultGroups } from '../relationsGroup.ts';
2
+ export type TypeDtoGroupResult<TRecord, Aggrs, Groups, Columns> = TypeModelGroupRelationResultGroups<TRecord, Aggrs, Groups, Columns>;
@@ -0,0 +1,14 @@
1
+ import type { BeanModelMeta } from '../../bean/bean.model/bean.model_meta.ts';
2
+ import type { IModelRelationIncludeWrapper } from '../model.ts';
3
+ import type { TypeModelColumnsStrict } from '../modelWhere.ts';
4
+ import type { IModelClassRecord } from '../onion/model.ts';
5
+ import type { TypeModelOfModelLike, TypeSymbolKeyEntity } from '../relations.ts';
6
+ import type { TypeModelMutateRelationData } from '../relationsMutate.ts';
7
+ export type TypeDtoMutateType = 'create' | 'update' | 'mutate';
8
+ export type IDtoMutateParams<ModelLike extends BeanModelMeta | (keyof IModelClassRecord)> = IBuildDtoMutateParams<TypeModelOfModelLike<ModelLike>[TypeSymbolKeyEntity], TypeModelOfModelLike<ModelLike>>;
9
+ export interface IBuildDtoMutateParams<TRecord, Model extends BeanModelMeta> extends IModelRelationIncludeWrapper<Model>, IBuildDtoMutateParamsBasic<TRecord> {
10
+ }
11
+ export interface IBuildDtoMutateParamsBasic<TRecord> {
12
+ columns?: TypeModelColumnsStrict<TRecord>;
13
+ }
14
+ export type TypeDtoMutateResult<ModelLike extends BeanModelMeta | (keyof IModelClassRecord), TOptionsRelation> = TypeModelMutateRelationData<TypeModelOfModelLike<ModelLike>[TypeSymbolKeyEntity], TypeModelOfModelLike<ModelLike>, TOptionsRelation>;
@@ -0,0 +1,4 @@
1
+ export * from './dtoAggregate.ts';
2
+ export * from './dtoGet.ts';
3
+ export * from './dtoGroup.ts';
4
+ export * from './dtoMutate.ts';