cloud-ide-lms-model 1.0.241 → 1.0.243

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.
@@ -0,0 +1,101 @@
1
+ import { MTableQueries } from "../../common-types/common";
2
+ import { CoreUserRole, CoreUserRoleBase, CoreUserRoleRights, CoreUserRoleRightsBase } from "../../schema";
3
+ import { controllerResponse } from "../../utilities";
4
+ type IUserRoleErrorLogger = {
5
+ [key in keyof MUserRole]: string;
6
+ };
7
+ type IUserRoleGetByIdErrorLogger = {
8
+ [key in keyof MUserRoleGetByIdPayload]: string;
9
+ };
10
+ type IUserRoleDeleteErrorLogger = {
11
+ [key in keyof MUserRoleDeletePayload]: string;
12
+ };
13
+ type IUserRoleInsertUpdateErrorLogger = {
14
+ [key in keyof MUserRoleInsertUpdatePayload]: string;
15
+ };
16
+ type IUserRoleWithRightsErrorLogger = {
17
+ [key in keyof MUserRoleWithRightsPayload]: string;
18
+ };
19
+ type IUserRoleToggleStatusErrorLogger = {
20
+ [key in keyof MUserRoleToggleStatusPayload]: string;
21
+ };
22
+ declare class MUserRole extends MTableQueries {
23
+ constructor(init: MUserRole);
24
+ Validate?(): Partial<IUserRoleErrorLogger>;
25
+ }
26
+ declare class MUserRoleGetByIdPayload {
27
+ syusrol_id?: string;
28
+ constructor(init: MUserRoleGetByIdPayload);
29
+ Validate?(): Partial<IUserRoleGetByIdErrorLogger>;
30
+ }
31
+ declare class MUserRoleDeletePayload {
32
+ syusrol_id?: string;
33
+ constructor(init: MUserRoleDeletePayload);
34
+ Validate?(): Partial<IUserRoleDeleteErrorLogger>;
35
+ }
36
+ declare class MUserRoleToggleStatusPayload {
37
+ syusrol_id?: string;
38
+ constructor(init: MUserRoleToggleStatusPayload);
39
+ Validate?(): Partial<IUserRoleToggleStatusErrorLogger>;
40
+ }
41
+ declare class MUserRoleInsertUpdatePayload extends CoreUserRole {
42
+ constructor(init: CoreUserRole);
43
+ Validate?(): Partial<IUserRoleInsertUpdateErrorLogger>;
44
+ }
45
+ declare class MUserRoleWithRightsPayload {
46
+ core_user_role?: CoreUserRole;
47
+ core_user_role_rights?: Array<CoreUserRoleRights>;
48
+ core_user_role_rights_delete?: string[];
49
+ constructor(init: MUserRoleWithRightsPayload);
50
+ Validate?(): Partial<IUserRoleWithRightsErrorLogger>;
51
+ }
52
+ interface CoreUserRoleResponse extends CoreUserRoleBase {
53
+ syusrol_role_entity_id_syen?: {
54
+ _id?: string;
55
+ syen_name?: string;
56
+ };
57
+ }
58
+ interface CoreUserRoleRightsResponse extends CoreUserRoleRightsBase {
59
+ syusrgt_role_id_syusrol?: {
60
+ _id?: string;
61
+ syusrol_role_name?: string;
62
+ };
63
+ syusrgt_role_permissions_id_sygms?: {
64
+ _id?: string;
65
+ sygms_name?: string;
66
+ };
67
+ syusrgt_menu_id_syme?: {
68
+ _id?: string;
69
+ syme_name?: string;
70
+ };
71
+ }
72
+ interface userRoleControllerResponse extends controllerResponse {
73
+ data?: Array<CoreUserRoleResponse>;
74
+ }
75
+ interface userRoleByIdControllerResponse extends controllerResponse {
76
+ data?: CoreUserRoleResponse;
77
+ }
78
+ interface userRoleInsertUpdateControllerResponse extends controllerResponse {
79
+ data?: CoreUserRole;
80
+ }
81
+ interface userRoleDeleteControllerResponse extends controllerResponse {
82
+ data?: boolean;
83
+ }
84
+ interface userRoleToggleStatusControllerResponse extends controllerResponse {
85
+ data?: boolean;
86
+ }
87
+ interface userRoleWithRightsControllerResponse extends controllerResponse {
88
+ data?: {
89
+ role: CoreUserRoleResponse;
90
+ rights: Array<CoreUserRoleRightsResponse>;
91
+ };
92
+ }
93
+ interface userRoleWithRightsInsertUpdateControllerResponse extends controllerResponse {
94
+ data?: {
95
+ role: CoreUserRoleResponse;
96
+ rightsInserted: number;
97
+ rightsUpdated: number;
98
+ rightsDeleted: number;
99
+ };
100
+ }
101
+ export { IUserRoleErrorLogger, IUserRoleGetByIdErrorLogger, IUserRoleDeleteErrorLogger, IUserRoleInsertUpdateErrorLogger, IUserRoleWithRightsErrorLogger, IUserRoleToggleStatusErrorLogger, MUserRole, MUserRoleGetByIdPayload, MUserRoleDeletePayload, MUserRoleInsertUpdatePayload, MUserRoleWithRightsPayload, MUserRoleToggleStatusPayload, userRoleControllerResponse, userRoleByIdControllerResponse, userRoleInsertUpdateControllerResponse, userRoleDeleteControllerResponse, userRoleToggleStatusControllerResponse, userRoleWithRightsControllerResponse, userRoleWithRightsInsertUpdateControllerResponse };
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MUserRoleToggleStatusPayload = exports.MUserRoleWithRightsPayload = exports.MUserRoleInsertUpdatePayload = exports.MUserRoleDeletePayload = exports.MUserRoleGetByIdPayload = exports.MUserRole = void 0;
4
+ const common_1 = require("../../common-types/common");
5
+ const schema_1 = require("../../schema");
6
+ /* INTERFACE END */
7
+ /* MODEL START */
8
+ class MUserRole extends common_1.MTableQueries {
9
+ constructor(init) {
10
+ super(init);
11
+ Object.assign(this, init);
12
+ }
13
+ Validate() {
14
+ let errorLogger = {};
15
+ return errorLogger;
16
+ }
17
+ }
18
+ exports.MUserRole = MUserRole;
19
+ class MUserRoleGetByIdPayload {
20
+ constructor(init) {
21
+ Object.assign(this, init);
22
+ }
23
+ Validate() {
24
+ let errorLogger = {};
25
+ if (!this.syusrol_id) {
26
+ errorLogger.syusrol_id = "User Role ID is Required!";
27
+ }
28
+ return errorLogger;
29
+ }
30
+ }
31
+ exports.MUserRoleGetByIdPayload = MUserRoleGetByIdPayload;
32
+ class MUserRoleDeletePayload {
33
+ constructor(init) {
34
+ Object.assign(this, init);
35
+ }
36
+ Validate() {
37
+ let errorLogger = {};
38
+ if (!this.syusrol_id) {
39
+ errorLogger.syusrol_id = "User Role ID is Required!";
40
+ }
41
+ return errorLogger;
42
+ }
43
+ }
44
+ exports.MUserRoleDeletePayload = MUserRoleDeletePayload;
45
+ class MUserRoleToggleStatusPayload {
46
+ constructor(init) {
47
+ Object.assign(this, init);
48
+ }
49
+ Validate() {
50
+ let errorLogger = {};
51
+ if (!this.syusrol_id) {
52
+ errorLogger.syusrol_id = "User Role ID is Required!";
53
+ }
54
+ return errorLogger;
55
+ }
56
+ }
57
+ exports.MUserRoleToggleStatusPayload = MUserRoleToggleStatusPayload;
58
+ class MUserRoleInsertUpdatePayload extends schema_1.CoreUserRole {
59
+ constructor(init) {
60
+ super();
61
+ Object.assign(this, init);
62
+ }
63
+ Validate() {
64
+ let errorLogger = {};
65
+ if (!this.syusrol_role_name) {
66
+ errorLogger.syusrol_role_name = "Role name is required!";
67
+ }
68
+ if (!this.syusrol_role_description) {
69
+ errorLogger.syusrol_role_description = "Role description is required!";
70
+ }
71
+ if (!this.syusrol_role_entity_id_syen) {
72
+ errorLogger.syusrol_role_entity_id_syen = "Entity ID is required!";
73
+ }
74
+ return errorLogger;
75
+ }
76
+ }
77
+ exports.MUserRoleInsertUpdatePayload = MUserRoleInsertUpdatePayload;
78
+ class MUserRoleWithRightsPayload {
79
+ constructor(init) {
80
+ Object.assign(this, init);
81
+ }
82
+ Validate() {
83
+ let errorLogger = {};
84
+ // Validate Core User Role
85
+ if (!this.core_user_role) {
86
+ errorLogger.core_user_role = "Role information is required!";
87
+ }
88
+ else {
89
+ if (!this.core_user_role.syusrol_role_name) {
90
+ errorLogger.core_user_role = "Role name is required!";
91
+ }
92
+ if (!this.core_user_role.syusrol_role_description) {
93
+ errorLogger.core_user_role = "Role description is required!";
94
+ }
95
+ if (!this.core_user_role.syusrol_role_entity_id_syen) {
96
+ errorLogger.core_user_role = "Entity ID is required!";
97
+ }
98
+ }
99
+ // Validate Core User Role Rights
100
+ if (this.core_user_role_rights && this.core_user_role_rights.length > 0) {
101
+ this.core_user_role_rights.forEach((right, index) => {
102
+ if (!right.syusrgt_menu_id_syme) {
103
+ errorLogger[`core_user_role_rights[${index}].syusrgt_menu_id_syme`] = "Menu ID is required!";
104
+ }
105
+ if (!right.syusrgt_role_permissions_id_sygms) {
106
+ errorLogger[`core_user_role_rights[${index}].syusrgt_role_permissions_id_sygms`] = "Permission ID is required!";
107
+ }
108
+ });
109
+ }
110
+ return errorLogger;
111
+ }
112
+ }
113
+ exports.MUserRoleWithRightsPayload = MUserRoleWithRightsPayload;
@@ -17,3 +17,4 @@ export * from "./core_designation";
17
17
  export * from "./core_designation_grade_level";
18
18
  export * from "./core_system_pages";
19
19
  export * from "./core_general_master_type";
20
+ export * from "./core_user_role";
@@ -33,3 +33,4 @@ __exportStar(require("./core_designation"), exports);
33
33
  __exportStar(require("./core_designation_grade_level"), exports);
34
34
  __exportStar(require("./core_system_pages"), exports);
35
35
  __exportStar(require("./core_general_master_type"), exports);
36
+ __exportStar(require("./core_user_role"), exports);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Object containing URLs for authentication-related endpoints.
3
+ * These URLs are used for various authentication operations such as sign-in, sign-out, etc.
4
+ */
5
+ declare const academicsRoutesUrl: {
6
+ module: string;
7
+ /** Endpoint to get academic year (academic-year)
8
+ * for more details refer {@link https://docs.google.com/document/d/1CwB4evLsQuatG4jI0U1faRtmqtNmIfZOE4fDWiz9-sQ/edit?pli=1&tab=t.0#bookmark=id.sxfaxi4qxff3}
9
+ */
10
+ academicYear: string;
11
+ /**
12
+ * Endpoint to get academic year mapping (academic-year-mapping)
13
+ */
14
+ academicYearMapping: string;
15
+ };
16
+ export { academicsRoutesUrl };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.academicsRoutesUrl = void 0;
4
+ /**
5
+ * Object containing URLs for authentication-related endpoints.
6
+ * These URLs are used for various authentication operations such as sign-in, sign-out, etc.
7
+ */
8
+ const academicsRoutesUrl = {
9
+ module: 'academics',
10
+ /** Endpoint to get academic year (academic-year)
11
+ * for more details refer {@link https://docs.google.com/document/d/1CwB4evLsQuatG4jI0U1faRtmqtNmIfZOE4fDWiz9-sQ/edit?pli=1&tab=t.0#bookmark=id.sxfaxi4qxff3}
12
+ */
13
+ academicYear: "academic-year",
14
+ /**
15
+ * Endpoint to get academic year mapping (academic-year-mapping)
16
+ */
17
+ academicYearMapping: "academic-year-mapping",
18
+ };
19
+ exports.academicsRoutesUrl = academicsRoutesUrl;
20
+ // Freeze the authRoutesUrl object to prevent modifications
21
+ Object.freeze(academicsRoutesUrl);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Object containing URLs for authentication-related endpoints.
3
+ * These URLs are used for various authentication operations such as sign-in, sign-out, etc.
4
+ */
5
+ declare const accountsRoutesUrl: {
6
+ module: string;
7
+ /** Endpoint to get accounts year (accounts-year)
8
+ * for more details refer {@link https://docs.google.com/document/d/1CwB4evLsQuatG4jI0U1faRtmqtNmIfZOE4fDWiz9-sQ/edit?pli=1&tab=t.0#bookmark=id.sxfaxi4qxff3}
9
+ */
10
+ financialYear: string;
11
+ /**
12
+ * Endpoint to get accounts year mapping (accounts-year-mapping)
13
+ */
14
+ financialYearMapping: string;
15
+ };
16
+ export { accountsRoutesUrl };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.accountsRoutesUrl = void 0;
4
+ /**
5
+ * Object containing URLs for authentication-related endpoints.
6
+ * These URLs are used for various authentication operations such as sign-in, sign-out, etc.
7
+ */
8
+ const accountsRoutesUrl = {
9
+ module: 'accounts',
10
+ /** Endpoint to get accounts year (accounts-year)
11
+ * for more details refer {@link https://docs.google.com/document/d/1CwB4evLsQuatG4jI0U1faRtmqtNmIfZOE4fDWiz9-sQ/edit?pli=1&tab=t.0#bookmark=id.sxfaxi4qxff3}
12
+ */
13
+ financialYear: "financial-year",
14
+ /**
15
+ * Endpoint to get accounts year mapping (accounts-year-mapping)
16
+ */
17
+ financialYearMapping: "financial-year-mapping",
18
+ };
19
+ exports.accountsRoutesUrl = accountsRoutesUrl;
20
+ // Freeze the accountsRoutesUrl object to prevent modifications
21
+ Object.freeze(accountsRoutesUrl);
@@ -81,5 +81,9 @@ declare const coreRoutesUrl: {
81
81
  * @description Endpoint to get the general master type (general-master-type)
82
82
  */
83
83
  generalMasterType: string;
84
+ /**
85
+ * @description Endpoint to get the user role (user-role)
86
+ */
87
+ userRole: string;
84
88
  };
85
89
  export { coreRoutesUrl };
@@ -83,7 +83,11 @@ const coreRoutesUrl = {
83
83
  /**
84
84
  * @description Endpoint to get the general master type (general-master-type)
85
85
  */
86
- generalMasterType: "general-master-type"
86
+ generalMasterType: "general-master-type",
87
+ /**
88
+ * @description Endpoint to get the user role (user-role)
89
+ */
90
+ userRole: "user-role",
87
91
  };
88
92
  exports.coreRoutesUrl = coreRoutesUrl;
89
93
  Object.freeze(coreRoutesUrl);
@@ -3,3 +3,5 @@ export * from './coreRoutes';
3
3
  export * from './designConfigRoutes';
4
4
  export * from './authRoutes';
5
5
  export * from './userRoutes';
6
+ export * from './academicsRoutes';
7
+ export * from './accountsRoutes';
@@ -19,3 +19,5 @@ __exportStar(require("./coreRoutes"), exports);
19
19
  __exportStar(require("./designConfigRoutes"), exports);
20
20
  __exportStar(require("./authRoutes"), exports);
21
21
  __exportStar(require("./userRoutes"), exports);
22
+ __exportStar(require("./academicsRoutes"), exports);
23
+ __exportStar(require("./accountsRoutes"), exports);
@@ -0,0 +1,11 @@
1
+ declare class CoreUserRoleBase {
2
+ _id?: string;
3
+ syusrol_role_name?: string;
4
+ syusrol_role_description?: string;
5
+ syusrol_isactive?: boolean;
6
+ }
7
+ declare class CoreUserRole extends CoreUserRoleBase {
8
+ syusrol_role_entity_id_syen?: string;
9
+ }
10
+ export { CoreUserRoleBase, // interface
11
+ CoreUserRole };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoreUserRole = exports.CoreUserRoleBase = void 0;
4
+ class CoreUserRoleBase {
5
+ }
6
+ exports.CoreUserRoleBase = CoreUserRoleBase;
7
+ class CoreUserRole extends CoreUserRoleBase {
8
+ }
9
+ exports.CoreUserRole = CoreUserRole;
@@ -0,0 +1,11 @@
1
+ declare class CoreUserRoleRightsBase {
2
+ _id?: string;
3
+ syusrgt_isactive?: boolean;
4
+ }
5
+ declare class CoreUserRoleRights extends CoreUserRoleRightsBase {
6
+ syusrgt_role_id_syusrol?: string;
7
+ syusrgt_role_permissions_id_sygms?: string;
8
+ syusrgt_menu_id_syme?: string;
9
+ }
10
+ export { CoreUserRoleRightsBase, // interface
11
+ CoreUserRoleRights };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoreUserRoleRights = exports.CoreUserRoleRightsBase = void 0;
4
+ class CoreUserRoleRightsBase {
5
+ }
6
+ exports.CoreUserRoleRightsBase = CoreUserRoleRightsBase;
7
+ class CoreUserRoleRights extends CoreUserRoleRightsBase {
8
+ }
9
+ exports.CoreUserRoleRights = CoreUserRoleRights;
@@ -27,3 +27,5 @@ export * from './core_user_contact_addresses';
27
27
  export * from './core_user_documents';
28
28
  export * from './core_user_family_details';
29
29
  export * from './core_user_attributes';
30
+ export * from './core_user_role';
31
+ export * from './core_user_role_rights';
@@ -43,3 +43,5 @@ __exportStar(require("./core_user_contact_addresses"), exports);
43
43
  __exportStar(require("./core_user_documents"), exports);
44
44
  __exportStar(require("./core_user_family_details"), exports);
45
45
  __exportStar(require("./core_user_attributes"), exports);
46
+ __exportStar(require("./core_user_role"), exports);
47
+ __exportStar(require("./core_user_role_rights"), exports);
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "typescript": "^5.4.2"
6
6
  },
7
7
  "name": "cloud-ide-lms-model",
8
- "version": "1.0.241",
8
+ "version": "1.0.243",
9
9
  "description": "Package for Model management of Cloud IDEsys LMS",
10
10
  "main": "lib/index.js",
11
11
  "types": "lib/index.d.ts",