@chevre/domain 25.2.0-alpha.34 → 25.2.0-alpha.35

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.
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { AnyExpression, Connection, Document, FilterQuery, PipelineStage } from 'mongoose';
1
+ import { AnyExpression, Connection, Document, FilterQuery, PipelineStage, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType as IAggregateOfferDocType } from './mongoose/schemas/aggregateOffer';
5
4
  type IMatchStage = PipelineStage.Match;
@@ -80,7 +79,7 @@ export declare class AggregateOfferRepo {
80
79
  */
81
80
  productType: factory.product.ProductType;
82
81
  }): Promise<{
83
- bulkWriteResult?: BulkWriteResult;
82
+ bulkWriteResult?: mongo.BulkWriteResult;
84
83
  modifiedOffers?: {
85
84
  id: string;
86
85
  }[];
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery, Types } from 'mongoose';
1
+ import { Connection, FilterQuery, Types, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType } from './mongoose/schemas/creativeWork';
5
4
  type IKeyOfProjection = keyof factory.creativeWork.movie.ICreativeWork;
@@ -32,7 +31,7 @@ export declare class CreativeWorkRepo {
32
31
  [key in keyof factory.creativeWork.movie.ICreativeWork]?: 1;
33
32
  };
34
33
  }[]): Promise<{
35
- bulkWriteResult?: BulkWriteResult;
34
+ bulkWriteResult?: mongo.BulkWriteResult;
36
35
  }>;
37
36
  /**
38
37
  * コンテンツを検索する
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { ICustomerType } from './mongoose/schemas/customerType';
4
3
  import { factory } from '../factory';
5
4
  type IKeyOfProjection = keyof ICustomerType;
@@ -17,6 +16,6 @@ export declare class CustomerTypeRepo {
17
16
  saveManyByCodeValue(params: {
18
17
  attributes: ICustomerType;
19
18
  upsert?: boolean;
20
- }[]): Promise<BulkWriteResult | undefined>;
19
+ }[]): Promise<mongo.BulkWriteResult | undefined>;
21
20
  }
22
21
  export {};
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery } from 'mongoose';
1
+ import { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import * as EventFactory from '../factory/event';
5
4
  export interface IAttributes4patchUpdate {
@@ -83,7 +82,7 @@ export declare class EventRepo {
83
82
  */
84
83
  update: boolean;
85
84
  }): Promise<{
86
- bulkWriteResult?: BulkWriteResult;
85
+ bulkWriteResult?: mongo.BulkWriteResult;
87
86
  modifiedEvents: {
88
87
  id: string;
89
88
  }[];
@@ -202,7 +201,7 @@ export declare class EventRepo {
202
201
  organizer: {
203
202
  id: string;
204
203
  };
205
- }): Promise<import("mongodb").DeleteResult>;
204
+ }): Promise<mongo.DeleteResult>;
206
205
  deleteManyEventsByScreeningRoom(params: {
207
206
  project: {
208
207
  id: string;
@@ -219,7 +218,7 @@ export declare class EventRepo {
219
218
  id: string;
220
219
  };
221
220
  };
222
- }): Promise<import("mongodb").DeleteResult>;
221
+ }): Promise<mongo.DeleteResult>;
223
222
  deleteManyBySuperEventId(params: {
224
223
  project: {
225
224
  id: string;
@@ -227,7 +226,7 @@ export declare class EventRepo {
227
226
  superEvent: {
228
227
  id: string;
229
228
  };
230
- }): Promise<import("mongodb").DeleteResult>;
229
+ }): Promise<mongo.DeleteResult>;
231
230
  deleteManyBySuperEventLocationId(params: {
232
231
  project: {
233
232
  id: string;
@@ -237,7 +236,7 @@ export declare class EventRepo {
237
236
  id: string;
238
237
  };
239
238
  };
240
- }): Promise<import("mongodb").DeleteResult>;
239
+ }): Promise<mongo.DeleteResult>;
241
240
  /**
242
241
  * 興行(プロダクト)から削除する
243
242
  */
@@ -252,7 +251,7 @@ export declare class EventRepo {
252
251
  };
253
252
  };
254
253
  };
255
- }): Promise<import("mongodb").DeleteResult>;
254
+ }): Promise<mongo.DeleteResult>;
256
255
  deleteManyEventsEndedByProject(params: {
257
256
  typeOf: {
258
257
  $in: factory.eventType.ScreeningEvent[];
@@ -263,7 +262,7 @@ export declare class EventRepo {
263
262
  endDate: {
264
263
  $lte: Date;
265
264
  };
266
- }): Promise<import("mongodb").DeleteResult>;
265
+ }): Promise<mongo.DeleteResult>;
267
266
  deleteManyEventsEnded(params: {
268
267
  typeOf: {
269
268
  $eq: factory.eventType.ScreeningEvent;
@@ -271,7 +270,7 @@ export declare class EventRepo {
271
270
  endDate: {
272
271
  $lte: Date;
273
272
  };
274
- }): Promise<import("mongodb").DeleteResult>;
273
+ }): Promise<mongo.DeleteResult>;
275
274
  deleteByProject(params: {
276
275
  project: {
277
276
  id: string;
@@ -283,7 +282,7 @@ export declare class EventRepo {
283
282
  updateAggregationById(params: {
284
283
  id: string;
285
284
  }, update: IUpdateAggregateReservationParams): Promise<void>;
286
- bulkWrite(bulkWriteOps: any[]): Promise<BulkWriteResult & {
285
+ bulkWrite(bulkWriteOps: any[]): Promise<mongo.BulkWriteResult & {
287
286
  mongoose?: {
288
287
  validationErrors: import("mongoose").Error[];
289
288
  } | undefined;
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult, DeleteResult } from 'mongodb';
2
- import { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType } from './mongoose/schemas/eventOffer';
5
4
  type IUnset = {
@@ -32,7 +31,7 @@ export declare class EventOfferRepo {
32
31
  */
33
32
  update: boolean;
34
33
  }): Promise<{
35
- bulkWriteResult?: BulkWriteResult;
34
+ bulkWriteResult?: mongo.BulkWriteResult;
36
35
  modifiedProductOffers?: {
37
36
  id: string;
38
37
  }[];
@@ -47,7 +46,7 @@ export declare class EventOfferRepo {
47
46
  seller: {
48
47
  id: string;
49
48
  };
50
- }): Promise<DeleteResult>;
49
+ }): Promise<mongo.DeleteResult>;
51
50
  /**
52
51
  * 有効期間を過ぎたイベントオファーを削除する
53
52
  */
@@ -55,6 +54,6 @@ export declare class EventOfferRepo {
55
54
  validThrough: {
56
55
  $lte: Date;
57
56
  };
58
- }): Promise<DeleteResult>;
57
+ }): Promise<mongo.DeleteResult>;
59
58
  }
60
59
  export {};
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection } from 'mongoose';
1
+ import type { Connection, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  /**
5
4
  * イベントのアプリケーションオファーリポジトリ
@@ -31,7 +30,7 @@ export declare class EventSellerMakesOfferRepo {
31
30
  };
32
31
  };
33
32
  }[]): Promise<{
34
- bulkWriteResult?: BulkWriteResult;
33
+ bulkWriteResult?: mongo.BulkWriteResult;
35
34
  modifiedEvents?: {
36
35
  id: string;
37
36
  }[];
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type ISearchConditions = factory.eventSeries.ISearchConditions;
5
4
  type IKeyOfProjection = Exclude<keyof factory.eventSeries.IEvent, 'id' | 'videoFormat'>;
@@ -26,7 +25,7 @@ export declare class EventSeriesRepo {
26
25
  */
27
26
  upsert: boolean;
28
27
  }): Promise<{
29
- bulkWriteResult?: BulkWriteResult;
28
+ bulkWriteResult?: mongo.BulkWriteResult;
30
29
  modifiedEvents: {
31
30
  id: string;
32
31
  }[];
@@ -55,7 +54,7 @@ export declare class EventSeriesRepo {
55
54
  organizer: {
56
55
  id: string;
57
56
  };
58
- }): Promise<import("mongodb").DeleteResult>;
57
+ }): Promise<mongo.DeleteResult>;
59
58
  deleteManyByLocationId(params: {
60
59
  project: {
61
60
  id: string;
@@ -63,7 +62,7 @@ export declare class EventSeriesRepo {
63
62
  location: {
64
63
  id: string;
65
64
  };
66
- }): Promise<import("mongodb").DeleteResult>;
65
+ }): Promise<mongo.DeleteResult>;
67
66
  /**
68
67
  * 既存施設コンテンツの最大バージョンを集計する
69
68
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult, DeleteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type INoteDigitalDocument = factory.creativeWork.noteDigitalDocument.INoteDigitalDocument;
5
4
  type IKeyOfProjection = keyof INoteDigitalDocument;
@@ -29,7 +28,7 @@ export declare class NoteRepo {
29
28
  */
30
29
  update: boolean;
31
30
  }): Promise<{
32
- bulkWriteResult?: BulkWriteResult;
31
+ bulkWriteResult?: mongo.BulkWriteResult;
33
32
  modifiedNotes?: {
34
33
  id: string;
35
34
  }[];
@@ -42,7 +41,7 @@ export declare class NoteRepo {
42
41
  id: string;
43
42
  typeOf: factory.creativeWork.noteDigitalDocument.IAbout['typeOf'];
44
43
  };
45
- }): Promise<DeleteResult>;
44
+ }): Promise<mongo.DeleteResult>;
46
45
  unsetUnnecessaryFields(params: {
47
46
  filter: any;
48
47
  $unset: any;
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type INoteAboutOrder = factory.creativeWork.noteDigitalDocument.INoteAboutOrder;
5
4
  type IKeyOfProjection = keyof INoteAboutOrder;
@@ -21,7 +20,7 @@ export declare class NoteAboutOrderRepo {
21
20
  */
22
21
  upsertOrderNoteByIdentifier(params: Pick<INoteAboutOrder, 'about' | 'creator' | 'identifier' | 'project' | 'provider' | 'text' | 'version'>[], options: {
23
22
  overwrite: boolean;
24
- }): Promise<BulkWriteResult | undefined>;
23
+ }): Promise<mongo.BulkWriteResult | undefined>;
25
24
  updateById(params: {
26
25
  id: string;
27
26
  attributes: Pick<INoteAboutOrder, 'text' | 'editor'>;
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType } from './mongoose/schemas/offerCatalog';
5
4
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty'> & {
@@ -49,7 +48,7 @@ export declare class OfferCatalogRepo {
49
48
  */
50
49
  itemListElementType: factory.offerCatalog.IItemListElement['typeOf'];
51
50
  }): Promise<{
52
- bulkWriteResult?: BulkWriteResult;
51
+ bulkWriteResult?: mongo.BulkWriteResult;
53
52
  modifiedCatalogs?: {
54
53
  id: string;
55
54
  }[];
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery } from 'mongoose';
1
+ import { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty' | 'relatedOffer'> & {
5
4
  numberOfItems?: number;
@@ -42,7 +41,7 @@ export declare class OfferCatalogItemRepo {
42
41
  */
43
42
  productType: factory.product.ProductType;
44
43
  }): Promise<{
45
- bulkWriteResult?: BulkWriteResult;
44
+ bulkWriteResult?: mongo.BulkWriteResult;
46
45
  modifiedCatalogs?: {
47
46
  id: string;
48
47
  }[];
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection } from 'mongoose';
1
+ import { Connection, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  /**
5
4
  * ゲートを操作する組織
@@ -37,12 +36,12 @@ export declare class EntranceGateRepo {
37
36
  addEntranceGatesByIdentifierIfNotExist(params: {
38
37
  $set: ICreatingEntranceGate;
39
38
  }[], options: IUpdateOptions): Promise<{
40
- bulkWriteResult?: BulkWriteResult;
39
+ bulkWriteResult?: mongo.BulkWriteResult;
41
40
  }>;
42
41
  updateEntranceGatesByIdentifier(params: {
43
42
  $set: ICreatingEntranceGate;
44
43
  }[], options: IUpdateOptions): Promise<{
45
- bulkWriteResult?: BulkWriteResult;
44
+ bulkWriteResult?: mongo.BulkWriteResult;
46
45
  }>;
47
46
  deleteEntranceGatesByIdentifier(params: {
48
47
  /**
@@ -50,7 +49,7 @@ export declare class EntranceGateRepo {
50
49
  */
51
50
  identifier: string;
52
51
  }[], options: IUpdateOptions): Promise<{
53
- bulkWriteResult?: BulkWriteResult;
52
+ bulkWriteResult?: mongo.BulkWriteResult;
54
53
  }>;
55
54
  private createMatchStages;
56
55
  }
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  import { IDocType } from '../mongoose/schemas/civicStructure';
5
4
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
@@ -49,7 +48,7 @@ export declare class MovieTheaterRepo {
49
48
  [key in keyof IUpsertingMovieTheater]?: 1;
50
49
  };
51
50
  }[], options: IUpsertOptions): Promise<{
52
- bulkWriteResult?: BulkWriteResult;
51
+ bulkWriteResult?: mongo.BulkWriteResult;
53
52
  /**
54
53
  * 追加あるいは編集された施設
55
54
  */
@@ -86,7 +85,7 @@ export declare class MovieTheaterRepo {
86
85
  */
87
86
  id: string;
88
87
  };
89
- }): Promise<import("mongodb").DeleteResult>;
88
+ }): Promise<mongo.DeleteResult>;
90
89
  /**
91
90
  * プロジェクトに属する施設を全削除
92
91
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery, PipelineStage } from 'mongoose';
1
+ import type { Connection, FilterQuery, PipelineStage, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  import { IDocType } from '../mongoose/schemas/place';
5
4
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
@@ -66,7 +65,7 @@ export declare class ScreeningRoomRepo {
66
65
  [key in keyof IUpsertingRoom]?: 1;
67
66
  };
68
67
  }[], options: IUpsertOptions): Promise<{
69
- bulkWriteResult?: BulkWriteResult;
68
+ bulkWriteResult?: mongo.BulkWriteResult;
70
69
  }>;
71
70
  deleteRoomByBranchCode(screeningRoom: {
72
71
  /**
@@ -84,7 +83,7 @@ export declare class ScreeningRoomRepo {
84
83
  */
85
84
  id: string;
86
85
  };
87
- }): Promise<import("mongodb").DeleteResult>;
86
+ }): Promise<mongo.DeleteResult>;
88
87
  searchScreeningRooms(searchConditions: factory.place.screeningRoom.ISearchConditions): Promise<Omit<factory.place.screeningRoom.IPlace, 'containsPlace' | 'parentOrganization'>[]>;
89
88
  findRooms(params: Omit<factory.place.screeningRoom.ISearchConditions, '$projection'>): Promise<Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed' | 'maximumAttendeeCapacity'>[]>;
90
89
  /**
@@ -116,7 +115,7 @@ export declare class ScreeningRoomRepo {
116
115
  */
117
116
  id: string;
118
117
  };
119
- }): Promise<import("mongodb").DeleteResult>;
118
+ }): Promise<mongo.DeleteResult>;
120
119
  /**
121
120
  * プロジェクトに属するルームを全削除
122
121
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { AnyExpression, Connection, PipelineStage } from 'mongoose';
1
+ import type { AnyExpression, Connection, PipelineStage, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  type IMatchStage = PipelineStage.Match;
5
4
  type ICreatingSeat = Pick<factory.place.seat.IPlace, 'additionalProperty' | 'branchCode' | 'name' | 'maximumAttendeeCapacity' | 'seatingType'>;
@@ -45,7 +44,7 @@ export declare class SeatRepo {
45
44
  addSeatsByBranchCodeIfNotExist(params: {
46
45
  $set: ICreatingSeat;
47
46
  }[], options: IUpdateOptions): Promise<{
48
- bulkWriteResult?: BulkWriteResult;
47
+ bulkWriteResult?: mongo.BulkWriteResult;
49
48
  }>;
50
49
  /**
51
50
  * コードをキーにして冪等編集
@@ -56,7 +55,7 @@ export declare class SeatRepo {
56
55
  [key in keyof ICreatingSeat]?: 1;
57
56
  };
58
57
  }[], options: IUpdateOptions): Promise<{
59
- bulkWriteResult?: BulkWriteResult;
58
+ bulkWriteResult?: mongo.BulkWriteResult;
60
59
  }>;
61
60
  updateSeatByBranchCode(seat: ICreatingSeat, $unset: any, // eslint-disable-line @typescript-eslint/no-explicit-any
62
61
  options: IUpdateOptions): Promise<IUpdateSeatResult>;
@@ -166,7 +165,7 @@ export declare class SeatRepo {
166
165
  */
167
166
  branchCode: string;
168
167
  }[], options: IUpdateOptions): Promise<{
169
- bulkWriteResult?: BulkWriteResult;
168
+ bulkWriteResult?: mongo.BulkWriteResult;
170
169
  }>;
171
170
  deleteSeatByBranchCode(seat: {
172
171
  /**
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, PipelineStage } from 'mongoose';
1
+ import type { Connection, PipelineStage, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.screeningRoomSection.IPlace, 'containsPlace'>;
5
4
  type ICreatingSection = Pick<factory.place.screeningRoomSection.IPlace, 'additionalProperty' | 'branchCode' | 'name'>;
@@ -57,7 +56,7 @@ export declare class SectionRepo {
57
56
  addSeatSectionsByBranchCodeIfNotExist(params: {
58
57
  $set: IUpsertingSeatSection;
59
58
  }[], options: IUpsertOptions): Promise<{
60
- bulkWriteResult?: BulkWriteResult;
59
+ bulkWriteResult?: mongo.BulkWriteResult;
61
60
  }>;
62
61
  /**
63
62
  * コードをキーにして冪等編集
@@ -65,7 +64,7 @@ export declare class SectionRepo {
65
64
  updateSeatSectionsByBranchCode(params: {
66
65
  $set: IUpsertingSeatSection;
67
66
  }[], options: IUpsertOptions): Promise<{
68
- bulkWriteResult?: BulkWriteResult;
67
+ bulkWriteResult?: mongo.BulkWriteResult;
69
68
  }>;
70
69
  migrateSectionIdentifier(screeningRoomSection: {
71
70
  project: {
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery, Types } from 'mongoose';
1
+ import { Connection, FilterQuery, Types, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType, IDocTypeAsProduct } from './mongoose/schemas/product';
5
4
  type IKeyOfProjection = keyof factory.product.IProduct | 'hasOfferCatalog.id';
@@ -65,7 +64,7 @@ export declare class ProductRepo {
65
64
  };
66
65
  $unset?: Partial<Record<IUnsetKey, 1>>;
67
66
  }[]): Promise<{
68
- bulkWriteResult?: BulkWriteResult;
67
+ bulkWriteResult?: mongo.BulkWriteResult;
69
68
  modifiedProducts?: {
70
69
  id: string;
71
70
  }[];
@@ -80,7 +79,7 @@ export declare class ProductRepo {
80
79
  hasOfferCatalog: {
81
80
  id: string;
82
81
  };
83
- }): Promise<import("mongodb").DeleteResult>;
82
+ }): Promise<mongo.DeleteResult>;
84
83
  /**
85
84
  * プロジェクト指定で削除する
86
85
  */
@@ -28,7 +28,6 @@ class OfferRateLimitRepo {
28
28
  * ロックする
29
29
  * discontinue array params(2025-05-26~)
30
30
  */
31
- // public async lock(ratelimitKeys: IRateLimitKey[]): Promise<void> {
32
31
  async lock(params) {
33
32
  const key = OfferRateLimitRepo.createKey(params);
34
33
  const value = params.reservationNumber;
@@ -50,18 +49,8 @@ class OfferRateLimitRepo {
50
49
  catch (_error) {
51
50
  throw new factory_1.factory.errors.RateLimitExceeded('Offer');
52
51
  }
53
- // const multi = this.redisClient.multi();
54
- // multi.setNX(key, value)
55
- // .expire(key, ttl);
56
- // const results = await multi.exec();
57
- // if (Array.isArray(results) && (results[0] === 1 || (<any>results)[0] === true)) {
58
- // return;
59
- // } else {
60
- // throw new factory.errors.RateLimitExceeded('Offer');
61
- // }
62
52
  }
63
53
  // discontinue array params(2025-05-26~)
64
- // public async unlock(ratelimitKeys: IRateLimitKey[]): Promise<void> {
65
54
  async unlock(params) {
66
55
  const key = OfferRateLimitRepo.createKey(params);
67
56
  // reimplement using concurrentLockRepo(2025-05-27~)
@@ -69,7 +58,6 @@ class OfferRateLimitRepo {
69
58
  about: { identifier: key, typeOf: 'Thing' },
70
59
  audience: { identifier: params.reservationNumber, typeOf: 'Audience' }
71
60
  });
72
- // await this.redisClient.del(key);
73
61
  }
74
62
  async getHolder(ratelimitKey) {
75
63
  const key = OfferRateLimitRepo.createKey(ratelimitKey);
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, UpdateWriteOpResult } from 'mongoose';
1
+ import type { Connection, UpdateWriteOpResult, mongo } from 'mongoose';
3
2
  import { IDocType } from './mongoose/schemas/reservation';
4
3
  import { factory } from '../factory';
5
4
  export interface IUpdatePartiallyParams {
@@ -77,7 +76,7 @@ export declare class ReservationRepo {
77
76
  reservationNumber: string;
78
77
  underName?: factory.reservation.IUnderName;
79
78
  broker?: factory.reservation.IBroker;
80
- }): Promise<BulkWriteResult | undefined>;
79
+ }): Promise<mongo.BulkWriteResult | undefined>;
81
80
  /**
82
81
  * 予約取消
83
82
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection } from 'mongoose';
1
+ import { Connection, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type IMakesOffer = Pick<factory.seller.IMakesOffer, 'typeOf' | 'availableAtOrFrom' | 'eligibleTransactionDuration'>;
5
4
  type IMakesOfferAsFindResult = IMakesOffer & {
@@ -51,7 +50,7 @@ export declare class SellerMakesOfferRepo {
51
50
  id: string;
52
51
  };
53
52
  }[];
54
- }): Promise<BulkWriteResult | undefined>;
53
+ }): Promise<mongo.BulkWriteResult | undefined>;
55
54
  /**
56
55
  * 販売者とアプリケーションに対してオファーが存在すれば削除する
57
56
  */
@@ -67,6 +66,6 @@ export declare class SellerMakesOfferRepo {
67
66
  id: string;
68
67
  };
69
68
  }[];
70
- }): Promise<BulkWriteResult | undefined>;
69
+ }): Promise<mongo.BulkWriteResult | undefined>;
71
70
  }
72
71
  export {};
@@ -16,7 +16,7 @@ export declare class StockHolderRepo implements AbstractStockHolderRepo {
16
16
  /**
17
17
  * 座席をロックする
18
18
  */
19
- lock(lockKey: ILockKey & {}): Promise<void>;
19
+ lock(lockKey: ILockKey): Promise<void>;
20
20
  /**
21
21
  * 座席ロックを解除する
22
22
  */
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StockHolderRepo = void 0;
4
- // import type { RedisClientType } from 'redis';
5
4
  const factory_1 = require("../factory");
6
5
  const pendingReservation_1 = require("./pendingReservation");
7
6
  const SEARCH_OFFERS_MAX_LENGTH = 100;
@@ -9,36 +8,11 @@ const SEARCH_OFFERS_MAX_LENGTH = 100;
9
8
  * 保留予約リポジトリ
10
9
  */
11
10
  class StockHolderRepo {
12
- // public static KEY_PREFIX_NEW: string = 'stockHolder';
13
- // private readonly redisClient: RedisClientType | undefined;
14
11
  pendingReservationRepo;
15
12
  constructor(params) {
16
13
  const { connection } = params;
17
- // this.redisClient = redisClient;
18
14
  this.pendingReservationRepo = new pendingReservation_1.PendingReservationRepo(connection);
19
15
  }
20
- // private static offer2field(params: IOffer, hasTicketedSeat: boolean) {
21
- // if (hasTicketedSeat) {
22
- // return `${params.seatSection}:${params.seatNumber}`;
23
- // } else {
24
- // // 予約IDをfieldにする場合
25
- // const serviceOutputId = params.itemOffered?.serviceOutput?.id;
26
- // if (typeof serviceOutputId === 'string') {
27
- // return serviceOutputId;
28
- // } else {
29
- // throw new factory.errors.Internal('offer2field requires itemOffered.serviceOutput.id');
30
- // }
31
- // }
32
- // }
33
- // private static createKey(params: {
34
- // eventId: string;
35
- // startDate: Date;
36
- // }): string {
37
- // if (!(params.startDate instanceof Date)) {
38
- // throw new factory.errors.Argument('startDate', 'must be Date');
39
- // }
40
- // return `${StockHolderRepo.KEY_PREFIX_NEW}:${params.eventId}`;
41
- // }
42
16
  /**
43
17
  * 座席をロックする(maxキャパシティチェック有)
44
18
  */
@@ -54,16 +28,6 @@ class StockHolderRepo {
54
28
  }
55
29
  else {
56
30
  throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
57
- // if (this.redisClient === undefined) {
58
- // throw new factory.errors.Internal('redisClient required');
59
- // }
60
- // const key = StockHolderRepo.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
61
- // await this.redisClient.watch(key);
62
- // const hashCount = await this.redisClient.hLen(key);
63
- // if (hashCount + lockKey.offers.length > maximum) {
64
- // throw new factory.errors.Argument('Event', 'maximumAttendeeCapacity exceeded');
65
- // }
66
- // await this.lock(lockKey);
67
31
  }
68
32
  }
69
33
  /**
@@ -79,59 +43,11 @@ class StockHolderRepo {
79
43
  startDate: lockKey.startDate,
80
44
  hasTicketedSeat: lockKey.hasTicketedSeat
81
45
  });
82
- // const key = StockHolderRepo.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
83
- // await this.checkIfConflicted({ key, eventId: lockKey.eventId, useMongoose });
84
46
  if (useMongoose) {
85
47
  return this.pendingReservationRepo.lock(lockKey);
86
48
  }
87
49
  else {
88
50
  throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
89
- // if (this.redisClient === undefined) {
90
- // throw new factory.errors.Internal('redisClient required');
91
- // }
92
- // const value = lockKey.holder;
93
- // const multi = this.redisClient.multi();
94
- // const fields = lockKey.offers.map((offer) => StockHolderRepo.offer2field(offer, lockKey.hasTicketedSeat));
95
- // // check uniqueness(2025-04-20~)
96
- // const uniqueFields = [...new Set(fields)];
97
- // if (uniqueFields.length !== fields.length) {
98
- // throw new factory.errors.Argument('offers', 'offers must be unique');
99
- // }
100
- // fields.forEach((field) => {
101
- // multi.hSetNX(key, field, value);
102
- // });
103
- // const results = await multi.expireAt(
104
- // key,
105
- // moment(lockKey.expires)
106
- // .unix()
107
- // )
108
- // .exec();
109
- // const lockedFields: string[] = [];
110
- // if (Array.isArray(results)) {
111
- // results.slice(0, fields.length)
112
- // .forEach((r, index) => {
113
- // if (r === 1 || (<any>r) === true) {
114
- // lockedFields.push(fields[index]);
115
- // }
116
- // });
117
- // }
118
- // const lockedAll = lockedFields.length === fields.length;
119
- // // expireAtReplyの検証も追加する(2023-04-19~)
120
- // const expiredAll = results.slice(fields.length)
121
- // .every((r) => (r === 1 || (<any>r) === true));
122
- // if (!lockedAll || !expiredAll) {
123
- // if (lockedFields.length > 0) {
124
- // // 全て仮押さえできなければ仮押さえできたものは解除
125
- // await this.redisClient.multi()
126
- // .hDel(key, lockedFields)
127
- // .exec();
128
- // }
129
- // if (!lockedAll) {
130
- // throw new factory.errors.AlreadyInUse(factory.reservationType.EventReservation, ['ticketedSeat'], 'Already hold');
131
- // } else {
132
- // throw new factory.errors.Internal('timeout cannot be set unexpectedly');
133
- // }
134
- // }
135
51
  }
136
52
  }
137
53
  /**
@@ -144,20 +60,11 @@ class StockHolderRepo {
144
60
  startDate: params.startDate,
145
61
  hasTicketedSeat: params.hasTicketedSeat
146
62
  });
147
- // const key = StockHolderRepo.createKey({ eventId: params.eventId, startDate: params.startDate });
148
- // await this.checkIfConflicted({ key, eventId: params.eventId, useMongoose });
149
63
  if (useMongoose) {
150
64
  return this.pendingReservationRepo.unlock(params);
151
65
  }
152
66
  else {
153
67
  throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
154
- // if (this.redisClient === undefined) {
155
- // throw new factory.errors.Internal('redisClient required');
156
- // }
157
- // const field = StockHolderRepo.offer2field(params.offer, params.hasTicketedSeat);
158
- // await this.redisClient.multi()
159
- // .hDel(key, field)
160
- // .exec();
161
68
  }
162
69
  }
163
70
  /**
@@ -174,16 +81,6 @@ class StockHolderRepo {
174
81
  }
175
82
  else {
176
83
  throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
177
- // if (this.redisClient === undefined) {
178
- // throw new factory.errors.Internal('redisClient required');
179
- // }
180
- // const key = StockHolderRepo.createKey({ eventId: params.event.id, startDate: params.event.startDate });
181
- // const reply = await this.redisClient.hLen(key);
182
- // let fieldCount: number = 0;
183
- // if (typeof reply === 'number') {
184
- // fieldCount = Number(reply);
185
- // }
186
- // return fieldCount;
187
84
  }
188
85
  }
189
86
  /**
@@ -200,12 +97,6 @@ class StockHolderRepo {
200
97
  }
201
98
  else {
202
99
  throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
203
- // if (this.redisClient === undefined) {
204
- // throw new factory.errors.Internal('redisClient required');
205
- // }
206
- // const key = StockHolderRepo.createKey({ eventId: params.eventId, startDate: params.startDate });
207
- // const field = StockHolderRepo.offer2field(params.offer, params.hasTicketedSeat);
208
- // return this.redisClient.hGet(key, field);
209
100
  }
210
101
  }
211
102
  async searchHolders(params) {
@@ -223,32 +114,8 @@ class StockHolderRepo {
223
114
  }
224
115
  else {
225
116
  throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
226
- // if (this.redisClient === undefined) {
227
- // throw new factory.errors.Internal('redisClient required');
228
- // }
229
- // const key = StockHolderRepo.createKey({ eventId: params.eventId, startDate: params.startDate });
230
- // const fields = params.offers.map((o) => {
231
- // return StockHolderRepo.offer2field(o, params.hasTicketedSeat);
232
- // });
233
- // // Array reply: list of values associated with the given fields, in the same order as they are requested.
234
- // const result = await this.redisClient.hmGet(key, fields);
235
- // if (!Array.isArray(result)) {
236
- // throw new factory.errors.Internal(`searchAvailability got non-array: ${typeof result}`);
237
- // }
238
- // // そのまま返却(2023-04-17~)
239
- // return result;
240
117
  }
241
118
  }
242
- // public async checkIfConflicted(params: {
243
- // eventId: string;
244
- // startDate: Date;
245
- // }): Promise<void> {
246
- // const redisKeyExists = await this.redisKeyExists(params);
247
- // const mongoDocExists = await this.pendingReservationRepo.docExists(params);
248
- // if (redisKeyExists && mongoDocExists) {
249
- // throw new factory.errors.Internal(`repository conflicted. eventId:${params.eventId}`);
250
- // }
251
- // }
252
119
  /**
253
120
  * 新リポジトリを使用するかどうか
254
121
  */
@@ -258,19 +125,6 @@ class StockHolderRepo {
258
125
  }
259
126
  // always use mongo(2025-08-17~)
260
127
  return true;
261
- // let useMongoose = false;
262
- // const redisKeyExists = await this.redisKeyExists(params);
263
- // if (redisKeyExists) {
264
- // useMongoose = false;
265
- // } else {
266
- // // redis keyが存在しなければmongo利用
267
- // useMongoose = true;
268
- // }
269
- // // check confliction for test
270
- // if (USE_STOCK_HOLDER_CHECK_CONFLICT) {
271
- // await this.checkIfConflicted(params);
272
- // }
273
- // return useMongoose;
274
128
  }
275
129
  }
276
130
  exports.StockHolderRepo = StockHolderRepo;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TransactionNumberCounterRepo = void 0;
4
- // import { RedisClientType } from 'redis';
5
4
  const errorHandler_1 = require("../errorHandler");
6
5
  const factory_1 = require("../factory");
7
6
  const transactionNumber_1 = require("./mongoose/schemas/transactionNumber");
@@ -10,44 +9,11 @@ const MAX_RETRY_INCREMENT = 1;
10
9
  * 取引番号カウンターリポジトリ
11
10
  */
12
11
  class TransactionNumberCounterRepo {
13
- // private readonly redisClient: RedisClientType;
14
12
  transactionNumberModel;
15
13
  constructor(params) {
16
14
  const { connection } = params;
17
- // this.redisClient = redisClient;
18
15
  this.transactionNumberModel = connection.model(transactionNumber_1.modelName, (0, transactionNumber_1.createSchema)());
19
16
  }
20
- // public async incrementByRedis(params: {
21
- // identifier: string;
22
- // includedInDataCatalog: {
23
- // identifier: DataCatalogIdentifier;
24
- // };
25
- // expires: Date;
26
- // }): Promise<number> {
27
- // // const now = moment();
28
- // const { expires } = params;
29
- // const key = `${params.includedInDataCatalog.identifier}:${params.identifier}`;
30
- // // const TTL = moment(expires)
31
- // // .diff(now, 'seconds');
32
- // const [incrReply, expireAtReply] = await this.redisClient.multi()
33
- // .incr(key)
34
- // // .expire(key, TTL)
35
- // .expireAt(key, expires)
36
- // .exec();
37
- // // tslint:disable-next-line:no-single-line-block-comment
38
- // /* istanbul ignore else: please write tests */
39
- // if (typeof incrReply !== 'number') {
40
- // // 基本的にありえないフロー
41
- // throw new factory.errors.Internal('transaction number not incremented unexpectedly');
42
- // }
43
- // // expireAtReplyの検証も追加する(2023-04-19~)
44
- // const expiredSet = expireAtReply === 1 || <any>expireAtReply === true;
45
- // if (!expiredSet) {
46
- // // 基本的にありえないフロー
47
- // throw new factory.errors.Internal('transaction number expiration not set unexpectedly');
48
- // }
49
- // return incrReply;
50
- // }
51
17
  async incrementByMongo(params) {
52
18
  const now = new Date();
53
19
  const dataFeedExpires = params.expires;
@@ -16,10 +16,8 @@ const DEFAULT_LOCK_EXPIRES = 120;
16
16
  class TransactionProcessRepo {
17
17
  concurrentLockRepo;
18
18
  options;
19
- // private readonly redisClient: RedisClientType;
20
19
  constructor(redisClient, options) {
21
20
  this.concurrentLockRepo = new concurrentLock_1.ConcurrentLockRepo({ redisClient });
22
- // this.redisClient = redisClient;
23
21
  this.options = options;
24
22
  }
25
23
  static CREATE_REDIS_KEY(params) {
@@ -44,16 +42,6 @@ class TransactionProcessRepo {
44
42
  catch (_error) {
45
43
  throw new factory_1.factory.errors.AlreadyInUse(params.typeOf, [], 'Another transaction process in progress');
46
44
  }
47
- // const results = await this.redisClient.multi()
48
- // .setNX(key, '1')
49
- // .expire(key, ttl)
50
- // .exec();
51
- // debug('locked,', params.id, results);
52
- // if (Array.isArray(results) && (results[0] === 1 || (<any>results)[0] === true)) {
53
- // return;
54
- // } else {
55
- // throw new factory.errors.AlreadyInUse(params.typeOf, [], 'Another transaction process in progress');
56
- // }
57
45
  }
58
46
  async unlock(params) {
59
47
  const key = TransactionProcessRepo.CREATE_REDIS_KEY(params);
@@ -62,7 +50,6 @@ class TransactionProcessRepo {
62
50
  about: { identifier: key, typeOf: 'Thing' },
63
51
  audience: { identifier: '1', typeOf: 'Audience' }
64
52
  });
65
- // await this.redisClient.del([key]);
66
53
  }
67
54
  }
68
55
  exports.TransactionProcessRepo = TransactionProcessRepo;
@@ -9,7 +9,7 @@ import type { ProjectMakesOfferRepo } from '../../../repo/projectMakesOffer';
9
9
  import type { SellerRepo } from '../../../repo/seller';
10
10
  import type { IStartedPlaceOrder, PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
11
11
  import { IStartPlaceOrderParams } from './start/factory';
12
- interface IStartOperationRepos {
12
+ export interface IStartOperationRepos {
13
13
  issuer: IssuerRepo;
14
14
  member: MemberRepo;
15
15
  memberProgram: MemberProgramRepo;
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@aws-sdk/client-cognito-identity-provider": "3.600.0",
13
- "@aws-sdk/credential-providers": "3.600.0",
12
+ "@aws-sdk/client-cognito-identity-provider": "3.1090.0",
13
+ "@aws-sdk/credential-providers": "3.1090.0",
14
14
  "@chevre/factory": "10.0.0-alpha.0",
15
15
  "@motionpicture/coa-service": "10.0.0",
16
16
  "@motionpicture/gmo-service": "6.1.0-alpha.0",
@@ -26,7 +26,7 @@
26
26
  "node-fpe": "2.0.4",
27
27
  "pug": "3.0.3",
28
28
  "uniqid": "5.4.0",
29
- "uuid": "^3.4.0"
29
+ "uuid": "11.1.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@eslint/js": "9.39.4",
@@ -39,15 +39,13 @@
39
39
  "@types/node": "22.19.7",
40
40
  "@types/pug": "2.0.10",
41
41
  "@types/uniqid": "^4.1.3",
42
- "@types/uuid": "^3.4.10",
43
42
  "@vitest/coverage-v8": "4.0.18",
44
43
  "@vitest/ui": "4.0.18",
45
44
  "csvtojson": "^2.0.10",
46
45
  "dependency-cruiser": "17.3.8",
47
46
  "eslint": "9.39.2",
48
- "mongodb": "6.20.0",
49
47
  "mongoose": "8.23.0",
50
- "redis": "4.6.5",
48
+ "redis": "4.7.1",
51
49
  "rimraf": "6.1.3",
52
50
  "size-limit": "12.0.0",
53
51
  "typescript": "5.9.3",
@@ -56,7 +54,7 @@
56
54
  },
57
55
  "peerDependencies": {
58
56
  "mongoose": "^8.23.0",
59
- "redis": "^4.6.5"
57
+ "redis": "^4.7.1"
60
58
  },
61
59
  "engines": {
62
60
  "node": ">=22.0.0",
@@ -90,5 +88,5 @@
90
88
  "postversion": "git push origin --tags",
91
89
  "prepublishOnly": "npm run clean && npm run build"
92
90
  },
93
- "version": "25.2.0-alpha.34"
91
+ "version": "25.2.0-alpha.35"
94
92
  }