cloud-ide-lms-model 1.1.12 → 1.1.13
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,21 @@
|
|
|
1
|
+
import { CoreSystemEntity, AuthUserMst } from "../../schema";
|
|
2
|
+
import { controllerResponse } from "../../utilities";
|
|
3
|
+
type IEntitySwitchErrorLogger = {
|
|
4
|
+
[key in keyof MEntitySwitch]: string;
|
|
5
|
+
};
|
|
6
|
+
declare class MEntitySwitch {
|
|
7
|
+
syen_id?: string;
|
|
8
|
+
constructor(init: MEntitySwitch);
|
|
9
|
+
Validate(): Partial<IEntitySwitchErrorLogger>;
|
|
10
|
+
}
|
|
11
|
+
interface switchEntityControllerResponse extends controllerResponse {
|
|
12
|
+
data?: Partial<switchEntityResponseData>;
|
|
13
|
+
token?: string;
|
|
14
|
+
}
|
|
15
|
+
interface switchEntityResponseData {
|
|
16
|
+
auth_user_mst: Partial<AuthUserMst>;
|
|
17
|
+
core_system_entity?: CoreSystemEntity;
|
|
18
|
+
}
|
|
19
|
+
export { IEntitySwitchErrorLogger, // interface
|
|
20
|
+
MEntitySwitch, // model
|
|
21
|
+
switchEntityControllerResponse, switchEntityResponseData };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MEntitySwitch = void 0;
|
|
4
|
+
/* INTERFACE END */
|
|
5
|
+
/* MODEL START */
|
|
6
|
+
class MEntitySwitch {
|
|
7
|
+
constructor(init) {
|
|
8
|
+
Object.assign(this, init);
|
|
9
|
+
}
|
|
10
|
+
Validate() {
|
|
11
|
+
let errorLogger = {};
|
|
12
|
+
if (!this.syen_id) {
|
|
13
|
+
errorLogger.syen_id = "Entity ID is Required";
|
|
14
|
+
}
|
|
15
|
+
return errorLogger;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.MEntitySwitch = MEntitySwitch;
|
package/lib/model/auth/index.js
CHANGED
|
@@ -20,3 +20,4 @@ __exportStar(require("./register"), exports);
|
|
|
20
20
|
__exportStar(require("./reset-password"), exports);
|
|
21
21
|
__exportStar(require("./auth_user_mst"), exports);
|
|
22
22
|
__exportStar(require("./generate-view-only-token"), exports);
|
|
23
|
+
__exportStar(require("./entity-switch"), exports);
|
package/lib/routes/authRoutes.js
CHANGED
|
@@ -21,6 +21,8 @@ const authRoutesUrl = {
|
|
|
21
21
|
signOut: 'sign-out',
|
|
22
22
|
/** Endpoint to generate view-only token for public APIs */
|
|
23
23
|
generateViewOnlyToken: 'generate-view-only-token',
|
|
24
|
+
/** Endpoint to switch entity for logged-in user */
|
|
25
|
+
switchEntity: 'switch-entity',
|
|
24
26
|
};
|
|
25
27
|
exports.authRoutesUrl = authRoutesUrl;
|
|
26
28
|
// Freeze the authRoutesUrl object to prevent modifications
|