@chevre/domain 21.13.0-alpha.1 → 21.13.0-alpha.2

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.
Files changed (61) hide show
  1. package/example/src/chevre/searchEvents.ts +4 -1
  2. package/example/src/chevre/task/executeTasks.ts +1 -1
  3. package/example/src/chevre/transaction/findPaymentCardPermit.ts +2 -2
  4. package/example/src/chevre/transaction/processReturnOrder.ts +1 -1
  5. package/lib/chevre/errorHandler.d.ts +2 -2
  6. package/lib/chevre/errorHandler.js +38 -19
  7. package/lib/chevre/index.d.ts +5 -4
  8. package/lib/chevre/index.js +31 -11
  9. package/lib/chevre/repo/account.d.ts +1 -1
  10. package/lib/chevre/repo/accountTitle.d.ts +1 -1
  11. package/lib/chevre/repo/accountTransaction.d.ts +1 -1
  12. package/lib/chevre/repo/accountingReport.d.ts +1 -1
  13. package/lib/chevre/repo/accountingReport.js +1 -1
  14. package/lib/chevre/repo/action.d.ts +1 -1
  15. package/lib/chevre/repo/additionalProperty.d.ts +1 -1
  16. package/lib/chevre/repo/aggregateOffer.d.ts +1 -1
  17. package/lib/chevre/repo/aggregation.d.ts +1 -1
  18. package/lib/chevre/repo/assetTransaction.d.ts +1 -1
  19. package/lib/chevre/repo/categoryCode.d.ts +1 -1
  20. package/lib/chevre/repo/code.d.ts +1 -1
  21. package/lib/chevre/repo/comment.d.ts +1 -1
  22. package/lib/chevre/repo/creativeWork.d.ts +1 -1
  23. package/lib/chevre/repo/customer.d.ts +1 -1
  24. package/lib/chevre/repo/emailMessage.d.ts +1 -1
  25. package/lib/chevre/repo/event.js +2 -2
  26. package/lib/chevre/repo/member.d.ts +1 -1
  27. package/lib/chevre/repo/merchantReturnPolicy.d.ts +1 -1
  28. package/lib/chevre/repo/mongoose/writeConcern.d.ts +1 -1
  29. package/lib/chevre/repo/offerItemCondition.d.ts +1 -1
  30. package/lib/chevre/repo/order.d.ts +1 -1
  31. package/lib/chevre/repo/order.js +1 -1
  32. package/lib/chevre/repo/ownershipInfo.d.ts +1 -1
  33. package/lib/chevre/repo/ownershipInfo.js +1 -1
  34. package/lib/chevre/repo/permit.d.ts +1 -1
  35. package/lib/chevre/repo/place.d.ts +1 -1
  36. package/lib/chevre/repo/priceSpecification.d.ts +1 -1
  37. package/lib/chevre/repo/product.d.ts +1 -1
  38. package/lib/chevre/repo/project.d.ts +1 -1
  39. package/lib/chevre/repo/reservation.d.ts +1 -1
  40. package/lib/chevre/repo/role.d.ts +1 -1
  41. package/lib/chevre/repo/serviceOutput.d.ts +1 -1
  42. package/lib/chevre/repo/stockHolder.d.ts +2 -2
  43. package/lib/chevre/repo/task.d.ts +1 -1
  44. package/lib/chevre/repo/telemetry.d.ts +1 -1
  45. package/lib/chevre/repo/transaction.d.ts +1 -1
  46. package/lib/chevre/repo/trip.d.ts +1 -1
  47. package/lib/chevre/repository.d.ts +36 -27
  48. package/lib/chevre/repository.js +117 -48
  49. package/lib/chevre/service/assetTransaction/cancelReservation.js +2 -2
  50. package/lib/chevre/service/task.d.ts +2 -2
  51. package/lib/chevre/service/task.js +9 -3
  52. package/lib/chevre/service/transaction/placeOrderInProgress.js +2 -2
  53. package/lib/chevre/service/transaction/returnOrder.js +1 -1
  54. package/lib/chevre/service.d.ts +73 -39
  55. package/lib/chevre/service.js +255 -39
  56. package/package.json +1 -1
  57. package/example/src/chevre/searchSendEmailActions.ts +0 -44
  58. package/example/src/chevre/searchTasks.ts +0 -31
  59. package/example/src/chevre/searchTransactions.ts +0 -25
  60. package/example/src/chevre/sendEmailMessage.ts +0 -80
  61. package/example/src/chevre/syncCatalogs2aggregateOffers.ts +0 -87
@@ -1,7 +1,10 @@
1
1
  // tslint:disable:no-console
2
2
  import * as mongoose from 'mongoose';
3
3
 
4
+ const startTime = process.hrtime();
4
5
  import { chevre } from '../../../lib/index';
6
+ const diff = process.hrtime(startTime);
7
+ console.log(`importing chevre took ${diff[0]} seconds and ${diff[1]} nanoseconds.`);
5
8
 
6
9
  const PROJECT_ID = process.env.PROJECT_ID;
7
10
 
@@ -26,7 +29,7 @@ async function main() {
26
29
  }
27
30
  );
28
31
  console.log(events);
29
- console.log(events.length);
32
+ console.log(events.length, 'events found');
30
33
  }
31
34
 
32
35
  main()
@@ -6,7 +6,7 @@ import { chevre } from '../../../../lib/index';
6
6
  async function main() {
7
7
  await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
8
8
 
9
- const taskRepo = new chevre.repository.Task(mongoose.connection);
9
+ const taskRepo = await chevre.repository.Task.createInstance(mongoose.connection);
10
10
  const result = await taskRepo.executeTasks({
11
11
  now: new Date(),
12
12
  delayInSeconds: 60,
@@ -9,8 +9,8 @@ const project = { id: String(process.env.PROJECT_ID) };
9
9
  async function main() {
10
10
  await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
11
11
 
12
- const ownershipInfoRepo = new chevre.repository.OwnershipInfo(mongoose.connection);
13
- const productRepo = new chevre.repository.Product(mongoose.connection);
12
+ const ownershipInfoRepo = await chevre.repository.OwnershipInfo.createInstance(mongoose.connection);
13
+ const productRepo = await chevre.repository.Product.createInstance(mongoose.connection);
14
14
 
15
15
  const result = await findPaymentCardPermit({
16
16
  project: { id: project.id },
@@ -8,7 +8,7 @@ const project = { id: String(process.env.PROJECT_ID) };
8
8
  async function main() {
9
9
  await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
10
10
 
11
- const result = await chevre.service.transaction.returnOrder.start({
11
+ const result = await (await chevre.service.transaction.createService()).returnOrder.start({
12
12
  project: { id: project.id, typeOf: chevre.factory.organizationType.Project },
13
13
  expiresInSeconds: 60,
14
14
  agent: { id: 'xxx', typeOf: chevre.factory.creativeWorkType.WebApplication },
@@ -3,8 +3,8 @@ export declare enum MongoErrorCode {
3
3
  MaxTimeMSExpired = 50,
4
4
  ExceededTimeLimit = 262
5
5
  }
6
- export declare function isMongoError(error: unknown): boolean;
7
- export declare function handleMongoError(error: unknown): unknown;
6
+ export declare function isMongoError(error: unknown): Promise<boolean>;
7
+ export declare function handleMongoError(error: unknown): Promise<unknown>;
8
8
  /**
9
9
  * 汎用的なCOAエラーハンドリング
10
10
  */
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.handleAWSError = exports.handleMvtkReserveError = exports.handlePecorinoError = exports.handleCOAError = exports.handleMongoError = exports.isMongoError = exports.MongoErrorCode = void 0;
4
13
  /**
@@ -7,7 +16,7 @@ exports.handleAWSError = exports.handleMvtkReserveError = exports.handlePecorino
7
16
  */
8
17
  const http_status_1 = require("http-status");
9
18
  const factory_1 = require("./factory");
10
- const mongoose_1 = require("mongoose");
19
+ let mongo;
11
20
  var MongoErrorCode;
12
21
  (function (MongoErrorCode) {
13
22
  MongoErrorCode[MongoErrorCode["DuplicateKey"] = 11000] = "DuplicateKey";
@@ -15,28 +24,38 @@ var MongoErrorCode;
15
24
  MongoErrorCode[MongoErrorCode["ExceededTimeLimit"] = 262] = "ExceededTimeLimit";
16
25
  })(MongoErrorCode = exports.MongoErrorCode || (exports.MongoErrorCode = {}));
17
26
  function isMongoError(error) {
18
- return (error instanceof mongoose_1.mongo.MongoError || error instanceof mongoose_1.mongo.MongoServerError);
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ if (mongo === undefined) {
29
+ mongo = (yield Promise.resolve().then(() => require('mongoose'))).mongo;
30
+ }
31
+ return (error instanceof mongo.MongoError || error instanceof mongo.MongoServerError);
32
+ });
19
33
  }
20
34
  exports.isMongoError = isMongoError;
21
35
  function handleMongoError(error) {
22
- let handledError = error;
23
- if (handledError instanceof mongoose_1.mongo.MongoError || handledError instanceof mongoose_1.mongo.MongoServerError) {
24
- switch (handledError.code) {
25
- case MongoErrorCode.DuplicateKey:
26
- handledError = new factory_1.errors.AlreadyInUse('', [], `Some fields already in use. code:${handledError.code} message:${handledError.message}`);
27
- // no op
28
- break;
29
- case MongoErrorCode.MaxTimeMSExpired:
30
- case MongoErrorCode.ExceededTimeLimit:
31
- handledError = new factory_1.errors.GatewayTimeout(`Gateway Timeout. name:${handledError.name} code:${handledError.code} message:${handledError.message}`);
32
- break;
33
- default:
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (mongo === undefined) {
38
+ mongo = (yield Promise.resolve().then(() => require('mongoose'))).mongo;
34
39
  }
35
- }
36
- if (mongoose_1.mongo.BSON.BSONError.isBSONError(handledError)) {
37
- handledError = new factory_1.errors.Argument('', handledError.message);
38
- }
39
- return handledError;
40
+ let handledError = error;
41
+ if (handledError instanceof mongo.MongoError || handledError instanceof mongo.MongoServerError) {
42
+ switch (handledError.code) {
43
+ case MongoErrorCode.DuplicateKey:
44
+ handledError = new factory_1.errors.AlreadyInUse('', [], `Some fields already in use. code:${handledError.code} message:${handledError.message}`);
45
+ // no op
46
+ break;
47
+ case MongoErrorCode.MaxTimeMSExpired:
48
+ case MongoErrorCode.ExceededTimeLimit:
49
+ handledError = new factory_1.errors.GatewayTimeout(`Gateway Timeout. name:${handledError.name} code:${handledError.code} message:${handledError.message}`);
50
+ break;
51
+ default:
52
+ }
53
+ }
54
+ if (mongo.BSON.BSONError.isBSONError(handledError)) {
55
+ handledError = new factory_1.errors.Argument('', handledError.message);
56
+ }
57
+ return handledError;
58
+ });
40
59
  }
41
60
  exports.handleMongoError = handleMongoError;
42
61
  /**
@@ -1,14 +1,15 @@
1
1
  /**
2
2
  * index module
3
3
  */
4
- import * as GMO from '@motionpicture/gmo-service';
5
- import * as surfrock from '@surfrock/sdk';
4
+ import type * as GMOService from '@motionpicture/gmo-service';
5
+ import type * as Pecorinoapi from './pecorinoapi';
6
6
  import { credentials } from './credentials';
7
7
  import * as errorHandler from './errorHandler';
8
8
  import * as eventEmitter from './eventEmitter';
9
9
  import * as factory from './factory';
10
- import * as pecorinoapi from './pecorinoapi';
11
10
  import * as repository from './repository';
12
11
  import * as service from './service';
13
12
  import * as settings from './settings';
14
- export { credentials, errorHandler, eventEmitter, factory, repository, service, settings, surfrock, pecorinoapi, GMO };
13
+ export { credentials, errorHandler, eventEmitter, factory, repository, service, settings };
14
+ export declare function loadPecorinoapi(): Promise<typeof Pecorinoapi>;
15
+ export declare function loadGMO(): Promise<typeof GMOService>;
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GMO = exports.pecorinoapi = exports.surfrock = exports.settings = exports.service = exports.repository = exports.factory = exports.eventEmitter = exports.errorHandler = exports.credentials = void 0;
4
- /**
5
- * index module
6
- */
7
- // import * as COA from '@motionpicture/coa-service';
8
- const GMO = require("@motionpicture/gmo-service");
9
- exports.GMO = GMO;
10
- const surfrock = require("@surfrock/sdk");
11
- exports.surfrock = surfrock;
12
+ exports.loadGMO = exports.loadPecorinoapi = exports.settings = exports.service = exports.repository = exports.factory = exports.eventEmitter = exports.errorHandler = exports.credentials = void 0;
13
+ // import * as surfrock from '@surfrock/sdk';
12
14
  const credentials_1 = require("./credentials");
13
15
  Object.defineProperty(exports, "credentials", { enumerable: true, get: function () { return credentials_1.credentials; } });
14
16
  const errorHandler = require("./errorHandler");
@@ -17,11 +19,29 @@ const eventEmitter = require("./eventEmitter");
17
19
  exports.eventEmitter = eventEmitter;
18
20
  const factory = require("./factory");
19
21
  exports.factory = factory;
20
- const pecorinoapi = require("./pecorinoapi");
21
- exports.pecorinoapi = pecorinoapi;
22
22
  const repository = require("./repository");
23
23
  exports.repository = repository;
24
24
  const service = require("./service");
25
25
  exports.service = service;
26
26
  const settings = require("./settings");
27
27
  exports.settings = settings;
28
+ let pecorinoapi;
29
+ function loadPecorinoapi() {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ if (pecorinoapi === undefined) {
32
+ pecorinoapi = yield Promise.resolve().then(() => require('./pecorinoapi'));
33
+ }
34
+ return pecorinoapi;
35
+ });
36
+ }
37
+ exports.loadPecorinoapi = loadPecorinoapi;
38
+ let GMO;
39
+ function loadGMO() {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ if (GMO === undefined) {
42
+ GMO = yield Promise.resolve().then(() => require('@motionpicture/gmo-service'));
43
+ }
44
+ return GMO;
45
+ });
46
+ }
47
+ exports.loadGMO = loadGMO;
@@ -1,4 +1,4 @@
1
- import { Connection } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  /**
4
4
  * 口座リポジトリ
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection, Model } from 'mongoose';
25
+ import type { Connection, Model } from 'mongoose';
26
26
  /**
27
27
  * 科目リポジトリ
28
28
  */
@@ -1,4 +1,4 @@
1
- import { Connection } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  /**
4
4
  * 口座取引リポジトリ
@@ -1,4 +1,4 @@
1
- import { Connection, Model } from 'mongoose';
1
+ import type { Connection, Model } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  export type IOrder4report = factory.report.accountingReport.IOrderAsMainEntity;
4
4
  export interface IAccountingReport {
@@ -30,7 +30,7 @@ class MongoRepository {
30
30
  }
31
31
  catch (error) {
32
32
  let throwsError = true;
33
- if ((0, errorHandler_1.isMongoError)(error)) {
33
+ if (yield (0, errorHandler_1.isMongoError)(error)) {
34
34
  // すでにorderNumberが存在する場合ok
35
35
  if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
36
36
  throwsError = false;
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  export type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
28
28
  export type IPayAction = factory.action.trade.pay.IAction;
@@ -1,4 +1,4 @@
1
- import { Connection } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  /**
4
4
  * 追加特性リポジトリ
@@ -1,4 +1,4 @@
1
- import { AnyExpression, Connection, PipelineStage } from 'mongoose';
1
+ import type { AnyExpression, Connection, PipelineStage } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  type IMatchStage = PipelineStage.Match;
4
4
  type KeyOfUnitPriceOffer = keyof factory.unitPriceOffer.IUnitPriceOffer;
@@ -1,4 +1,4 @@
1
- import { Connection, Model } from 'mongoose';
1
+ import type { Connection, Model } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  export declare enum AggregationType {
4
4
  AggregateAuthorizeEventServiceOfferAction = "AggregateAuthorizeEventServiceOfferAction",
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  interface IAggregationByStatus {
28
28
  transactionCount: number;
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  /**
28
28
  * 区分リポジトリ
@@ -1,4 +1,4 @@
1
- import { Connection } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  import { modelName } from './mongoose/schemas/authorization';
4
4
  export type IObject = factory.authorization.IObject;
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  /**
28
28
  * コメントリポジトリ
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  /**
28
28
  * コンテンツリポジトリ
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  /**
28
28
  * 顧客リポジトリ
@@ -1,4 +1,4 @@
1
- import { Connection } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  export type IEmailMessage = factory.creativeWork.message.email.ICreativeWork;
4
4
  export interface ISearchConditions {
@@ -475,7 +475,7 @@ class MongoRepository {
475
475
  }));
476
476
  }
477
477
  catch (error) {
478
- if ((0, errorHandler_1.isMongoError)(error)) {
478
+ if (yield (0, errorHandler_1.isMongoError)(error)) {
479
479
  if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
480
480
  throw new factory.errors.AlreadyInUse(factory.eventType.ScreeningEventSeries, ['workPerformed.version']);
481
481
  }
@@ -644,7 +644,7 @@ class MongoRepository {
644
644
  }
645
645
  }
646
646
  catch (error) {
647
- if ((0, errorHandler_1.isMongoError)(error)) {
647
+ if (yield (0, errorHandler_1.isMongoError)(error)) {
648
648
  if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
649
649
  throw new factory.errors.AlreadyInUse(factory.eventType.ScreeningEventSeries, ['workPerformed.version']);
650
650
  }
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  /**
28
28
  * IAMメンバーリポジトリ
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  /**
28
28
  * 返品ポリシーリポジトリ
@@ -1,3 +1,3 @@
1
- import { WriteConcern } from 'mongoose';
1
+ import type { WriteConcern } from 'mongoose';
2
2
  declare const writeConcern: WriteConcern;
3
3
  export { writeConcern };
@@ -1,4 +1,4 @@
1
- import { Connection } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  interface IProjection {
4
4
  [key: string]: 0 | 1;
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  /**
28
28
  * 注文リポジトリ
@@ -667,7 +667,7 @@ class MongoRepository {
667
667
  }
668
668
  catch (error) {
669
669
  let throwsError = true;
670
- if ((0, errorHandler_1.isMongoError)(error)) {
670
+ if (yield (0, errorHandler_1.isMongoError)(error)) {
671
671
  // すでにorderNumberが存在する場合ok
672
672
  if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
673
673
  throwsError = false;
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  export type IOwnershipInfo = factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood>;
28
28
  /**
@@ -242,7 +242,7 @@ class MongoRepository {
242
242
  .exec();
243
243
  }
244
244
  catch (error) {
245
- if ((0, errorHandler_1.isMongoError)(error)) {
245
+ if (yield (0, errorHandler_1.isMongoError)(error)) {
246
246
  // すでに所有権が存在する場合ok
247
247
  if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
248
248
  duplicate = true;
@@ -1,4 +1,4 @@
1
- import { Connection } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  /**
4
4
  * 許可証リポジトリ
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.screeningRoomSection.IPlace, 'containsPlace'>;
28
28
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  /**
28
28
  * 価格仕様リポジトリ
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  export type IProduct = factory.product.IProduct | factory.service.paymentService.IService;
28
28
  export type IPaymentServiceByProvider = Pick<factory.service.paymentService.IService, 'name' | 'description' | 'typeOf' | 'id' | 'productID' | 'serviceType' | 'serviceOutput' | 'additionalProperty'> & {
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  /**
28
28
  * プロジェクトリポジトリ
@@ -23,7 +23,7 @@
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import { BulkWriteResult as BulkWriteOpResultObject } from 'mongodb';
26
- import { Connection, UpdateWriteOpResult } from 'mongoose';
26
+ import type { Connection, UpdateWriteOpResult } from 'mongoose';
27
27
  import * as factory from '../factory';
28
28
  export interface IUpdatePartiallyParams {
29
29
  additionalTicketText?: string;
@@ -1,4 +1,4 @@
1
- import { Connection } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  export declare enum RoleType {
4
4
  OrganizationRole = "OrganizationRole"
@@ -1,4 +1,4 @@
1
- import { Connection } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  /**
4
4
  * サービスアウトプットリポジトリ
@@ -1,5 +1,5 @@
1
- import { Connection } from 'mongoose';
2
- import { RedisClientType } from 'redis';
1
+ import type { Connection } from 'mongoose';
2
+ import type { RedisClientType } from 'redis';
3
3
  import * as factory from '../factory';
4
4
  export interface IOffer {
5
5
  itemOffered?: {
@@ -1,4 +1,4 @@
1
- import { Connection, Model } from 'mongoose';
1
+ import type { Connection, Model } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  interface IAggregationByStatus {
4
4
  taskCount: number;
@@ -1,4 +1,4 @@
1
- import { Connection, Model } from 'mongoose';
1
+ import type { Connection, Model } from 'mongoose';
2
2
  /**
3
3
  * 測定リポジトリ
4
4
  */
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Connection } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  interface IAggregationByStatus {
28
28
  transactionCount: number;
@@ -1,4 +1,4 @@
1
- import { Connection } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  export type ISearchConditions<T extends factory.tripType> = factory.trip.ISearchConditions<T>;
4
4
  export interface IAttributes4patchUpdate<T extends factory.tripType> {