c2-mongoose 2.1.42 → 2.1.44
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.
|
@@ -16,8 +16,8 @@ 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>,
|
|
20
|
-
search(model: mongoose.Model<any>,
|
|
19
|
+
searchPageable(model: mongoose.Model<any>, pipeline: any): Promise<any>;
|
|
20
|
+
search(model: mongoose.Model<any>, pipeline: any): Promise<SearchResponse<any>>;
|
|
21
21
|
/**
|
|
22
22
|
*
|
|
23
23
|
* @param model
|
package/dist/flow/SearchFlow.js
CHANGED
|
@@ -136,11 +136,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
136
136
|
.replace(/[u|ü|ú|ù|U|Ú|Ü|Ù]/g, '[u,ü,ú,ù,U,Ú,Ü,Ù]')
|
|
137
137
|
.replace(/[ç|Ç|c|C]/g, '[c,C,ç,Ç]');
|
|
138
138
|
};
|
|
139
|
-
SearchFlow.prototype.searchPageable = function (model) {
|
|
140
|
-
var pipeline = [];
|
|
141
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
142
|
-
pipeline[_i - 1] = arguments[_i];
|
|
143
|
-
}
|
|
139
|
+
SearchFlow.prototype.searchPageable = function (model, pipeline) {
|
|
144
140
|
return __awaiter(this, void 0, void 0, function () {
|
|
145
141
|
var result;
|
|
146
142
|
return __generator(this, function (_a) {
|
|
@@ -175,11 +171,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
175
171
|
});
|
|
176
172
|
});
|
|
177
173
|
};
|
|
178
|
-
SearchFlow.prototype.search = function (model) {
|
|
179
|
-
var pipeline = [];
|
|
180
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
181
|
-
pipeline[_i - 1] = arguments[_i];
|
|
182
|
-
}
|
|
174
|
+
SearchFlow.prototype.search = function (model, pipeline) {
|
|
183
175
|
return __awaiter(this, void 0, void 0, function () {
|
|
184
176
|
return __generator(this, function (_a) {
|
|
185
177
|
switch (_a.label) {
|
package/package.json
CHANGED
package/src/flow/SearchFlow.ts
CHANGED
|
@@ -74,7 +74,7 @@ abstract class SearchFlow {
|
|
|
74
74
|
.replace(/[ç|Ç|c|C]/g, '[c,C,ç,Ç]')
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
async searchPageable(model: mongoose.Model<any>,
|
|
77
|
+
async searchPageable(model: mongoose.Model<any>, pipeline: any) {
|
|
78
78
|
const result = await model.aggregate(
|
|
79
79
|
[
|
|
80
80
|
{
|
|
@@ -104,7 +104,7 @@ abstract class SearchFlow {
|
|
|
104
104
|
return result[0]
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
public async search(model: mongoose.Model<any>,
|
|
107
|
+
public async search(model: mongoose.Model<any>, pipeline: any): Promise<SearchResponse<any>> {
|
|
108
108
|
if (this.pageable == true) {
|
|
109
109
|
if (pipeline) {
|
|
110
110
|
return await this.searchPageable(model, pipeline)
|