@platform-modules/civil-aviation-authority 1.0.0 → 1.0.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/.env +5 -0
- package/.gitkeep +0 -0
- package/package.json +24 -24
- package/src/data-source.ts +20 -19
- package/src/helpers/utils/enum.ts +94 -94
- package/src/models/BaseModel.ts +61 -61
- package/src/models/ITHelpDeskModel.ts +61 -0
- package/src/models/role.ts +36 -36
- package/src/models/user-sessions.ts +37 -37
- package/src/models/user.ts +100 -100
- package/src/scripts.ts +10 -10
- package/tsconfig.json +16 -16
- package/dist/data-source.d.ts +0 -4
- package/dist/data-source.js +0 -21
- package/dist/helpers/utils/enum.d.ts +0 -75
- package/dist/helpers/utils/enum.js +0 -53
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -28
- package/dist/models/BaseModel.d.ts +0 -16
- package/dist/models/BaseModel.js +0 -80
- package/dist/models/db.d.ts +0 -2
- package/dist/models/db.js +0 -40
- package/dist/models/role.d.ts +0 -22
- package/dist/models/role.js +0 -44
- package/dist/models/user-sessions.d.ts +0 -18
- package/dist/models/user-sessions.js +0 -54
- package/dist/models/user.d.ts +0 -19
- package/dist/models/user.js +0 -104
- package/dist/scripts.d.ts +0 -1
- package/dist/scripts.js +0 -11
- package/src/index.ts +0 -13
- package/src/models/db.ts +0 -37
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** *
|
|
3
|
-
@author
|
|
4
|
-
Amnet Digital
|
|
5
|
-
@date
|
|
6
|
-
2024-05-20
|
|
7
|
-
@Model
|
|
8
|
-
Role
|
|
9
|
-
@usage
|
|
10
|
-
Roles Information will store
|
|
11
|
-
*/
|
|
12
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
13
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17
|
-
};
|
|
18
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.userSessions = void 0;
|
|
23
|
-
const typeorm_1 = require("typeorm");
|
|
24
|
-
const BaseModel_1 = require("./BaseModel");
|
|
25
|
-
let userSessions = class userSessions extends BaseModel_1.BaseModel {
|
|
26
|
-
constructor(last_active_at, expires_at, user_id, is_active) {
|
|
27
|
-
super();
|
|
28
|
-
this.last_active_at = last_active_at,
|
|
29
|
-
this.expires_at = expires_at,
|
|
30
|
-
this.user_id = user_id,
|
|
31
|
-
this.is_active = is_active;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
exports.userSessions = userSessions;
|
|
35
|
-
__decorate([
|
|
36
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
37
|
-
__metadata("design:type", Date)
|
|
38
|
-
], userSessions.prototype, "last_active_at", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
(0, typeorm_1.Column)({ nullable: true, default: true }),
|
|
41
|
-
__metadata("design:type", Boolean)
|
|
42
|
-
], userSessions.prototype, "is_active", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
45
|
-
__metadata("design:type", Date)
|
|
46
|
-
], userSessions.prototype, "expires_at", void 0);
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
49
|
-
__metadata("design:type", Number)
|
|
50
|
-
], userSessions.prototype, "user_id", void 0);
|
|
51
|
-
exports.userSessions = userSessions = __decorate([
|
|
52
|
-
(0, typeorm_1.Entity)({ name: 'user_sessions' }),
|
|
53
|
-
__metadata("design:paramtypes", [Date, Date, Number, Boolean])
|
|
54
|
-
], userSessions);
|
package/dist/models/user.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { BaseModel } from './BaseModel';
|
|
2
|
-
export declare class User extends BaseModel {
|
|
3
|
-
first_name: string;
|
|
4
|
-
last_name: string;
|
|
5
|
-
full_name: string;
|
|
6
|
-
password: string;
|
|
7
|
-
mobile: string;
|
|
8
|
-
email: string;
|
|
9
|
-
address: string;
|
|
10
|
-
city: string;
|
|
11
|
-
state: string;
|
|
12
|
-
country: string;
|
|
13
|
-
pincode: string;
|
|
14
|
-
is_active: boolean;
|
|
15
|
-
EncryptPassword: string;
|
|
16
|
-
roleId: number;
|
|
17
|
-
company: string;
|
|
18
|
-
constructor(first_name: string, last_name: string, full_name: string, password: string, mobile: string, email: string, address: string, city: string, state: string, country: string, pincode: string, is_active: boolean, EncryptPassword: string, roleId: number, company: string);
|
|
19
|
-
}
|
package/dist/models/user.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.User = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
let User = class User extends BaseModel_1.BaseModel {
|
|
16
|
-
constructor(first_name, last_name, full_name, password, mobile, email, address, city, state, country, pincode, is_active, EncryptPassword, roleId,
|
|
17
|
-
// contract_start_date: string,
|
|
18
|
-
// contract_end_date: string,
|
|
19
|
-
company) {
|
|
20
|
-
super();
|
|
21
|
-
this.first_name = first_name,
|
|
22
|
-
this.last_name = last_name,
|
|
23
|
-
this.full_name = full_name,
|
|
24
|
-
this.password = password,
|
|
25
|
-
this.EncryptPassword = EncryptPassword,
|
|
26
|
-
this.mobile = mobile,
|
|
27
|
-
this.email = email,
|
|
28
|
-
this.is_active = is_active,
|
|
29
|
-
this.address = address,
|
|
30
|
-
this.city = city,
|
|
31
|
-
this.state = state,
|
|
32
|
-
this.country = country,
|
|
33
|
-
this.pincode = pincode,
|
|
34
|
-
this.roleId = roleId,
|
|
35
|
-
// this.contract_start_date = contract_start_date,
|
|
36
|
-
// this.contract_end_date = contract_end_date,
|
|
37
|
-
this.company = company;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.User = User;
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
43
|
-
__metadata("design:type", String)
|
|
44
|
-
], User.prototype, "first_name", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], User.prototype, "last_name", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
51
|
-
__metadata("design:type", String)
|
|
52
|
-
], User.prototype, "full_name", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
55
|
-
__metadata("design:type", String)
|
|
56
|
-
], User.prototype, "password", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
59
|
-
__metadata("design:type", String)
|
|
60
|
-
], User.prototype, "mobile", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
63
|
-
__metadata("design:type", String)
|
|
64
|
-
], User.prototype, "email", void 0);
|
|
65
|
-
__decorate([
|
|
66
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
67
|
-
__metadata("design:type", String)
|
|
68
|
-
], User.prototype, "address", void 0);
|
|
69
|
-
__decorate([
|
|
70
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
71
|
-
__metadata("design:type", String)
|
|
72
|
-
], User.prototype, "city", void 0);
|
|
73
|
-
__decorate([
|
|
74
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
75
|
-
__metadata("design:type", String)
|
|
76
|
-
], User.prototype, "state", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
79
|
-
__metadata("design:type", String)
|
|
80
|
-
], User.prototype, "country", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
83
|
-
__metadata("design:type", String)
|
|
84
|
-
], User.prototype, "pincode", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
(0, typeorm_1.Column)({ nullable: true, default: true }),
|
|
87
|
-
__metadata("design:type", Boolean)
|
|
88
|
-
], User.prototype, "is_active", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
91
|
-
__metadata("design:type", String)
|
|
92
|
-
], User.prototype, "EncryptPassword", void 0);
|
|
93
|
-
__decorate([
|
|
94
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
95
|
-
__metadata("design:type", Number)
|
|
96
|
-
], User.prototype, "roleId", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
99
|
-
__metadata("design:type", String)
|
|
100
|
-
], User.prototype, "company", void 0);
|
|
101
|
-
exports.User = User = __decorate([
|
|
102
|
-
(0, typeorm_1.Entity)({ name: 'users' }),
|
|
103
|
-
__metadata("design:paramtypes", [String, String, String, String, String, String, String, String, String, String, String, Boolean, String, Number, String])
|
|
104
|
-
], User);
|
package/dist/scripts.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/scripts.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const data_source_1 = require("./data-source");
|
|
4
|
-
data_source_1.AppDataSource.initialize()
|
|
5
|
-
.then(() => {
|
|
6
|
-
console.log('✅ Database schema synchronized successfully.');
|
|
7
|
-
})
|
|
8
|
-
.catch((error) => {
|
|
9
|
-
console.error('❌ Error during schema synchronization:', error);
|
|
10
|
-
process.exit(1);
|
|
11
|
-
});
|
package/src/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/index.ts
|
|
2
|
-
export * from './models/user';
|
|
3
|
-
//export * from './models/AMC';
|
|
4
|
-
//export * from './models/categories';
|
|
5
|
-
//export * from './models/import';
|
|
6
|
-
//export * from './models/notifications';
|
|
7
|
-
//export * from './models/otps';
|
|
8
|
-
export * from './models/role';
|
|
9
|
-
//export * from './models/subcategories';
|
|
10
|
-
export * from './models/user-sessions';
|
|
11
|
-
//export * from './models/workflow';
|
|
12
|
-
// export * from './models/request';
|
|
13
|
-
|
package/src/models/db.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { DataSource } from "typeorm";
|
|
2
|
-
import dotenv from 'dotenv';
|
|
3
|
-
import { User } from "../models/user";
|
|
4
|
-
import { userSessions } from '../models/user-sessions';
|
|
5
|
-
|
|
6
|
-
dotenv.config();
|
|
7
|
-
let AppDataSource: any;
|
|
8
|
-
let retries: number = 5;
|
|
9
|
-
while (retries) {
|
|
10
|
-
try {
|
|
11
|
-
AppDataSource = new DataSource({
|
|
12
|
-
type: "postgres",
|
|
13
|
-
host: process.env.TYPEORM_HOST,
|
|
14
|
-
port: parseInt(process.env.TYPEORM_PORT!),
|
|
15
|
-
username: process.env.TYPEORM_USERNAME,
|
|
16
|
-
password: process.env.TYPEORM_PASSWORD,
|
|
17
|
-
database: process.env.TYPEORM_DATABASE,
|
|
18
|
-
synchronize: true,
|
|
19
|
-
logging: false,
|
|
20
|
-
entities: [ User,userSessions]
|
|
21
|
-
});
|
|
22
|
-
AppDataSource.initialize()
|
|
23
|
-
.then(() => {
|
|
24
|
-
console.log("Database Connection Established");
|
|
25
|
-
})
|
|
26
|
-
.catch((error: any) => console.log(error));
|
|
27
|
-
retries = 0;
|
|
28
|
-
} catch (error) {
|
|
29
|
-
console.log('Postgres trying to reconnect : ', retries, 'Error :', error);
|
|
30
|
-
retries -= 1;
|
|
31
|
-
AppDataSource = undefined;
|
|
32
|
-
new Promise(res => setTimeout(res, 500));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export default AppDataSource;
|