c2-mongoose 2.1.47 → 2.1.49
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
CHANGED
|
@@ -15,7 +15,7 @@ declare class CrudFlow<D> {
|
|
|
15
15
|
update(id: string, data: D, session?: any): Promise<D>;
|
|
16
16
|
updateAny(id: string, data: any, session?: any): Promise<D>;
|
|
17
17
|
updateByModel(filter: any, data: any, params: any): Promise<D>;
|
|
18
|
-
find(
|
|
18
|
+
find(pipelineStages?: PipelineStage[]): Promise<SearchResponse<D>>;
|
|
19
19
|
getOne(model: D, params?: any): Promise<D>;
|
|
20
20
|
get(id: string, pop?: string, sel?: string, session?: ClientSession): Promise<D>;
|
|
21
21
|
getById(id: string, session?: ClientSession): Promise<Partial<D>>;
|
package/dist/flow/CrudFlow.js
CHANGED
|
@@ -123,11 +123,7 @@ var CrudFlow = /** @class */ (function () {
|
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
};
|
|
126
|
-
CrudFlow.prototype.find = function () {
|
|
127
|
-
var pipelineStages = [];
|
|
128
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
129
|
-
pipelineStages[_i] = arguments[_i];
|
|
130
|
-
}
|
|
126
|
+
CrudFlow.prototype.find = function (pipelineStages) {
|
|
131
127
|
return __awaiter(this, void 0, void 0, function () {
|
|
132
128
|
return __generator(this, function (_a) {
|
|
133
129
|
switch (_a.label) {
|
|
@@ -16,7 +16,10 @@ declare abstract class SearchFlow {
|
|
|
16
16
|
buildPath(target: string, nested?: string): any;
|
|
17
17
|
buildOrdenation(): any;
|
|
18
18
|
diacriticSensitiveRegex(string?: string): string;
|
|
19
|
-
searchPageable(model: mongoose.Model<any>, pipeline: any): Promise<
|
|
19
|
+
searchPageable(model: mongoose.Model<any>, pipeline: any): Promise<{
|
|
20
|
+
items: any;
|
|
21
|
+
paging: any;
|
|
22
|
+
}>;
|
|
20
23
|
search(model: mongoose.Model<any>, pipeline?: any): Promise<SearchResponse<any>>;
|
|
21
24
|
/**
|
|
22
25
|
*
|
package/dist/flow/SearchFlow.js
CHANGED
package/package.json
CHANGED
package/src/flow/CrudFlow.ts
CHANGED
|
@@ -47,7 +47,7 @@ class CrudFlow<D> {
|
|
|
47
47
|
return dataAfter as D
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
public async find(
|
|
50
|
+
public async find(pipelineStages?: PipelineStage[]): Promise<SearchResponse<D>> {
|
|
51
51
|
return await this.search.search(this.repository, pipelineStages)
|
|
52
52
|
}
|
|
53
53
|
|
package/src/flow/SearchFlow.ts
CHANGED
|
@@ -103,7 +103,10 @@ abstract class SearchFlow {
|
|
|
103
103
|
}
|
|
104
104
|
]
|
|
105
105
|
)
|
|
106
|
-
return
|
|
106
|
+
return {
|
|
107
|
+
items: result[0],
|
|
108
|
+
paging: result[0].paging[0]
|
|
109
|
+
}
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
public async search(model: mongoose.Model<any>, pipeline?: any): Promise<SearchResponse<any>> {
|