@chevre/domain 21.0.0-alpha.7 → 21.0.0-alpha.8
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/lib/chevre/repo/account.js +3 -2
- package/lib/chevre/repo/accountTransaction.js +2 -2
- package/lib/chevre/repo/action.js +2 -2
- package/lib/chevre/repo/additionalProperty.js +2 -2
- package/lib/chevre/repo/assetTransaction.js +2 -2
- package/lib/chevre/repo/categoryCode.js +2 -2
- package/lib/chevre/repo/code.js +2 -2
- package/lib/chevre/repo/comment.js +2 -2
- package/lib/chevre/repo/creativeWork.js +2 -2
- package/lib/chevre/repo/customer.js +2 -2
- package/lib/chevre/repo/emailMessage.js +2 -2
- package/lib/chevre/repo/event.js +2 -2
- package/lib/chevre/repo/member.js +10 -7
- package/lib/chevre/repo/merchantReturnPolicy.js +2 -2
- package/lib/chevre/repo/offer.js +2 -2
- package/lib/chevre/repo/offerCatalog.js +2 -2
- package/lib/chevre/repo/order.js +4 -4
- package/lib/chevre/repo/ownershipInfo.js +2 -2
- package/lib/chevre/repo/place.js +10 -10
- package/lib/chevre/repo/priceSpecification.js +2 -2
- package/lib/chevre/repo/product.js +2 -2
- package/lib/chevre/repo/project.js +2 -2
- package/lib/chevre/repo/reservation.js +2 -19
- package/lib/chevre/repo/role.js +2 -2
- package/lib/chevre/repo/seller.js +2 -2
- package/lib/chevre/repo/serviceOutput.js +2 -2
- package/lib/chevre/repo/task.js +2 -2
- package/lib/chevre/repo/transaction.js +2 -2
- package/lib/chevre/repo/trip.js +2 -2
- package/package.json +1 -1
|
@@ -410,9 +410,10 @@ class MongoRepository {
|
|
|
410
410
|
});
|
|
411
411
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
412
412
|
/* istanbul ignore else */
|
|
413
|
-
if (params.limit
|
|
413
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
414
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
414
415
|
query.limit(params.limit)
|
|
415
|
-
.skip(params.limit * (
|
|
416
|
+
.skip(params.limit * (page - 1));
|
|
416
417
|
}
|
|
417
418
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
418
419
|
/* istanbul ignore else */
|
|
@@ -304,8 +304,8 @@ class MongoRepository {
|
|
|
304
304
|
createdAt: 0,
|
|
305
305
|
updatedAt: 0
|
|
306
306
|
});
|
|
307
|
-
if (typeof params.limit === 'number') {
|
|
308
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
307
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
308
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
309
309
|
query.limit(params.limit)
|
|
310
310
|
.skip(params.limit * (page - 1));
|
|
311
311
|
}
|
|
@@ -409,8 +409,8 @@ class MongoRepository {
|
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
const query = this.actionModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
|
|
412
|
-
if (typeof params.limit === 'number') {
|
|
413
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
412
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
413
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
414
414
|
query.limit(params.limit)
|
|
415
415
|
.skip(params.limit * (page - 1));
|
|
416
416
|
}
|
|
@@ -135,8 +135,8 @@ class MongoRepository {
|
|
|
135
135
|
createdAt: 0,
|
|
136
136
|
updatedAt: 0
|
|
137
137
|
});
|
|
138
|
-
if (typeof params.limit === 'number') {
|
|
139
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
138
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
139
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
140
140
|
query.limit(params.limit)
|
|
141
141
|
.skip(params.limit * (page - 1));
|
|
142
142
|
}
|
|
@@ -477,8 +477,8 @@ class MongoRepository {
|
|
|
477
477
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
478
478
|
const query = this.transactionModel.find((conditions.length > 0) ? { $and: conditions } : {})
|
|
479
479
|
.select(Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
480
|
-
if (typeof params.limit === 'number') {
|
|
481
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
480
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
481
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
482
482
|
query.limit(params.limit)
|
|
483
483
|
.skip(params.limit * (page - 1));
|
|
484
484
|
}
|
|
@@ -170,8 +170,8 @@ class MongoRepository {
|
|
|
170
170
|
createdAt: 0,
|
|
171
171
|
updatedAt: 0
|
|
172
172
|
});
|
|
173
|
-
if (typeof params.limit === 'number') {
|
|
174
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
173
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
174
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
175
175
|
query.limit(params.limit)
|
|
176
176
|
.skip(params.limit * (page - 1));
|
|
177
177
|
}
|
package/lib/chevre/repo/code.js
CHANGED
|
@@ -190,8 +190,8 @@ class MongoRepository {
|
|
|
190
190
|
createdAt: 0,
|
|
191
191
|
updatedAt: 0
|
|
192
192
|
});
|
|
193
|
-
if (typeof params.limit === 'number') {
|
|
194
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
193
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
194
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
195
195
|
query.limit(params.limit)
|
|
196
196
|
.skip(params.limit * (page - 1));
|
|
197
197
|
}
|
|
@@ -48,8 +48,8 @@ class MongoRepository {
|
|
|
48
48
|
createdAt: 0,
|
|
49
49
|
updatedAt: 0
|
|
50
50
|
});
|
|
51
|
-
if (typeof params.limit === 'number') {
|
|
52
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
51
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
52
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
53
53
|
query.limit(params.limit)
|
|
54
54
|
.skip(params.limit * (page - 1));
|
|
55
55
|
}
|
|
@@ -222,8 +222,8 @@ class MongoRepository {
|
|
|
222
222
|
createdAt: 0,
|
|
223
223
|
updatedAt: 0
|
|
224
224
|
});
|
|
225
|
-
if (typeof params.limit === 'number') {
|
|
226
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
225
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
226
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
227
227
|
query.limit(params.limit)
|
|
228
228
|
.skip(params.limit * (page - 1));
|
|
229
229
|
}
|
|
@@ -110,8 +110,8 @@ class MongoRepository {
|
|
|
110
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
111
111
|
const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
|
|
112
112
|
const query = this.customerModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
113
|
-
if (typeof conditions.limit === 'number') {
|
|
114
|
-
const page = (typeof conditions.page === 'number') ? conditions.page : 1;
|
|
113
|
+
if (typeof conditions.limit === 'number' && conditions.limit > 0) {
|
|
114
|
+
const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
|
|
115
115
|
query.limit(conditions.limit)
|
|
116
116
|
.skip(conditions.limit * (page - 1));
|
|
117
117
|
}
|
|
@@ -97,8 +97,8 @@ class MongoRepository {
|
|
|
97
97
|
createdAt: 0,
|
|
98
98
|
updatedAt: 0
|
|
99
99
|
});
|
|
100
|
-
if (typeof params.limit === 'number') {
|
|
101
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
100
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
101
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
102
102
|
query.limit(params.limit)
|
|
103
103
|
.skip(params.limit * (page - 1));
|
|
104
104
|
}
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -647,8 +647,8 @@ class MongoRepository {
|
|
|
647
647
|
(positiveProjectionExists)
|
|
648
648
|
? projection
|
|
649
649
|
: Object.assign(Object.assign({}, projection), { __v: 0, createdAt: 0, updatedAt: 0 }));
|
|
650
|
-
if (typeof params.limit === 'number') {
|
|
651
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
650
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
651
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
652
652
|
query.limit(params.limit)
|
|
653
653
|
.skip(params.limit * (page - 1));
|
|
654
654
|
}
|
|
@@ -114,8 +114,8 @@ class MongoRepository {
|
|
|
114
114
|
createdAt: 0,
|
|
115
115
|
updatedAt: 0
|
|
116
116
|
});
|
|
117
|
-
if (typeof params.limit === 'number') {
|
|
118
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
117
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
118
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
119
119
|
query.limit(params.limit)
|
|
120
120
|
.skip(params.limit * (page - 1));
|
|
121
121
|
}
|
|
@@ -219,12 +219,15 @@ class MongoRepository {
|
|
|
219
219
|
const searchConditions = Object.assign({ 'member.id': { $eq: params.member.id } }, (typeof ((_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$regex) === 'string' && params.project.id.$regex.length > 0)
|
|
220
220
|
? { 'project.id': { $regex: new RegExp(params.project.id.$regex) } }
|
|
221
221
|
: undefined);
|
|
222
|
-
const
|
|
222
|
+
const query = this.memberModel.find(searchConditions, { project: 1 })
|
|
223
223
|
// sortを保証する
|
|
224
|
-
.sort({ 'project.id': factory.sortType.Ascending })
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
.
|
|
224
|
+
.sort({ 'project.id': factory.sortType.Ascending });
|
|
225
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
226
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
227
|
+
query.limit(params.limit)
|
|
228
|
+
.skip(params.limit * (page - 1));
|
|
229
|
+
}
|
|
230
|
+
const projectMembers = yield query.setOptions({ maxTimeMS: 10000 })
|
|
228
231
|
.exec()
|
|
229
232
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
230
233
|
return projectMembers.map((m) => m.project.id);
|
|
@@ -135,8 +135,8 @@ class MongoRepository {
|
|
|
135
135
|
createdAt: 0,
|
|
136
136
|
updatedAt: 0
|
|
137
137
|
});
|
|
138
|
-
if (typeof params.limit === 'number') {
|
|
139
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
138
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
139
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
140
140
|
query.limit(params.limit)
|
|
141
141
|
.skip(params.limit * (page - 1));
|
|
142
142
|
}
|
package/lib/chevre/repo/offer.js
CHANGED
|
@@ -424,8 +424,8 @@ class MongoRepository {
|
|
|
424
424
|
const query = this.offerModel.find((conditions.length > 0) ? { $and: conditions } : {}, (positiveProjectionExists)
|
|
425
425
|
? projection
|
|
426
426
|
: Object.assign(Object.assign({}, projection), { __v: 0, createdAt: 0, updatedAt: 0 }));
|
|
427
|
-
if (typeof params.limit === 'number') {
|
|
428
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
427
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
428
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
429
429
|
query.limit(params.limit)
|
|
430
430
|
.skip(params.limit * (page - 1));
|
|
431
431
|
}
|
|
@@ -238,8 +238,8 @@ class MongoRepository {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
]);
|
|
241
|
-
if (typeof params.limit === 'number') {
|
|
242
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
241
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
242
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
243
243
|
aggregate.limit(params.limit * page)
|
|
244
244
|
.skip(params.limit * (page - 1));
|
|
245
245
|
}
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -899,8 +899,8 @@ class MongoRepository {
|
|
|
899
899
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
900
900
|
const query = this.orderModel.find((conditions.length > 0) ? { $and: conditions } : {})
|
|
901
901
|
.select(Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
902
|
-
if (typeof params.limit === 'number') {
|
|
903
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
902
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
903
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
904
904
|
query.limit(params.limit)
|
|
905
905
|
.skip(params.limit * (page - 1));
|
|
906
906
|
}
|
|
@@ -970,8 +970,8 @@ class MongoRepository {
|
|
|
970
970
|
createdAt: 0,
|
|
971
971
|
updatedAt: 0
|
|
972
972
|
});
|
|
973
|
-
if (typeof params.limit === 'number') {
|
|
974
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
973
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
974
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
975
975
|
aggregate.limit(params.limit * page)
|
|
976
976
|
.skip(params.limit * (page - 1));
|
|
977
977
|
}
|
|
@@ -291,8 +291,8 @@ class MongoRepository {
|
|
|
291
291
|
return __awaiter(this, void 0, void 0, function* () {
|
|
292
292
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
293
293
|
const query = this.ownershipInfoModel.find((conditions.length > 0) ? { $and: conditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
294
|
-
if (typeof params.limit === 'number') {
|
|
295
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
294
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
295
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
296
296
|
query.limit(params.limit)
|
|
297
297
|
.skip(params.limit * (page - 1));
|
|
298
298
|
}
|
package/lib/chevre/repo/place.js
CHANGED
|
@@ -278,8 +278,8 @@ class MongoRepository {
|
|
|
278
278
|
updatedAt: 0,
|
|
279
279
|
containsPlace: 0
|
|
280
280
|
});
|
|
281
|
-
if (typeof params.limit === 'number') {
|
|
282
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
281
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
282
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
283
283
|
query.limit(params.limit)
|
|
284
284
|
.skip(params.limit * (page - 1));
|
|
285
285
|
}
|
|
@@ -629,8 +629,8 @@ class MongoRepository {
|
|
|
629
629
|
]);
|
|
630
630
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
631
631
|
/* istanbul ignore else */
|
|
632
|
-
if (typeof searchConditions.limit === 'number') {
|
|
633
|
-
const page = (typeof searchConditions.page === 'number') ? searchConditions.page : 1;
|
|
632
|
+
if (typeof searchConditions.limit === 'number' && searchConditions.limit > 0) {
|
|
633
|
+
const page = (typeof searchConditions.page === 'number' && searchConditions.page > 0) ? searchConditions.page : 1;
|
|
634
634
|
aggregate.limit(searchConditions.limit * page)
|
|
635
635
|
.skip(searchConditions.limit * (page - 1));
|
|
636
636
|
}
|
|
@@ -805,8 +805,8 @@ class MongoRepository {
|
|
|
805
805
|
]);
|
|
806
806
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
807
807
|
/* istanbul ignore else */
|
|
808
|
-
if (typeof searchConditions.limit === 'number') {
|
|
809
|
-
const page = (typeof searchConditions.page === 'number') ? searchConditions.page : 1;
|
|
808
|
+
if (typeof searchConditions.limit === 'number' && searchConditions.limit > 0) {
|
|
809
|
+
const page = (typeof searchConditions.page === 'number' && searchConditions.page > 0) ? searchConditions.page : 1;
|
|
810
810
|
aggregate.limit(searchConditions.limit * page)
|
|
811
811
|
.skip(searchConditions.limit * (page - 1));
|
|
812
812
|
}
|
|
@@ -1142,8 +1142,8 @@ class MongoRepository {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
}
|
|
1144
1144
|
]);
|
|
1145
|
-
if (typeof params.limit === 'number') {
|
|
1146
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
1145
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
1146
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
1147
1147
|
aggregate.limit(params.limit * page)
|
|
1148
1148
|
.skip(params.limit * (page - 1));
|
|
1149
1149
|
}
|
|
@@ -1230,8 +1230,8 @@ class MongoRepository {
|
|
|
1230
1230
|
updatedAt: 0,
|
|
1231
1231
|
containsPlace: 0
|
|
1232
1232
|
});
|
|
1233
|
-
if (typeof params.limit === 'number') {
|
|
1234
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
1233
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
1234
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
1235
1235
|
query.limit(params.limit)
|
|
1236
1236
|
.skip(params.limit * (page - 1));
|
|
1237
1237
|
}
|
|
@@ -169,8 +169,8 @@ class MongoRepository {
|
|
|
169
169
|
createdAt: 0,
|
|
170
170
|
updatedAt: 0
|
|
171
171
|
});
|
|
172
|
-
if (typeof params.limit === 'number') {
|
|
173
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
172
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
173
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
174
174
|
query.limit(params.limit)
|
|
175
175
|
.skip(params.limit * (page - 1));
|
|
176
176
|
}
|
|
@@ -160,8 +160,8 @@ class MongoRepository {
|
|
|
160
160
|
return __awaiter(this, void 0, void 0, function* () {
|
|
161
161
|
const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
|
|
162
162
|
const query = this.productModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
163
|
-
if (typeof conditions.limit === 'number') {
|
|
164
|
-
const page = (typeof conditions.page === 'number') ? conditions.page : 1;
|
|
163
|
+
if (typeof conditions.limit === 'number' && conditions.limit > 0) {
|
|
164
|
+
const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
|
|
165
165
|
query.limit(conditions.limit)
|
|
166
166
|
.skip(conditions.limit * (page - 1));
|
|
167
167
|
}
|
|
@@ -79,8 +79,8 @@ class MongoRepository {
|
|
|
79
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
80
|
const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
|
|
81
81
|
const query = this.projectModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
82
|
-
if (typeof conditions.limit === 'number') {
|
|
83
|
-
const page = (typeof conditions.page === 'number') ? conditions.page : 1;
|
|
82
|
+
if (typeof conditions.limit === 'number' && conditions.limit > 0) {
|
|
83
|
+
const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
|
|
84
84
|
query.limit(conditions.limit)
|
|
85
85
|
.skip(conditions.limit * (page - 1));
|
|
86
86
|
}
|
|
@@ -867,8 +867,8 @@ class MongoRepository {
|
|
|
867
867
|
createdAt: 0,
|
|
868
868
|
updatedAt: 0
|
|
869
869
|
});
|
|
870
|
-
if (typeof params.limit === 'number') {
|
|
871
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
870
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
871
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
872
872
|
query.limit(params.limit)
|
|
873
873
|
.skip(params.limit * (page - 1));
|
|
874
874
|
}
|
|
@@ -882,23 +882,6 @@ class MongoRepository {
|
|
|
882
882
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
883
883
|
});
|
|
884
884
|
}
|
|
885
|
-
// public stream<T extends factory.reservationType>(params: factory.reservation.ISearchConditions<T>): QueryCursor<Document> {
|
|
886
|
-
// const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
887
|
-
// const query = this.reservationModel.find((conditions.length > 0) ? { $and: conditions } : {})
|
|
888
|
-
// .select({ __v: 0, createdAt: 0, updatedAt: 0 });
|
|
889
|
-
// // tslint:disable-next-line:no-single-line-block-comment
|
|
890
|
-
// /* istanbul ignore else */
|
|
891
|
-
// if (params.limit !== undefined && params.page !== undefined) {
|
|
892
|
-
// query.limit(params.limit)
|
|
893
|
-
// .skip(params.limit * (params.page - 1));
|
|
894
|
-
// }
|
|
895
|
-
// // tslint:disable-next-line:no-single-line-block-comment
|
|
896
|
-
// /* istanbul ignore else */
|
|
897
|
-
// if (params.sort !== undefined) {
|
|
898
|
-
// query.sort(params.sort);
|
|
899
|
-
// }
|
|
900
|
-
// return query.cursor();
|
|
901
|
-
// }
|
|
902
885
|
findById(params) {
|
|
903
886
|
return __awaiter(this, void 0, void 0, function* () {
|
|
904
887
|
let projection = {};
|
package/lib/chevre/repo/role.js
CHANGED
|
@@ -79,8 +79,8 @@ class MongoRepository {
|
|
|
79
79
|
createdAt: 0,
|
|
80
80
|
updatedAt: 0
|
|
81
81
|
});
|
|
82
|
-
if (typeof params.limit === 'number') {
|
|
83
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
82
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
83
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
84
84
|
query.limit(params.limit)
|
|
85
85
|
.skip(params.limit * (page - 1));
|
|
86
86
|
}
|
|
@@ -172,8 +172,8 @@ class MongoRepository {
|
|
|
172
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
173
173
|
const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
|
|
174
174
|
const query = this.organizationModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
175
|
-
if (typeof conditions.limit === 'number') {
|
|
176
|
-
const page = (typeof conditions.page === 'number') ? conditions.page : 1;
|
|
175
|
+
if (typeof conditions.limit === 'number' && conditions.limit > 0) {
|
|
176
|
+
const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
|
|
177
177
|
query.limit(conditions.limit)
|
|
178
178
|
.skip(conditions.limit * (page - 1));
|
|
179
179
|
}
|
|
@@ -118,8 +118,8 @@ class MongoRepository {
|
|
|
118
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
119
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
120
120
|
const query = this.serviceOutputModel.find((conditions.length > 0) ? { $and: conditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
121
|
-
if (typeof params.limit === 'number') {
|
|
122
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
121
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
122
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
123
123
|
query.limit(params.limit)
|
|
124
124
|
.skip(params.limit * (page - 1));
|
|
125
125
|
}
|
package/lib/chevre/repo/task.js
CHANGED
|
@@ -309,8 +309,8 @@ class MongoRepository {
|
|
|
309
309
|
return __awaiter(this, void 0, void 0, function* () {
|
|
310
310
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
311
311
|
const query = this.taskModel.find((conditions.length > 0) ? { $and: conditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
312
|
-
if (typeof params.limit === 'number') {
|
|
313
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
312
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
313
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
314
314
|
query.limit(params.limit)
|
|
315
315
|
.skip(params.limit * (page - 1));
|
|
316
316
|
}
|
|
@@ -592,8 +592,8 @@ class MongoRepository {
|
|
|
592
592
|
}
|
|
593
593
|
const query = this.transactionModel.find((conditions.length > 0) ? { $and: conditions } : {})
|
|
594
594
|
.select(projection);
|
|
595
|
-
if (typeof params.limit === 'number') {
|
|
596
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
595
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
596
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
597
597
|
query.limit(params.limit)
|
|
598
598
|
.skip(params.limit * (page - 1));
|
|
599
599
|
}
|
package/lib/chevre/repo/trip.js
CHANGED
|
@@ -175,8 +175,8 @@ class MongoRepository {
|
|
|
175
175
|
return __awaiter(this, void 0, void 0, function* () {
|
|
176
176
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
177
177
|
const query = this.tripModel.find({ $and: conditions }, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
178
|
-
if (typeof params.limit === 'number') {
|
|
179
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
178
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
179
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
180
180
|
query.limit(params.limit)
|
|
181
181
|
.skip(params.limit * (page - 1));
|
|
182
182
|
}
|
package/package.json
CHANGED