cloud-ide-model-schema 1.0.2 → 1.0.3

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.
Files changed (55) hide show
  1. package/config/database.ts +20 -0
  2. package/config/index.ts +5 -0
  3. package/index.ts +5 -0
  4. package/package.json +1 -1
  5. package/schema/auth/auth_logses.ts +68 -0
  6. package/schema/auth/{auth_user_mst.js → auth_user_mst.ts} +143 -130
  7. package/schema/auth/index.ts +13 -0
  8. package/schema/auth/mpin.ts +60 -0
  9. package/schema/core/core_entity_mapping.ts +49 -0
  10. package/schema/core/core_general_master.ts +52 -0
  11. package/schema/core/core_general_master_type.ts +46 -0
  12. package/schema/core/core_page_controls.ts +100 -0
  13. package/schema/core/core_page_grid.ts +48 -0
  14. package/schema/core/core_page_tab.ts +54 -0
  15. package/schema/core/core_pin_code.ts +73 -0
  16. package/schema/core/core_system_config.ts +54 -0
  17. package/schema/core/{core_system_entity.js → core_system_entity.ts} +216 -200
  18. package/schema/core/{core_system_logs.js → core_system_logs.ts} +141 -137
  19. package/schema/core/core_system_menu.ts +74 -0
  20. package/schema/core/core_system_pages.ts +59 -0
  21. package/schema/core/core_system_pages_theme.ts +60 -0
  22. package/schema/core/index.ts +42 -0
  23. package/schema/email/elist.ts +47 -0
  24. package/schema/email/elog.ts +68 -0
  25. package/schema/email/eref.ts +49 -0
  26. package/schema/email/esub.ts +81 -0
  27. package/schema/email/etmp.ts +46 -0
  28. package/schema/email/evdr.ts +46 -0
  29. package/schema/email/index.ts +21 -0
  30. package/tsconfig.json +111 -0
  31. package/config/database.js +0 -57
  32. package/config/index.js +0 -5
  33. package/index.js +0 -21
  34. package/schema/auth/auth_logses.js +0 -73
  35. package/schema/auth/index.js +0 -10
  36. package/schema/auth/mpin.js +0 -74
  37. package/schema/core/core_entity_mapping.js +0 -57
  38. package/schema/core/core_general_master.js +0 -60
  39. package/schema/core/core_general_master_type.js +0 -56
  40. package/schema/core/core_page_controls.js +0 -98
  41. package/schema/core/core_page_grid.js +0 -59
  42. package/schema/core/core_page_tab.js +0 -56
  43. package/schema/core/core_pin_code.js +0 -74
  44. package/schema/core/core_system_config.js +0 -68
  45. package/schema/core/core_system_menu.js +0 -83
  46. package/schema/core/core_system_pages.js +0 -71
  47. package/schema/core/core_system_pages_theme.js +0 -71
  48. package/schema/core/index.js +0 -34
  49. package/schema/email/elist.js +0 -62
  50. package/schema/email/elog.js +0 -78
  51. package/schema/email/eref.js +0 -63
  52. package/schema/email/esub.js +0 -89
  53. package/schema/email/etmp.js +0 -61
  54. package/schema/email/evdr.js +0 -61
  55. package/schema/email/index.js +0 -21
@@ -0,0 +1,20 @@
1
+ import * as mongoose from 'mongoose';
2
+ import dotenv from 'dotenv';
3
+
4
+ dotenv.config();
5
+
6
+ async function connectDB() {
7
+ const options:any = {
8
+ // authSource: process.env.MONGODB_AUTH_SOURCE || 'admin', // Optional authentication database
9
+ connectTimeoutMS: 10000,
10
+ socketTimeoutMS: 30000,
11
+ // Other MongoDB connection options as needed
12
+ };
13
+ await mongoose.connect(process.env.MONGODB_URI || '', options).then(() => {
14
+ console.log('Connected to MongoDB');
15
+ }).catch((error) => {
16
+ console.error('Error connecting to MongoDB:', error);
17
+ });
18
+ }
19
+
20
+ export { connectDB };
@@ -0,0 +1,5 @@
1
+ import { connectDB } from './database';
2
+
3
+ export {
4
+ connectDB
5
+ }
package/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * from './schema/auth';
2
+ export * from './schema/core';
3
+ export * from './schema/email';
4
+ /* database config */
5
+ export { connectDB } from './config';
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "typescript": "^5.4.2"
9
9
  },
10
10
  "name": "cloud-ide-model-schema",
11
- "version": "1.0.2",
11
+ "version": "1.0.3",
12
12
  "description": "Pachage for schema management of Cloud IDEsys LMS",
13
13
  "main": "index.js",
14
14
  "scripts": {
@@ -0,0 +1,68 @@
1
+ import mongoose, { Schema } from "mongoose";
2
+
3
+ /* INTERFACE START */
4
+ interface ILogses {
5
+ _id: string;
6
+ logses_id_user: string;
7
+ logses_start_dtm: Date;
8
+ logses_end_dtm: Date;
9
+ logses_end_max_dtm: Date;
10
+ logses_token: string;
11
+ logses_user_ask_mpin: string;
12
+ logses_last_id_logses: string;
13
+ logses_sequence: number;
14
+ logses_isactive: boolean;
15
+ }
16
+ /* INTERFACE END */
17
+
18
+ /* SCHEMA START */
19
+ const auth_logses = new Schema({
20
+ logses_id_user: {
21
+ type: mongoose.Schema.Types.ObjectId,
22
+ ref: 'auth_user_mst'
23
+ },
24
+ logses_start_dtm: {
25
+ type: Date,
26
+ required: true,
27
+ default: new Date()
28
+ },
29
+ logses_end_dtm: {
30
+ type: Date,
31
+ required: true,
32
+ default: new Date()
33
+ },
34
+ logses_end_max_dtm: {
35
+ type: Date,
36
+ required: true,
37
+ default: new Date()
38
+ },
39
+ logses_token: {
40
+ type: String,
41
+ trim: true
42
+ },
43
+ logses_user_ask_mpin: {
44
+ type: Boolean,
45
+ required: true,
46
+ default: false
47
+ },
48
+ logses_last_id_logses: {
49
+ type: mongoose.Schema.Types.ObjectId,
50
+ ref: "auth_logses"
51
+ },
52
+ logses_sequence: {
53
+ type: Number,
54
+ default: 1
55
+ },
56
+ logses_isactive: {
57
+ type: Boolean,
58
+ default: true
59
+ }
60
+ }, { collection: 'auth_logses' });
61
+
62
+ const Clogses = mongoose.model<ILogses>('auth_logses', auth_logses);
63
+ /* SCHEMA END */
64
+
65
+ export {
66
+ ILogses, // interface name
67
+ Clogses // collecton name
68
+ };
@@ -1,130 +1,143 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.CUser = void 0;
27
- const mongoose_1 = __importStar(require("mongoose"));
28
- /* INTERFACE END */
29
- /* SCHEMA START */
30
- const auth_user_mst = new mongoose_1.Schema({
31
- user_id_ent: {
32
- type: String,
33
- comment: "Unique Entity id"
34
- },
35
- user_username: {
36
- type: String,
37
- minlength: 8,
38
- maxlength: 20,
39
- required: true,
40
- trim: true,
41
- unique: true,
42
- comment: "Unique User Name",
43
- message: "Unique User Name"
44
- },
45
- user_firstname: {
46
- type: String,
47
- minlength: 3,
48
- maxlength: 20
49
- },
50
- user_middlename: {
51
- type: String,
52
- minlength: 3,
53
- maxlength: 20
54
- },
55
- user_lastname: {
56
- type: String,
57
- minlength: 8,
58
- maxlength: 20
59
- },
60
- user_fullname: {
61
- type: String,
62
- minlength: 8,
63
- maxlength: 52
64
- },
65
- user_emailid: {
66
- type: String,
67
- minlength: 8,
68
- maxlength: 50,
69
- trim: true,
70
- unique: true,
71
- comment: "Unique Email ID",
72
- message: "Unique Email ID"
73
- },
74
- user_mobileno: {
75
- type: Number,
76
- minlength: 10,
77
- maxlength: 15,
78
- trim: true,
79
- unique: true,
80
- comment: "Unique Mobile no",
81
- message: "Unique Mobile no"
82
- },
83
- user_password: {
84
- type: String,
85
- maxlength: 250,
86
- trim: true
87
- },
88
- user_activefrom: {
89
- type: Date,
90
- comment: "User Effective from- Default is created date"
91
- },
92
- user_activeupto: {
93
- type: Date,
94
- comment: "User Valid upto registered academic year default"
95
- },
96
- user_photo_id_fm: {
97
- type: String,
98
- comment: "photo file manager id",
99
- trim: true
100
- },
101
- user_passwordchangeonlogin: {
102
- type: Boolean,
103
- comment: "Change password on Login. Flag can be set by the Admin/ Reset option",
104
- default: true
105
- },
106
- user_id_role: {
107
- type: String,
108
- comment: "Role Id associated with the user.",
109
- trim: true
110
- },
111
- user_id_desg: {
112
- type: String,
113
- comment: "Users Designation",
114
- trim: true
115
- },
116
- user_id_dept: {
117
- type: String,
118
- comment: "Users Department",
119
- trim: true
120
- },
121
- user_permissions: {
122
- type: Array,
123
- default: []
124
- },
125
- user_isactive: {
126
- type: Boolean
127
- }
128
- }, { collection: 'auth_user_mst' });
129
- const CUser = mongoose_1.default.model('auth_user_mst', auth_user_mst);
130
- exports.CUser = CUser;
1
+ import mongoose, { Schema } from "mongoose";
2
+
3
+ /* INTERFACE START */
4
+ interface IUser {
5
+ _id?: string;
6
+ user_id_ent?: string;
7
+ user_username?: string;
8
+ user_firstname?: string;
9
+ user_middlename?: string;
10
+ user_lastname?: string;
11
+ user_fullname?: string;
12
+ user_emailid?: string;
13
+ user_mobileno?: number;
14
+ user_password?: string;
15
+ user_activefrom?: Date;
16
+ user_activeupto?: Date;
17
+ user_photo_id_fm?: string;
18
+ user_passwordchangeonlogin?: boolean;
19
+ user_id_role?: string;
20
+ user_id_desg?: string;
21
+ user_id_dept?: string;
22
+ user_permissions?: IUserPermissions[];
23
+ user_isactive?: boolean;
24
+ }
25
+
26
+ interface IUserPermissions {
27
+ _id: string;
28
+ create?: boolean;
29
+ read?: boolean;
30
+ update?: boolean;
31
+ delete?: boolean;
32
+ }
33
+ /* INTERFACE END */
34
+
35
+ /* SCHEMA START */
36
+ const auth_user_mst: Schema = new Schema({
37
+ user_id_ent: {
38
+ type: String,
39
+ comment: "Unique Entity id"
40
+ },
41
+ user_username: {
42
+ type: String,
43
+ minlength: 8,
44
+ maxlength: 20,
45
+ required: true,
46
+ trim: true,
47
+ unique: true,
48
+ comment: "Unique User Name",
49
+ message: "Unique User Name"
50
+ },
51
+ user_firstname: {
52
+ type: String,
53
+ minlength: 3,
54
+ maxlength: 20
55
+ },
56
+ user_middlename: {
57
+ type: String,
58
+ minlength: 3,
59
+ maxlength: 20
60
+ },
61
+ user_lastname: {
62
+ type: String,
63
+ minlength: 8,
64
+ maxlength: 20
65
+ },
66
+ user_fullname: {
67
+ type: String,
68
+ minlength: 8,
69
+ maxlength: 52
70
+ },
71
+ user_emailid: {
72
+ type: String,
73
+ minlength: 8,
74
+ maxlength: 50,
75
+ trim: true,
76
+ unique: true,
77
+ comment: "Unique Email ID",
78
+ message: "Unique Email ID"
79
+ },
80
+ user_mobileno: {
81
+ type: Number,
82
+ minlength: 10,
83
+ maxlength: 15,
84
+ trim: true,
85
+ unique: true,
86
+ comment: "Unique Mobile no",
87
+ message: "Unique Mobile no"
88
+ },
89
+ user_password: {
90
+ type: String,
91
+ maxlength: 250,
92
+ trim: true
93
+ },
94
+ user_activefrom: {
95
+ type: Date,
96
+ comment: "User Effective from- Default is created date"
97
+ },
98
+ user_activeupto: {
99
+ type: Date,
100
+ comment: "User Valid upto registered academic year default"
101
+ },
102
+ user_photo_id_fm: {
103
+ type: String,
104
+ comment: "photo file manager id",
105
+ trim: true
106
+ },
107
+ user_passwordchangeonlogin: {
108
+ type: Boolean,
109
+ comment: "Change password on Login. Flag can be set by the Admin/ Reset option",
110
+ default: true
111
+ },
112
+ user_id_role: {
113
+ type: String,
114
+ comment: "Role Id associated with the user.",
115
+ trim: true
116
+ },
117
+ user_id_desg: {
118
+ type: String,
119
+ comment: "Users Designation",
120
+ trim: true
121
+ },
122
+ user_id_dept: {
123
+ type: String,
124
+ comment: "Users Department",
125
+ trim: true
126
+ },
127
+ user_permissions: {
128
+ type: Array,
129
+ default: []
130
+ },
131
+ user_isactive: {
132
+ type: Boolean
133
+ }
134
+ }, { collection: 'auth_user_mst' });
135
+
136
+ const CUser = mongoose.model<IUser>('auth_user_mst', auth_user_mst);
137
+ /* SCHEMA END */
138
+
139
+ export {
140
+ IUser, // interface name
141
+ IUserPermissions,
142
+ CUser // collecton name
143
+ };
@@ -0,0 +1,13 @@
1
+ import { CUser, IUser, IUserPermissions } from "./auth_user_mst"
2
+ import { Clogses, ILogses } from './auth_logses';
3
+ import { IMpin, CMpin } from './mpin';
4
+
5
+ // export all model and collections
6
+ export {
7
+ /* user Schemas */
8
+ CUser, IUser, IUserPermissions,
9
+ /* Logsession schemas */
10
+ Clogses, ILogses,
11
+ /* Mpin schemas */
12
+ IMpin, CMpin
13
+ }
@@ -0,0 +1,60 @@
1
+ import mongoose, { Schema } from "mongoose";
2
+
3
+ /* INTERFASE START */
4
+ class IMpin {
5
+ mpin_pin!: number;
6
+ mpin_id_user!: string;
7
+ mpin_expiry_dtm!: Date;
8
+ mpin_used!: boolean;
9
+ mpin_isactive!: boolean;
10
+ }
11
+ /* INTERFACE END */
12
+
13
+ /* SCHEMA START */
14
+ const auth_mpin: Schema = new Schema({
15
+ mpin_id_user: {
16
+ type: mongoose.Schema.Types.ObjectId,
17
+ ref: 'auth_user_mst',
18
+ required: true,
19
+ comment: "User unique primery key, reference user"
20
+ },
21
+ mpin_pin: {
22
+ type: Number,
23
+ require: true,
24
+ unique: true,
25
+ minlength: 6,
26
+ minlenght: 6
27
+ },
28
+ mpin_generation_dtm: {
29
+ type: Date,
30
+ required: true,
31
+ default: new Date()
32
+ },
33
+ mpin_expiry_dtm: {
34
+ type: Date,
35
+ required: true,
36
+ default: new Date()
37
+ },
38
+ mpin_used: {
39
+ type: Boolean,
40
+ default: false
41
+ },
42
+ mpin_id_logses: {
43
+ type: mongoose.Schema.Types.ObjectId,
44
+ comment: "logses session table, whre loggin id is stored which used the mpin",
45
+ trim: true
46
+ },
47
+ mpin_isactive: {
48
+ type: Boolean,
49
+ default: true,
50
+ comment: "automaticaly expire when expiry time completes, when authenticator is refreshed new key generates and this will set to false"
51
+ }
52
+ }, { collection: 'auth_mpin' });
53
+
54
+ const CMpin = mongoose.model<IMpin>("auth_mpin", auth_mpin);
55
+ /* SCHIMA END */
56
+
57
+ export {
58
+ IMpin, // interface
59
+ CMpin // collection
60
+ };
@@ -0,0 +1,49 @@
1
+ import mongoose, { Schema } from "mongoose";
2
+
3
+ /* INTERFASE START */
4
+ interface ICoreSyenm {
5
+ _id?: string;
6
+ syenm_id_user?: string;
7
+ syenm_id_syen?: string;
8
+ syenm_id_logses?: string;
9
+ syenm_isactive?: boolean;
10
+ syenm_isdefault?: boolean;
11
+ syenm_isloggedin?: boolean;
12
+ }
13
+ /* INTERFACE END */
14
+
15
+ /* SCHEMA START */
16
+ const core_entity_mapping: Schema = new Schema({
17
+ syenm_id_user: {
18
+ type: mongoose.Schema.Types.ObjectId,
19
+ ref: "auth_user_mst"
20
+ },
21
+ syenm_id_syen: {
22
+ type: mongoose.Schema.Types.ObjectId,
23
+ ref: "core_system_entity"
24
+ },
25
+ syenm_id_logses: {
26
+ type: mongoose.Schema.Types.ObjectId,
27
+ ref: "auth_logses"
28
+ },
29
+ syenm_isactive: {
30
+ type: Boolean,
31
+ default: true
32
+ },
33
+ syenm_isloggedin: {
34
+ type: Boolean,
35
+ default: true
36
+ },
37
+ syenm_isdefault: {
38
+ type: Boolean,
39
+ default: true
40
+ },
41
+ }, { collection: 'core_entity_mapping' });
42
+
43
+ const CCoreSyenm = mongoose.model<ICoreSyenm>("core_entity_mapping", core_entity_mapping);
44
+ /* SCHIMA END */
45
+
46
+ export {
47
+ ICoreSyenm, // interface
48
+ CCoreSyenm // collection
49
+ };
@@ -0,0 +1,52 @@
1
+ import mongoose, { Schema } from "mongoose";
2
+
3
+ /* INTERFASE START */
4
+ interface ICoreSygms {
5
+ _id: string;
6
+ sygms_id_sygmt: string;
7
+ sygms_code: string;
8
+ sygms_title: string;
9
+ sygms_desc: string;
10
+ sygms_isactive: boolean;
11
+ sygms_configuration: object;
12
+ }
13
+ /* INTERFACE END */
14
+
15
+ /* SCHEMA START */
16
+ const core_general_master: Schema = new Schema({
17
+ sygms_id_sygmt: {
18
+ type: mongoose.Schema.Types.ObjectId,
19
+ ref: "core_general_master_type"
20
+ },
21
+ sygms_code: {
22
+ type: String,
23
+ require: true,
24
+ maxlength: 40,
25
+ trim: true
26
+ },
27
+ sygms_title: {
28
+ type: String,
29
+ require: true,
30
+ minlength: 3,
31
+ maxlength: 150,
32
+ trim: true
33
+ },
34
+ sygms_desc: {
35
+ type: String,
36
+ minlength: 0,
37
+ maxlength: 500,
38
+ trim: true
39
+ },
40
+ sygms_isactive: {
41
+ type: Boolean,
42
+ default: true
43
+ },
44
+ }, { collection: 'core_general_master' });
45
+
46
+ const CCoreSygms = mongoose.model<ICoreSygms>("core_general_master", core_general_master);
47
+ /* SCHIMA END */
48
+
49
+ export {
50
+ ICoreSygms, // interface
51
+ CCoreSygms // collection
52
+ };
@@ -0,0 +1,46 @@
1
+ import mongoose, { Schema } from "mongoose";
2
+
3
+ /* INTERFASE START */
4
+ interface ICoreSygmt {
5
+ _id: string;
6
+ sygmt_code: string;
7
+ sygmt_title: string;
8
+ sygmt_desc: string;
9
+ sygmt_isactive: boolean;
10
+ }
11
+ /* INTERFACE END */
12
+
13
+ /* SCHEMA START */
14
+ const core_general_master_type: Schema = new Schema({
15
+ sygmt_code: {
16
+ type: String,
17
+ require: true,
18
+ maxlength: 40,
19
+ trim: true
20
+ },
21
+ sygmt_title: {
22
+ type: String,
23
+ require: true,
24
+ minlength: 3,
25
+ maxlength: 100,
26
+ trim: true
27
+ },
28
+ sygmt_desc: {
29
+ type: String,
30
+ minlength: 0,
31
+ maxlength: 255,
32
+ trim: true
33
+ },
34
+ sygmt_isactive: {
35
+ type: Boolean,
36
+ default: true
37
+ },
38
+ }, { collection: 'core_general_master_type' });
39
+
40
+ const CCoreSygmt = mongoose.model<ICoreSygmt>("core_general_master_type", core_general_master_type);
41
+ /* SCHIMA END */
42
+
43
+ export {
44
+ ICoreSygmt, // interface
45
+ CCoreSygmt // collection
46
+ };