@chevre/domain 21.15.0-alpha.0 → 21.15.0-alpha.1

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.
@@ -14,14 +14,18 @@ async function main() {
14
14
 
15
15
  const now = new Date();
16
16
 
17
- const events = await eventRepo.search<chevre.factory.eventType.ScreeningEvent>({
18
- typeOf: chevre.factory.eventType.ScreeningEvent,
19
- project: { id: { $eq: project.id } },
20
- startFrom: now
21
- // startFrom: moment().add(-1, 'day').toDate(),
22
- // startThrough: moment().add(1, 'day').toDate(),
23
- // startThrough: now
24
- });
17
+ const events = await eventRepo.search<chevre.factory.eventType.ScreeningEvent>(
18
+ {
19
+ typeOf: chevre.factory.eventType.ScreeningEvent,
20
+ project: { id: { $eq: project.id } },
21
+ startFrom: now
22
+ // startFrom: moment().add(-1, 'day').toDate(),
23
+ // startThrough: moment().add(1, 'day').toDate(),
24
+ // startThrough: now
25
+ },
26
+ [],
27
+ []
28
+ );
25
29
 
26
30
  // console.log(events);
27
31
  console.log(events.length);
@@ -15,18 +15,16 @@ async function main() {
15
15
 
16
16
  const events = await eventRepo.search(
17
17
  {
18
- // limit: 100,
19
- // page: 1,
18
+ limit: 100,
19
+ page: 1,
20
20
  // sort: { startDate: 1 },
21
21
  // typeOf: chevre.factory.eventType.ScreeningEvent,
22
22
  project: { id: { $eq: PROJECT_ID } },
23
- id: { $eq: 'al6aff83y' },
23
+ // id: { $eq: 'al6aff83y' },
24
24
  typeOfIn: [chevre.factory.eventType.Event, chevre.factory.eventType.ScreeningEvent]
25
25
  },
26
- {
27
- _id: 1
28
- // name: 1
29
- }
26
+ ['_id', 'name'],
27
+ []
30
28
  );
31
29
  console.log(events);
32
30
  console.log(events.length, 'events found');
@@ -23,7 +23,7 @@
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import type { BulkWriteResult } from 'mongodb';
26
- import type { Connection } from 'mongoose';
26
+ import type { Connection, FilterQuery } from 'mongoose';
27
27
  import * as factory from '../factory';
28
28
  import * as EventFactory from '../factory/event';
29
29
  export interface IAttributes4patchUpdate<T extends factory.eventType> {
@@ -78,8 +78,8 @@ interface IAggregateEvent {
78
78
  statuses: IStatus[];
79
79
  }
80
80
  type IKeyOfProjection<T extends factory.eventType> = keyof factory.event.IEvent<T> | '_id' | '__v' | 'createdAt' | 'updatedAt';
81
- type IProjection<T extends factory.eventType> = {
82
- [key in IKeyOfProjection<T>]?: 0 | 1;
81
+ type IUnset<T extends factory.eventType> = {
82
+ [key in keyof factory.event.IEvent<T>]?: 1;
83
83
  };
84
84
  export import IMinimizedIndividualEvent = EventFactory.IMinimizedIndividualEvent;
85
85
  export declare const keyOfMinimizedScreeningEvent: IKeyOfProjection<factory.eventType.ScreeningEvent>[];
@@ -90,7 +90,7 @@ export declare const keyOfMinimizedEvent: IKeyOfProjection<factory.eventType.Eve
90
90
  export declare class MongoRepository {
91
91
  private readonly eventModel;
92
92
  constructor(connection: Connection);
93
- static CREATE_MONGO_CONDITIONS<T extends factory.eventType>(conditions: ISearchConditions<T>): any[];
93
+ static CREATE_MONGO_CONDITIONS<T extends factory.eventType>(conditions: ISearchConditions<T>): FilterQuery<factory.event.IEvent<T>>[];
94
94
  /**
95
95
  * 複数イベントを作成する
96
96
  */
@@ -135,13 +135,13 @@ export declare class MongoRepository {
135
135
  save<T extends factory.eventType>(params: {
136
136
  id?: string;
137
137
  attributes: factory.event.IAttributes<T>;
138
- $unset?: IProjection<T>;
138
+ $unset?: IUnset<T>;
139
139
  upsert?: boolean;
140
140
  }): Promise<factory.event.IEvent<T>>;
141
141
  saveMany<T extends factory.eventType>(params: {
142
142
  id: string;
143
143
  attributes: factory.event.IAttributes<T>;
144
- $unset?: IProjection<T>;
144
+ $unset?: IUnset<T>;
145
145
  upsert: boolean;
146
146
  }[]): Promise<void>;
147
147
  save4ttts(params: {
@@ -282,10 +282,10 @@ export declare class MongoRepository {
282
282
  validationErrors: import("mongoose").Error[];
283
283
  } | undefined;
284
284
  }>;
285
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
285
+ getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
286
286
  unsetUnnecessaryFields(params: {
287
- filter: any;
288
- $unset: any;
287
+ filter: FilterQuery<any>;
288
+ $unset: IUnset<any>;
289
289
  }): Promise<import("mongodb").UpdateResult>;
290
290
  /**
291
291
  * 既存施設コンテンツの最大バージョンを集計する
package/package.json CHANGED
@@ -117,5 +117,5 @@
117
117
  "postversion": "git push origin --tags",
118
118
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
119
119
  },
120
- "version": "21.15.0-alpha.0"
120
+ "version": "21.15.0-alpha.1"
121
121
  }