@medyll/idae-db 0.2.0 → 0.3.0
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/IdaeDbAdapter.d.ts +12 -14
- package/dist/idaeDb.d.ts +1 -1
- package/package.json +1 -1
package/dist/IdaeDbAdapter.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DbType, type IdaeDbAdapterInterface, type IdaeDbParams } from './types.js';
|
|
2
2
|
import { IdaeDbConnection } from './IdaeDbConnection.js';
|
|
3
3
|
import { IdaeEventEmitter, type EventListeners } from './IdaeEventEmitter.js';
|
|
4
|
-
export type AdapterConstructor = new <T extends Document = Document>(collection: string, connection: IdaeDbConnection) => IdaeDbAdapterInterface<T>;
|
|
4
|
+
export type AdapterConstructor = new <T extends Document = Document>(collection: string, connection: IdaeDbConnection) => Omit<IdaeDbAdapterInterface<T>, 'connect' | 'getDb' | 'close'>;
|
|
5
5
|
export declare class IdaeDbAdapter<T extends Document> extends IdaeEventEmitter {
|
|
6
6
|
private dbType;
|
|
7
7
|
private adapter;
|
|
@@ -19,18 +19,16 @@ export declare class IdaeDbAdapter<T extends Document> extends IdaeEventEmitter
|
|
|
19
19
|
* @param events An object containing event listeners for different operations.
|
|
20
20
|
*/
|
|
21
21
|
registerEvents(events: EventListeners<T>): void;
|
|
22
|
-
static getAdapterForDbType(dbType: DbType):
|
|
23
|
-
create(data: Partial<T>): Promise<T
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
deleteById(id: string): Promise<string[] | T | import("mongodb").DeleteResult | null>;
|
|
34
|
-
deleteWhere(params: IdaeDbParams<T>): Promise<any>;
|
|
22
|
+
static getAdapterForDbType(dbType: DbType): IdaeDbAdapterInterface<T> | undefined;
|
|
23
|
+
create(data: Partial<T>): Promise<T>;
|
|
24
|
+
findById(id: string): Promise<T[]>;
|
|
25
|
+
find(params: IdaeDbParams<T>): Promise<T[]>;
|
|
26
|
+
findOne(params: IdaeDbParams<T>): Promise<T | null>;
|
|
27
|
+
update(id: string, updateData: Partial<T>): Promise<any>;
|
|
28
|
+
updateWhere(params: IdaeDbParams<T>, updateData: Partial<T>): Promise<any>;
|
|
29
|
+
deleteById(id: string): Promise<any>;
|
|
30
|
+
deleteWhere(params: IdaeDbParams<T>): Promise<{
|
|
31
|
+
deletedCount?: number;
|
|
32
|
+
}>;
|
|
35
33
|
transaction<TResult>(callback: (session: any) => Promise<TResult>): Promise<TResult>;
|
|
36
34
|
}
|
package/dist/idaeDb.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare class IdaeDb {
|
|
|
47
47
|
private applyEvents;
|
|
48
48
|
closeConnection(): Promise<void>;
|
|
49
49
|
closeAllConnections(): Promise<void>;
|
|
50
|
-
get adapterClass(): import("./
|
|
50
|
+
get adapterClass(): import("./types.js").IdaeDbAdapterInterface<T> | undefined;
|
|
51
51
|
get connectionKey(): IdaeDbInstanceKey;
|
|
52
52
|
get uri(): string;
|
|
53
53
|
get options(): Options;
|