@chevre/domain 21.4.0-alpha.31 → 21.4.0-alpha.33

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.
@@ -7,7 +7,7 @@ import { chevre } from '../../../../lib/index';
7
7
  const memberId = String(process.env.MEMBER_ID);
8
8
 
9
9
  async function main() {
10
- await mongoose.connect(<string>process.env.MONGOLAB_URI);
10
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: true });
11
11
 
12
12
  const memberRepo = new chevre.repository.Member(mongoose.connection);
13
13
 
@@ -8,7 +8,7 @@ import { chevre } from '../../../lib/index';
8
8
  const project = { id: String(process.env.PROJECT_ID) };
9
9
 
10
10
  async function main() {
11
- await mongoose.connect(<string>process.env.MONGOLAB_URI);
11
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
12
12
 
13
13
  const actionRepo = new chevre.repository.Action(mongoose.connection);
14
14
  const categoryCodeRepo = new chevre.repository.CategoryCode(mongoose.connection);
@@ -21,10 +21,11 @@ async function main() {
21
21
  id: project.id,
22
22
  typeOf: chevre.factory.organizationType.Project
23
23
  },
24
- locationBranchCode: '018',
25
- importFrom: moment('2023-05-17T02:45:00.214Z')
24
+ locationBranchCode: '022',
25
+ importFrom: moment()
26
26
  .toDate(),
27
- importThrough: moment('2023-05-20T02:45:00.214Z')
27
+ importThrough: moment()
28
+ .add(1, 'day')
28
29
  .toDate(),
29
30
  saveMovieTheater: false,
30
31
  saveScreeningEventSeries: false
@@ -9,7 +9,7 @@ import { chevre } from '../../../lib/index';
9
9
 
10
10
  // tslint:disable-next-line:max-func-body-length
11
11
  async function main() {
12
- await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: true });
12
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
13
13
 
14
14
  const eventRepo = new chevre.repository.Event(mongoose.connection);
15
15
  const placeRepo = new chevre.repository.Place(mongoose.connection);
@@ -9,7 +9,7 @@ import { chevre } from '../../../lib/index';
9
9
 
10
10
  // tslint:disable-next-line:max-func-body-length
11
11
  async function main() {
12
- await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: true });
12
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
13
13
 
14
14
  const memberRepo = new chevre.repository.Member(mongoose.connection);
15
15
 
@@ -9,7 +9,7 @@ import { chevre } from '../../../lib/index';
9
9
 
10
10
  // tslint:disable-next-line:max-func-body-length
11
11
  async function main() {
12
- await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: true });
12
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
13
13
 
14
14
  const placeRepo = new chevre.repository.Place(mongoose.connection);
15
15
 
@@ -6,7 +6,7 @@ import * as mongoose from 'mongoose';
6
6
  // const project = { id: String(process.env.PROJECT_ID) };
7
7
 
8
8
  async function main() {
9
- await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: true });
9
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
10
10
 
11
11
  const actionRepo = new chevre.repository.Action(mongoose.connection);
12
12
  const actions = await actionRepo.search(
@@ -128,6 +128,7 @@ export declare class MongoRepository {
128
128
  };
129
129
  project?: {
130
130
  id?: {
131
+ $eq?: string;
131
132
  $regex?: string;
132
133
  };
133
134
  };
@@ -274,7 +274,7 @@ class MongoRepository {
274
274
  * メンバーの権限を持つプロジェクト検索
275
275
  */
276
276
  searchProjectIdsByMemberId(params) {
277
- var _a, _b;
277
+ var _a, _b, _c, _d;
278
278
  return __awaiter(this, void 0, void 0, function* () {
279
279
  if (typeof params.limit !== 'number') {
280
280
  throw new factory.errors.ArgumentNull('limit');
@@ -283,7 +283,10 @@ class MongoRepository {
283
283
  throw new factory.errors.ArgumentNull('page');
284
284
  }
285
285
  const matchStages = [{ $match: { 'member.id': { $eq: params.member.id } } }];
286
- if (typeof ((_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$regex) === 'string' && params.project.id.$regex.length > 0) {
286
+ if (typeof ((_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq) === 'string') {
287
+ matchStages.push({ $match: { 'project.id': { $eq: params.project.id.$eq } } });
288
+ }
289
+ if (typeof ((_d = (_c = params.project) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.$regex) === 'string' && params.project.id.$regex.length > 0) {
287
290
  matchStages.push({ $match: { 'project.id': { $regex: new RegExp(params.project.id.$regex) } } });
288
291
  }
289
292
  const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
@@ -50,8 +50,16 @@ exports.schema = schema;
50
50
  schema.index({ createdAt: 1 }, { name: 'searchByCreatedAt' });
51
51
  schema.index({ updatedAt: 1 }, { name: 'searchByUpdatedAt' });
52
52
  schema.index({ 'member.id': 1 }, { name: 'searchByMemberId' });
53
- schema.index({ 'project.id': 1, 'member.id': 1 }, {
54
- name: 'uniqueProjectMember',
53
+ // uniqueIndex再設定(2023-07-25~)
54
+ // schema.index(
55
+ // { 'project.id': 1, 'member.id': 1 },
56
+ // {
57
+ // name: 'uniqueProjectMember',
58
+ // unique: true
59
+ // }
60
+ // );
61
+ schema.index({ 'project.id': 1, 'member.id': 1, 'member.memberOf.id': 1 }, {
62
+ name: 'uniqueIAMMember',
55
63
  unique: true
56
64
  });
57
65
  schema.index({ 'member.typeOf': 1, 'member.id': 1 }, {
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.4.0-alpha.31"
120
+ "version": "21.4.0-alpha.33"
121
121
  }