wingbot-mongodb 4.2.7 → 4.2.9
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/package.json +7 -2
- package/src/AttachmentCache.js +8 -2
- package/src/BaseStorage.js +28 -10
- package/src/BotConfigStorage.js +3 -1
- package/tsconfig.json +16 -0
- package/types/AttachmentCache.d.ts +55 -0
- package/types/AuditLogStorage.d.ts +231 -0
- package/types/BaseStorage.d.ts +189 -0
- package/types/BotConfigStorage.d.ts +74 -0
- package/types/BotTokenStorage.d.ts +61 -0
- package/types/ChatLogStorage.d.ts +66 -0
- package/types/NotificationsStorage.d.ts +295 -0
- package/types/StateStorage.d.ts +97 -0
- package/types/compact.d.ts +53 -0
- package/types/defaultLogger.d.ts +4 -0
- package/types/getNestedObjects.d.ts +10 -0
- package/types/main.d.ts +9 -0
- package/types/tokenFactory.d.ts +5 -0
- package/baseStorage.d.ts +0 -50
package/baseStorage.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
declare module "wingbot-mongodb" {
|
|
4
|
-
|
|
5
|
-
type Collection<T> = import('mongodb').Collection<T>;
|
|
6
|
-
type Db = import('mongodb').Db;
|
|
7
|
-
type CreateIndexesOptions = import('mongodb').CreateIndexesOptions;
|
|
8
|
-
type ObjectId = import('mongodb').ObjectId;
|
|
9
|
-
export interface Logger {
|
|
10
|
-
log: {(...any): void}
|
|
11
|
-
error: {(...any): void}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type WithId<T extends object> = T & { _id: ObjectId };
|
|
15
|
-
|
|
16
|
-
export class BaseStorage<T = {}> {
|
|
17
|
-
|
|
18
|
-
constructor (
|
|
19
|
-
mongoDb: Db|{():Promise<Db>},
|
|
20
|
-
collectionName: string,
|
|
21
|
-
log?: Logger,
|
|
22
|
-
isCosmo?: boolean
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
_getCollection (forRead?: boolean): Promise<Collection<WithId<T>>>
|
|
26
|
-
|
|
27
|
-
public addFixtureDoc (...any: T)
|
|
28
|
-
|
|
29
|
-
public addIndex (index: object, options: CreateIndexesOptions)
|
|
30
|
-
|
|
31
|
-
protected _id (id: string): ObjectId
|
|
32
|
-
|
|
33
|
-
protected _expandObjectToSet (
|
|
34
|
-
attr: string|null,
|
|
35
|
-
obj: {[key: string]: any},
|
|
36
|
-
nested?: boolean
|
|
37
|
-
): {[key: string]: any}
|
|
38
|
-
|
|
39
|
-
protected _log: { log: Function, error: Function };
|
|
40
|
-
|
|
41
|
-
public preHeat(): Promise<void>
|
|
42
|
-
|
|
43
|
-
public drop (): Promise<void>
|
|
44
|
-
|
|
45
|
-
protected _catchNetworkIssues<I> (fn: {():I}): Promise<I>
|
|
46
|
-
|
|
47
|
-
protected _detectNetworkIssueException<E extends Error> (e: E): E
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
}
|