ia-common 1.0.0 → 1.0.1-beta.1
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/README.md +7 -1
- package/build/@enum.d.ts +5 -0
- package/build/@enum.js +21 -0
- package/build/@type.d.ts +3 -0
- package/build/@type.js +19 -0
- package/build/enum/organization-status.enum.d.ts +3 -0
- package/build/enum/organization-status.enum.js +7 -0
- package/build/enum/organization-type.enum.d.ts +5 -0
- package/build/enum/organization-type.enum.js +9 -0
- package/build/enum/registration-status.enum.d.ts +3 -0
- package/build/enum/registration-status.enum.js +7 -0
- package/build/enum/user-status.enum.d.ts +5 -0
- package/build/enum/user-status.enum.js +9 -0
- package/build/enum/user-type.enum.d.ts +6 -0
- package/build/enum/user-type.enum.js +10 -0
- package/build/interface/controller.interface.d.ts +6 -0
- package/build/interface/controller.interface.js +2 -0
- package/build/interface/entity/entity-audit-column.interface.d.ts +6 -0
- package/build/interface/entity/entity-audit-column.interface.js +8 -0
- package/build/interface/entity/index.d.ts +4 -0
- package/build/interface/entity/index.js +20 -0
- package/build/interface/entity/organization-entity.interface.d.ts +21 -0
- package/build/interface/entity/organization-entity.interface.js +2 -0
- package/build/interface/entity/registration-entity.d.ts +11 -0
- package/build/interface/entity/registration-entity.js +2 -0
- package/build/interface/entity/user-entity.interface.d.ts +19 -0
- package/build/interface/entity/user-entity.interface.js +2 -0
- package/build/interface/upload-multer-file.interface.d.ts +9 -0
- package/build/interface/upload-multer-file.interface.js +2 -0
- package/build/utils/string-utils.d.ts +4 -0
- package/build/utils/string-utils.js +41 -0
- package/package.json +1 -1
- package/build/demo.d.ts +0 -1
- package/build/demo.js +0 -7
package/README.md
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
# ia-common
|
|
1
|
+
# ia-common
|
|
2
|
+
|
|
3
|
+
# npm run version:deploy:beta to publish demo beta version
|
|
4
|
+
|
|
5
|
+
# npm run version:deploy:patch to upgrade version eg 1.0.0 to 1.0.1 and publish package
|
|
6
|
+
|
|
7
|
+
# npm run version:deploy:minor to upgrade version eg 1.0.0 to 1.1.0 and publish package
|
package/build/@enum.d.ts
ADDED
package/build/@enum.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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("./enum/organization-status.enum"), exports);
|
|
18
|
+
__exportStar(require("./enum/organization-type.enum"), exports);
|
|
19
|
+
__exportStar(require("./enum/user-status.enum"), exports);
|
|
20
|
+
__exportStar(require("./enum/user-type.enum"), exports);
|
|
21
|
+
__exportStar(require("./enum/registration-status.enum"), exports);
|
package/build/@type.d.ts
ADDED
package/build/@type.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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("./interface/entity"), exports);
|
|
18
|
+
__exportStar(require("./interface/controller.interface"), exports);
|
|
19
|
+
__exportStar(require("./interface/upload-multer-file.interface"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrganizationStatus = void 0;
|
|
4
|
+
var OrganizationStatus;
|
|
5
|
+
(function (OrganizationStatus) {
|
|
6
|
+
OrganizationStatus["REGISTRATION_APPROVED"] = "registration_approved";
|
|
7
|
+
})(OrganizationStatus || (exports.OrganizationStatus = OrganizationStatus = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrganizationType = void 0;
|
|
4
|
+
var OrganizationType;
|
|
5
|
+
(function (OrganizationType) {
|
|
6
|
+
OrganizationType["PARTNERSHIP"] = "partnership";
|
|
7
|
+
OrganizationType["COMPANY"] = "company";
|
|
8
|
+
OrganizationType["PROPRIETOR"] = "proprietor";
|
|
9
|
+
})(OrganizationType || (exports.OrganizationType = OrganizationType = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RegistrationStatus = void 0;
|
|
4
|
+
var RegistrationStatus;
|
|
5
|
+
(function (RegistrationStatus) {
|
|
6
|
+
RegistrationStatus["REGISTRATION_APPROVED"] = "registration_approved";
|
|
7
|
+
})(RegistrationStatus || (exports.RegistrationStatus = RegistrationStatus = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserStatus = void 0;
|
|
4
|
+
var UserStatus;
|
|
5
|
+
(function (UserStatus) {
|
|
6
|
+
UserStatus["ACTIVE"] = "active";
|
|
7
|
+
UserStatus["DEACTIVE"] = "deactive";
|
|
8
|
+
UserStatus["REGISTRATION_APPROVED"] = "registration_approved";
|
|
9
|
+
})(UserStatus || (exports.UserStatus = UserStatus = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserType = void 0;
|
|
4
|
+
var UserType;
|
|
5
|
+
(function (UserType) {
|
|
6
|
+
UserType["USER"] = "user";
|
|
7
|
+
UserType["ADVISOR"] = "advisor";
|
|
8
|
+
UserType["SUPERADMIN"] = "superadmin";
|
|
9
|
+
UserType["BOT_USER"] = "bot_user";
|
|
10
|
+
})(UserType || (exports.UserType = UserType = {}));
|
|
@@ -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("./entity-audit-column.interface"), exports);
|
|
18
|
+
__exportStar(require("./organization-entity.interface"), exports);
|
|
19
|
+
__exportStar(require("./user-entity.interface"), exports);
|
|
20
|
+
__exportStar(require("./registration-entity"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OrganizationStatus } from "../../enum/organization-status.enum";
|
|
2
|
+
import { OrganizationType } from "../../enum/organization-type.enum";
|
|
3
|
+
import { IEntityAuditColumn } from "./entity-audit-column.interface";
|
|
4
|
+
export interface IOrganizationEntity extends IEntityAuditColumn {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
email: string | null;
|
|
8
|
+
contactNo: string | null;
|
|
9
|
+
type: OrganizationType;
|
|
10
|
+
panNo: string;
|
|
11
|
+
panFilePath: string;
|
|
12
|
+
gstNo: string | null;
|
|
13
|
+
gstFilePath: string | null;
|
|
14
|
+
deed: string | null;
|
|
15
|
+
deedFilePath: string | null;
|
|
16
|
+
status: OrganizationStatus;
|
|
17
|
+
registrationId: number;
|
|
18
|
+
sebiCertificate: string;
|
|
19
|
+
validateFrom: string;
|
|
20
|
+
validateTo: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RegistrationStatus } from "../../enum/registration-status.enum";
|
|
2
|
+
import { IEntityAuditColumn } from "./entity-audit-column.interface";
|
|
3
|
+
export interface IRegistrationEntity extends IEntityAuditColumn {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
contact: string;
|
|
7
|
+
email: string;
|
|
8
|
+
status: RegistrationStatus;
|
|
9
|
+
comments: string | null;
|
|
10
|
+
token: string | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UserStatus } from "../../enum/user-status.enum";
|
|
2
|
+
import { UserType } from "../../enum/user-type.enum";
|
|
3
|
+
import { IEntityAuditColumn } from "./entity-audit-column.interface";
|
|
4
|
+
export interface IUserEntity extends IEntityAuditColumn {
|
|
5
|
+
id: number;
|
|
6
|
+
firstname: string;
|
|
7
|
+
phone: string;
|
|
8
|
+
password: string;
|
|
9
|
+
email: string;
|
|
10
|
+
status: UserStatus;
|
|
11
|
+
isEmailVerified: boolean;
|
|
12
|
+
isMobileVerified: boolean;
|
|
13
|
+
isAccountVerified: boolean;
|
|
14
|
+
requireNewPassword: boolean;
|
|
15
|
+
type: UserType;
|
|
16
|
+
registrationId: number;
|
|
17
|
+
organizationId: number;
|
|
18
|
+
imageUrl: string | null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stringUtil = exports.StringUtil = void 0;
|
|
4
|
+
var StringUtil = /** @class */ (function () {
|
|
5
|
+
function StringUtil() {
|
|
6
|
+
}
|
|
7
|
+
StringUtil.prototype.generateRandomPassword = function () {
|
|
8
|
+
var _a;
|
|
9
|
+
var alphabets = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
10
|
+
var numbers = "0123456789";
|
|
11
|
+
var specialChars = "!@#$%^&*?+";
|
|
12
|
+
function getRandomCharacter(characters) {
|
|
13
|
+
return characters[Math.floor(Math.random() * characters.length)];
|
|
14
|
+
}
|
|
15
|
+
var randomAlphabet = getRandomCharacter(alphabets);
|
|
16
|
+
var randomNumber = getRandomCharacter(numbers);
|
|
17
|
+
var randomSpecialChar = getRandomCharacter(specialChars);
|
|
18
|
+
var remainingCharacters = alphabets + alphabets.toLowerCase();
|
|
19
|
+
var randomRemainingChars = Array.from({ length: 3 }, function () {
|
|
20
|
+
return getRandomCharacter(remainingCharacters);
|
|
21
|
+
}).join("");
|
|
22
|
+
var passwordArray = [
|
|
23
|
+
randomAlphabet,
|
|
24
|
+
randomNumber,
|
|
25
|
+
randomSpecialChar,
|
|
26
|
+
randomRemainingChars,
|
|
27
|
+
];
|
|
28
|
+
// Shuffle the password array
|
|
29
|
+
for (var i = passwordArray.length - 1; i > 0; i--) {
|
|
30
|
+
var j = Math.floor(Math.random() * (i + 1));
|
|
31
|
+
_a = [
|
|
32
|
+
passwordArray[j],
|
|
33
|
+
passwordArray[i],
|
|
34
|
+
], passwordArray[i] = _a[0], passwordArray[j] = _a[1];
|
|
35
|
+
}
|
|
36
|
+
return passwordArray.join("");
|
|
37
|
+
};
|
|
38
|
+
return StringUtil;
|
|
39
|
+
}());
|
|
40
|
+
exports.StringUtil = StringUtil;
|
|
41
|
+
exports.stringUtil = new StringUtil();
|
package/package.json
CHANGED
package/build/demo.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function add(a: number, b: number): number;
|