c2-mongoose 2.1.0 → 2.1.1
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/flow/CrudFlow.d.ts +2 -1
- package/dist/flow/CrudFlow.js +3 -0
- package/package.json +1 -1
- package/src/flow/CrudFlow.ts +5 -1
package/dist/flow/CrudFlow.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import SearchFlow from "./SearchFlow";
|
|
|
4
4
|
declare class CrudFlow<D> {
|
|
5
5
|
private repository;
|
|
6
6
|
private search;
|
|
7
|
-
constructor(repository: mongoose.Model<any>, search
|
|
7
|
+
constructor(repository: mongoose.Model<any>, search?: SearchFlow);
|
|
8
|
+
prepareSearch(search: SearchFlow): void;
|
|
8
9
|
create(data: any, session?: any): Promise<any[]>;
|
|
9
10
|
delete(id: string, session?: any): Promise<void>;
|
|
10
11
|
update(id: string, data: D, session?: any): Promise<D>;
|
package/dist/flow/CrudFlow.js
CHANGED
|
@@ -41,6 +41,9 @@ var CrudFlow = /** @class */ (function () {
|
|
|
41
41
|
this.repository = repository;
|
|
42
42
|
this.search = search;
|
|
43
43
|
}
|
|
44
|
+
CrudFlow.prototype.prepareSearch = function (search) {
|
|
45
|
+
this.search = search;
|
|
46
|
+
};
|
|
44
47
|
CrudFlow.prototype.create = function (data, session) {
|
|
45
48
|
if (session === void 0) { session = undefined; }
|
|
46
49
|
return __awaiter(this, void 0, void 0, function () {
|
package/package.json
CHANGED
package/src/flow/CrudFlow.ts
CHANGED
|
@@ -7,10 +7,14 @@ class CrudFlow<D> {
|
|
|
7
7
|
private repository: mongoose.Model<any>
|
|
8
8
|
private search: any
|
|
9
9
|
|
|
10
|
-
constructor(repository: mongoose.Model<any>, search
|
|
10
|
+
constructor(repository: mongoose.Model<any>, search?: SearchFlow) {
|
|
11
11
|
this.repository = repository
|
|
12
12
|
this.search = search
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
public prepareSearch(search: SearchFlow) {
|
|
16
|
+
this.search = search
|
|
17
|
+
}
|
|
14
18
|
|
|
15
19
|
public async create(data: any, session: any = undefined) {
|
|
16
20
|
return await this.repository.create([data], { session })
|