@taiger-common/model 1.0.14 → 1.0.16
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.
- package/dist/cjs/model/User.js +17 -24
- package/dist/cjs/model/index.js +17 -0
- package/dist/esm/model/User.js +19 -25
- package/dist/esm/model/index.js +17 -0
- package/dist/types/model/User.d.ts +1 -31
- package/dist/types/model/index.d.ts +17 -0
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
package/dist/cjs/model/User.js
CHANGED
|
@@ -3,7 +3,6 @@ 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.Admin = void 0;
|
|
7
6
|
var mongoose_1 = require("mongoose");
|
|
8
7
|
var isEmail_1 = __importDefault(require("validator/lib/isEmail"));
|
|
9
8
|
var core_1 = require("@taiger-common/core");
|
|
@@ -25,7 +24,7 @@ var attributeSchema = new mongoose_1.Schema({
|
|
|
25
24
|
required: true
|
|
26
25
|
}
|
|
27
26
|
});
|
|
28
|
-
var
|
|
27
|
+
var userSchema = new mongoose_1.Schema({
|
|
29
28
|
firstname: {
|
|
30
29
|
type: String,
|
|
31
30
|
trim: true
|
|
@@ -361,8 +360,6 @@ var UserSchema = new mongoose_1.Schema({
|
|
|
361
360
|
},
|
|
362
361
|
lastLoginAt: Date
|
|
363
362
|
}, options);
|
|
364
|
-
var User = (0, mongoose_1.model)('User', UserSchema);
|
|
365
|
-
var Guest = User.discriminator('Guest', new mongoose_1.Schema({}, options), core_1.Role.Guest);
|
|
366
363
|
var applicationSchema = new mongoose_1.Schema({
|
|
367
364
|
programId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Program' },
|
|
368
365
|
uni_assist: {
|
|
@@ -434,7 +431,7 @@ var applicationSchema = new mongoose_1.Schema({
|
|
|
434
431
|
closed: { type: String, default: '-' },
|
|
435
432
|
admission: { type: String, default: '-' }
|
|
436
433
|
});
|
|
437
|
-
var
|
|
434
|
+
var studentSchema = new mongoose_1.Schema({
|
|
438
435
|
agents: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Agent' }],
|
|
439
436
|
editors: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Editor' }],
|
|
440
437
|
needEditor: { type: Boolean, default: false },
|
|
@@ -491,8 +488,8 @@ var Student = User.discriminator('Student', new mongoose_1.Schema({
|
|
|
491
488
|
createdAt: Date
|
|
492
489
|
}
|
|
493
490
|
]
|
|
494
|
-
}, options)
|
|
495
|
-
var
|
|
491
|
+
}, options);
|
|
492
|
+
var externalSchema = new mongoose_1.Schema({
|
|
496
493
|
attribute: {
|
|
497
494
|
can_update_program_list: {
|
|
498
495
|
type: Boolean,
|
|
@@ -507,8 +504,8 @@ var External = User.discriminator('External', new mongoose_1.Schema({
|
|
|
507
504
|
default: false
|
|
508
505
|
}
|
|
509
506
|
}
|
|
510
|
-
}, options)
|
|
511
|
-
var
|
|
507
|
+
}, options);
|
|
508
|
+
var managerSchema = new mongoose_1.Schema({
|
|
512
509
|
agents: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Agent' }],
|
|
513
510
|
editors: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Editor' }],
|
|
514
511
|
manager_type: {
|
|
@@ -552,8 +549,8 @@ var Manager = User.discriminator('Manager', new mongoose_1.Schema({
|
|
|
552
549
|
default: false
|
|
553
550
|
}
|
|
554
551
|
}
|
|
555
|
-
}, options)
|
|
556
|
-
var
|
|
552
|
+
}, options);
|
|
553
|
+
var agentSchema = new mongoose_1.Schema({
|
|
557
554
|
timezone: { type: String, default: '' },
|
|
558
555
|
officehours: {
|
|
559
556
|
Monday: {
|
|
@@ -619,8 +616,8 @@ var Agent = User.discriminator('Agent', new mongoose_1.Schema({
|
|
|
619
616
|
default: false
|
|
620
617
|
}
|
|
621
618
|
}
|
|
622
|
-
}, options)
|
|
623
|
-
var
|
|
619
|
+
}, options);
|
|
620
|
+
var editorSchema = new mongoose_1.Schema({
|
|
624
621
|
editor_notification: {
|
|
625
622
|
isRead_survey_not_complete: {
|
|
626
623
|
type: Boolean,
|
|
@@ -661,16 +658,12 @@ var Editor = User.discriminator('Editor', new mongoose_1.Schema({
|
|
|
661
658
|
default: false
|
|
662
659
|
}
|
|
663
660
|
}
|
|
664
|
-
}, options)
|
|
665
|
-
exports.Admin = User.discriminator('Admin', new mongoose_1.Schema({}, options), core_1.Role.Admin);
|
|
661
|
+
}, options);
|
|
666
662
|
module.exports = {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
Editor: Editor,
|
|
674
|
-
Manager: Manager,
|
|
675
|
-
Admin: exports.Admin
|
|
663
|
+
userSchema: userSchema,
|
|
664
|
+
studentSchema: studentSchema,
|
|
665
|
+
agentSchema: agentSchema,
|
|
666
|
+
externalSchema: externalSchema,
|
|
667
|
+
editorSchema: editorSchema,
|
|
668
|
+
managerSchema: managerSchema
|
|
676
669
|
};
|
package/dist/cjs/model/index.js
CHANGED
|
@@ -24,3 +24,20 @@ __exportStar(require("./Docspage"), exports);
|
|
|
24
24
|
__exportStar(require("./Documentation"), exports);
|
|
25
25
|
__exportStar(require("./Documentthread"), exports);
|
|
26
26
|
__exportStar(require("./Event"), exports);
|
|
27
|
+
__exportStar(require("./Internaldoc"), exports);
|
|
28
|
+
__exportStar(require("./Interval"), exports);
|
|
29
|
+
__exportStar(require("./Event"), exports);
|
|
30
|
+
__exportStar(require("./Interview"), exports);
|
|
31
|
+
__exportStar(require("./InterviewSurveyResponse"), exports);
|
|
32
|
+
__exportStar(require("./Keywordset"), exports);
|
|
33
|
+
__exportStar(require("./Note"), exports);
|
|
34
|
+
__exportStar(require("./Permission"), exports);
|
|
35
|
+
__exportStar(require("./Program"), exports);
|
|
36
|
+
__exportStar(require("./Programrequirement"), exports);
|
|
37
|
+
__exportStar(require("./ResponseTime"), exports);
|
|
38
|
+
__exportStar(require("./SurveyInput"), exports);
|
|
39
|
+
__exportStar(require("./Template"), exports);
|
|
40
|
+
__exportStar(require("./Tenant"), exports);
|
|
41
|
+
__exportStar(require("./Ticket"), exports);
|
|
42
|
+
__exportStar(require("./Token"), exports);
|
|
43
|
+
__exportStar(require("./User"), exports);
|
package/dist/esm/model/User.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
2
|
import isEmail from 'validator/lib/isEmail';
|
|
3
|
-
import {
|
|
3
|
+
import { DocumentStatusType } from '@taiger-common/core';
|
|
4
4
|
import { PROGRAM_SUBJECT_KEYS } from './Program';
|
|
5
5
|
var ManagerType = {
|
|
6
6
|
Agent: 'Agent',
|
|
@@ -19,7 +19,7 @@ var attributeSchema = new Schema({
|
|
|
19
19
|
required: true
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
var
|
|
22
|
+
var userSchema = new Schema({
|
|
23
23
|
firstname: {
|
|
24
24
|
type: String,
|
|
25
25
|
trim: true
|
|
@@ -355,8 +355,6 @@ var UserSchema = new Schema({
|
|
|
355
355
|
},
|
|
356
356
|
lastLoginAt: Date
|
|
357
357
|
}, options);
|
|
358
|
-
var User = model('User', UserSchema);
|
|
359
|
-
var Guest = User.discriminator('Guest', new Schema({}, options), Role.Guest);
|
|
360
358
|
var applicationSchema = new Schema({
|
|
361
359
|
programId: { type: Schema.Types.ObjectId, ref: 'Program' },
|
|
362
360
|
uni_assist: {
|
|
@@ -428,7 +426,7 @@ var applicationSchema = new Schema({
|
|
|
428
426
|
closed: { type: String, default: '-' },
|
|
429
427
|
admission: { type: String, default: '-' }
|
|
430
428
|
});
|
|
431
|
-
var
|
|
429
|
+
var studentSchema = new Schema({
|
|
432
430
|
agents: [{ type: Schema.Types.ObjectId, ref: 'Agent' }],
|
|
433
431
|
editors: [{ type: Schema.Types.ObjectId, ref: 'Editor' }],
|
|
434
432
|
needEditor: { type: Boolean, default: false },
|
|
@@ -485,8 +483,8 @@ var Student = User.discriminator('Student', new Schema({
|
|
|
485
483
|
createdAt: Date
|
|
486
484
|
}
|
|
487
485
|
]
|
|
488
|
-
}, options)
|
|
489
|
-
var
|
|
486
|
+
}, options);
|
|
487
|
+
var externalSchema = new Schema({
|
|
490
488
|
attribute: {
|
|
491
489
|
can_update_program_list: {
|
|
492
490
|
type: Boolean,
|
|
@@ -501,8 +499,8 @@ var External = User.discriminator('External', new Schema({
|
|
|
501
499
|
default: false
|
|
502
500
|
}
|
|
503
501
|
}
|
|
504
|
-
}, options)
|
|
505
|
-
var
|
|
502
|
+
}, options);
|
|
503
|
+
var managerSchema = new Schema({
|
|
506
504
|
agents: [{ type: Schema.Types.ObjectId, ref: 'Agent' }],
|
|
507
505
|
editors: [{ type: Schema.Types.ObjectId, ref: 'Editor' }],
|
|
508
506
|
manager_type: {
|
|
@@ -546,8 +544,8 @@ var Manager = User.discriminator('Manager', new Schema({
|
|
|
546
544
|
default: false
|
|
547
545
|
}
|
|
548
546
|
}
|
|
549
|
-
}, options)
|
|
550
|
-
var
|
|
547
|
+
}, options);
|
|
548
|
+
var agentSchema = new Schema({
|
|
551
549
|
timezone: { type: String, default: '' },
|
|
552
550
|
officehours: {
|
|
553
551
|
Monday: {
|
|
@@ -613,8 +611,8 @@ var Agent = User.discriminator('Agent', new Schema({
|
|
|
613
611
|
default: false
|
|
614
612
|
}
|
|
615
613
|
}
|
|
616
|
-
}, options)
|
|
617
|
-
var
|
|
614
|
+
}, options);
|
|
615
|
+
var editorSchema = new Schema({
|
|
618
616
|
editor_notification: {
|
|
619
617
|
isRead_survey_not_complete: {
|
|
620
618
|
type: Boolean,
|
|
@@ -655,16 +653,12 @@ var Editor = User.discriminator('Editor', new Schema({
|
|
|
655
653
|
default: false
|
|
656
654
|
}
|
|
657
655
|
}
|
|
658
|
-
}, options)
|
|
659
|
-
export var Admin = User.discriminator('Admin', new Schema({}, options), Role.Admin);
|
|
656
|
+
}, options);
|
|
660
657
|
module.exports = {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
Editor: Editor,
|
|
668
|
-
Manager: Manager,
|
|
669
|
-
Admin: Admin
|
|
658
|
+
userSchema: userSchema,
|
|
659
|
+
studentSchema: studentSchema,
|
|
660
|
+
agentSchema: agentSchema,
|
|
661
|
+
externalSchema: externalSchema,
|
|
662
|
+
editorSchema: editorSchema,
|
|
663
|
+
managerSchema: managerSchema
|
|
670
664
|
};
|
package/dist/esm/model/index.js
CHANGED
|
@@ -8,3 +8,20 @@ export * from './Docspage';
|
|
|
8
8
|
export * from './Documentation';
|
|
9
9
|
export * from './Documentthread';
|
|
10
10
|
export * from './Event';
|
|
11
|
+
export * from './Internaldoc';
|
|
12
|
+
export * from './Interval';
|
|
13
|
+
export * from './Event';
|
|
14
|
+
export * from './Interview';
|
|
15
|
+
export * from './InterviewSurveyResponse';
|
|
16
|
+
export * from './Keywordset';
|
|
17
|
+
export * from './Note';
|
|
18
|
+
export * from './Permission';
|
|
19
|
+
export * from './Program';
|
|
20
|
+
export * from './Programrequirement';
|
|
21
|
+
export * from './ResponseTime';
|
|
22
|
+
export * from './SurveyInput';
|
|
23
|
+
export * from './Template';
|
|
24
|
+
export * from './Tenant';
|
|
25
|
+
export * from './Ticket';
|
|
26
|
+
export * from './Token';
|
|
27
|
+
export * from './User';
|
|
@@ -1,31 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="mongoose/types/callback" />
|
|
3
|
-
/// <reference types="mongoose/types/collection" />
|
|
4
|
-
/// <reference types="mongoose/types/connection" />
|
|
5
|
-
/// <reference types="mongoose/types/cursor" />
|
|
6
|
-
/// <reference types="mongoose/types/document" />
|
|
7
|
-
/// <reference types="mongoose/types/error" />
|
|
8
|
-
/// <reference types="mongoose/types/expressions" />
|
|
9
|
-
/// <reference types="mongoose/types/helpers" />
|
|
10
|
-
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
-
/// <reference types="mongoose/types/indexes" />
|
|
12
|
-
/// <reference types="mongoose/types/models" />
|
|
13
|
-
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
-
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
-
/// <reference types="mongoose/types/populate" />
|
|
16
|
-
/// <reference types="mongoose/types/query" />
|
|
17
|
-
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
-
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
-
/// <reference types="mongoose/types/session" />
|
|
20
|
-
/// <reference types="mongoose/types/types" />
|
|
21
|
-
/// <reference types="mongoose/types/utility" />
|
|
22
|
-
/// <reference types="mongoose/types/validation" />
|
|
23
|
-
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
-
/// <reference types="mongoose" />
|
|
25
|
-
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
-
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
export declare const Admin: import("mongoose").Model<unknown, {}, {}, {}, import("mongoose").Document<unknown, {}, unknown> & {
|
|
28
|
-
_id: import("mongoose").Types.ObjectId;
|
|
29
|
-
} & {
|
|
30
|
-
__v: number;
|
|
31
|
-
}, any>;
|
|
1
|
+
export {};
|
|
@@ -8,3 +8,20 @@ export * from './Docspage';
|
|
|
8
8
|
export * from './Documentation';
|
|
9
9
|
export * from './Documentthread';
|
|
10
10
|
export * from './Event';
|
|
11
|
+
export * from './Internaldoc';
|
|
12
|
+
export * from './Interval';
|
|
13
|
+
export * from './Event';
|
|
14
|
+
export * from './Interview';
|
|
15
|
+
export * from './InterviewSurveyResponse';
|
|
16
|
+
export * from './Keywordset';
|
|
17
|
+
export * from './Note';
|
|
18
|
+
export * from './Permission';
|
|
19
|
+
export * from './Program';
|
|
20
|
+
export * from './Programrequirement';
|
|
21
|
+
export * from './ResponseTime';
|
|
22
|
+
export * from './SurveyInput';
|
|
23
|
+
export * from './Template';
|
|
24
|
+
export * from './Tenant';
|
|
25
|
+
export * from './Ticket';
|
|
26
|
+
export * from './Token';
|
|
27
|
+
export * from './User';
|