@chevre/domain 20.14.0 → 21.0.0-alpha.0
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/example/src/chevre/ownershipInfosCsv2peopleJson.ts +1 -2
- package/example/src/chevre/saveTasks.ts +38 -0
- package/lib/chevre/repo/account.d.ts +1 -1
- package/lib/chevre/repo/account.js +5 -6
- package/lib/chevre/repo/accountTitle.d.ts +25 -1
- package/lib/chevre/repo/accountTransaction.js +3 -2
- package/lib/chevre/repo/action.js +9 -6
- package/lib/chevre/repo/assetTransaction.d.ts +25 -1
- package/lib/chevre/repo/assetTransaction.js +3 -2
- package/lib/chevre/repo/categoryCode.d.ts +25 -1
- package/lib/chevre/repo/code.js +3 -2
- package/lib/chevre/repo/comment.d.ts +25 -1
- package/lib/chevre/repo/comment.js +3 -2
- package/lib/chevre/repo/creativeWork.d.ts +29 -3
- package/lib/chevre/repo/creativeWork.js +3 -2
- package/lib/chevre/repo/customer.d.ts +25 -1
- package/lib/chevre/repo/customer.js +3 -2
- package/lib/chevre/repo/emailMessage.d.ts +28 -2
- package/lib/chevre/repo/event.d.ts +27 -3
- package/lib/chevre/repo/event.js +3 -2
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +29 -3
- package/lib/chevre/repo/merchantReturnPolicy.js +3 -2
- package/lib/chevre/repo/mongoose/model/account.d.ts +24 -1
- package/lib/chevre/repo/mongoose/model/accountTitle.d.ts +34 -1
- package/lib/chevre/repo/mongoose/model/accountTransaction.d.ts +37 -1
- package/lib/chevre/repo/mongoose/model/accountingReport.d.ts +28 -1
- package/lib/chevre/repo/mongoose/model/action.d.ts +43 -1
- package/lib/chevre/repo/mongoose/model/additionalProperty.d.ts +30 -1
- package/lib/chevre/repo/mongoose/model/aggregation.d.ts +24 -1
- package/lib/chevre/repo/mongoose/model/assetTransaction.d.ts +42 -1
- package/lib/chevre/repo/mongoose/model/authorization.d.ts +31 -1
- package/lib/chevre/repo/mongoose/model/categoryCode.d.ts +34 -1
- package/lib/chevre/repo/mongoose/model/comments.d.ts +35 -1
- package/lib/chevre/repo/mongoose/model/creativeWork.d.ts +43 -1
- package/lib/chevre/repo/mongoose/model/customer.d.ts +34 -1
- package/lib/chevre/repo/mongoose/model/emailMessages.d.ts +32 -1
- package/lib/chevre/repo/mongoose/model/event.d.ts +57 -1
- package/lib/chevre/repo/mongoose/model/member.d.ts +28 -1
- package/lib/chevre/repo/mongoose/model/merchantReturnPolicy.d.ts +32 -1
- package/lib/chevre/repo/mongoose/model/offer.d.ts +53 -1
- package/lib/chevre/repo/mongoose/model/offerCatalog.d.ts +34 -1
- package/lib/chevre/repo/mongoose/model/order.d.ts +47 -1
- package/lib/chevre/repo/mongoose/model/ownershipInfo.d.ts +34 -1
- package/lib/chevre/repo/mongoose/model/place.d.ts +46 -1
- package/lib/chevre/repo/mongoose/model/priceSpecification.d.ts +36 -1
- package/lib/chevre/repo/mongoose/model/product.d.ts +37 -1
- package/lib/chevre/repo/mongoose/model/project.d.ts +33 -1
- package/lib/chevre/repo/mongoose/model/reservation.d.ts +52 -1
- package/lib/chevre/repo/mongoose/model/role.d.ts +27 -1
- package/lib/chevre/repo/mongoose/model/seller.d.ts +37 -1
- package/lib/chevre/repo/mongoose/model/serviceOutput.d.ts +27 -1
- package/lib/chevre/repo/mongoose/model/task.d.ts +35 -1
- package/lib/chevre/repo/mongoose/model/telemetry.d.ts +32 -1
- package/lib/chevre/repo/mongoose/model/transaction.d.ts +40 -1
- package/lib/chevre/repo/mongoose/model/trip.d.ts +27 -1
- package/lib/chevre/repo/offer.d.ts +26 -2
- package/lib/chevre/repo/offer.js +3 -2
- package/lib/chevre/repo/offerCatalog.d.ts +25 -1
- package/lib/chevre/repo/offerCatalog.js +2 -22
- package/lib/chevre/repo/order.js +4 -3
- package/lib/chevre/repo/ownershipInfo.d.ts +25 -5
- package/lib/chevre/repo/ownershipInfo.js +7 -10
- package/lib/chevre/repo/place.d.ts +25 -1
- package/lib/chevre/repo/place.js +8 -6
- package/lib/chevre/repo/priceSpecification.d.ts +27 -8
- package/lib/chevre/repo/priceSpecification.js +3 -2
- package/lib/chevre/repo/product.d.ts +25 -1
- package/lib/chevre/repo/product.js +3 -2
- package/lib/chevre/repo/project.d.ts +25 -1
- package/lib/chevre/repo/project.js +3 -2
- package/lib/chevre/repo/reservation.d.ts +1 -1
- package/lib/chevre/repo/reservation.js +5 -4
- package/lib/chevre/repo/seller.d.ts +25 -1
- package/lib/chevre/repo/seller.js +3 -2
- package/lib/chevre/repo/serviceOutput.d.ts +1 -1
- package/lib/chevre/repo/serviceOutput.js +3 -3
- package/lib/chevre/repo/task.d.ts +4 -7
- package/lib/chevre/repo/task.js +10 -5
- package/lib/chevre/repo/transaction.js +3 -2
- package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +3 -1
- package/lib/chevre/service/assetTransaction/moneyTransfer.d.ts +3 -1
- package/lib/chevre/service/assetTransaction/pay.d.ts +3 -1
- package/lib/chevre/service/assetTransaction/refund.d.ts +3 -1
- package/lib/chevre/service/assetTransaction/registerService.d.ts +3 -1
- package/lib/chevre/service/assetTransaction/reserve.d.ts +3 -1
- package/lib/chevre/service/assetTransaction.d.ts +3 -1
- package/lib/chevre/service/assetTransaction.js +8 -8
- package/lib/chevre/service/payment/any/onPaid.d.ts +3 -1
- package/lib/chevre/service/payment/any/onRefund.d.ts +3 -1
- package/lib/chevre/service/reserve/cancelReservation.js +10 -6
- package/package.json +4 -4
- package/example/src/chevre/retryTasks.ts +0 -69
|
@@ -29,8 +29,7 @@ export interface IReport {
|
|
|
29
29
|
|
|
30
30
|
async function main() {
|
|
31
31
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, {
|
|
32
|
-
autoIndex: false
|
|
33
|
-
useUnifiedTopology: true
|
|
32
|
+
autoIndex: false
|
|
34
33
|
});
|
|
35
34
|
|
|
36
35
|
const sellerRepo = new chevre.repository.Seller(mongoose.connection);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as mongoose from 'mongoose';
|
|
3
|
+
|
|
4
|
+
import { chevre } from '../../../lib/index';
|
|
5
|
+
|
|
6
|
+
const project = { id: String(process.env.PROJECT_ID) };
|
|
7
|
+
|
|
8
|
+
async function main() {
|
|
9
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
10
|
+
|
|
11
|
+
const taskRepo = new chevre.repository.Task(mongoose.connection);
|
|
12
|
+
|
|
13
|
+
const result = await taskRepo.saveMany([{
|
|
14
|
+
name: chevre.factory.taskName.TriggerWebhook,
|
|
15
|
+
runsAt: new Date(),
|
|
16
|
+
data: {},
|
|
17
|
+
executionResults: [],
|
|
18
|
+
project: { id: project.id, typeOf: chevre.factory.organizationType.Project },
|
|
19
|
+
numberOfTried: 0,
|
|
20
|
+
remainingNumberOfTries: 1,
|
|
21
|
+
status: chevre.factory.taskStatus.Ready
|
|
22
|
+
}]);
|
|
23
|
+
|
|
24
|
+
console.log(result, 'tasks saved');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
main()
|
|
28
|
+
.then()
|
|
29
|
+
.catch(console.error);
|
|
30
|
+
// setInterval(
|
|
31
|
+
// () => {
|
|
32
|
+
// main()
|
|
33
|
+
// .then()
|
|
34
|
+
// .catch(console.error);
|
|
35
|
+
// },
|
|
36
|
+
// // tslint:disable-next-line:no-magic-numbers
|
|
37
|
+
// 60000
|
|
38
|
+
// );
|
|
@@ -158,16 +158,14 @@ class MongoRepository {
|
|
|
158
158
|
availableBalance: p.initialBalance,
|
|
159
159
|
pendingTransactions: [],
|
|
160
160
|
openDate: p.openDate
|
|
161
|
-
// status: factory.account.AccountStatusType.Opened
|
|
162
161
|
};
|
|
163
162
|
});
|
|
164
|
-
// const doc = await this.accountModel.create(account);
|
|
165
|
-
// return doc.toObject();
|
|
166
163
|
const result = yield this.accountModel.insertMany(accounts, { ordered: false, rawResult: true });
|
|
167
164
|
if (result.insertedCount !== accounts.length) {
|
|
168
165
|
throw new factory.errors.ServiceUnavailable('all accounts not saved');
|
|
169
166
|
}
|
|
170
|
-
return result.ops;
|
|
167
|
+
// return result.ops;
|
|
168
|
+
return accounts;
|
|
171
169
|
}
|
|
172
170
|
else {
|
|
173
171
|
return [];
|
|
@@ -401,6 +399,7 @@ class MongoRepository {
|
|
|
401
399
|
* 口座を検索する
|
|
402
400
|
*/
|
|
403
401
|
search(params) {
|
|
402
|
+
var _a;
|
|
404
403
|
return __awaiter(this, void 0, void 0, function* () {
|
|
405
404
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
406
405
|
const query = this.accountModel.find((conditions.length > 0) ? { $and: conditions } : {}, {
|
|
@@ -417,8 +416,8 @@ class MongoRepository {
|
|
|
417
416
|
}
|
|
418
417
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
419
418
|
/* istanbul ignore else */
|
|
420
|
-
if (params.sort !== undefined) {
|
|
421
|
-
query.sort(params.sort);
|
|
419
|
+
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.openDate) !== undefined) {
|
|
420
|
+
query.sort({ openDate: params.sort.openDate });
|
|
422
421
|
}
|
|
423
422
|
return query.setOptions({ maxTimeMS: 10000 })
|
|
424
423
|
.exec()
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import { Connection, Model } from 'mongoose';
|
|
2
26
|
/**
|
|
3
27
|
* 科目リポジトリ
|
|
@@ -10,5 +34,5 @@ export declare class MongoRepository {
|
|
|
10
34
|
id: string;
|
|
11
35
|
};
|
|
12
36
|
}): Promise<void>;
|
|
13
|
-
getCursor(conditions: any, projection: any): import("mongoose").
|
|
37
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
|
|
14
38
|
}
|
|
@@ -295,6 +295,7 @@ class MongoRepository {
|
|
|
295
295
|
* 取引を検索する
|
|
296
296
|
*/
|
|
297
297
|
search(params) {
|
|
298
|
+
var _a;
|
|
298
299
|
return __awaiter(this, void 0, void 0, function* () {
|
|
299
300
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
300
301
|
const query = this.transactionModel.find((conditions.length > 0) ? { $and: conditions } : {})
|
|
@@ -310,8 +311,8 @@ class MongoRepository {
|
|
|
310
311
|
}
|
|
311
312
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
312
313
|
/* istanbul ignore else */
|
|
313
|
-
if (params.sort !== undefined) {
|
|
314
|
-
query.sort(params.sort);
|
|
314
|
+
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.startDate) !== undefined) {
|
|
315
|
+
query.sort({ startDate: params.sort.startDate });
|
|
315
316
|
}
|
|
316
317
|
return query.setOptions({ maxTimeMS: 10000 })
|
|
317
318
|
.exec()
|
|
@@ -387,6 +387,7 @@ class MongoRepository {
|
|
|
387
387
|
* アクション検索
|
|
388
388
|
*/
|
|
389
389
|
search(params, inclusion, exclusion) {
|
|
390
|
+
var _a;
|
|
390
391
|
return __awaiter(this, void 0, void 0, function* () {
|
|
391
392
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
392
393
|
let projection = {};
|
|
@@ -415,8 +416,8 @@ class MongoRepository {
|
|
|
415
416
|
}
|
|
416
417
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
417
418
|
/* istanbul ignore else */
|
|
418
|
-
if (params.sort !== undefined) {
|
|
419
|
-
query.sort(params.sort);
|
|
419
|
+
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.startDate) !== undefined) {
|
|
420
|
+
query.sort({ startDate: params.sort.startDate });
|
|
420
421
|
}
|
|
421
422
|
// const explainResult = await (<any>query).explain();
|
|
422
423
|
// console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
|
|
@@ -528,6 +529,7 @@ class MongoRepository {
|
|
|
528
529
|
* 取引に対するアクション検索時などに使用
|
|
529
530
|
*/
|
|
530
531
|
searchByPurpose(params) {
|
|
532
|
+
var _a;
|
|
531
533
|
return __awaiter(this, void 0, void 0, function* () {
|
|
532
534
|
const conditions = {
|
|
533
535
|
'purpose.typeOf': {
|
|
@@ -548,8 +550,8 @@ class MongoRepository {
|
|
|
548
550
|
.select({ __v: 0, createdAt: 0, updatedAt: 0 });
|
|
549
551
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
550
552
|
/* istanbul ignore else */
|
|
551
|
-
if (params.sort !== undefined) {
|
|
552
|
-
query.sort(params.sort);
|
|
553
|
+
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.startDate) !== undefined) {
|
|
554
|
+
query.sort({ startDate: params.sort.startDate });
|
|
553
555
|
}
|
|
554
556
|
return query.exec()
|
|
555
557
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
@@ -559,6 +561,7 @@ class MongoRepository {
|
|
|
559
561
|
* 注文番号から、注文に対するアクションを検索する
|
|
560
562
|
*/
|
|
561
563
|
searchByOrderNumber(params) {
|
|
564
|
+
var _a;
|
|
562
565
|
return __awaiter(this, void 0, void 0, function* () {
|
|
563
566
|
const conditions = {
|
|
564
567
|
$or: [
|
|
@@ -570,8 +573,8 @@ class MongoRepository {
|
|
|
570
573
|
.select({ __v: 0, createdAt: 0, updatedAt: 0 });
|
|
571
574
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
572
575
|
/* istanbul ignore else */
|
|
573
|
-
if (params.sort !== undefined) {
|
|
574
|
-
query.sort(params.sort);
|
|
576
|
+
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.startDate) !== undefined) {
|
|
577
|
+
query.sort({ startDate: params.sort.startDate });
|
|
575
578
|
}
|
|
576
579
|
return query.exec()
|
|
577
580
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import { Connection } from 'mongoose';
|
|
2
26
|
import { modelName } from './mongoose/model/assetTransaction';
|
|
3
27
|
import * as factory from '../factory';
|
|
@@ -144,7 +168,7 @@ export declare class MongoRepository {
|
|
|
144
168
|
findByIdAndDelete(params: {
|
|
145
169
|
id: string;
|
|
146
170
|
}): Promise<void>;
|
|
147
|
-
getCursor(conditions: any, projection: any): import("mongoose").
|
|
171
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
|
|
148
172
|
aggregateAssetTransaction(params: {
|
|
149
173
|
project?: {
|
|
150
174
|
id?: {
|
|
@@ -472,6 +472,7 @@ class MongoRepository {
|
|
|
472
472
|
* 取引を検索する
|
|
473
473
|
*/
|
|
474
474
|
search(params, projection) {
|
|
475
|
+
var _a;
|
|
475
476
|
return __awaiter(this, void 0, void 0, function* () {
|
|
476
477
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
477
478
|
const query = this.transactionModel.find((conditions.length > 0) ? { $and: conditions } : {})
|
|
@@ -483,8 +484,8 @@ class MongoRepository {
|
|
|
483
484
|
}
|
|
484
485
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
485
486
|
/* istanbul ignore else */
|
|
486
|
-
if (params.sort !== undefined) {
|
|
487
|
-
query.sort(params.sort);
|
|
487
|
+
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.startDate) !== undefined) {
|
|
488
|
+
query.sort({ startDate: params.sort.startDate });
|
|
488
489
|
}
|
|
489
490
|
return query.setOptions({ maxTimeMS: 10000 })
|
|
490
491
|
.exec()
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import { Connection } from 'mongoose';
|
|
2
26
|
import * as factory from '../factory';
|
|
3
27
|
/**
|
|
@@ -37,5 +61,5 @@ export declare class MongoRepository {
|
|
|
37
61
|
id: string;
|
|
38
62
|
};
|
|
39
63
|
}): Promise<void>;
|
|
40
|
-
getCursor(conditions: any, projection: any): import("mongoose").
|
|
64
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
|
|
41
65
|
}
|
package/lib/chevre/repo/code.js
CHANGED
|
@@ -182,6 +182,7 @@ class MongoRepository {
|
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
search(params) {
|
|
185
|
+
var _a;
|
|
185
186
|
return __awaiter(this, void 0, void 0, function* () {
|
|
186
187
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
187
188
|
const query = this.authorizationModel.find((conditions.length > 0) ? { $and: conditions } : {}, {
|
|
@@ -196,8 +197,8 @@ class MongoRepository {
|
|
|
196
197
|
}
|
|
197
198
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
198
199
|
/* istanbul ignore else */
|
|
199
|
-
if (params.sort !== undefined) {
|
|
200
|
-
query.sort(params.sort);
|
|
200
|
+
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.validFrom) !== undefined) {
|
|
201
|
+
query.sort({ validFrom: params.sort.validFrom });
|
|
201
202
|
}
|
|
202
203
|
return query.setOptions({ maxTimeMS: 10000 })
|
|
203
204
|
.exec()
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import { Connection } from 'mongoose';
|
|
2
26
|
import * as factory from '../factory';
|
|
3
27
|
/**
|
|
@@ -27,5 +51,5 @@ export declare class MongoRepository {
|
|
|
27
51
|
deleteById(params: {
|
|
28
52
|
id: string;
|
|
29
53
|
}): Promise<void>;
|
|
30
|
-
getCursor(conditions: any, projection: any): import("mongoose").
|
|
54
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
|
|
31
55
|
}
|
|
@@ -40,6 +40,7 @@ class MongoRepository {
|
|
|
40
40
|
* 検索
|
|
41
41
|
*/
|
|
42
42
|
search(params) {
|
|
43
|
+
var _a;
|
|
43
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
45
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
45
46
|
const query = this.commentModel.find((conditions.length > 0) ? { $and: conditions } : {}, {
|
|
@@ -54,8 +55,8 @@ class MongoRepository {
|
|
|
54
55
|
}
|
|
55
56
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
56
57
|
/* istanbul ignore else */
|
|
57
|
-
if (params.sort !== undefined) {
|
|
58
|
-
query.sort(params.sort);
|
|
58
|
+
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.dateCreated) !== undefined) {
|
|
59
|
+
query.sort({ dateCreated: params.sort.dateCreated });
|
|
59
60
|
}
|
|
60
61
|
return query.setOptions({ maxTimeMS: 10000 })
|
|
61
62
|
.exec()
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Connection } from 'mongoose';
|
|
2
26
|
import { modelName } from './mongoose/model/creativeWork';
|
|
3
27
|
import * as factory from '../factory';
|
|
4
28
|
export { modelName };
|
|
@@ -12,7 +36,9 @@ export declare class MongoRepository {
|
|
|
12
36
|
/**
|
|
13
37
|
* コンテンツを保管する
|
|
14
38
|
*/
|
|
15
|
-
saveMovie(params: factory.creativeWork.movie.ICreativeWork): Promise<import("mongoose").LeanDocument<
|
|
39
|
+
saveMovie(params: factory.creativeWork.movie.ICreativeWork): Promise<import("mongoose").LeanDocument<any> & Required<{
|
|
40
|
+
_id: unknown;
|
|
41
|
+
}>>;
|
|
16
42
|
findMovieById(params: {
|
|
17
43
|
id: string;
|
|
18
44
|
}): Promise<factory.creativeWork.movie.ICreativeWork>;
|
|
@@ -32,5 +58,5 @@ export declare class MongoRepository {
|
|
|
32
58
|
id: string;
|
|
33
59
|
};
|
|
34
60
|
}): Promise<void>;
|
|
35
|
-
getCursor(conditions: any, projection: any): import("mongoose").
|
|
61
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
|
|
36
62
|
}
|
|
@@ -214,6 +214,7 @@ class MongoRepository {
|
|
|
214
214
|
* コンテンツを検索する
|
|
215
215
|
*/
|
|
216
216
|
searchMovies(params) {
|
|
217
|
+
var _a;
|
|
217
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
218
219
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
219
220
|
const query = this.creativeWorkModel.find({ $and: conditions }, {
|
|
@@ -228,8 +229,8 @@ class MongoRepository {
|
|
|
228
229
|
}
|
|
229
230
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
230
231
|
/* istanbul ignore else */
|
|
231
|
-
if (params.sort !== undefined) {
|
|
232
|
-
query.sort(params.sort);
|
|
232
|
+
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.identifier) !== undefined) {
|
|
233
|
+
query.sort({ identifier: params.sort.identifier });
|
|
233
234
|
}
|
|
234
235
|
return query.setOptions({ maxTimeMS: 10000 })
|
|
235
236
|
.exec()
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import { Connection } from 'mongoose';
|
|
2
26
|
import * as factory from '../factory';
|
|
3
27
|
/**
|
|
@@ -21,5 +45,5 @@ export declare class MongoRepository {
|
|
|
21
45
|
deleteById(params: {
|
|
22
46
|
id: string;
|
|
23
47
|
}): Promise<void>;
|
|
24
|
-
getCursor(conditions: any, projection: any): import("mongoose").
|
|
48
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
|
|
25
49
|
}
|
|
@@ -106,6 +106,7 @@ class MongoRepository {
|
|
|
106
106
|
* 顧客検索
|
|
107
107
|
*/
|
|
108
108
|
search(conditions, projection) {
|
|
109
|
+
var _a;
|
|
109
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
111
|
const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
|
|
111
112
|
const query = this.customerModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
@@ -116,8 +117,8 @@ class MongoRepository {
|
|
|
116
117
|
}
|
|
117
118
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
118
119
|
/* istanbul ignore else */
|
|
119
|
-
if (conditions.sort !== undefined) {
|
|
120
|
-
query.sort(conditions.sort);
|
|
120
|
+
if (((_a = conditions.sort) === null || _a === void 0 ? void 0 : _a.branchCode) !== undefined) {
|
|
121
|
+
query.sort({ branchCode: conditions.sort.branchCode });
|
|
121
122
|
}
|
|
122
123
|
return query.setOptions({ maxTimeMS: 10000 })
|
|
123
124
|
.exec()
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Connection } from 'mongoose';
|
|
2
26
|
import * as factory from '../factory';
|
|
3
27
|
export declare type IEmailMessage = factory.creativeWork.message.email.ICreativeWork;
|
|
4
28
|
export interface ISearchConditions {
|
|
@@ -26,7 +50,9 @@ export declare class MongoRepository {
|
|
|
26
50
|
private readonly emailMessageModel;
|
|
27
51
|
constructor(connection: Connection);
|
|
28
52
|
static CREATE_MONGO_CONDITIONS(params: ISearchConditions): any[];
|
|
29
|
-
save(params: IEmailMessage): Promise<import("mongoose").LeanDocument<
|
|
53
|
+
save(params: IEmailMessage): Promise<import("mongoose").LeanDocument<any> & Required<{
|
|
54
|
+
_id: unknown;
|
|
55
|
+
}>>;
|
|
30
56
|
findById(params: {
|
|
31
57
|
id: string;
|
|
32
58
|
}): Promise<IEmailMessage>;
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { BulkWriteResult as BulkWriteOpResultObject } from 'mongodb';
|
|
2
26
|
import { Connection } from 'mongoose';
|
|
3
27
|
import * as factory from '../factory';
|
|
4
28
|
import * as EventFactory from '../factory/event';
|
|
@@ -140,11 +164,11 @@ export declare class MongoRepository {
|
|
|
140
164
|
id: string;
|
|
141
165
|
}, update: IUpdateAggregateReservationParams | IUpdateAggregateUseActionsParams): Promise<factory.event.IEvent<T>>;
|
|
142
166
|
bulkWrite(bulkWriteOps: any[]): Promise<BulkWriteOpResultObject>;
|
|
143
|
-
getCursor(conditions: any, projection: any): import("mongoose").
|
|
167
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
|
|
144
168
|
unsetUnnecessaryFields(params: {
|
|
145
169
|
filter: any;
|
|
146
170
|
$unset: any;
|
|
147
|
-
}): Promise<import("
|
|
171
|
+
}): Promise<import("mongodb").UpdateResult>;
|
|
148
172
|
aggregateEvent(params: {
|
|
149
173
|
project?: {
|
|
150
174
|
id?: {
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -635,6 +635,7 @@ class MongoRepository {
|
|
|
635
635
|
* イベントを検索する
|
|
636
636
|
*/
|
|
637
637
|
search(params, projection) {
|
|
638
|
+
var _a;
|
|
638
639
|
return __awaiter(this, void 0, void 0, function* () {
|
|
639
640
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
640
641
|
const positiveProjectionExists = (projection !== undefined && projection !== null)
|
|
@@ -653,8 +654,8 @@ class MongoRepository {
|
|
|
653
654
|
}
|
|
654
655
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
655
656
|
/* istanbul ignore else */
|
|
656
|
-
if (params.sort !== undefined) {
|
|
657
|
-
query.sort(params.sort);
|
|
657
|
+
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.startDate) !== undefined) {
|
|
658
|
+
query.sort({ startDate: params.sort.startDate });
|
|
658
659
|
}
|
|
659
660
|
// const explainResult = await query.explain()
|
|
660
661
|
// .exec();
|