@platform-modules/civil-aviation-authority 2.2.30 → 2.2.32
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 +10 -4
- package/dist/data-source.js +21 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/models/AccessCardApprovalModel.d.ts +22 -0
- package/dist/models/AccessCardApprovalModel.js +96 -0
- package/dist/models/AccessCardAttachmentModel.d.ts +12 -0
- package/dist/models/AccessCardAttachmentModel.js +64 -0
- package/dist/models/AccessCardChatModel.d.ts +17 -0
- package/dist/models/AccessCardChatModel.js +67 -0
- package/dist/models/AccessCardRequestModel.d.ts +43 -0
- package/dist/models/AccessCardRequestModel.js +148 -0
- package/dist/models/AccessCardWorkflowModel.d.ts +14 -0
- package/dist/models/AccessCardWorkflowModel.js +60 -0
- package/dist/models/ITApprovalSettings.d.ts +7 -0
- package/dist/models/ITApprovalSettings.js +40 -0
- package/dist/models/ITServicesTypesMuscatModel.d.ts +6 -0
- package/dist/models/ITServicesTypesMuscatModel.js +34 -0
- package/dist/models/ITServicesTypesSalalahModel.d.ts +6 -0
- package/dist/models/ITServicesTypesSalalahModel.js +34 -0
- package/dist/models/ItApprovalsModel.d.ts +3 -1
- package/dist/models/ItApprovalsModel.js +2 -0
- package/dist/models/SecurityThreatApprovalModel.d.ts +24 -0
- package/dist/models/SecurityThreatApprovalModel.js +97 -0
- package/dist/models/SecurityThreatAttachmentModel.d.ts +12 -0
- package/dist/models/SecurityThreatAttachmentModel.js +64 -0
- package/dist/models/SecurityThreatChatModel.d.ts +17 -0
- package/dist/models/SecurityThreatChatModel.js +67 -0
- package/dist/models/SecurityThreatRequestModel.d.ts +29 -0
- package/dist/models/SecurityThreatRequestModel.js +104 -0
- package/dist/models/SecurityThreatWorkflowModel.d.ts +14 -0
- package/dist/models/SecurityThreatWorkflowModel.js +56 -0
- package/dist/models/Workflows.d.ts +0 -0
- package/dist/models/Workflows.js +31 -0
- package/package.json +1 -1
- package/src/data-source.ts +11 -1
- package/src/index.ts +5 -0
- package/src/models/SecurityThreatApprovalModel.ts +84 -0
- package/src/models/SecurityThreatAttachmentModel.ts +52 -0
- package/src/models/SecurityThreatChatModel.ts +55 -0
- package/src/models/SecurityThreatRequestModel.ts +91 -0
- package/src/models/SecurityThreatWorkflowModel.ts +43 -0
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { Column, Entity, Unique } from "typeorm";
|
|
3
|
+
// import { BaseModel } from './BaseModel';
|
|
4
|
+
// @Entity({ name: 'workflows' })
|
|
5
|
+
// @Unique(['service_id', 'sub_service_id', 'request_for'])
|
|
6
|
+
// export class Workflows extends BaseModel {
|
|
7
|
+
// @Column({ type: 'varchar', length: 100, nullable: false })
|
|
8
|
+
// name: string;
|
|
9
|
+
// @Column({ type: 'bigint', nullable: false })
|
|
10
|
+
// service_id: number;
|
|
11
|
+
// @Column({ type: 'bigint', nullable: false })
|
|
12
|
+
// sub_service_id: number;
|
|
13
|
+
// @Column({ type: 'varchar', length: 20, nullable: false })
|
|
14
|
+
// request_for: string; // 'Self' | 'Behalf of' | 'Internal'
|
|
15
|
+
// @Column({ type: 'int', nullable: false })
|
|
16
|
+
// levels: number;
|
|
17
|
+
// constructor(
|
|
18
|
+
// name: string,
|
|
19
|
+
// service_id: number,
|
|
20
|
+
// sub_service_id: number,
|
|
21
|
+
// request_for: string,
|
|
22
|
+
// levels: number,
|
|
23
|
+
// ) {
|
|
24
|
+
// super();
|
|
25
|
+
// this.name = name;
|
|
26
|
+
// this.service_id = service_id;
|
|
27
|
+
// this.sub_service_id = sub_service_id;
|
|
28
|
+
// this.request_for = request_for;
|
|
29
|
+
// this.levels = levels;
|
|
30
|
+
// }
|
|
31
|
+
// }
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -57,6 +57,11 @@ import { HotelApprovalDetails } from './models/HotelApprovalModel';
|
|
|
57
57
|
import { HotelWorkFlow } from './models/HotelWorkFlowModel';
|
|
58
58
|
import { HotelRequestChat } from './models/HotelChatModel';
|
|
59
59
|
import { HotelRequestAttachment } from './models/HotelAttachedModel';
|
|
60
|
+
import { SecurityThreatRequest } from './models/SecurityThreatRequestModel';
|
|
61
|
+
import { SecurityThreatApproval } from './models/SecurityThreatApprovalModel';
|
|
62
|
+
import { SecurityThreatAttachment } from './models/SecurityThreatAttachmentModel';
|
|
63
|
+
import { SecurityThreatChat } from './models/SecurityThreatChatModel';
|
|
64
|
+
import { SecurityThreatWorkFlow } from './models/SecurityThreatWorkflowModel';
|
|
60
65
|
|
|
61
66
|
export const AppDataSource = new DataSource({
|
|
62
67
|
type: 'postgres',
|
|
@@ -120,6 +125,11 @@ export const AppDataSource = new DataSource({
|
|
|
120
125
|
HotelApprovalDetails,
|
|
121
126
|
HotelWorkFlow,
|
|
122
127
|
HotelRequestChat,
|
|
123
|
-
HotelRequestAttachment
|
|
128
|
+
HotelRequestAttachment,
|
|
129
|
+
SecurityThreatRequest,
|
|
130
|
+
SecurityThreatApproval,
|
|
131
|
+
SecurityThreatAttachment,
|
|
132
|
+
SecurityThreatChat,
|
|
133
|
+
SecurityThreatWorkFlow
|
|
124
134
|
],
|
|
125
135
|
});
|
package/src/index.ts
CHANGED
|
@@ -52,3 +52,8 @@ export * from './models/HotelApprovalModel';
|
|
|
52
52
|
export * from './models/HotelWorkFlowModel';
|
|
53
53
|
export * from './models/HotelChatModel';
|
|
54
54
|
export * from './models/HotelAttachedModel';
|
|
55
|
+
export * from './models/SecurityThreatRequestModel';
|
|
56
|
+
export * from './models/SecurityThreatApprovalModel';
|
|
57
|
+
export * from './models/SecurityThreatAttachmentModel';
|
|
58
|
+
export * from './models/SecurityThreatChatModel';
|
|
59
|
+
export * from './models/SecurityThreatWorkflowModel';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum SecurityThreatApprovalStatus {
|
|
5
|
+
PENDING = "Pending",
|
|
6
|
+
IN_PROGRESS = "In Progress",
|
|
7
|
+
APPROVED = "Approved",
|
|
8
|
+
REJECTED = "Rejected",
|
|
9
|
+
CLOSED = "Closed"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Entity({ name: 'security_threat_approvals' })
|
|
13
|
+
export class SecurityThreatApproval extends BaseModel {
|
|
14
|
+
@Column({ type: 'integer', nullable: false })
|
|
15
|
+
request_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ type: 'integer', nullable: true })
|
|
18
|
+
service_id: number | null;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'integer', nullable: true })
|
|
21
|
+
sub_service_id: number | null;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'integer', nullable: false })
|
|
24
|
+
level: number;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'integer', nullable: false })
|
|
27
|
+
approver_role_id: number;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'integer', nullable: true })
|
|
30
|
+
department_id: number | null;
|
|
31
|
+
|
|
32
|
+
@Column({ type: 'integer', nullable: true })
|
|
33
|
+
section_id: number | null;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'integer', nullable: true })
|
|
36
|
+
approver_user_id: number | null;
|
|
37
|
+
|
|
38
|
+
@Column({ type: 'integer', nullable: true })
|
|
39
|
+
delegate_user_id: number | null;
|
|
40
|
+
|
|
41
|
+
@Column({ type: 'integer', nullable: true })
|
|
42
|
+
approved_by: number | null;
|
|
43
|
+
|
|
44
|
+
@Column({ type: 'varchar', length: 500, nullable: true, default: '' })
|
|
45
|
+
comment: string;
|
|
46
|
+
|
|
47
|
+
@Column({ type: 'enum', enum: SecurityThreatApprovalStatus, default: SecurityThreatApprovalStatus.PENDING, nullable: false })
|
|
48
|
+
approval_status: SecurityThreatApprovalStatus;
|
|
49
|
+
|
|
50
|
+
@Column({ type: 'boolean', default: false, nullable: false })
|
|
51
|
+
is_manager: boolean;
|
|
52
|
+
|
|
53
|
+
constructor(
|
|
54
|
+
request_id: number,
|
|
55
|
+
approver_role_id: number,
|
|
56
|
+
comment: string,
|
|
57
|
+
approval_status: SecurityThreatApprovalStatus,
|
|
58
|
+
level: number,
|
|
59
|
+
is_manager: boolean = false,
|
|
60
|
+
department_id?: number | null,
|
|
61
|
+
section_id?: number | null,
|
|
62
|
+
approver_user_id?: number | null,
|
|
63
|
+
delegate_user_id?: number | null,
|
|
64
|
+
approved_by?: number | null,
|
|
65
|
+
service_id?: number,
|
|
66
|
+
sub_service_id?: number
|
|
67
|
+
) {
|
|
68
|
+
super();
|
|
69
|
+
this.request_id = request_id;
|
|
70
|
+
this.service_id = service_id || null;
|
|
71
|
+
this.sub_service_id = sub_service_id || null;
|
|
72
|
+
this.approver_role_id = approver_role_id;
|
|
73
|
+
this.comment = comment;
|
|
74
|
+
this.approval_status = approval_status;
|
|
75
|
+
this.level = level;
|
|
76
|
+
this.is_manager = is_manager;
|
|
77
|
+
this.department_id = department_id || null;
|
|
78
|
+
this.section_id = section_id || null;
|
|
79
|
+
this.approver_user_id = approver_user_id || null;
|
|
80
|
+
this.delegate_user_id = delegate_user_id || null;
|
|
81
|
+
this.approved_by = approved_by || null;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'security_threat_attachments' })
|
|
5
|
+
export class SecurityThreatAttachment extends BaseModel {
|
|
6
|
+
|
|
7
|
+
@Column({ type: 'integer', nullable: false })
|
|
8
|
+
request_id: number;
|
|
9
|
+
|
|
10
|
+
@Column({ type: 'integer', nullable: true })
|
|
11
|
+
service_id: number | null;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'integer', nullable: true })
|
|
14
|
+
sub_service_id: number | null;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'varchar', length: 500, nullable: false })
|
|
17
|
+
file_url: string;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
20
|
+
file_name: string;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
23
|
+
file_type: string;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'bigint', nullable: true })
|
|
26
|
+
file_size: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'integer', nullable: true })
|
|
29
|
+
chat_id: number | null;
|
|
30
|
+
|
|
31
|
+
constructor(
|
|
32
|
+
request_id: number,
|
|
33
|
+
file_url: string,
|
|
34
|
+
file_name?: string,
|
|
35
|
+
file_type?: string,
|
|
36
|
+
file_size?: number,
|
|
37
|
+
service_id?: number,
|
|
38
|
+
sub_service_id?: number,
|
|
39
|
+
chat_id?: number
|
|
40
|
+
) {
|
|
41
|
+
super();
|
|
42
|
+
this.request_id = request_id;
|
|
43
|
+
this.service_id = service_id || null;
|
|
44
|
+
this.sub_service_id = sub_service_id || null;
|
|
45
|
+
this.file_url = file_url;
|
|
46
|
+
this.file_name = file_name || '';
|
|
47
|
+
this.file_type = file_type || '';
|
|
48
|
+
this.file_size = file_size || null;
|
|
49
|
+
this.chat_id = chat_id || null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum SecurityThreatMessageType {
|
|
5
|
+
TEXT = "text",
|
|
6
|
+
IMAGE = "image",
|
|
7
|
+
VIDEO = "video",
|
|
8
|
+
FILE = "file",
|
|
9
|
+
LINK = "link"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Entity({ name: 'security_threat_chats' })
|
|
13
|
+
export class SecurityThreatChat extends BaseModel {
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'integer', nullable: false })
|
|
16
|
+
request_id: number;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'integer', nullable: true })
|
|
19
|
+
service_id: number | null;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'integer', nullable: true })
|
|
22
|
+
sub_service_id: number | null;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'integer', nullable: false })
|
|
25
|
+
user_id: number;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'text', nullable: false })
|
|
28
|
+
message: string;
|
|
29
|
+
|
|
30
|
+
@Column({
|
|
31
|
+
type: 'enum',
|
|
32
|
+
enum: SecurityThreatMessageType,
|
|
33
|
+
default: SecurityThreatMessageType.TEXT,
|
|
34
|
+
nullable: false
|
|
35
|
+
})
|
|
36
|
+
messageType: SecurityThreatMessageType;
|
|
37
|
+
|
|
38
|
+
constructor(
|
|
39
|
+
request_id: number,
|
|
40
|
+
user_id: number,
|
|
41
|
+
message: string,
|
|
42
|
+
service_id?: number,
|
|
43
|
+
sub_service_id?: number,
|
|
44
|
+
messageType?: SecurityThreatMessageType
|
|
45
|
+
) {
|
|
46
|
+
super();
|
|
47
|
+
this.request_id = request_id;
|
|
48
|
+
this.service_id = service_id || null;
|
|
49
|
+
this.sub_service_id = sub_service_id || null;
|
|
50
|
+
this.user_id = user_id;
|
|
51
|
+
this.message = message;
|
|
52
|
+
this.messageType = messageType || SecurityThreatMessageType.TEXT;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum SecurityThreatRequestStatus {
|
|
5
|
+
PENDING = "Pending",
|
|
6
|
+
IN_PROGRESS = "In Progress",
|
|
7
|
+
APPROVED = "Approved",
|
|
8
|
+
REJECTED = "Rejected",
|
|
9
|
+
CLOSED = "Closed"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum SecurityThreatPriority {
|
|
13
|
+
P1_VERY_LOW = "P1-Very Low",
|
|
14
|
+
P2_LOW = "P2–Low", // Note: Using en dash (–) as specified
|
|
15
|
+
P3_MODERATE = "P3-Moderate",
|
|
16
|
+
P4_HIGH = "P4-High",
|
|
17
|
+
P5_VERY_HIGH = "P5-Very High"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Entity({ name: 'security_threat_requests' })
|
|
21
|
+
export class SecurityThreatRequest extends BaseModel {
|
|
22
|
+
@Column({ type: 'int', nullable: true })
|
|
23
|
+
req_user_department_id: number | null;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'int', nullable: true })
|
|
26
|
+
req_user_section_id: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ nullable: true })
|
|
29
|
+
service_id: number;
|
|
30
|
+
|
|
31
|
+
@Column({ nullable: true })
|
|
32
|
+
sub_service_id: number;
|
|
33
|
+
|
|
34
|
+
@Column({ nullable: false })
|
|
35
|
+
user_id: number;
|
|
36
|
+
|
|
37
|
+
@Column({ type: 'int', nullable: false })
|
|
38
|
+
type_of_threat: number;
|
|
39
|
+
|
|
40
|
+
@Column({ type: 'text', nullable: false })
|
|
41
|
+
description: string;
|
|
42
|
+
|
|
43
|
+
@Column({ type: 'varchar', length: 50, nullable: false })
|
|
44
|
+
contact_number: string;
|
|
45
|
+
|
|
46
|
+
@Column({
|
|
47
|
+
type: "enum",
|
|
48
|
+
enum: SecurityThreatPriority,
|
|
49
|
+
nullable: false,
|
|
50
|
+
})
|
|
51
|
+
priority: SecurityThreatPriority;
|
|
52
|
+
|
|
53
|
+
@Column({
|
|
54
|
+
type: "enum",
|
|
55
|
+
enum: SecurityThreatRequestStatus,
|
|
56
|
+
default: SecurityThreatRequestStatus.PENDING,
|
|
57
|
+
nullable: false,
|
|
58
|
+
})
|
|
59
|
+
status: SecurityThreatRequestStatus;
|
|
60
|
+
|
|
61
|
+
@Column({ type: "varchar", nullable: true })
|
|
62
|
+
workflow_execution_id: string | null;
|
|
63
|
+
|
|
64
|
+
constructor(
|
|
65
|
+
req_user_department_id: number | null,
|
|
66
|
+
req_user_section_id: number | null,
|
|
67
|
+
service_id: number,
|
|
68
|
+
sub_service_id: number,
|
|
69
|
+
user_id: number,
|
|
70
|
+
type_of_threat: number,
|
|
71
|
+
description: string,
|
|
72
|
+
contact_number: string,
|
|
73
|
+
priority: SecurityThreatPriority,
|
|
74
|
+
status: SecurityThreatRequestStatus,
|
|
75
|
+
workflow_execution_id?: string | null,
|
|
76
|
+
) {
|
|
77
|
+
super();
|
|
78
|
+
this.req_user_department_id = req_user_department_id ?? null;
|
|
79
|
+
this.req_user_section_id = req_user_section_id ?? null;
|
|
80
|
+
this.service_id = service_id;
|
|
81
|
+
this.sub_service_id = sub_service_id;
|
|
82
|
+
this.user_id = user_id;
|
|
83
|
+
this.type_of_threat = type_of_threat;
|
|
84
|
+
this.description = description;
|
|
85
|
+
this.contact_number = contact_number;
|
|
86
|
+
this.priority = priority;
|
|
87
|
+
this.status = status;
|
|
88
|
+
this.workflow_execution_id = workflow_execution_id ?? null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum SecurityThreatWorkFlowStatus {
|
|
5
|
+
COMPLETED = "Completed",
|
|
6
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
7
|
+
PENDING = "Pending"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//This model is used to store the security threat workflow status and activity logs
|
|
11
|
+
@Entity({ name: 'security_threat_workflows' })
|
|
12
|
+
export class SecurityThreatWorkFlow extends BaseModel {
|
|
13
|
+
@Column({ type: 'integer', nullable: false })
|
|
14
|
+
request_id: number;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'integer', nullable: true })
|
|
17
|
+
service_id: number | null;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'integer', nullable: true })
|
|
20
|
+
sub_service_id: number | null;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'varchar', length: 500, nullable: false })
|
|
23
|
+
content: string;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'enum', enum: SecurityThreatWorkFlowStatus, default: SecurityThreatWorkFlowStatus.NOT_YET_STARTED, nullable: false })
|
|
26
|
+
status: SecurityThreatWorkFlowStatus;
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
request_id: number,
|
|
30
|
+
content: string,
|
|
31
|
+
status: SecurityThreatWorkFlowStatus,
|
|
32
|
+
service_id?: number,
|
|
33
|
+
sub_service_id?: number
|
|
34
|
+
) {
|
|
35
|
+
super();
|
|
36
|
+
this.request_id = request_id;
|
|
37
|
+
this.service_id = service_id || null;
|
|
38
|
+
this.sub_service_id = sub_service_id || null;
|
|
39
|
+
this.content = content;
|
|
40
|
+
this.status = status;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|