vona-module-a-orm 5.1.4 → 5.1.6

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 (157) hide show
  1. package/cli/entity/metadata/generate.ts +13 -3
  2. package/cli/model/metadata/generate.ts +6 -3
  3. package/cli/model/metadata/magic.ts +6 -1
  4. package/dist/.metadata/locales.d.ts.map +1 -1
  5. package/dist/bean/aopMethod.transaction.d.ts.map +1 -1
  6. package/dist/bean/bean.database.d.ts.map +1 -1
  7. package/dist/bean/bean.databaseDialectBase.d.ts +3 -3
  8. package/dist/bean/bean.databaseDialectBase.d.ts.map +1 -1
  9. package/dist/bean/bean.model/bean.model_cache.d.ts.map +1 -1
  10. package/dist/bean/bean.model/bean.model_crud.d.ts.map +1 -1
  11. package/dist/bean/bean.model/bean.model_crud_inner.d.ts.map +1 -1
  12. package/dist/bean/bean.model/bean.model_crud_table.d.ts.map +1 -1
  13. package/dist/bean/bean.model/bean.model_knex.d.ts.map +1 -1
  14. package/dist/bean/bean.model/bean.model_meta.d.ts.map +1 -1
  15. package/dist/bean/bean.model/bean.model_utils.d.ts +1 -0
  16. package/dist/bean/bean.model/bean.model_utils.d.ts.map +1 -1
  17. package/dist/bean/bean.model/bean.model_view.d.ts.map +1 -1
  18. package/dist/bean/event.clientNameReal.d.ts.map +1 -1
  19. package/dist/bean/event.columnsClear.d.ts.map +1 -1
  20. package/dist/bean/queue.doubleDelete.d.ts.map +1 -1
  21. package/dist/bean/schedule.softDeletionPrune.d.ts.map +1 -1
  22. package/dist/common/buildWhere.d.ts.map +1 -1
  23. package/dist/common/utils.d.ts.map +1 -1
  24. package/dist/config/config.d.ts +3 -0
  25. package/dist/config/config.d.ts.map +1 -1
  26. package/dist/extend/schemaBuilder.d.ts.map +1 -1
  27. package/dist/extend/tableBuilder.d.ts.map +1 -1
  28. package/dist/index.js +59 -28
  29. package/dist/index.js.map +1 -1
  30. package/dist/lib/const.d.ts.map +1 -1
  31. package/dist/lib/databaseDialect.d.ts.map +1 -1
  32. package/dist/lib/dto/dtoAggregate.d.ts.map +1 -1
  33. package/dist/lib/dto/dtoCreate.d.ts.map +1 -1
  34. package/dist/lib/dto/dtoGet.d.ts.map +1 -1
  35. package/dist/lib/dto/dtoGroup.d.ts.map +1 -1
  36. package/dist/lib/dto/dtoListAndCount.d.ts.map +1 -1
  37. package/dist/lib/dto/dtoMutate.d.ts.map +1 -1
  38. package/dist/lib/dto/dtoQueryPage.d.ts.map +1 -1
  39. package/dist/lib/dto/dtoSelectAndCount.d.ts.map +1 -1
  40. package/dist/lib/dto/dtoUpdate.d.ts.map +1 -1
  41. package/dist/lib/entity.d.ts.map +1 -1
  42. package/dist/lib/modelCacheBase.d.ts.map +1 -1
  43. package/dist/lib/relations.d.ts.map +1 -1
  44. package/dist/lib/relationsDynamic.d.ts.map +1 -1
  45. package/dist/lib/relationsMutate.d.ts.map +1 -1
  46. package/dist/lib/relationsStatic.d.ts.map +1 -1
  47. package/dist/lib/utils.d.ts.map +1 -1
  48. package/dist/main.d.ts.map +1 -1
  49. package/dist/service/columnsCache_.d.ts.map +1 -1
  50. package/dist/service/database.d.ts.map +1 -1
  51. package/dist/service/databaseClient_.d.ts.map +1 -1
  52. package/dist/service/relations_.d.ts.map +1 -1
  53. package/dist/service/transaction_.d.ts.map +1 -1
  54. package/dist/types/dto/dtoGet.d.ts.map +1 -1
  55. package/dist/types/dto/dtoGroup.d.ts.map +1 -1
  56. package/dist/types/dto/dtoMutate.d.ts.map +1 -1
  57. package/dist/types/dto/dtoQueryBase.d.ts.map +1 -1
  58. package/dist/types/dto/dtoSelectAndCount.d.ts.map +1 -1
  59. package/dist/types/entity.d.ts.map +1 -1
  60. package/dist/types/model.d.ts +5 -1
  61. package/dist/types/model.d.ts.map +1 -1
  62. package/dist/types/modelAggr.d.ts.map +1 -1
  63. package/dist/types/modelCount.d.ts.map +1 -1
  64. package/dist/types/modelGeneral.d.ts.map +1 -1
  65. package/dist/types/modelGroup.d.ts.map +1 -1
  66. package/dist/types/modelIncrement.d.ts.map +1 -1
  67. package/dist/types/modelWhere.d.ts.map +1 -1
  68. package/dist/types/onion/entity.d.ts +2 -2
  69. package/dist/types/onion/entity.d.ts.map +1 -1
  70. package/dist/types/onion/model.d.ts.map +1 -1
  71. package/dist/types/relations.d.ts.map +1 -1
  72. package/dist/types/relationsAggr.d.ts +1 -1
  73. package/dist/types/relationsAggr.d.ts.map +1 -1
  74. package/dist/types/relationsColumns.d.ts.map +1 -1
  75. package/dist/types/relationsDef.d.ts.map +1 -1
  76. package/dist/types/relationsDefDynamic.d.ts.map +1 -1
  77. package/dist/types/relationsDefMutate.d.ts.map +1 -1
  78. package/dist/types/relationsGroup.d.ts.map +1 -1
  79. package/dist/types/relationsMutate.d.ts.map +1 -1
  80. package/dist/types/relationsTables.d.ts.map +1 -1
  81. package/dist/types/transaction.d.ts.map +1 -1
  82. package/dist-cli/entity/metadata/generate.js +4 -1
  83. package/dist-cli/model/metadata/generate.js +4 -2
  84. package/package.json +1 -1
  85. package/src/.metadata/locales.ts +6 -1
  86. package/src/bean/aopMethod.transaction.ts +9 -2
  87. package/src/bean/bean.database.ts +33 -8
  88. package/src/bean/bean.databaseDialectBase.ts +50 -15
  89. package/src/bean/bean.model/bean.model_cache.ts +130 -46
  90. package/src/bean/bean.model/bean.model_crud.ts +28 -7
  91. package/src/bean/bean.model/bean.model_crud_inner.ts +48 -16
  92. package/src/bean/bean.model/bean.model_crud_table.ts +25 -5
  93. package/src/bean/bean.model/bean.model_knex.ts +18 -5
  94. package/src/bean/bean.model/bean.model_meta.ts +23 -5
  95. package/src/bean/bean.model/bean.model_utils.ts +63 -12
  96. package/src/bean/bean.model/bean.model_view.ts +20 -5
  97. package/src/bean/event.clientNameReal.ts +4 -1
  98. package/src/bean/event.columnsClear.ts +4 -1
  99. package/src/bean/queue.doubleDelete.ts +9 -2
  100. package/src/bean/schedule.softDeletionPrune.ts +3 -1
  101. package/src/common/buildWhere.ts +30 -5
  102. package/src/common/utils.ts +6 -2
  103. package/src/config/config.ts +3 -0
  104. package/src/extend/schemaBuilder.ts +2 -1
  105. package/src/extend/tableBuilder.ts +32 -19
  106. package/src/lib/const.ts +3 -1
  107. package/src/lib/databaseDialect.ts +3 -1
  108. package/src/lib/dto/dtoAggregate.ts +18 -6
  109. package/src/lib/dto/dtoCreate.ts +24 -4
  110. package/src/lib/dto/dtoGet.ts +82 -17
  111. package/src/lib/dto/dtoGroup.ts +24 -8
  112. package/src/lib/dto/dtoListAndCount.ts +3 -1
  113. package/src/lib/dto/dtoMutate.ts +26 -7
  114. package/src/lib/dto/dtoQueryPage.ts +4 -1
  115. package/src/lib/dto/dtoSelectAndCount.ts +3 -1
  116. package/src/lib/dto/dtoUpdate.ts +24 -4
  117. package/src/lib/entity.ts +10 -4
  118. package/src/lib/modelCacheBase.ts +9 -3
  119. package/src/lib/relations.ts +22 -4
  120. package/src/lib/relationsDynamic.ts +29 -7
  121. package/src/lib/relationsMutate.ts +28 -5
  122. package/src/lib/relationsStatic.ts +4 -1
  123. package/src/lib/utils.ts +11 -2
  124. package/src/main.ts +10 -2
  125. package/src/service/columnsCache_.ts +8 -6
  126. package/src/service/database.ts +34 -10
  127. package/src/service/databaseClient_.ts +4 -1
  128. package/src/service/relations_.ts +98 -23
  129. package/src/service/transaction_.ts +14 -4
  130. package/src/types/dto/dtoGet.ts +14 -6
  131. package/src/types/dto/dtoGroup.ts +2 -1
  132. package/src/types/dto/dtoMutate.ts +102 -20
  133. package/src/types/dto/dtoQueryBase.ts +5 -1
  134. package/src/types/dto/dtoSelectAndCount.ts +4 -1
  135. package/src/types/entity.ts +3 -1
  136. package/src/types/entityBase.ts +1 -1
  137. package/src/types/entityBaseInner.ts +4 -4
  138. package/src/types/entityBaseSimple.ts +1 -1
  139. package/src/types/model.ts +73 -16
  140. package/src/types/modelAggr.ts +18 -6
  141. package/src/types/modelCount.ts +4 -1
  142. package/src/types/modelGeneral.ts +26 -5
  143. package/src/types/modelGroup.ts +8 -2
  144. package/src/types/modelIncrement.ts +4 -1
  145. package/src/types/modelWhere.ts +12 -3
  146. package/src/types/onion/entity.ts +2 -2
  147. package/src/types/onion/model.ts +20 -4
  148. package/src/types/relations.ts +151 -47
  149. package/src/types/relationsAggr.ts +35 -11
  150. package/src/types/relationsColumns.ts +80 -57
  151. package/src/types/relationsDef.ts +82 -29
  152. package/src/types/relationsDefDynamic.ts +59 -13
  153. package/src/types/relationsDefMutate.ts +3 -1
  154. package/src/types/relationsGroup.ts +32 -10
  155. package/src/types/relationsMutate.ts +60 -19
  156. package/src/types/relationsTables.ts +16 -14
  157. package/src/types/transaction.ts +14 -2
@@ -2,7 +2,10 @@ import type { BeanModelMeta } from '../../bean/bean.model/bean.model_meta.ts';
2
2
  import type { IModelClassRecord } from '../onion/model.ts';
3
3
  import type { TypeDtoGetResult } from './dtoGet.ts';
4
4
 
5
- export interface TypeDtoSelectAndCountResult<ModelLike extends BeanModelMeta | keyof IModelClassRecord, TOptionsRelation> {
5
+ export interface TypeDtoSelectAndCountResult<
6
+ ModelLike extends BeanModelMeta | keyof IModelClassRecord,
7
+ TOptionsRelation,
8
+ > {
6
9
  list: TypeDtoGetResult<ModelLike, TOptionsRelation>[];
7
10
  total: string;
8
11
  pageCount: number;
@@ -12,4 +12,6 @@ export const SymbolKeyFieldsMore = Symbol('$fieldsMore');
12
12
  export type TypeSymbolKeyFieldsMore = typeof SymbolKeyFieldsMore;
13
13
 
14
14
  export type TypeEntityStudentMetaSimple<T> = Omit<T, '$table' | '$comment' | '$default'>;
15
- export type TypeEntityStudentMetaSimpleColumns<T> = PickString<keyof TypeEntityStudentMetaSimple<T>>;
15
+ export type TypeEntityStudentMetaSimpleColumns<T> = PickString<
16
+ keyof TypeEntityStudentMetaSimple<T>
17
+ >;
@@ -6,6 +6,6 @@ import { $locale } from '../.metadata/locales.ts';
6
6
  import { EntityBaseInner } from './entityBaseInner.ts';
7
7
 
8
8
  export class EntityBase extends EntityBaseInner {
9
- @Api.field(v.order(1, 'core'), v.title($locale('TableIdentity')), v.tableIdentity())
9
+ @Api.field(v.title($locale('TableIdentity')), v.tableIdentity())
10
10
  id: TableIdentity;
11
11
  }
@@ -4,15 +4,15 @@ import { $locale } from '../.metadata/locales.ts';
4
4
  import { EntityBaseEmpty } from './entityBaseEmpty.ts';
5
5
 
6
6
  export class EntityBaseInner extends EntityBaseEmpty {
7
- @Api.field(v.title($locale('CreatedAt')), v.order(-2, 'max'), v.filterDateRange(), v.component('date'))
7
+ @Api.field(v.title($locale('CreatedAt')))
8
8
  createdAt: Date;
9
9
 
10
- @Api.field(v.title($locale('UpdatedAt')), v.order(-1, 'max'), v.filterDateRange(), v.component('date'))
10
+ @Api.field(v.title($locale('UpdatedAt')))
11
11
  updatedAt: Date;
12
12
 
13
- @Api.field(v.title($locale('Deleted')), v.visible(false), v.default(false))
13
+ @Api.field(v.title($locale('Deleted')), v.default(false))
14
14
  deleted: boolean;
15
15
 
16
- @Api.field(v.title($locale('InstanceId')), v.visible(false), v.default(0))
16
+ @Api.field(v.title($locale('InstanceId')), v.default(0))
17
17
  iid: number;
18
18
  }
@@ -4,6 +4,6 @@ import { $locale } from '../.metadata/locales.ts';
4
4
  import { EntityBaseInner } from './entityBaseInner.ts';
5
5
 
6
6
  export class EntityBaseSimple extends EntityBaseInner {
7
- @Api.field(v.order(1, 'core'), v.title($locale('TableIdentity')))
7
+ @Api.field(v.title($locale('TableIdentity')))
8
8
  id: number;
9
9
  }
@@ -2,9 +2,22 @@ import type { Knex } from 'knex';
2
2
  import type { TSummerCacheActionOptions } from 'vona-module-a-summer';
3
3
 
4
4
  import type { BeanModelMeta } from '../bean/bean.model/bean.model_meta.ts';
5
- import type { TypeModelColumn, TypeModelColumns, TypeModelColumnsPatch, TypeModelWhere } from './modelWhere.ts';
6
- import type { TypeModelOfModelLike, TypeModelParamsInclude, TypeModelsClassLikeGeneral, TypeSymbolKeyEntity } from './relations.ts';
7
- import type { TypeEntityTableColumnNamesOfGeneral, TypeEntityTableColumnsOfGeneral } from './relationsColumns.ts';
5
+ import type {
6
+ TypeModelColumn,
7
+ TypeModelColumns,
8
+ TypeModelColumnsPatch,
9
+ TypeModelWhere,
10
+ } from './modelWhere.ts';
11
+ import type {
12
+ TypeModelOfModelLike,
13
+ TypeModelParamsInclude,
14
+ TypeModelsClassLikeGeneral,
15
+ TypeSymbolKeyEntity,
16
+ } from './relations.ts';
17
+ import type {
18
+ TypeEntityTableColumnNamesOfGeneral,
19
+ TypeEntityTableColumnsOfGeneral,
20
+ } from './relationsColumns.ts';
8
21
  import type { TypeModelMutateParamsInclude } from './relationsMutate.ts';
9
22
  import type { TypeEntityTableNamesOfGeneral } from './relationsTables.ts';
10
23
 
@@ -30,7 +43,11 @@ export type IModelSelectParamsJoin<TRecord, TableNames = undefined, ColumnNames
30
43
  // order
31
44
  export type IModelSelectParamsOrderDirection = 'asc' | 'desc';
32
45
  export type IModelSelectParamsOrderNulls = 'first' | 'last';
33
- export type IModelSelectParamsOrder<ColumnNames> = [ColumnNames, IModelSelectParamsOrderDirection?, IModelSelectParamsOrderNulls?];
46
+ export type IModelSelectParamsOrder<ColumnNames> = [
47
+ ColumnNames,
48
+ IModelSelectParamsOrderDirection?,
49
+ IModelSelectParamsOrderNulls?,
50
+ ];
34
51
 
35
52
  export interface IBuildModelSelectParams<
36
53
  TRecord,
@@ -39,7 +56,15 @@ export interface IBuildModelSelectParams<
39
56
  ColumnNames = keyof TRecord,
40
57
  Columns extends {} | undefined = undefined,
41
58
  >
42
- extends IModelRelationIncludeWrapper<Model>, IBuildModelSelectParamsBasic<TRecord, TypeModelColumn<TRecord>, TableNames, ColumnNames, Columns> {}
59
+ extends
60
+ IModelRelationIncludeWrapper<Model>,
61
+ IBuildModelSelectParamsBasic<
62
+ TRecord,
63
+ TypeModelColumn<TRecord>,
64
+ TableNames,
65
+ ColumnNames,
66
+ Columns
67
+ > {}
43
68
 
44
69
  export interface IBuildModelSelectParamsBasic<
45
70
  TRecord,
@@ -101,11 +126,26 @@ export type IModelCountParams<
101
126
  >;
102
127
 
103
128
  export type IModelMethodOptions = IModelMethodOptionsGeneral;
104
- export type IModelInsertOptions<TRecord, Model extends BeanModelMeta | undefined = undefined> = IModelInsertOptionsGeneral<TRecord, Model>;
105
- export type IModelUpdateOptions<TRecord, Model extends BeanModelMeta | undefined = undefined> = IModelUpdateOptionsGeneral<TRecord, Model>;
106
- export type IModelDeleteOptions<TRecord, Model extends BeanModelMeta | undefined = undefined> = IModelDeleteOptionsGeneral<TRecord, Model>;
107
- export type IModelGetOptions<TRecord, Model extends BeanModelMeta | undefined = undefined> = IModelGetOptionsGeneral<TRecord, Model>;
108
- export type IModelMutateOptions<TRecord, Model extends BeanModelMeta | undefined = undefined> = IModelMutateOptionsGeneral<TRecord, Model>;
129
+ export type IModelInsertOptions<
130
+ TRecord,
131
+ Model extends BeanModelMeta | undefined = undefined,
132
+ > = IModelInsertOptionsGeneral<TRecord, Model>;
133
+ export type IModelUpdateOptions<
134
+ TRecord,
135
+ Model extends BeanModelMeta | undefined = undefined,
136
+ > = IModelUpdateOptionsGeneral<TRecord, Model>;
137
+ export type IModelDeleteOptions<
138
+ TRecord,
139
+ Model extends BeanModelMeta | undefined = undefined,
140
+ > = IModelDeleteOptionsGeneral<TRecord, Model>;
141
+ export type IModelGetOptions<
142
+ TRecord,
143
+ Model extends BeanModelMeta | undefined = undefined,
144
+ > = IModelGetOptionsGeneral<TRecord, Model>;
145
+ export type IModelMutateOptions<
146
+ TRecord,
147
+ Model extends BeanModelMeta | undefined = undefined,
148
+ > = IModelMutateOptionsGeneral<TRecord, Model>;
109
149
 
110
150
  export interface IModelMethodOptionsGeneral {
111
151
  disableDeleted?: boolean;
@@ -117,23 +157,38 @@ export interface IModelMethodOptionsGeneral {
117
157
  cache?: TSummerCacheActionOptions<unknown, unknown>;
118
158
  }
119
159
 
120
- export interface IModelInsertOptionsGeneral<_TRecord, Model extends BeanModelMeta | undefined = undefined>
160
+ export interface IModelInsertOptionsGeneral<
161
+ _TRecord,
162
+ Model extends BeanModelMeta | undefined = undefined,
163
+ >
121
164
  extends IModelMethodOptionsGeneral, IModelMutateRelationIncludeWrapper<Model> {}
122
165
 
123
- export interface IModelUpdateOptionsGeneral<TRecord, Model extends BeanModelMeta | undefined = undefined>
166
+ export interface IModelUpdateOptionsGeneral<
167
+ TRecord,
168
+ Model extends BeanModelMeta | undefined = undefined,
169
+ >
124
170
  extends IModelMethodOptionsGeneral, IModelMutateRelationIncludeWrapper<Model> {
125
171
  where?: TypeModelWhere<TRecord>;
126
172
  }
127
173
 
128
- export interface IModelDeleteOptionsGeneral<_TRecord, Model extends BeanModelMeta | undefined = undefined>
174
+ export interface IModelDeleteOptionsGeneral<
175
+ _TRecord,
176
+ Model extends BeanModelMeta | undefined = undefined,
177
+ >
129
178
  extends IModelMethodOptionsGeneral, IModelMutateRelationIncludeWrapper<Model> {}
130
179
 
131
- export interface IModelGetOptionsGeneral<TRecord, Model extends BeanModelMeta | undefined = undefined>
180
+ export interface IModelGetOptionsGeneral<
181
+ TRecord,
182
+ Model extends BeanModelMeta | undefined = undefined,
183
+ >
132
184
  extends IModelMethodOptionsGeneral, IModelRelationIncludeWrapper<Model> {
133
185
  columns?: TypeModelColumns<TRecord>;
134
186
  }
135
187
 
136
- export interface IModelMutateOptionsGeneral<_TRecord, Model extends BeanModelMeta | undefined = undefined>
188
+ export interface IModelMutateOptionsGeneral<
189
+ _TRecord,
190
+ Model extends BeanModelMeta | undefined = undefined,
191
+ >
137
192
  extends IModelMethodOptionsGeneral, IModelMutateRelationIncludeWrapper<Model> {}
138
193
 
139
194
  export interface IModelSelectParamsPage {
@@ -146,7 +201,9 @@ export interface IModelRelationIncludeWrapper<Model extends BeanModelMeta | unde
146
201
  with?: Record<string, unknown>;
147
202
  }
148
203
 
149
- export interface IModelMutateRelationIncludeWrapper<Model extends BeanModelMeta | undefined = undefined> {
204
+ export interface IModelMutateRelationIncludeWrapper<
205
+ Model extends BeanModelMeta | undefined = undefined,
206
+ > {
150
207
  include?: TypeModelMutateParamsInclude<Model>;
151
208
  with?: Record<string, unknown>;
152
209
  }
@@ -4,7 +4,10 @@ import type { BeanModelMeta } from '../bean/bean.model/bean.model_meta.ts';
4
4
  import type { IModelSelectParamsJoin } from './model.ts';
5
5
  import type { TypeModelColumns, TypeModelWhere } from './modelWhere.ts';
6
6
  import type { TypeModelsClassLikeGeneral } from './relations.ts';
7
- import type { TypeEntityTableColumnNamesOfGeneral, TypeEntityTableColumnsOfGeneral } from './relationsColumns.ts';
7
+ import type {
8
+ TypeEntityTableColumnNamesOfGeneral,
9
+ TypeEntityTableColumnsOfGeneral,
10
+ } from './relationsColumns.ts';
8
11
  import type { TypeEntityTableNamesOfGeneral } from './relationsTables.ts';
9
12
 
10
13
  // export interface TypeModelSelectAggrParamsAggrs<TRecord> {
@@ -17,13 +20,22 @@ import type { TypeEntityTableNamesOfGeneral } from './relationsTables.ts';
17
20
 
18
21
  export interface TypeModelSelectAggrParamsAggrs<TRecord> {
19
22
  count?: TypeModelColumns<TRecord>;
20
- sum?: TypeEntityTableColumnNamesForAggrs<TRecord> | Array<TypeEntityTableColumnNamesForAggrs<TRecord>>;
21
- avg?: TypeEntityTableColumnNamesForAggrs<TRecord> | Array<TypeEntityTableColumnNamesForAggrs<TRecord>>;
22
- max?: TypeEntityTableColumnNamesForAggrs<TRecord> | Array<TypeEntityTableColumnNamesForAggrs<TRecord>>;
23
- min?: TypeEntityTableColumnNamesForAggrs<TRecord> | Array<TypeEntityTableColumnNamesForAggrs<TRecord>>;
23
+ sum?:
24
+ | TypeEntityTableColumnNamesForAggrs<TRecord>
25
+ | Array<TypeEntityTableColumnNamesForAggrs<TRecord>>;
26
+ avg?:
27
+ | TypeEntityTableColumnNamesForAggrs<TRecord>
28
+ | Array<TypeEntityTableColumnNamesForAggrs<TRecord>>;
29
+ max?:
30
+ | TypeEntityTableColumnNamesForAggrs<TRecord>
31
+ | Array<TypeEntityTableColumnNamesForAggrs<TRecord>>;
32
+ min?:
33
+ | TypeEntityTableColumnNamesForAggrs<TRecord>
34
+ | Array<TypeEntityTableColumnNamesForAggrs<TRecord>>;
24
35
  }
25
36
 
26
- export type TypeEntityTableColumnNamesForAggrs<Entity> = keyof TypeEntityTableColumnsForAggrs<Entity>;
37
+ export type TypeEntityTableColumnNamesForAggrs<Entity> =
38
+ keyof TypeEntityTableColumnsForAggrs<Entity>;
27
39
 
28
40
  export type TypeEntityTableColumnsForAggrs<Entity> = OmitNever<
29
41
  Omit<
@@ -2,7 +2,10 @@ import type { BeanModelMeta } from '../bean/bean.model/bean.model_meta.ts';
2
2
  import type { IModelSelectParamsJoin } from './model.ts';
3
3
  import type { TypeModelColumn, TypeModelWhere } from './modelWhere.ts';
4
4
  import type { TypeModelsClassLikeGeneral } from './relations.ts';
5
- import type { TypeEntityTableColumnNamesOfGeneral, TypeEntityTableColumnsOfGeneral } from './relationsColumns.ts';
5
+ import type {
6
+ TypeEntityTableColumnNamesOfGeneral,
7
+ TypeEntityTableColumnsOfGeneral,
8
+ } from './relationsColumns.ts';
6
9
  import type { TypeEntityTableNamesOfGeneral } from './relationsTables.ts';
7
10
 
8
11
  export interface IBuildModelSelectCountParams<
@@ -1,10 +1,25 @@
1
1
  import type { BeanModelMeta } from '../bean/bean.model/bean.model_meta.ts';
2
- import type { IModelRelationIncludeWrapper, IModelSelectParamsJoin, IModelSelectParamsOrder } from './model.ts';
2
+ import type {
3
+ IModelRelationIncludeWrapper,
4
+ IModelSelectParamsJoin,
5
+ IModelSelectParamsOrder,
6
+ } from './model.ts';
3
7
  import type { TypeModelSelectAggrParamsAggrs } from './modelAggr.ts';
4
- import type { TypeModelColumn, TypeModelColumnsPatch, TypeModelColumnsStrict, TypeModelWhere } from './modelWhere.ts';
8
+ import type {
9
+ TypeModelColumn,
10
+ TypeModelColumnsPatch,
11
+ TypeModelColumnsStrict,
12
+ TypeModelWhere,
13
+ } from './modelWhere.ts';
5
14
  import type { TypeModelsClassLikeGeneral } from './relations.ts';
6
- import type { TypeEntityTableColumnNamesOfGeneral, TypeEntityTableColumnsOfGeneral } from './relationsColumns.ts';
7
- import type { TypeModelSelectGroupParamsColumnNames, TypeModelSelectGroupParamsColumns } from './relationsGroup.ts';
15
+ import type {
16
+ TypeEntityTableColumnNamesOfGeneral,
17
+ TypeEntityTableColumnsOfGeneral,
18
+ } from './relationsColumns.ts';
19
+ import type {
20
+ TypeModelSelectGroupParamsColumnNames,
21
+ TypeModelSelectGroupParamsColumns,
22
+ } from './relationsGroup.ts';
8
23
  import type { TypeEntityTableNamesOfGeneral } from './relationsTables.ts';
9
24
 
10
25
  export interface IBuildModelSelectGeneralParams<
@@ -16,7 +31,13 @@ export interface IBuildModelSelectGeneralParams<
16
31
  >
17
32
  extends
18
33
  IModelRelationIncludeWrapper<Model>,
19
- IBuildModelSelectGeneralParamsBasic<TRecord, TypeModelColumn<TRecord>, TableNames, ColumnNames, Columns> {}
34
+ IBuildModelSelectGeneralParamsBasic<
35
+ TRecord,
36
+ TypeModelColumn<TRecord>,
37
+ TableNames,
38
+ ColumnNames,
39
+ Columns
40
+ > {}
20
41
 
21
42
  export interface IBuildModelSelectGeneralParamsBasic<
22
43
  TRecord,
@@ -3,8 +3,14 @@ import type { IModelSelectParamsJoin, IModelSelectParamsOrder } from './model.ts
3
3
  import type { TypeModelSelectAggrParamsAggrs } from './modelAggr.ts';
4
4
  import type { TypeModelColumnsStrict, TypeModelWhere } from './modelWhere.ts';
5
5
  import type { TypeModelsClassLikeGeneral } from './relations.ts';
6
- import type { TypeEntityTableColumnNamesOfGeneral, TypeEntityTableColumnsOfGeneral } from './relationsColumns.ts';
7
- import type { TypeModelSelectGroupParamsColumnNames, TypeModelSelectGroupParamsColumns } from './relationsGroup.ts';
6
+ import type {
7
+ TypeEntityTableColumnNamesOfGeneral,
8
+ TypeEntityTableColumnsOfGeneral,
9
+ } from './relationsColumns.ts';
10
+ import type {
11
+ TypeModelSelectGroupParamsColumnNames,
12
+ TypeModelSelectGroupParamsColumns,
13
+ } from './relationsGroup.ts';
8
14
  import type { TypeEntityTableNamesOfGeneral } from './relationsTables.ts';
9
15
 
10
16
  export interface IBuildModelSelectGroupParams<
@@ -4,7 +4,10 @@ import type { BeanModelMeta } from '../bean/bean.model/bean.model_meta.ts';
4
4
  import type { IModelSelectParamsJoin } from './model.ts';
5
5
  import type { TypeModelWhere } from './modelWhere.ts';
6
6
  import type { TypeModelsClassLikeGeneral } from './relations.ts';
7
- import type { TypeEntityTableColumnNamesOfGeneral, TypeEntityTableColumnsOfGeneral } from './relationsColumns.ts';
7
+ import type {
8
+ TypeEntityTableColumnNamesOfGeneral,
9
+ TypeEntityTableColumnsOfGeneral,
10
+ } from './relationsColumns.ts';
8
11
  import type { TypeEntityTableNamesOfGeneral } from './relationsTables.ts';
9
12
 
10
13
  export type TypeModelIncrementParamsColumns<Entity> = OmitNever<
@@ -52,7 +52,12 @@ export type TypeOpsNormal = TypeRecordValues<typeof OpNormal>;
52
52
  export type TypeOpsAll = TypeRecordValues<typeof Op>;
53
53
 
54
54
  // not use Knex.Raw
55
- export type TypeModelColumnValue<TRecord, Column> = keyof TRecord | Column | Column[] | null | '_skip_';
55
+ export type TypeModelColumnValue<TRecord, Column> =
56
+ | keyof TRecord
57
+ | Column
58
+ | Column[]
59
+ | null
60
+ | '_skip_';
56
61
 
57
62
  export type TypeModelWhere<TRecord, Columns extends {} | undefined = undefined> = Columns extends {}
58
63
  ? TypeModelWhereInner<Columns>
@@ -61,7 +66,9 @@ export type TypeModelWhere<TRecord, Columns extends {} | undefined = undefined>
61
66
  // Columns extends {} ? TypeModelWhereInner<Columns> | Knex.Raw : TypeModelWhereInner<TRecord> | Knex.Raw;
62
67
 
63
68
  export type TypeModelWhereInner<TRecord> = {
64
- [prop in keyof TRecord]?: TypeModelColumnValue<TRecord, TRecord[prop]> | TypeModelWhereFieldAll<TRecord, TRecord[prop]>;
69
+ [prop in keyof TRecord]?:
70
+ | TypeModelColumnValue<TRecord, TRecord[prop]>
71
+ | TypeModelWhereFieldAll<TRecord, TRecord[prop]>;
65
72
  } & {
66
73
  [key in TypeOpsJoint]?: TypeModelWhereInner<TRecord>;
67
74
  };
@@ -78,7 +85,9 @@ export type TypeModelWhereFieldJoint<TRecord, Column> = {
78
85
 
79
86
  export type TypeModelColumn<TRecord> = keyof TRecord | '*';
80
87
  export type TypeModelColumns<TRecord> = TypeModelColumn<TRecord> | Array<TypeModelColumn<TRecord>>;
81
- export type TypeModelColumnPatch<TRecord, TColumn> = TColumn extends '*' ? TypeModelColumn<TRecord> : TColumn;
88
+ export type TypeModelColumnPatch<TRecord, TColumn> = TColumn extends '*'
89
+ ? TypeModelColumn<TRecord>
90
+ : TColumn;
82
91
  export type TypeModelColumnsPatch<TRecord, TColumn> = [TColumn] extends [string]
83
92
  ? TypeModelColumnPatch<TRecord, TColumn> | Array<TypeModelColumnPatch<TRecord, TColumn>>
84
93
  : TColumn;
@@ -1,6 +1,6 @@
1
1
  import type { OmitNever } from 'vona';
2
2
  import type { ServiceOnion } from 'vona-module-a-onion';
3
- import type { TypeOpenapiMetadata } from 'vona-module-a-openapi';
3
+ import type { ISchemaObjectExtensionField } from 'vona-module-a-openapi';
4
4
  import type { SchemaLike } from 'vona-module-a-openapiutils';
5
5
 
6
6
  import type { SymbolKeyFieldsMore } from '../entity.ts';
@@ -12,7 +12,7 @@ export interface IDecoratorEntityOptions<FieldsMore = never> {
12
12
  [SymbolKeyFieldsMore]?: FieldsMore;
13
13
  table?: keyof ITableRecord;
14
14
  independent?: boolean;
15
- openapi?: TypeOpenapiMetadata;
15
+ openapi?: ISchemaObjectExtensionField;
16
16
  pipes?: SchemaLike | SchemaLike[];
17
17
  }
18
18
 
@@ -11,13 +11,29 @@ import type { ITableRecord } from './table.ts';
11
11
  export interface IModelRecord {}
12
12
  export interface IModelClassRecord {}
13
13
 
14
- export type TypeDynamicTableName = (ctx: VonaContext, where: any | undefined, defaultTable: keyof ITableRecord, modelInstance: any) => string;
14
+ export type TypeDynamicTableName = (
15
+ ctx: VonaContext,
16
+ where: any | undefined,
17
+ defaultTable: keyof ITableRecord,
18
+ modelInstance: any,
19
+ ) => string;
15
20
 
16
- export type TypeDynamicClientName = (ctx: VonaContext, modelInstance: any) => keyof IDatabaseClientRecord;
21
+ export type TypeDynamicClientName = (
22
+ ctx: VonaContext,
23
+ modelInstance: any,
24
+ ) => keyof IDatabaseClientRecord;
17
25
 
18
- export type TypeModelsClearedByFn = (ctx: VonaContext, modelTarget: any, modelSource: any) => Promise<void>;
26
+ export type TypeModelsClearedByFn = (
27
+ ctx: VonaContext,
28
+ modelTarget: any,
29
+ modelSource: any,
30
+ ) => Promise<void>;
19
31
 
20
- export type TypeSoftDeletionPruneHandler = (ctx: VonaContext, modelInstance: any, options: ISoftDeletionPruneHandlerOptions) => Promise<void>;
32
+ export type TypeSoftDeletionPruneHandler = (
33
+ ctx: VonaContext,
34
+ modelInstance: any,
35
+ options: ISoftDeletionPruneHandlerOptions,
36
+ ) => Promise<void>;
21
37
 
22
38
  export interface ISoftDeletionPruneHandlerOptions {
23
39
  expired: number;