@taiger-common/model 1.0.48 → 1.0.49

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.
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DocumentStatusType = void 0;
6
+ exports.editorSchema = exports.agentSchema = exports.managerSchema = exports.externalSchema = exports.studentSchema = exports.userSchema = exports.attributeSchema = exports.options = exports.ManagerType = exports.DocumentStatusType = void 0;
7
7
  var mongoose_1 = require("mongoose");
8
8
  var validator_1 = __importDefault(require("validator"));
9
9
  var users_1 = require("../constants/users");
@@ -17,14 +17,14 @@ var DocumentStatusType;
17
17
  DocumentStatusType["Rejected"] = "rejected";
18
18
  DocumentStatusType["NotNeeded"] = "notneeded";
19
19
  })(DocumentStatusType = exports.DocumentStatusType || (exports.DocumentStatusType = {}));
20
- var ManagerType = {
20
+ exports.ManagerType = {
21
21
  Agent: 'Agent',
22
22
  Editor: 'Editor',
23
23
  AgentAndEditor: 'AgentAndEditor',
24
24
  None: 'None'
25
25
  };
26
- var options = { discriminatorKey: 'role', timestamps: true };
27
- var attributeSchema = new mongoose_1.Schema({
26
+ exports.options = { discriminatorKey: 'role', timestamps: true };
27
+ exports.attributeSchema = new mongoose_1.Schema({
28
28
  value: {
29
29
  type: Number,
30
30
  required: true
@@ -34,7 +34,7 @@ var attributeSchema = new mongoose_1.Schema({
34
34
  required: true
35
35
  }
36
36
  });
37
- var userSchema = new mongoose_1.Schema({
37
+ exports.userSchema = new mongoose_1.Schema({
38
38
  role: {
39
39
  type: String,
40
40
  enum: Object.values(users_1.Role),
@@ -377,8 +377,8 @@ var userSchema = new mongoose_1.Schema({
377
377
  }
378
378
  },
379
379
  lastLoginAt: Date
380
- }, options);
381
- var studentSchema = new mongoose_1.Schema({
380
+ }, exports.options);
381
+ exports.studentSchema = new mongoose_1.Schema({
382
382
  agents: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Agent' }],
383
383
  editors: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Editor' }],
384
384
  needEditor: { type: Boolean, default: false },
@@ -388,7 +388,7 @@ var studentSchema = new mongoose_1.Schema({
388
388
  },
389
389
  attributes: [
390
390
  {
391
- type: attributeSchema,
391
+ type: exports.attributeSchema,
392
392
  required: true
393
393
  }
394
394
  ],
@@ -434,8 +434,8 @@ var studentSchema = new mongoose_1.Schema({
434
434
  createdAt: Date
435
435
  }
436
436
  ]
437
- }, options);
438
- var externalSchema = new mongoose_1.Schema({
437
+ }, exports.options);
438
+ exports.externalSchema = new mongoose_1.Schema({
439
439
  attribute: {
440
440
  can_update_program_list: {
441
441
  type: Boolean,
@@ -450,14 +450,14 @@ var externalSchema = new mongoose_1.Schema({
450
450
  default: false
451
451
  }
452
452
  }
453
- }, options);
454
- var managerSchema = new mongoose_1.Schema({
453
+ }, exports.options);
454
+ exports.managerSchema = new mongoose_1.Schema({
455
455
  agents: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Agent' }],
456
456
  editors: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Editor' }],
457
457
  manager_type: {
458
458
  type: String,
459
- enum: Object.values(ManagerType),
460
- default: ManagerType.None
459
+ enum: Object.values(exports.ManagerType),
460
+ default: exports.ManagerType.None
461
461
  },
462
462
  manager_notification: {
463
463
  isRead_new_base_docs_uploaded: [
@@ -495,7 +495,7 @@ var managerSchema = new mongoose_1.Schema({
495
495
  default: false
496
496
  }
497
497
  }
498
- }, options);
498
+ }, exports.options);
499
499
  var officehours = {
500
500
  Monday: {
501
501
  active: { type: Boolean, default: false },
@@ -526,7 +526,7 @@ var officehours = {
526
526
  time_slots: [{ type: Object }]
527
527
  }
528
528
  };
529
- var agentSchema = new mongoose_1.Schema({
529
+ exports.agentSchema = new mongoose_1.Schema({
530
530
  timezone: { type: String, default: '' },
531
531
  officehours: officehours,
532
532
  selfIntroduction: {
@@ -563,8 +563,8 @@ var agentSchema = new mongoose_1.Schema({
563
563
  default: false
564
564
  }
565
565
  }
566
- }, options);
567
- var editorSchema = new mongoose_1.Schema({
566
+ }, exports.options);
567
+ exports.editorSchema = new mongoose_1.Schema({
568
568
  timezone: { type: String, default: '' },
569
569
  officehours: officehours,
570
570
  editor_notification: {
@@ -607,13 +607,4 @@ var editorSchema = new mongoose_1.Schema({
607
607
  default: false
608
608
  }
609
609
  }
610
- }, options);
611
- module.exports = {
612
- attributeSchema: attributeSchema,
613
- userSchema: userSchema,
614
- studentSchema: studentSchema,
615
- agentSchema: agentSchema,
616
- externalSchema: externalSchema,
617
- editorSchema: editorSchema,
618
- managerSchema: managerSchema
619
- };
610
+ }, exports.options);
@@ -11,14 +11,14 @@ export var DocumentStatusType;
11
11
  DocumentStatusType["Rejected"] = "rejected";
12
12
  DocumentStatusType["NotNeeded"] = "notneeded";
13
13
  })(DocumentStatusType || (DocumentStatusType = {}));
14
- var ManagerType = {
14
+ export var ManagerType = {
15
15
  Agent: 'Agent',
16
16
  Editor: 'Editor',
17
17
  AgentAndEditor: 'AgentAndEditor',
18
18
  None: 'None'
19
19
  };
20
- var options = { discriminatorKey: 'role', timestamps: true };
21
- var attributeSchema = new Schema({
20
+ export var options = { discriminatorKey: 'role', timestamps: true };
21
+ export var attributeSchema = new Schema({
22
22
  value: {
23
23
  type: Number,
24
24
  required: true
@@ -28,7 +28,7 @@ var attributeSchema = new Schema({
28
28
  required: true
29
29
  }
30
30
  });
31
- var userSchema = new Schema({
31
+ export var userSchema = new Schema({
32
32
  role: {
33
33
  type: String,
34
34
  enum: Object.values(Role),
@@ -372,7 +372,7 @@ var userSchema = new Schema({
372
372
  },
373
373
  lastLoginAt: Date
374
374
  }, options);
375
- var studentSchema = new Schema({
375
+ export var studentSchema = new Schema({
376
376
  agents: [{ type: Schema.Types.ObjectId, ref: 'Agent' }],
377
377
  editors: [{ type: Schema.Types.ObjectId, ref: 'Editor' }],
378
378
  needEditor: { type: Boolean, default: false },
@@ -429,7 +429,7 @@ var studentSchema = new Schema({
429
429
  }
430
430
  ]
431
431
  }, options);
432
- var externalSchema = new Schema({
432
+ export var externalSchema = new Schema({
433
433
  attribute: {
434
434
  can_update_program_list: {
435
435
  type: Boolean,
@@ -445,7 +445,7 @@ var externalSchema = new Schema({
445
445
  }
446
446
  }
447
447
  }, options);
448
- var managerSchema = new Schema({
448
+ export var managerSchema = new Schema({
449
449
  agents: [{ type: Schema.Types.ObjectId, ref: 'Agent' }],
450
450
  editors: [{ type: Schema.Types.ObjectId, ref: 'Editor' }],
451
451
  manager_type: {
@@ -520,7 +520,7 @@ var officehours = {
520
520
  time_slots: [{ type: Object }]
521
521
  }
522
522
  };
523
- var agentSchema = new Schema({
523
+ export var agentSchema = new Schema({
524
524
  timezone: { type: String, default: '' },
525
525
  officehours: officehours,
526
526
  selfIntroduction: {
@@ -558,7 +558,7 @@ var agentSchema = new Schema({
558
558
  }
559
559
  }
560
560
  }, options);
561
- var editorSchema = new Schema({
561
+ export var editorSchema = new Schema({
562
562
  timezone: { type: String, default: '' },
563
563
  officehours: officehours,
564
564
  editor_notification: {
@@ -602,12 +602,3 @@ var editorSchema = new Schema({
602
602
  }
603
603
  }
604
604
  }, options);
605
- module.exports = {
606
- attributeSchema: attributeSchema,
607
- userSchema: userSchema,
608
- studentSchema: studentSchema,
609
- agentSchema: agentSchema,
610
- externalSchema: externalSchema,
611
- editorSchema: editorSchema,
612
- managerSchema: managerSchema
613
- };