cloud-ide-lms-model 1.0.0
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/lib/@types/common.d.ts +22 -0
- package/lib/@types/common.js +50 -0
- package/lib/@types/coreControllerResponse.d.ts +43 -0
- package/lib/@types/coreControllerResponse.js +2 -0
- package/lib/@types/designConfigControllerResponse.d.ts +28 -0
- package/lib/@types/designConfigControllerResponse.js +2 -0
- package/lib/@types/emailServiceConfig.d.ts +33 -0
- package/lib/@types/emailServiceConfig.js +2 -0
- package/lib/@types/entityControllerResponse.d.ts +35 -0
- package/lib/@types/entityControllerResponse.js +2 -0
- package/lib/@types/forgotPasswordControllerResponse.d.ts +13 -0
- package/lib/@types/forgotPasswordControllerResponse.js +2 -0
- package/lib/@types/jwtPayload.d.ts +16 -0
- package/lib/@types/jwtPayload.js +2 -0
- package/lib/@types/loginControllerResponse.d.ts +17 -0
- package/lib/@types/loginControllerResponse.js +2 -0
- package/lib/@types/menuControllerResponse.d.ts +13 -0
- package/lib/@types/menuControllerResponse.js +2 -0
- package/lib/@types/resetPasswordControllerResponse.d.ts +15 -0
- package/lib/@types/resetPasswordControllerResponse.js +2 -0
- package/lib/@types/userPermissions.d.ts +7 -0
- package/lib/@types/userPermissions.js +2 -0
- package/lib/common-types/common.d.ts +31 -0
- package/lib/common-types/common.js +60 -0
- package/lib/common-types/coreControllerResponse.d.ts +43 -0
- package/lib/common-types/coreControllerResponse.js +2 -0
- package/lib/common-types/designConfigControllerResponse.d.ts +28 -0
- package/lib/common-types/designConfigControllerResponse.js +2 -0
- package/lib/common-types/emailServiceConfig.d.ts +33 -0
- package/lib/common-types/emailServiceConfig.js +2 -0
- package/lib/common-types/entityControllerResponse.d.ts +35 -0
- package/lib/common-types/entityControllerResponse.js +2 -0
- package/lib/common-types/forgotPasswordControllerResponse.d.ts +13 -0
- package/lib/common-types/forgotPasswordControllerResponse.js +2 -0
- package/lib/common-types/index.d.ts +4 -0
- package/lib/common-types/index.js +20 -0
- package/lib/common-types/jwtPayload.d.ts +9 -0
- package/lib/common-types/jwtPayload.js +2 -0
- package/lib/common-types/loginControllerResponse.d.ts +17 -0
- package/lib/common-types/loginControllerResponse.js +2 -0
- package/lib/common-types/menuControllerResponse.d.ts +13 -0
- package/lib/common-types/menuControllerResponse.js +2 -0
- package/lib/common-types/resetPasswordControllerResponse.d.ts +15 -0
- package/lib/common-types/resetPasswordControllerResponse.js +2 -0
- package/lib/common-types/userPermissions.d.ts +7 -0
- package/lib/common-types/userPermissions.js +2 -0
- package/lib/config/database.d.ts +3 -0
- package/lib/config/database.js +66 -0
- package/lib/config/index.d.ts +2 -0
- package/lib/config/index.js +5 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +20 -0
- package/lib/model/auth/forgot-password.d.ts +28 -0
- package/lib/model/auth/forgot-password.js +62 -0
- package/lib/model/auth/index.d.ts +4 -0
- package/lib/model/auth/index.js +20 -0
- package/lib/model/auth/login.d.ts +44 -0
- package/lib/model/auth/login.js +109 -0
- package/lib/model/auth/register.d.ts +20 -0
- package/lib/model/auth/register.js +33 -0
- package/lib/model/auth/reset-password.d.ts +36 -0
- package/lib/model/auth/reset-password.js +22 -0
- package/lib/model/core/design-config.d.ts +34 -0
- package/lib/model/core/design-config.js +19 -0
- package/lib/model/core/entity.d.ts +47 -0
- package/lib/model/core/entity.js +35 -0
- package/lib/model/core/general-master.d.ts +37 -0
- package/lib/model/core/general-master.js +19 -0
- package/lib/model/core/index.d.ts +6 -0
- package/lib/model/core/index.js +22 -0
- package/lib/model/core/menu.d.ts +28 -0
- package/lib/model/core/menu.js +31 -0
- package/lib/model/core/pin-code.d.ts +21 -0
- package/lib/model/core/pin-code.js +28 -0
- package/lib/model/core/user.d.ts +19 -0
- package/lib/model/core/user.js +19 -0
- package/lib/model/index.d.ts +2 -0
- package/lib/model/index.js +18 -0
- package/lib/schema/auth/auth_logses.d.ts +13 -0
- package/lib/schema/auth/auth_logses.js +2 -0
- package/lib/schema/auth/auth_user_mst.d.ts +30 -0
- package/lib/schema/auth/auth_user_mst.js +2 -0
- package/lib/schema/auth/index.d.ts +3 -0
- package/lib/schema/auth/index.js +19 -0
- package/lib/schema/auth/mpin.d.ts +8 -0
- package/lib/schema/auth/mpin.js +10 -0
- package/lib/schema/core/core_entity_mapping.d.ts +10 -0
- package/lib/schema/core/core_entity_mapping.js +2 -0
- package/lib/schema/core/core_general_master.d.ts +10 -0
- package/lib/schema/core/core_general_master.js +2 -0
- package/lib/schema/core/core_general_master_type.d.ts +8 -0
- package/lib/schema/core/core_general_master_type.js +2 -0
- package/lib/schema/core/core_page_controls.d.ts +18 -0
- package/lib/schema/core/core_page_controls.js +2 -0
- package/lib/schema/core/core_page_grid.d.ts +7 -0
- package/lib/schema/core/core_page_grid.js +2 -0
- package/lib/schema/core/core_page_tab.d.ts +14 -0
- package/lib/schema/core/core_page_tab.js +2 -0
- package/lib/schema/core/core_pin_code.d.ts +15 -0
- package/lib/schema/core/core_pin_code.js +2 -0
- package/lib/schema/core/core_system_config.d.ts +8 -0
- package/lib/schema/core/core_system_config.js +10 -0
- package/lib/schema/core/core_system_entity.d.ts +34 -0
- package/lib/schema/core/core_system_entity.js +2 -0
- package/lib/schema/core/core_system_logs.d.ts +24 -0
- package/lib/schema/core/core_system_logs.js +33 -0
- package/lib/schema/core/core_system_menu.d.ts +13 -0
- package/lib/schema/core/core_system_menu.js +10 -0
- package/lib/schema/core/core_system_pages.d.ts +10 -0
- package/lib/schema/core/core_system_pages.js +10 -0
- package/lib/schema/core/core_system_pages_theme.d.ts +11 -0
- package/lib/schema/core/core_system_pages_theme.js +10 -0
- package/lib/schema/core/index.d.ts +13 -0
- package/lib/schema/core/index.js +29 -0
- package/lib/schema/email/elist.d.ts +36 -0
- package/lib/schema/email/elist.js +42 -0
- package/lib/schema/email/elog.d.ts +41 -0
- package/lib/schema/email/elog.js +58 -0
- package/lib/schema/email/email_list.d.ts +7 -0
- package/lib/schema/email/email_list.js +10 -0
- package/lib/schema/email/email_log.d.ts +12 -0
- package/lib/schema/email/email_log.js +10 -0
- package/lib/schema/email/email_reference.d.ts +8 -0
- package/lib/schema/email/email_reference.js +10 -0
- package/lib/schema/email/email_subscription_vendor.d.ts +14 -0
- package/lib/schema/email/email_subscription_vendor.js +10 -0
- package/lib/schema/email/email_templete.d.ts +7 -0
- package/lib/schema/email/email_templete.js +10 -0
- package/lib/schema/email/email_vendor.d.ts +7 -0
- package/lib/schema/email/email_vendor.js +10 -0
- package/lib/schema/email/eref.d.ts +37 -0
- package/lib/schema/email/eref.js +43 -0
- package/lib/schema/email/esub.d.ts +43 -0
- package/lib/schema/email/esub.js +69 -0
- package/lib/schema/email/etmp.d.ts +36 -0
- package/lib/schema/email/etmp.js +41 -0
- package/lib/schema/email/evdr.d.ts +36 -0
- package/lib/schema/email/evdr.js +41 -0
- package/lib/schema/email/index.d.ts +6 -0
- package/lib/schema/email/index.js +22 -0
- package/lib/schema/index.d.ts +3 -0
- package/lib/schema/index.js +19 -0
- package/lib/utilities/helpers/encryption.helper.d.ts +2 -0
- package/lib/utilities/helpers/encryption.helper.js +14 -0
- package/lib/utilities/helpers/error.helper.d.ts +9 -0
- package/lib/utilities/helpers/error.helper.js +26 -0
- package/lib/utilities/helpers/index.d.ts +5 -0
- package/lib/utilities/helpers/index.js +21 -0
- package/lib/utilities/helpers/response.helper.d.ts +16 -0
- package/lib/utilities/helpers/response.helper.js +9 -0
- package/lib/utilities/helpers/string.helper.d.ts +3 -0
- package/lib/utilities/helpers/string.helper.js +232 -0
- package/lib/utilities/helpers/type.hepler.d.ts +3 -0
- package/lib/utilities/helpers/type.hepler.js +2 -0
- package/lib/utilities/helpers/view.helper.d.ts +2 -0
- package/lib/utilities/helpers/view.helper.js +14 -0
- package/lib/utilities/index.d.ts +1 -0
- package/lib/utilities/index.js +17 -0
- package/package.json +25 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IUser } from "../schema/auth";
|
|
2
|
+
import { controllerResponse } from "../utilities/helpers/response.helper";
|
|
3
|
+
import { SendMailInfo } from "./emailServiceConfig";
|
|
4
|
+
export interface loginControllerResponse extends controllerResponse {
|
|
5
|
+
data?: Partial<loginResponseData>;
|
|
6
|
+
token?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface reLoginControllerResponse extends controllerResponse {
|
|
9
|
+
data?: Partial<loginResponseData>;
|
|
10
|
+
token?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface loginResponseData {
|
|
13
|
+
user: Partial<IUser>;
|
|
14
|
+
}
|
|
15
|
+
export interface LoginSendMailInfo extends SendMailInfo {
|
|
16
|
+
data: Partial<loginResponseData>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { controllerResponse } from "../utilities/helpers/response.helper";
|
|
2
|
+
export interface menuControllerResponse extends controllerResponse {
|
|
3
|
+
data?: menuResponseData[];
|
|
4
|
+
}
|
|
5
|
+
export interface menuResponseData {
|
|
6
|
+
key: string;
|
|
7
|
+
path: string;
|
|
8
|
+
isExternalLink?: boolean;
|
|
9
|
+
title: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
type: string;
|
|
12
|
+
subMenu: menuResponseData[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IUser } from "../schema/auth";
|
|
2
|
+
import { controllerResponse } from "../utilities/helpers/response.helper";
|
|
3
|
+
import { SendMailInfo } from "./emailServiceConfig";
|
|
4
|
+
export interface ResetPasswordControllerResponse extends controllerResponse {
|
|
5
|
+
data?: Partial<ResetPasswordResponseData>;
|
|
6
|
+
}
|
|
7
|
+
export interface SignOutControllerResponse extends controllerResponse {
|
|
8
|
+
}
|
|
9
|
+
export interface ResetPasswordResponseData {
|
|
10
|
+
user: Partial<IUser>;
|
|
11
|
+
reset_password_link: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ResetPasswordSendMailInfo extends SendMailInfo {
|
|
14
|
+
data: Partial<ResetPasswordResponseData>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.connectDB = void 0;
|
|
40
|
+
var mongoose = require("mongoose");
|
|
41
|
+
require("dotenv/config");
|
|
42
|
+
function connectDB() {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
44
|
+
var options;
|
|
45
|
+
return __generator(this, function (_a) {
|
|
46
|
+
switch (_a.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
options = {
|
|
49
|
+
// authSource: process.env.MONGODB_AUTH_SOURCE || 'admin', // Optional authentication database
|
|
50
|
+
connectTimeoutMS: 10000,
|
|
51
|
+
socketTimeoutMS: 30000,
|
|
52
|
+
// Other MongoDB connection options as needed
|
|
53
|
+
};
|
|
54
|
+
return [4 /*yield*/, mongoose.connect(process.env.MONGODB_URI || '', options).then(function () {
|
|
55
|
+
console.log('Connected to MongoDB');
|
|
56
|
+
}).catch(function (error) {
|
|
57
|
+
console.error('Error connecting to MongoDB:', error);
|
|
58
|
+
})];
|
|
59
|
+
case 1:
|
|
60
|
+
_a.sent();
|
|
61
|
+
return [2 /*return*/];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.connectDB = connectDB;
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
__exportStar(require("./schema"), exports);
|
|
18
|
+
__exportStar(require("./common-types"), exports);
|
|
19
|
+
__exportStar(require("./model"), exports);
|
|
20
|
+
__exportStar(require("./utilities"), exports);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SendMailInfo } from "../../common-types";
|
|
2
|
+
import { IUser } from "../../schema";
|
|
3
|
+
import { controllerResponse } from "../../utilities";
|
|
4
|
+
import { forgotPasswordMethod } from "../../utilities/helpers/type.hepler";
|
|
5
|
+
type IForgotPasswordErrorLogger = {
|
|
6
|
+
[key in keyof MForgotPassword]: string;
|
|
7
|
+
};
|
|
8
|
+
declare class MForgotPassword {
|
|
9
|
+
custom_forgot_password_method: forgotPasswordMethod;
|
|
10
|
+
user_username: string;
|
|
11
|
+
user_emailid: string;
|
|
12
|
+
user_mobileno: number;
|
|
13
|
+
constructor(init: MForgotPassword);
|
|
14
|
+
Validate?(): Partial<IForgotPasswordErrorLogger>;
|
|
15
|
+
}
|
|
16
|
+
interface ForgotPasswordControllerResponse extends controllerResponse {
|
|
17
|
+
data?: Partial<ForgotPasswordResponseData>;
|
|
18
|
+
}
|
|
19
|
+
interface ForgotPasswordResponseData {
|
|
20
|
+
user: Partial<IUser>;
|
|
21
|
+
reset_password_link: string;
|
|
22
|
+
}
|
|
23
|
+
interface ForgotPasswordSendMailInfo extends SendMailInfo {
|
|
24
|
+
data: Partial<ForgotPasswordResponseData>;
|
|
25
|
+
}
|
|
26
|
+
export { IForgotPasswordErrorLogger, //interface
|
|
27
|
+
MForgotPassword, // model
|
|
28
|
+
ForgotPasswordControllerResponse, ForgotPasswordResponseData, ForgotPasswordSendMailInfo };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MForgotPassword = void 0;
|
|
4
|
+
/* INTERFACE END */
|
|
5
|
+
/* MODEL START */
|
|
6
|
+
var MForgotPassword = /** @class */ (function () {
|
|
7
|
+
function MForgotPassword(init) {
|
|
8
|
+
Object.assign(this, init);
|
|
9
|
+
}
|
|
10
|
+
MForgotPassword.prototype.Validate = function () {
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
var errorLogger = {};
|
|
13
|
+
/* Check method set or not */
|
|
14
|
+
if (!this.custom_forgot_password_method) {
|
|
15
|
+
errorLogger.custom_forgot_password_method = "Forgot Password Method is Required!";
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
if (this.custom_forgot_password_method == "username") {
|
|
19
|
+
/* if username is selected by user */
|
|
20
|
+
if (this.user_username) {
|
|
21
|
+
/* Check wether length is in between 8 to 20 or not */
|
|
22
|
+
if (((_a = this.user_username) === null || _a === void 0 ? void 0 : _a.length) < 8 || ((_b = this.user_username) === null || _b === void 0 ? void 0 : _b.length) > 20) {
|
|
23
|
+
errorLogger.user_username = "Username is Invalid!";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
errorLogger.user_username = "Username is Required!";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else if (this.custom_forgot_password_method == "email") {
|
|
31
|
+
/* if email is selected by user */
|
|
32
|
+
if (this.user_emailid) {
|
|
33
|
+
/* Check wether length is 8 to 50 or not */
|
|
34
|
+
if (((_c = this.user_emailid) === null || _c === void 0 ? void 0 : _c.length) < 8 || this.user_emailid.length > 50) {
|
|
35
|
+
errorLogger.user_emailid = "Email Id is Invalid!";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
errorLogger.user_emailid = "Email Id is Required!";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else if (this.custom_forgot_password_method == "mobile") {
|
|
43
|
+
/* if mobile is selected by user */
|
|
44
|
+
if (this.user_mobileno) {
|
|
45
|
+
/* Check wether length is 10 to 15 digits or not */
|
|
46
|
+
if (this.user_mobileno < 1000000000 || this.user_mobileno > 999999999999999) {
|
|
47
|
+
errorLogger.user_mobileno = "Mobile Number is Invalid!";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
errorLogger.user_mobileno = "Mobile Number is Required!";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
errorLogger.custom_forgot_password_method = "Forgot Password Method is Invalid, please use 'username' or 'email' or 'mobile'";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return errorLogger;
|
|
59
|
+
};
|
|
60
|
+
return MForgotPassword;
|
|
61
|
+
}());
|
|
62
|
+
exports.MForgotPassword = MForgotPassword;
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
__exportStar(require("./forgot-password"), exports);
|
|
18
|
+
__exportStar(require("./login"), exports);
|
|
19
|
+
__exportStar(require("./register"), exports);
|
|
20
|
+
__exportStar(require("./reset-password"), exports);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SendMailInfo } from "../../common-types";
|
|
2
|
+
import { IUser } from "../../schema";
|
|
3
|
+
import { controllerResponse } from "../../utilities";
|
|
4
|
+
import { loginMethod } from "../../utilities/helpers/type.hepler";
|
|
5
|
+
type ILoginErrorLogger = {
|
|
6
|
+
[key in keyof MLogin]: string;
|
|
7
|
+
};
|
|
8
|
+
declare class MLogin {
|
|
9
|
+
custom_login_method?: loginMethod;
|
|
10
|
+
user_username?: string;
|
|
11
|
+
user_password?: string;
|
|
12
|
+
mpin_pin?: string;
|
|
13
|
+
constructor(init: MLogin);
|
|
14
|
+
Validate(): Partial<ILoginErrorLogger>;
|
|
15
|
+
}
|
|
16
|
+
interface loginControllerResponse extends controllerResponse {
|
|
17
|
+
data?: Partial<loginResponseData>;
|
|
18
|
+
token?: string;
|
|
19
|
+
}
|
|
20
|
+
interface loginResponseData {
|
|
21
|
+
user: Partial<IUser>;
|
|
22
|
+
}
|
|
23
|
+
interface LoginSendMailInfo extends SendMailInfo {
|
|
24
|
+
data: Partial<loginResponseData>;
|
|
25
|
+
}
|
|
26
|
+
type IReLoginErrorLogger = {
|
|
27
|
+
[key in keyof MReLogin]: string;
|
|
28
|
+
};
|
|
29
|
+
declare class MReLogin {
|
|
30
|
+
custom_login_method?: loginMethod;
|
|
31
|
+
user_password?: string;
|
|
32
|
+
mpin_pin?: string;
|
|
33
|
+
token?: string;
|
|
34
|
+
constructor(init: MReLogin);
|
|
35
|
+
Validate?(): Partial<IReLoginErrorLogger>;
|
|
36
|
+
}
|
|
37
|
+
interface reLoginControllerResponse extends controllerResponse {
|
|
38
|
+
data?: Partial<loginResponseData>;
|
|
39
|
+
token?: string;
|
|
40
|
+
}
|
|
41
|
+
export { ILoginErrorLogger, //interface,
|
|
42
|
+
IReLoginErrorLogger, MLogin, // model
|
|
43
|
+
MReLogin, // model
|
|
44
|
+
loginControllerResponse, reLoginControllerResponse, loginResponseData, LoginSendMailInfo };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MReLogin = exports.MLogin = void 0;
|
|
4
|
+
/* INTERFACE END */
|
|
5
|
+
/* MODEL START */
|
|
6
|
+
var MLogin = /** @class */ (function () {
|
|
7
|
+
function MLogin(init) {
|
|
8
|
+
Object.assign(this, init);
|
|
9
|
+
}
|
|
10
|
+
MLogin.prototype.Validate = function () {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
var errorLogger = {};
|
|
13
|
+
if (!this.user_username) {
|
|
14
|
+
errorLogger.user_username = "Username is Required";
|
|
15
|
+
}
|
|
16
|
+
/* Check mpin or password selected or not, any one from both */
|
|
17
|
+
if (!this.custom_login_method) {
|
|
18
|
+
errorLogger.custom_login_method = "Login Method is Required, Mpin or Password!";
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
if (this.custom_login_method == "pass") {
|
|
22
|
+
/* if password is selected by user */
|
|
23
|
+
if (this.user_password) {
|
|
24
|
+
/* Check wether length is in between 8 to 50 or not */
|
|
25
|
+
if (((_a = this.user_password) === null || _a === void 0 ? void 0 : _a.length) < 7 || ((_b = this.user_password) === null || _b === void 0 ? void 0 : _b.length) > 50) {
|
|
26
|
+
errorLogger.user_password = "Password is Invalid!";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
errorLogger.user_password = "Password is Invalid!";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (this.custom_login_method == "mpin") {
|
|
34
|
+
/* if mpin is selected by user */
|
|
35
|
+
if (this.mpin_pin) {
|
|
36
|
+
/* Check wether length is 6 or not */
|
|
37
|
+
if (parseInt(this.mpin_pin) < 100000 || parseInt(this.mpin_pin) > 999999) {
|
|
38
|
+
errorLogger.mpin_pin = "MPIN is Invalid!";
|
|
39
|
+
}
|
|
40
|
+
if (!(/^[0-9]+$/).test(this.mpin_pin)) {
|
|
41
|
+
errorLogger.mpin_pin = "MPIN is Invalid!";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
errorLogger.mpin_pin = "MPIN is Invalid!";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
errorLogger.custom_login_method = "Login Method is Invalid, please use 'mpin' or 'pass'";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return errorLogger;
|
|
53
|
+
};
|
|
54
|
+
return MLogin;
|
|
55
|
+
}());
|
|
56
|
+
exports.MLogin = MLogin;
|
|
57
|
+
/* INTERFACE END */
|
|
58
|
+
/* MODEL START */
|
|
59
|
+
var MReLogin = /** @class */ (function () {
|
|
60
|
+
function MReLogin(init) {
|
|
61
|
+
Object.assign(this, init);
|
|
62
|
+
}
|
|
63
|
+
MReLogin.prototype.Validate = function () {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
var errorLogger = {};
|
|
66
|
+
if (!this.token) {
|
|
67
|
+
errorLogger.token = "Token is Required";
|
|
68
|
+
}
|
|
69
|
+
/* Check mpin or password selected or not, any one from both */
|
|
70
|
+
if (!this.custom_login_method) {
|
|
71
|
+
errorLogger.custom_login_method = "Login Method is Required, Mpin or Password!";
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
if (this.custom_login_method == "pass") {
|
|
75
|
+
/* if password is selected by user */
|
|
76
|
+
if (this.user_password) {
|
|
77
|
+
/* Check wether length is in between 8 to 50 or not */
|
|
78
|
+
if (((_a = this.user_password) === null || _a === void 0 ? void 0 : _a.length) < 7 || ((_b = this.user_password) === null || _b === void 0 ? void 0 : _b.length) > 50) {
|
|
79
|
+
errorLogger.user_password = "Password is Invalid!";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
errorLogger.user_password = "Password is Invalid!";
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else if (this.custom_login_method == "mpin") {
|
|
87
|
+
/* if mpin is selected by user */
|
|
88
|
+
if (this.mpin_pin) {
|
|
89
|
+
/* Check wether length is 6 or not */
|
|
90
|
+
if (parseInt(this.mpin_pin) < 100000 || parseInt(this.mpin_pin) > 999999) {
|
|
91
|
+
errorLogger.mpin_pin = "MPIN is Invalid!";
|
|
92
|
+
}
|
|
93
|
+
if (!(/^[0-9]+$/).test(this.mpin_pin)) {
|
|
94
|
+
errorLogger.mpin_pin = "MPIN is Invalid!";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
errorLogger.mpin_pin = "MPIN is Invalid!";
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
errorLogger.custom_login_method = "Login Method is Invalid, please use 'mpin' or 'pass'";
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return errorLogger;
|
|
106
|
+
};
|
|
107
|
+
return MReLogin;
|
|
108
|
+
}());
|
|
109
|
+
exports.MReLogin = MReLogin;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MErrorLoggerHelper } from "../../utilities/helpers/error.helper";
|
|
2
|
+
interface IRegisterErrorLogger extends MErrorLoggerHelper {
|
|
3
|
+
control: keyof MRegister;
|
|
4
|
+
}
|
|
5
|
+
declare class MRegister {
|
|
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_photo_id_fm: string;
|
|
16
|
+
constructor(init: MRegister);
|
|
17
|
+
Validate?(): IRegisterErrorLogger[];
|
|
18
|
+
}
|
|
19
|
+
export { IRegisterErrorLogger, //interface
|
|
20
|
+
MRegister };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MRegister = void 0;
|
|
4
|
+
/* INTERFACE END */
|
|
5
|
+
/* MODEL START */
|
|
6
|
+
var MRegister = /** @class */ (function () {
|
|
7
|
+
function MRegister(init) {
|
|
8
|
+
Object.assign(this, init);
|
|
9
|
+
}
|
|
10
|
+
MRegister.prototype.Validate = function () {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
var errorLogger = [];
|
|
13
|
+
if (!this.user_username) {
|
|
14
|
+
errorLogger.push({
|
|
15
|
+
control: "user_username",
|
|
16
|
+
message: "Username is Required"
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/* if password is selected by user */
|
|
20
|
+
if (this.user_password) {
|
|
21
|
+
/* Check wether length is in between 8 to 50 or not */
|
|
22
|
+
if (((_a = this.user_password) === null || _a === void 0 ? void 0 : _a.length) < 8 || ((_b = this.user_password) === null || _b === void 0 ? void 0 : _b.length) > 50) {
|
|
23
|
+
errorLogger.push({
|
|
24
|
+
control: "user_password",
|
|
25
|
+
message: "Password is Invalid!"
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return errorLogger;
|
|
30
|
+
};
|
|
31
|
+
return MRegister;
|
|
32
|
+
}());
|
|
33
|
+
exports.MRegister = MRegister;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SendMailInfo } from "../../common-types";
|
|
2
|
+
import { IUser } from "../../schema";
|
|
3
|
+
import { controllerResponse } from "../../utilities";
|
|
4
|
+
type IResetPasswordErrorLogger = {
|
|
5
|
+
[key in keyof MResetPassword]: string;
|
|
6
|
+
};
|
|
7
|
+
declare class MResetPassword {
|
|
8
|
+
user_password: string;
|
|
9
|
+
user_username: string;
|
|
10
|
+
sylog_config_data: resetPasswordSylog;
|
|
11
|
+
constructor(init: MResetPassword);
|
|
12
|
+
Validate?(): Partial<IResetPasswordErrorLogger>;
|
|
13
|
+
}
|
|
14
|
+
interface resetPasswordJwtPayload {
|
|
15
|
+
user_password?: string;
|
|
16
|
+
}
|
|
17
|
+
interface resetPasswordSylog {
|
|
18
|
+
reset_password_link?: string;
|
|
19
|
+
reset_password_secret?: string;
|
|
20
|
+
request_timestamp?: Date;
|
|
21
|
+
}
|
|
22
|
+
interface ResetPasswordControllerResponse extends controllerResponse {
|
|
23
|
+
data?: Partial<ResetPasswordResponseData>;
|
|
24
|
+
}
|
|
25
|
+
interface SignOutControllerResponse extends controllerResponse {
|
|
26
|
+
}
|
|
27
|
+
interface ResetPasswordResponseData {
|
|
28
|
+
user: Partial<IUser>;
|
|
29
|
+
reset_password_link: string;
|
|
30
|
+
}
|
|
31
|
+
interface ResetPasswordSendMailInfo extends SendMailInfo {
|
|
32
|
+
data: Partial<ResetPasswordResponseData>;
|
|
33
|
+
}
|
|
34
|
+
export { IResetPasswordErrorLogger, //interface
|
|
35
|
+
MResetPassword, // model
|
|
36
|
+
resetPasswordJwtPayload, resetPasswordSylog, ResetPasswordControllerResponse, ResetPasswordResponseData, ResetPasswordSendMailInfo, SignOutControllerResponse };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MResetPassword = void 0;
|
|
4
|
+
/* INTERFACE END */
|
|
5
|
+
/* MODEL START */
|
|
6
|
+
var MResetPassword = /** @class */ (function () {
|
|
7
|
+
function MResetPassword(init) {
|
|
8
|
+
Object.assign(this, init);
|
|
9
|
+
}
|
|
10
|
+
MResetPassword.prototype.Validate = function () {
|
|
11
|
+
var errorLogger = {};
|
|
12
|
+
if (!this.sylog_config_data) {
|
|
13
|
+
errorLogger.sylog_config_data = "Configuration Data is Required!";
|
|
14
|
+
}
|
|
15
|
+
if (!this.user_password) {
|
|
16
|
+
errorLogger.user_password = "Password is Required!";
|
|
17
|
+
}
|
|
18
|
+
return errorLogger;
|
|
19
|
+
};
|
|
20
|
+
return MResetPassword;
|
|
21
|
+
}());
|
|
22
|
+
exports.MResetPassword = MResetPassword;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ICoreSypc, ICoreSypg, ICoreSypgr, ICoreSyptb, ICoreSytm, ITabs } from "../../schema";
|
|
2
|
+
import { controllerResponse } from "../../utilities";
|
|
3
|
+
type IDesignConfigErrorLogger = {
|
|
4
|
+
[key in keyof MDesignConfig]: string;
|
|
5
|
+
};
|
|
6
|
+
declare class MDesignConfig {
|
|
7
|
+
sypg_page_code?: string;
|
|
8
|
+
constructor(init: MDesignConfig);
|
|
9
|
+
Validate?(): Partial<IDesignConfigErrorLogger>;
|
|
10
|
+
}
|
|
11
|
+
interface designConfigControllerResponse extends controllerResponse {
|
|
12
|
+
data?: designConfigResponseData;
|
|
13
|
+
}
|
|
14
|
+
interface designConfigResponseData {
|
|
15
|
+
page?: Partial<ICoreSypg>;
|
|
16
|
+
theme?: Partial<ICoreSytm>;
|
|
17
|
+
grid?: {
|
|
18
|
+
[key: string]: ICoreSypgr;
|
|
19
|
+
};
|
|
20
|
+
controls?: {
|
|
21
|
+
[key: string]: ICoreSypc;
|
|
22
|
+
};
|
|
23
|
+
tab?: {
|
|
24
|
+
[key: string]: ICoreTabs;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
interface ICoreTabs extends ICoreSyptb {
|
|
28
|
+
syptb_tabs_select: {
|
|
29
|
+
[key: string]: ITabs;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export { IDesignConfigErrorLogger, //interface
|
|
33
|
+
MDesignConfig, // model
|
|
34
|
+
designConfigControllerResponse, designConfigResponseData, ICoreTabs };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MDesignConfig = void 0;
|
|
4
|
+
/* INTERFACE END */
|
|
5
|
+
/* MODEL START */
|
|
6
|
+
var MDesignConfig = /** @class */ (function () {
|
|
7
|
+
function MDesignConfig(init) {
|
|
8
|
+
Object.assign(this, init);
|
|
9
|
+
}
|
|
10
|
+
MDesignConfig.prototype.Validate = function () {
|
|
11
|
+
var errorLogger = {};
|
|
12
|
+
if (!this.sypg_page_code) {
|
|
13
|
+
errorLogger.sypg_page_code = "Page Code is Required!";
|
|
14
|
+
}
|
|
15
|
+
return errorLogger;
|
|
16
|
+
};
|
|
17
|
+
return MDesignConfig;
|
|
18
|
+
}());
|
|
19
|
+
exports.MDesignConfig = MDesignConfig;
|