@chevre/domain 21.0.0-alpha.14 → 21.0.0-alpha.15
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/event.js +28 -12
- package/package.json +2 -2
package/lib/chevre/repo/event.js
CHANGED
|
@@ -54,7 +54,7 @@ class MongoRepository {
|
|
|
54
54
|
}
|
|
55
55
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
56
56
|
static CREATE_MONGO_CONDITIONS(conditions) {
|
|
57
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35;
|
|
57
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37;
|
|
58
58
|
const andConditions = [{ typeOf: { $eq: conditions.typeOf } }];
|
|
59
59
|
const projectIdEq = (_b = (_a = conditions.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
60
60
|
if (typeof projectIdEq === 'string') {
|
|
@@ -401,13 +401,16 @@ class MongoRepository {
|
|
|
401
401
|
/* istanbul ignore else */
|
|
402
402
|
if (Array.isArray(workPerformedIdentifierIn)) {
|
|
403
403
|
andConditions.push({
|
|
404
|
-
'workPerformed.identifier': {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
404
|
+
'workPerformed.identifier': { $exists: true, $in: workPerformedIdentifierIn }
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
const workPerformedVersionEq = (_29 = (_28 = params.workPerformed) === null || _28 === void 0 ? void 0 : _28.version) === null || _29 === void 0 ? void 0 : _29.$eq;
|
|
408
|
+
if (typeof workPerformedVersionEq === 'string') {
|
|
409
|
+
andConditions.push({
|
|
410
|
+
'workPerformed.version': { $exists: true, $eq: workPerformedVersionEq }
|
|
408
411
|
});
|
|
409
412
|
}
|
|
410
|
-
const videoFormatTypeOfEq = (
|
|
413
|
+
const videoFormatTypeOfEq = (_31 = (_30 = params.videoFormat) === null || _30 === void 0 ? void 0 : _30.typeOf) === null || _31 === void 0 ? void 0 : _31.$eq;
|
|
411
414
|
if (typeof videoFormatTypeOfEq === 'string') {
|
|
412
415
|
andConditions.push({
|
|
413
416
|
'videoFormat.typeOf': {
|
|
@@ -416,7 +419,7 @@ class MongoRepository {
|
|
|
416
419
|
}
|
|
417
420
|
});
|
|
418
421
|
}
|
|
419
|
-
const videoFormatTypeOfIn = (
|
|
422
|
+
const videoFormatTypeOfIn = (_33 = (_32 = params.videoFormat) === null || _32 === void 0 ? void 0 : _32.typeOf) === null || _33 === void 0 ? void 0 : _33.$in;
|
|
420
423
|
if (Array.isArray(videoFormatTypeOfIn)) {
|
|
421
424
|
andConditions.push({
|
|
422
425
|
'videoFormat.typeOf': {
|
|
@@ -425,7 +428,7 @@ class MongoRepository {
|
|
|
425
428
|
}
|
|
426
429
|
});
|
|
427
430
|
}
|
|
428
|
-
const soundFormatTypeOfEq = (
|
|
431
|
+
const soundFormatTypeOfEq = (_35 = (_34 = params.soundFormat) === null || _34 === void 0 ? void 0 : _34.typeOf) === null || _35 === void 0 ? void 0 : _35.$eq;
|
|
429
432
|
if (typeof soundFormatTypeOfEq === 'string') {
|
|
430
433
|
andConditions.push({
|
|
431
434
|
'soundFormat.typeOf': {
|
|
@@ -434,7 +437,7 @@ class MongoRepository {
|
|
|
434
437
|
}
|
|
435
438
|
});
|
|
436
439
|
}
|
|
437
|
-
const soundFormatTypeOfIn = (
|
|
440
|
+
const soundFormatTypeOfIn = (_37 = (_36 = params.soundFormat) === null || _36 === void 0 ? void 0 : _36.typeOf) === null || _37 === void 0 ? void 0 : _37.$in;
|
|
438
441
|
if (Array.isArray(soundFormatTypeOfIn)) {
|
|
439
442
|
andConditions.push({
|
|
440
443
|
'soundFormat.typeOf': {
|
|
@@ -453,9 +456,20 @@ class MongoRepository {
|
|
|
453
456
|
*/
|
|
454
457
|
createMany(params) {
|
|
455
458
|
return __awaiter(this, void 0, void 0, function* () {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
+
let docs;
|
|
460
|
+
try {
|
|
461
|
+
docs = yield this.eventModel.insertMany(params.attributes.map((p) => {
|
|
462
|
+
return Object.assign({ _id: uniqid() }, p);
|
|
463
|
+
}));
|
|
464
|
+
}
|
|
465
|
+
catch (error) {
|
|
466
|
+
if ((0, errorHandler_1.isMongoError)(error)) {
|
|
467
|
+
if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
|
|
468
|
+
throw new factory.errors.AlreadyInUse(factory.eventType.ScreeningEventSeries, ['workPerformed.version']);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
throw error;
|
|
472
|
+
}
|
|
459
473
|
if (params.expectsNoContent) {
|
|
460
474
|
return;
|
|
461
475
|
}
|
|
@@ -483,6 +497,8 @@ class MongoRepository {
|
|
|
483
497
|
updateOne: {
|
|
484
498
|
filter: {
|
|
485
499
|
typeOf: creatingEventParams.attributes.typeOf,
|
|
500
|
+
// 追加特性をキーにした冪等イベント作成時のfilterにproject.idを追加(2023-04-06~)
|
|
501
|
+
'project.id': { $eq: creatingEventParams.attributes.project.id },
|
|
486
502
|
// 追加特性をキーに更新
|
|
487
503
|
additionalProperty: {
|
|
488
504
|
$exists: true,
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.310.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.310.0-alpha.1",
|
|
13
13
|
"@cinerino/sdk": "3.153.0",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"postversion": "git push origin --tags",
|
|
121
121
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
122
122
|
},
|
|
123
|
-
"version": "21.0.0-alpha.
|
|
123
|
+
"version": "21.0.0-alpha.15"
|
|
124
124
|
}
|