vona-module-a-orm 5.0.56 → 5.0.58
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/dist/.metadata/index.d.ts +21 -0
- package/dist/bean/bean.model/bean.model_meta.d.ts +5 -5
- package/dist/bean/broadcast.databaseClientDispose.d.ts +9 -0
- package/dist/bean/event.databaseClientDispose.d.ts +8 -0
- package/dist/bean/queue.doubleDelete.d.ts +1 -1
- package/dist/index.js +249 -200
- package/dist/service/database.d.ts +5 -1
- package/dist/service/databaseClient_.d.ts +2 -2
- package/dist/types/onion/model.d.ts +3 -2
- package/dist/types/relationsDef.d.ts +2 -3
- package/package.json +1 -1
|
@@ -86,11 +86,13 @@ declare module 'vona' {
|
|
|
86
86
|
/** service: end */
|
|
87
87
|
/** broadcast: begin */
|
|
88
88
|
export * from '../bean/broadcast.columnsClear.ts';
|
|
89
|
+
export * from '../bean/broadcast.databaseClientDispose.ts';
|
|
89
90
|
export * from '../bean/broadcast.databaseClientReload.ts';
|
|
90
91
|
import { type IDecoratorBroadcastOptions } from 'vona-module-a-broadcast';
|
|
91
92
|
declare module 'vona-module-a-broadcast' {
|
|
92
93
|
interface IBroadcastRecord {
|
|
93
94
|
'a-orm:columnsClear': IDecoratorBroadcastOptions;
|
|
95
|
+
'a-orm:databaseClientDispose': IDecoratorBroadcastOptions;
|
|
94
96
|
'a-orm:databaseClientReload': IDecoratorBroadcastOptions;
|
|
95
97
|
}
|
|
96
98
|
}
|
|
@@ -101,6 +103,12 @@ declare module 'vona-module-a-orm' {
|
|
|
101
103
|
get $beanFullName(): 'a-orm.broadcast.columnsClear';
|
|
102
104
|
get $onionName(): 'a-orm:columnsClear';
|
|
103
105
|
}
|
|
106
|
+
interface BroadcastDatabaseClientDispose {
|
|
107
|
+
}
|
|
108
|
+
interface BroadcastDatabaseClientDispose {
|
|
109
|
+
get $beanFullName(): 'a-orm.broadcast.databaseClientDispose';
|
|
110
|
+
get $onionName(): 'a-orm:databaseClientDispose';
|
|
111
|
+
}
|
|
104
112
|
interface BroadcastDatabaseClientReload {
|
|
105
113
|
}
|
|
106
114
|
interface BroadcastDatabaseClientReload {
|
|
@@ -111,15 +119,18 @@ declare module 'vona-module-a-orm' {
|
|
|
111
119
|
/** broadcast: end */
|
|
112
120
|
/** broadcast: begin */
|
|
113
121
|
import type { BroadcastColumnsClear } from '../bean/broadcast.columnsClear.ts';
|
|
122
|
+
import type { BroadcastDatabaseClientDispose } from '../bean/broadcast.databaseClientDispose.ts';
|
|
114
123
|
import type { BroadcastDatabaseClientReload } from '../bean/broadcast.databaseClientReload.ts';
|
|
115
124
|
export interface IModuleBroadcast {
|
|
116
125
|
'columnsClear': BroadcastColumnsClear;
|
|
126
|
+
'databaseClientDispose': BroadcastDatabaseClientDispose;
|
|
117
127
|
'databaseClientReload': BroadcastDatabaseClientReload;
|
|
118
128
|
}
|
|
119
129
|
/** broadcast: end */
|
|
120
130
|
/** event: begin */
|
|
121
131
|
export * from '../bean/event.clientNameReal.ts';
|
|
122
132
|
export * from '../bean/event.columnsClear.ts';
|
|
133
|
+
export * from '../bean/event.databaseClientDispose.ts';
|
|
123
134
|
export * from '../bean/event.databaseClientReload.ts';
|
|
124
135
|
import 'vona';
|
|
125
136
|
declare module 'vona' {
|
|
@@ -137,6 +148,12 @@ declare module 'vona-module-a-orm' {
|
|
|
137
148
|
get $beanFullName(): 'a-orm.event.columnsClear';
|
|
138
149
|
get $onionName(): 'a-orm:columnsClear';
|
|
139
150
|
}
|
|
151
|
+
interface EventDatabaseClientDispose {
|
|
152
|
+
}
|
|
153
|
+
interface EventDatabaseClientDispose {
|
|
154
|
+
get $beanFullName(): 'a-orm.event.databaseClientDispose';
|
|
155
|
+
get $onionName(): 'a-orm:databaseClientDispose';
|
|
156
|
+
}
|
|
140
157
|
interface EventDatabaseClientReload {
|
|
141
158
|
}
|
|
142
159
|
interface EventDatabaseClientReload {
|
|
@@ -148,22 +165,26 @@ declare module 'vona-module-a-orm' {
|
|
|
148
165
|
/** event: begin */
|
|
149
166
|
import type { EventClientNameReal } from '../bean/event.clientNameReal.ts';
|
|
150
167
|
import type { EventColumnsClear } from '../bean/event.columnsClear.ts';
|
|
168
|
+
import type { EventDatabaseClientDispose } from '../bean/event.databaseClientDispose.ts';
|
|
151
169
|
import type { EventDatabaseClientReload } from '../bean/event.databaseClientReload.ts';
|
|
152
170
|
export interface IModuleEvent {
|
|
153
171
|
'clientNameReal': EventClientNameReal;
|
|
154
172
|
'columnsClear': EventColumnsClear;
|
|
173
|
+
'databaseClientDispose': EventDatabaseClientDispose;
|
|
155
174
|
'databaseClientReload': EventDatabaseClientReload;
|
|
156
175
|
}
|
|
157
176
|
/** event: end */
|
|
158
177
|
/** event: begin */
|
|
159
178
|
import type { TypeEventClientNameRealData, TypeEventClientNameRealResult } from '../bean/event.clientNameReal.ts';
|
|
160
179
|
import type { TypeEventColumnsClearData, TypeEventColumnsClearResult } from '../bean/event.columnsClear.ts';
|
|
180
|
+
import type { TypeEventDatabaseClientDisposeData, TypeEventDatabaseClientDisposeResult } from '../bean/event.databaseClientDispose.ts';
|
|
161
181
|
import type { TypeEventDatabaseClientReloadData, TypeEventDatabaseClientReloadResult } from '../bean/event.databaseClientReload.ts';
|
|
162
182
|
import type { EventOn } from 'vona-module-a-event';
|
|
163
183
|
declare module 'vona-module-a-event' {
|
|
164
184
|
interface IEventRecord {
|
|
165
185
|
'a-orm:clientNameReal': EventOn<TypeEventClientNameRealData, TypeEventClientNameRealResult>;
|
|
166
186
|
'a-orm:columnsClear': EventOn<TypeEventColumnsClearData, TypeEventColumnsClearResult>;
|
|
187
|
+
'a-orm:databaseClientDispose': EventOn<TypeEventDatabaseClientDisposeData, TypeEventDatabaseClientDisposeResult>;
|
|
167
188
|
'a-orm:databaseClientReload': EventOn<TypeEventDatabaseClientReloadData, TypeEventDatabaseClientReloadResult>;
|
|
168
189
|
}
|
|
169
190
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServiceDb } from '../../service/db_.ts';
|
|
2
|
-
import type { IDatabaseClientRecord, IDecoratorModelOptions, IModelClassRecord, IModelMethodOptionsGeneral, IModelUpdateOptionsGeneral, ITableRecord, TypeEntityMeta, TypeModelClassLike, TypeModelRelationOptionsMetaClient } from '../../types/index.ts';
|
|
2
|
+
import type { IDatabaseClientRecord, IDecoratorModelOptions, IModelClassRecord, IModelMethodOptionsGeneral, IModelUpdateOptionsGeneral, ITableRecord, TypeEntityMeta, TypeModelClassLike, TypeModelOptionsTable, TypeModelRelationOptionsMetaClient } from '../../types/index.ts';
|
|
3
3
|
import type { BeanModel } from '../bean.model.ts';
|
|
4
4
|
import { BeanBase } from 'vona';
|
|
5
5
|
import { SymbolKeyEntity, SymbolKeyEntityMeta, SymbolKeyModelOptions } from '../../types/index.ts';
|
|
@@ -11,7 +11,7 @@ export declare class BeanModelMeta<TRecord extends {} = {}> extends BeanBase {
|
|
|
11
11
|
[SymbolKeyModelOptions]: IDecoratorModelOptions;
|
|
12
12
|
private [SymbolModelDb]?;
|
|
13
13
|
private [SymbolModelTable]?;
|
|
14
|
-
protected __init__(clientName?: keyof IDatabaseClientRecord | ServiceDb, table?:
|
|
14
|
+
protected __init__(clientName?: keyof IDatabaseClientRecord | ServiceDb, table?: TypeModelOptionsTable): void;
|
|
15
15
|
protected get self(): BeanModel<any>;
|
|
16
16
|
protected get connection(): import("knex").Knex<any, any[]>;
|
|
17
17
|
protected get dialect(): import("vona-module-a-orm").BeanDatabaseDialectBase;
|
|
@@ -19,7 +19,7 @@ export declare class BeanModelMeta<TRecord extends {} = {}> extends BeanBase {
|
|
|
19
19
|
get modelViewRecord(): import("vona-module-a-version").ModelViewRecord;
|
|
20
20
|
get db(): ServiceDb;
|
|
21
21
|
private _getDb;
|
|
22
|
-
getTable(): keyof ITableRecord;
|
|
22
|
+
getTable(where: object | undefined): keyof ITableRecord;
|
|
23
23
|
private _getTable;
|
|
24
24
|
get options(): IDecoratorModelOptions;
|
|
25
25
|
get disableInstance(): boolean;
|
|
@@ -34,7 +34,7 @@ export declare class BeanModelMeta<TRecord extends {} = {}> extends BeanBase {
|
|
|
34
34
|
protected _checkDisableDeletedByOptions(options?: IModelMethodOptionsGeneral): boolean;
|
|
35
35
|
protected _checkDisableCreateTimeByOptions(options?: IModelUpdateOptionsGeneral<TRecord>): boolean;
|
|
36
36
|
protected _checkDisableUpdateTimeByOptions(options?: IModelUpdateOptionsGeneral<TRecord>): boolean;
|
|
37
|
-
newInstance(client?: keyof IDatabaseClientRecord | ServiceDb, table?:
|
|
38
|
-
newInstanceTarget<MODEL extends BeanModelMeta | (keyof IModelClassRecord)>(modelClassTarget: TypeModelClassLike<MODEL>, client?: TypeModelRelationOptionsMetaClient, table?:
|
|
37
|
+
newInstance(client?: keyof IDatabaseClientRecord | ServiceDb, table?: TypeModelOptionsTable): this;
|
|
38
|
+
newInstanceTarget<MODEL extends BeanModelMeta | (keyof IModelClassRecord)>(modelClassTarget: TypeModelClassLike<MODEL>, client?: TypeModelRelationOptionsMetaClient, table?: TypeModelOptionsTable): BeanModelMeta;
|
|
39
39
|
}
|
|
40
40
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IBroadcastExecute } from 'vona-module-a-broadcast';
|
|
2
|
+
import type { IDatabaseClientRecord } from '../types/database.ts';
|
|
3
|
+
import { BeanBroadcastBase } from 'vona-module-a-broadcast';
|
|
4
|
+
export interface TypeBroadcastDatabaseClientDisposeJobData {
|
|
5
|
+
clientName?: keyof IDatabaseClientRecord;
|
|
6
|
+
}
|
|
7
|
+
export declare class BroadcastDatabaseClientDispose extends BeanBroadcastBase<TypeBroadcastDatabaseClientDisposeJobData> implements IBroadcastExecute<TypeBroadcastDatabaseClientDisposeJobData> {
|
|
8
|
+
execute(data: TypeBroadcastDatabaseClientDisposeJobData, isEmitter?: boolean): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IDatabaseClientRecord } from '../types/database.ts';
|
|
2
|
+
import { BeanEventBase } from 'vona-module-a-event';
|
|
3
|
+
export interface TypeEventDatabaseClientDisposeData {
|
|
4
|
+
clientName: keyof IDatabaseClientRecord;
|
|
5
|
+
}
|
|
6
|
+
export type TypeEventDatabaseClientDisposeResult = void;
|
|
7
|
+
export declare class EventDatabaseClientDispose extends BeanEventBase<TypeEventDatabaseClientDisposeData, TypeEventDatabaseClientDisposeResult> {
|
|
8
|
+
}
|
|
@@ -5,7 +5,7 @@ import { BeanQueueBase } from 'vona-module-a-queue';
|
|
|
5
5
|
export interface TypeQueueDoubleDeleteJobData {
|
|
6
6
|
beanFullName: string;
|
|
7
7
|
clientName: keyof IDatabaseClientRecord;
|
|
8
|
-
table
|
|
8
|
+
table?: keyof ITableRecord;
|
|
9
9
|
method: 'cacheEntityDelInner' | 'cacheEntityClearInner' | 'cacheQueryClearInner';
|
|
10
10
|
args: any[];
|
|
11
11
|
}
|