cloud-ide-model-schema 1.0.4 → 1.0.5

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 (39) hide show
  1. package/config/database.js +30 -0
  2. package/config/index.js +5 -0
  3. package/index.js +23 -0
  4. package/package.json +2 -1
  5. package/schema/auth/{auth_logses.ts → auth_logses.js} +50 -68
  6. package/schema/auth/{auth_user_mst.ts → auth_user_mst.js} +107 -143
  7. package/schema/auth/index.js +10 -0
  8. package/schema/auth/{mpin.ts → mpin.js} +51 -60
  9. package/schema/core/core_entity_mapping.js +34 -0
  10. package/schema/core/core_general_master.js +37 -0
  11. package/schema/core/{core_general_master_type.ts → core_general_master_type.js} +33 -46
  12. package/schema/core/{core_page_controls.ts → core_page_controls.js} +75 -100
  13. package/schema/core/{core_page_grid.ts → core_page_grid.js} +36 -48
  14. package/schema/core/core_page_tab.js +33 -0
  15. package/schema/core/{core_pin_code.ts → core_pin_code.js} +51 -73
  16. package/schema/core/{core_system_config.ts → core_system_config.js} +45 -54
  17. package/schema/core/{core_system_entity.ts → core_system_entity.js} +177 -216
  18. package/schema/core/{core_system_logs.ts → core_system_logs.js} +114 -141
  19. package/schema/core/{core_system_menu.ts → core_system_menu.js} +60 -74
  20. package/schema/core/{core_system_pages.ts → core_system_pages.js} +48 -59
  21. package/schema/core/{core_system_pages_theme.ts → core_system_pages_theme.js} +48 -60
  22. package/schema/core/index.js +34 -0
  23. package/schema/email/{elist.ts → elist.js} +39 -47
  24. package/schema/email/{elog.ts → elog.js} +55 -68
  25. package/schema/email/eref.js +40 -0
  26. package/schema/email/{esub.ts → esub.js} +66 -81
  27. package/schema/email/{etmp.ts → etmp.js} +38 -46
  28. package/schema/email/{evdr.ts → evdr.js} +38 -46
  29. package/schema/email/index.js +21 -0
  30. package/config/database.ts +0 -20
  31. package/config/index.ts +0 -5
  32. package/index.ts +0 -5
  33. package/schema/auth/index.ts +0 -13
  34. package/schema/core/core_entity_mapping.ts +0 -49
  35. package/schema/core/core_general_master.ts +0 -52
  36. package/schema/core/core_page_tab.ts +0 -54
  37. package/schema/core/index.ts +0 -42
  38. package/schema/email/eref.ts +0 -49
  39. package/schema/email/index.ts +0 -21
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.connectDB = void 0;
13
+ const mongoose = require("mongoose");
14
+ require("dotenv/config");
15
+ function connectDB() {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ const options = {
18
+ // authSource: process.env.MONGODB_AUTH_SOURCE || 'admin', // Optional authentication database
19
+ connectTimeoutMS: 10000,
20
+ socketTimeoutMS: 30000,
21
+ // Other MongoDB connection options as needed
22
+ };
23
+ yield mongoose.connect(process.env.MONGODB_URI || '', options).then(() => {
24
+ console.log('Connected to MongoDB');
25
+ }).catch((error) => {
26
+ console.error('Error connecting to MongoDB:', error);
27
+ });
28
+ });
29
+ }
30
+ exports.connectDB = connectDB;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.connectDB = void 0;
4
+ const database_1 = require("./database");
5
+ Object.defineProperty(exports, "connectDB", { enumerable: true, get: function () { return database_1.connectDB; } });
package/index.js ADDED
@@ -0,0 +1,23 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.connectDB = void 0;
18
+ __exportStar(require("./schema/auth"), exports);
19
+ __exportStar(require("./schema/core"), exports);
20
+ __exportStar(require("./schema/email"), exports);
21
+ /* database config */
22
+ var config_1 = require("./config");
23
+ Object.defineProperty(exports, "connectDB", { enumerable: true, get: function () { return config_1.connectDB; } });
package/package.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
+ "@types/dotenv": "^8.2.0",
3
4
  "dotenv": "^16.4.5",
4
5
  "mongoose": "^8.2.1"
5
6
  },
@@ -7,7 +8,7 @@
7
8
  "@types/node": "^20.11.25"
8
9
  },
9
10
  "name": "cloud-ide-model-schema",
10
- "version": "1.0.4",
11
+ "version": "1.0.5",
11
12
  "description": "Pachage for schema management of Cloud IDEsys LMS",
12
13
  "main": "index.js",
13
14
  "scripts": {
@@ -1,68 +1,50 @@
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
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Clogses = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ /* INTERFACE END */
6
+ /* SCHEMA START */
7
+ const auth_logses = new mongoose_1.Schema({
8
+ logses_id_user: {
9
+ type: mongoose_1.default.Schema.Types.ObjectId,
10
+ ref: 'auth_user_mst'
11
+ },
12
+ logses_start_dtm: {
13
+ type: Date,
14
+ required: true,
15
+ default: new Date()
16
+ },
17
+ logses_end_dtm: {
18
+ type: Date,
19
+ required: true,
20
+ default: new Date()
21
+ },
22
+ logses_end_max_dtm: {
23
+ type: Date,
24
+ required: true,
25
+ default: new Date()
26
+ },
27
+ logses_token: {
28
+ type: String,
29
+ trim: true
30
+ },
31
+ logses_user_ask_mpin: {
32
+ type: Boolean,
33
+ required: true,
34
+ default: false
35
+ },
36
+ logses_last_id_logses: {
37
+ type: mongoose_1.default.Schema.Types.ObjectId,
38
+ ref: "auth_logses"
39
+ },
40
+ logses_sequence: {
41
+ type: Number,
42
+ default: 1
43
+ },
44
+ logses_isactive: {
45
+ type: Boolean,
46
+ default: true
47
+ }
48
+ }, { collection: 'auth_logses' });
49
+ const Clogses = mongoose_1.default.model('auth_logses', auth_logses);
50
+ exports.Clogses = Clogses;
@@ -1,143 +1,107 @@
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
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CUser = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ /* INTERFACE END */
6
+ /* SCHEMA START */
7
+ const auth_user_mst = new mongoose_1.Schema({
8
+ user_id_ent: {
9
+ type: String,
10
+ comment: "Unique Entity id"
11
+ },
12
+ user_username: {
13
+ type: String,
14
+ minlength: 8,
15
+ maxlength: 20,
16
+ required: true,
17
+ trim: true,
18
+ unique: true,
19
+ comment: "Unique User Name",
20
+ message: "Unique User Name"
21
+ },
22
+ user_firstname: {
23
+ type: String,
24
+ minlength: 3,
25
+ maxlength: 20
26
+ },
27
+ user_middlename: {
28
+ type: String,
29
+ minlength: 3,
30
+ maxlength: 20
31
+ },
32
+ user_lastname: {
33
+ type: String,
34
+ minlength: 8,
35
+ maxlength: 20
36
+ },
37
+ user_fullname: {
38
+ type: String,
39
+ minlength: 8,
40
+ maxlength: 52
41
+ },
42
+ user_emailid: {
43
+ type: String,
44
+ minlength: 8,
45
+ maxlength: 50,
46
+ trim: true,
47
+ unique: true,
48
+ comment: "Unique Email ID",
49
+ message: "Unique Email ID"
50
+ },
51
+ user_mobileno: {
52
+ type: Number,
53
+ minlength: 10,
54
+ maxlength: 15,
55
+ trim: true,
56
+ unique: true,
57
+ comment: "Unique Mobile no",
58
+ message: "Unique Mobile no"
59
+ },
60
+ user_password: {
61
+ type: String,
62
+ maxlength: 250,
63
+ trim: true
64
+ },
65
+ user_activefrom: {
66
+ type: Date,
67
+ comment: "User Effective from- Default is created date"
68
+ },
69
+ user_activeupto: {
70
+ type: Date,
71
+ comment: "User Valid upto registered academic year default"
72
+ },
73
+ user_photo_id_fm: {
74
+ type: String,
75
+ comment: "photo file manager id",
76
+ trim: true
77
+ },
78
+ user_passwordchangeonlogin: {
79
+ type: Boolean,
80
+ comment: "Change password on Login. Flag can be set by the Admin/ Reset option",
81
+ default: true
82
+ },
83
+ user_id_role: {
84
+ type: String,
85
+ comment: "Role Id associated with the user.",
86
+ trim: true
87
+ },
88
+ user_id_desg: {
89
+ type: String,
90
+ comment: "Users Designation",
91
+ trim: true
92
+ },
93
+ user_id_dept: {
94
+ type: String,
95
+ comment: "Users Department",
96
+ trim: true
97
+ },
98
+ user_permissions: {
99
+ type: Array,
100
+ default: []
101
+ },
102
+ user_isactive: {
103
+ type: Boolean
104
+ }
105
+ }, { collection: 'auth_user_mst' });
106
+ const CUser = mongoose_1.default.model('auth_user_mst', auth_user_mst);
107
+ exports.CUser = CUser;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CMpin = exports.IMpin = exports.Clogses = exports.CUser = void 0;
4
+ const auth_user_mst_1 = require("./auth_user_mst");
5
+ Object.defineProperty(exports, "CUser", { enumerable: true, get: function () { return auth_user_mst_1.CUser; } });
6
+ const auth_logses_1 = require("./auth_logses");
7
+ Object.defineProperty(exports, "Clogses", { enumerable: true, get: function () { return auth_logses_1.Clogses; } });
8
+ const mpin_1 = require("./mpin");
9
+ Object.defineProperty(exports, "IMpin", { enumerable: true, get: function () { return mpin_1.IMpin; } });
10
+ Object.defineProperty(exports, "CMpin", { enumerable: true, get: function () { return mpin_1.CMpin; } });
@@ -1,60 +1,51 @@
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
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CMpin = exports.IMpin = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ /* INTERFASE START */
6
+ class IMpin {
7
+ }
8
+ exports.IMpin = IMpin;
9
+ /* INTERFACE END */
10
+ /* SCHEMA START */
11
+ const auth_mpin = new mongoose_1.Schema({
12
+ mpin_id_user: {
13
+ type: mongoose_1.default.Schema.Types.ObjectId,
14
+ ref: 'auth_user_mst',
15
+ required: true,
16
+ comment: "User unique primery key, reference user"
17
+ },
18
+ mpin_pin: {
19
+ type: Number,
20
+ require: true,
21
+ unique: true,
22
+ minlength: 6,
23
+ minlenght: 6
24
+ },
25
+ mpin_generation_dtm: {
26
+ type: Date,
27
+ required: true,
28
+ default: new Date()
29
+ },
30
+ mpin_expiry_dtm: {
31
+ type: Date,
32
+ required: true,
33
+ default: new Date()
34
+ },
35
+ mpin_used: {
36
+ type: Boolean,
37
+ default: false
38
+ },
39
+ mpin_id_logses: {
40
+ type: mongoose_1.default.Schema.Types.ObjectId,
41
+ comment: "logses session table, whre loggin id is stored which used the mpin",
42
+ trim: true
43
+ },
44
+ mpin_isactive: {
45
+ type: Boolean,
46
+ default: true,
47
+ comment: "automaticaly expire when expiry time completes, when authenticator is refreshed new key generates and this will set to false"
48
+ }
49
+ }, { collection: 'auth_mpin' });
50
+ const CMpin = mongoose_1.default.model("auth_mpin", auth_mpin);
51
+ exports.CMpin = CMpin;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CCoreSyenm = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ /* INTERFACE END */
6
+ /* SCHEMA START */
7
+ const core_entity_mapping = new mongoose_1.Schema({
8
+ syenm_id_user: {
9
+ type: mongoose_1.default.Schema.Types.ObjectId,
10
+ ref: "auth_user_mst"
11
+ },
12
+ syenm_id_syen: {
13
+ type: mongoose_1.default.Schema.Types.ObjectId,
14
+ ref: "core_system_entity"
15
+ },
16
+ syenm_id_logses: {
17
+ type: mongoose_1.default.Schema.Types.ObjectId,
18
+ ref: "auth_logses"
19
+ },
20
+ syenm_isactive: {
21
+ type: Boolean,
22
+ default: true
23
+ },
24
+ syenm_isloggedin: {
25
+ type: Boolean,
26
+ default: true
27
+ },
28
+ syenm_isdefault: {
29
+ type: Boolean,
30
+ default: true
31
+ },
32
+ }, { collection: 'core_entity_mapping' });
33
+ const CCoreSyenm = mongoose_1.default.model("core_entity_mapping", core_entity_mapping);
34
+ exports.CCoreSyenm = CCoreSyenm;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CCoreSygms = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ /* INTERFACE END */
6
+ /* SCHEMA START */
7
+ const core_general_master = new mongoose_1.Schema({
8
+ sygms_id_sygmt: {
9
+ type: mongoose_1.default.Schema.Types.ObjectId,
10
+ ref: "core_general_master_type"
11
+ },
12
+ sygms_code: {
13
+ type: String,
14
+ require: true,
15
+ maxlength: 40,
16
+ trim: true
17
+ },
18
+ sygms_title: {
19
+ type: String,
20
+ require: true,
21
+ minlength: 3,
22
+ maxlength: 150,
23
+ trim: true
24
+ },
25
+ sygms_desc: {
26
+ type: String,
27
+ minlength: 0,
28
+ maxlength: 500,
29
+ trim: true
30
+ },
31
+ sygms_isactive: {
32
+ type: Boolean,
33
+ default: true
34
+ },
35
+ }, { collection: 'core_general_master' });
36
+ const CCoreSygms = mongoose_1.default.model("core_general_master", core_general_master);
37
+ exports.CCoreSygms = CCoreSygms;