@resolveio/server-lib 20.7.101 → 20.7.103
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { AggregateOptions, AggregationCursor, BulkWriteOptions, BulkWriteResult, ChangeStream, ChangeStreamOptions, Collection, CollectionInfo, CommandOperationOptions, CountDocumentsOptions, CreateCollectionOptions, CreateIndexesOptions, CursorStreamOptions, DeleteOptions, FindCursor, FindOneAndDeleteOptions, FindOneAndReplaceOptions, FindOneAndUpdateOptions, FindOptions, IndexDescription, IndexInformationOptions, InsertOneOptions, ListIndexesCursor, ListIndexesOptions, RenameOptions, ReplaceOptions, UpdateOptions } from 'mongodb';
|
|
2
|
+
import { AggregateOptions, AggregationCursor, BulkWriteOptions, BulkWriteResult, ChangeStream, ChangeStreamOptions, Collection, CollectionInfo, CommandOperationOptions, CountDocumentsOptions, CreateCollectionOptions, CreateIndexesOptions, CursorStreamOptions, DeleteOptions, DeleteResult, FindCursor, FindOneAndDeleteOptions, FindOneAndReplaceOptions, FindOneAndUpdateOptions, FindOptions, IndexDescription, IndexInformationOptions, InsertOneOptions, ListIndexesCursor, ListIndexesOptions, RenameOptions, ReplaceOptions, UpdateOptions, UpdateResult } from 'mongodb';
|
|
3
3
|
import { CollectionDocument, Document } from '../models/collection-document.model';
|
|
4
4
|
import { LookupTables } from '../models/report-builder.model';
|
|
5
5
|
import { UserModel } from '../models/user.model';
|
|
@@ -50,11 +50,30 @@ export declare type MongoManagerUnsetFilter<T> = {
|
|
|
50
50
|
export declare type MongoManagerIncFilter<T> = {
|
|
51
51
|
[P in keyof T]?: number;
|
|
52
52
|
};
|
|
53
|
+
export declare type MongoManagerRenameFilter<T> = {
|
|
54
|
+
[P in keyof T]?: string;
|
|
55
|
+
};
|
|
56
|
+
export declare type MongoManagerArrayFilter<T> = {
|
|
57
|
+
[P in keyof T]?: any;
|
|
58
|
+
};
|
|
59
|
+
export declare type MongoManagerCurrentDateFilter<T> = {
|
|
60
|
+
[P in keyof T]?: true | {
|
|
61
|
+
$type: 'date' | 'timestamp';
|
|
62
|
+
};
|
|
63
|
+
};
|
|
53
64
|
export declare type MongoManagerUpdateFilter<T> = {
|
|
54
|
-
$inc?: MongoManagerIncFilter<T> | Document;
|
|
55
65
|
$set?: MongoManagerFilter<T> | Document;
|
|
56
|
-
$setOnInsert?: MongoManagerFilter<T> | Document;
|
|
57
66
|
$unset?: MongoManagerUnsetFilter<T> | Document;
|
|
67
|
+
$inc?: MongoManagerIncFilter<T> | Document;
|
|
68
|
+
$setOnInsert?: MongoManagerFilter<T> | Document;
|
|
69
|
+
$push?: MongoManagerArrayFilter<T> | Document;
|
|
70
|
+
$pull?: MongoManagerArrayFilter<T> | Document;
|
|
71
|
+
$addToSet?: MongoManagerArrayFilter<T> | Document;
|
|
72
|
+
$min?: MongoManagerIncFilter<T> | Document;
|
|
73
|
+
$max?: MongoManagerIncFilter<T> | Document;
|
|
74
|
+
$currentDate?: MongoManagerCurrentDateFilter<T> | Document;
|
|
75
|
+
$mul?: MongoManagerIncFilter<T> | Document;
|
|
76
|
+
$rename?: MongoManagerRenameFilter<T>;
|
|
58
77
|
};
|
|
59
78
|
export declare class MongoManager {
|
|
60
79
|
private _collections;
|
|
@@ -138,8 +157,8 @@ export declare class MongoManagerCollection<T extends CollectionDocument> {
|
|
|
138
157
|
create(f_docs: T | T[], options?: InsertOneOptions | BulkWriteOptions): Promise<T | T[]>;
|
|
139
158
|
createIndex(fieldOrSpec: any, options?: CreateIndexesOptions): Promise<string>;
|
|
140
159
|
createIndexes(indexSpecs: IndexDescription[], options?: CreateIndexesOptions): Promise<string[]>;
|
|
141
|
-
deleteMany(filter?: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, options?: DeleteOptions, bypassLogs?: boolean, bypassSession?: boolean): Promise<
|
|
142
|
-
deleteOne(filter?: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, options?: FindOneAndDeleteOptions, bypassLogs?: boolean, bypassSession?: boolean): Promise<
|
|
160
|
+
deleteMany(filter?: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, options?: DeleteOptions, bypassLogs?: boolean, bypassSession?: boolean): Promise<DeleteResult>;
|
|
161
|
+
deleteOne(filter?: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, options?: FindOneAndDeleteOptions, bypassLogs?: boolean, bypassSession?: boolean): Promise<DeleteResult>;
|
|
143
162
|
distinct(key: string, filter?: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, options?: CommandOperationOptions, bypassSession?: boolean): Promise<T[]>;
|
|
144
163
|
drop(options?: CommandOperationOptions, bypassSession?: boolean): Promise<boolean>;
|
|
145
164
|
dropIndex(indexName: string, options?: CommandOperationOptions, bypassSession?: boolean): Promise<Document>;
|
|
@@ -159,9 +178,9 @@ export declare class MongoManagerCollection<T extends CollectionDocument> {
|
|
|
159
178
|
insertOne(doc: T, options?: InsertOneOptions, bypassLogs?: boolean, bypassCheckSchema?: boolean, bypassSession?: boolean): Promise<T>;
|
|
160
179
|
listIndexes(options?: ListIndexesOptions, bypassSession?: boolean): ListIndexesCursor;
|
|
161
180
|
rename(newName: string, options?: RenameOptions, bypassSession?: boolean): Promise<Collection<Document>>;
|
|
162
|
-
replaceOne(filter: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, replacement: T, options?: ReplaceOptions, bypassLogs?: boolean, bypassCheckSchema?: boolean, doc?: T, bypassSession?: boolean): Promise<
|
|
163
|
-
updateMany(filter: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, update: MongoManagerUpdateFilter<T>, options?: UpdateOptions, bypassLogs?: boolean, bypassCheckSchema?: boolean, bypassVersions?: boolean, bypassSession?: boolean): Promise<
|
|
164
|
-
updateOne(filter: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, update: MongoManagerUpdateFilter<T>, options?: UpdateOptions, bypassLogs?: boolean, bypassCheckSchema?: boolean, bypassSession?: boolean): Promise<
|
|
181
|
+
replaceOne(filter: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, replacement: T, options?: ReplaceOptions, bypassLogs?: boolean, bypassCheckSchema?: boolean, doc?: T, bypassSession?: boolean): Promise<UpdateResult>;
|
|
182
|
+
updateMany(filter: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, update: MongoManagerUpdateFilter<T>, options?: UpdateOptions, bypassLogs?: boolean, bypassCheckSchema?: boolean, bypassVersions?: boolean, bypassSession?: boolean): Promise<UpdateResult>;
|
|
183
|
+
updateOne(filter: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, update: MongoManagerUpdateFilter<T>, options?: UpdateOptions, bypassLogs?: boolean, bypassCheckSchema?: boolean, bypassSession?: boolean): Promise<UpdateResult>;
|
|
165
184
|
watchCollection(pipeline?: any[], options?: ChangeStreamOptions, bypassSession?: boolean): ChangeStream<T>;
|
|
166
185
|
}
|
|
167
186
|
export declare class MongoManagerUserCollection<T extends CollectionDocument> extends MongoManagerCollection<T> {
|
|
@@ -172,8 +191,8 @@ export declare class MongoManagerUserCollection<T extends CollectionDocument> ex
|
|
|
172
191
|
}>;
|
|
173
192
|
serializeUser(): (user: any, cb: any) => void;
|
|
174
193
|
deserializeUser(): (username: any) => Promise<UserModel>;
|
|
175
|
-
setPassword(user: UserModel, password: string): Promise<
|
|
176
|
-
changePassword(user: any, oldPassword: any, newPassword: any): Promise<
|
|
194
|
+
setPassword(user: UserModel, password: string): Promise<UpdateResult>;
|
|
195
|
+
changePassword(user: any, oldPassword: any, newPassword: any): Promise<UpdateResult>;
|
|
177
196
|
register(user: any, password: any): Promise<any>;
|
|
178
|
-
resetAttempts(user: UserModel): Promise<
|
|
197
|
+
resetAttempts(user: UserModel): Promise<UpdateResult>;
|
|
179
198
|
}
|