scheduler-node-models 1.2.1 → 1.2.3

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.
Files changed (125) hide show
  1. package/general/emailer.d.ts +1 -0
  2. package/general/emailer.js +31 -0
  3. package/general/general.d.ts +12 -0
  4. package/general/general.js +2 -0
  5. package/general/index.d.ts +5 -0
  6. package/general/index.js +21 -0
  7. package/general/logger.d.ts +10 -0
  8. package/general/logger.js +90 -0
  9. package/general/report.d.ts +25 -0
  10. package/general/report.js +76 -0
  11. package/general/viewstate.d.ts +5 -0
  12. package/general/viewstate.js +9 -0
  13. package/index.d.ts +0 -0
  14. package/index.js +1 -0
  15. package/metrics/images.d.ts +22 -0
  16. package/metrics/images.js +33 -0
  17. package/metrics/index.d.ts +5 -0
  18. package/metrics/index.js +21 -0
  19. package/metrics/mission.d.ts +47 -0
  20. package/metrics/mission.js +81 -0
  21. package/metrics/missionSensorOutage.d.ts +11 -0
  22. package/metrics/missionSensorOutage.js +14 -0
  23. package/metrics/missionsensor.d.ts +67 -0
  24. package/metrics/missionsensor.js +128 -0
  25. package/metrics/outage.d.ts +43 -0
  26. package/metrics/outage.js +55 -0
  27. package/metrics/systemdata/classifications.d.ts +18 -0
  28. package/metrics/systemdata/classifications.js +23 -0
  29. package/metrics/systemdata/communications.d.ts +21 -0
  30. package/metrics/systemdata/communications.js +40 -0
  31. package/metrics/systemdata/dcgs.d.ts +19 -0
  32. package/metrics/systemdata/dcgs.js +29 -0
  33. package/metrics/systemdata/exploitations.d.ts +18 -0
  34. package/metrics/systemdata/exploitations.js +23 -0
  35. package/metrics/systemdata/groundSystems.d.ts +86 -0
  36. package/metrics/systemdata/groundSystems.js +143 -0
  37. package/metrics/systemdata/index.d.ts +7 -0
  38. package/metrics/systemdata/index.js +23 -0
  39. package/metrics/systemdata/platform.d.ts +124 -0
  40. package/metrics/systemdata/platform.js +176 -0
  41. package/metrics/systemdata/systeminfo.d.ts +28 -0
  42. package/metrics/systemdata/systeminfo.js +64 -0
  43. package/package.json +4 -4
  44. package/scheduler/employees/assignment.d.ts +139 -0
  45. package/scheduler/employees/assignment.js +304 -0
  46. package/scheduler/employees/balance.d.ts +35 -0
  47. package/scheduler/employees/balance.js +39 -0
  48. package/scheduler/employees/companyinfo.d.ts +16 -0
  49. package/scheduler/employees/companyinfo.js +6 -0
  50. package/scheduler/employees/contact.d.ts +36 -0
  51. package/scheduler/employees/contact.js +40 -0
  52. package/scheduler/employees/employee.d.ts +427 -0
  53. package/scheduler/employees/employee.js +1887 -0
  54. package/scheduler/employees/employeename.d.ts +48 -0
  55. package/scheduler/employees/employeename.js +97 -0
  56. package/scheduler/employees/index.d.ts +14 -0
  57. package/scheduler/employees/index.js +30 -0
  58. package/scheduler/employees/labor.d.ts +31 -0
  59. package/scheduler/employees/labor.js +39 -0
  60. package/scheduler/employees/leave.d.ts +58 -0
  61. package/scheduler/employees/leave.js +73 -0
  62. package/scheduler/employees/leaverequest.d.ts +105 -0
  63. package/scheduler/employees/leaverequest.js +226 -0
  64. package/scheduler/employees/specialty.d.ts +35 -0
  65. package/scheduler/employees/specialty.js +40 -0
  66. package/scheduler/employees/variation.d.ts +80 -0
  67. package/scheduler/employees/variation.js +132 -0
  68. package/scheduler/employees/web.d.ts +6 -0
  69. package/scheduler/employees/web.js +2 -0
  70. package/scheduler/employees/work.d.ts +96 -0
  71. package/scheduler/employees/work.js +133 -0
  72. package/scheduler/employees/workday.d.ts +91 -0
  73. package/scheduler/employees/workday.js +170 -0
  74. package/scheduler/labor/index.d.ts +2 -0
  75. package/scheduler/labor/index.js +18 -0
  76. package/scheduler/labor/laborcode.d.ts +33 -0
  77. package/scheduler/labor/laborcode.js +55 -0
  78. package/scheduler/labor/workcode.d.ts +28 -0
  79. package/scheduler/labor/workcode.js +35 -0
  80. package/scheduler/sites/index.d.ts +1 -0
  81. package/scheduler/sites/index.js +17 -0
  82. package/scheduler/sites/reports/cofsReport.d.ts +41 -0
  83. package/scheduler/sites/reports/cofsReport.js +104 -0
  84. package/scheduler/sites/reports/forecast.d.ts +57 -0
  85. package/scheduler/sites/reports/forecast.js +205 -0
  86. package/scheduler/sites/reports/index.d.ts +4 -0
  87. package/scheduler/sites/reports/index.js +20 -0
  88. package/scheduler/sites/reports/period.d.ts +11 -0
  89. package/scheduler/sites/reports/period.js +27 -0
  90. package/scheduler/sites/reports/section.d.ts +63 -0
  91. package/scheduler/sites/reports/section.js +186 -0
  92. package/scheduler/sites/site.d.ts +39 -0
  93. package/scheduler/sites/site.js +68 -0
  94. package/scheduler/sites/workcenters/index.d.ts +3 -0
  95. package/scheduler/sites/workcenters/index.js +19 -0
  96. package/scheduler/sites/workcenters/position.d.ts +27 -0
  97. package/scheduler/sites/workcenters/position.js +36 -0
  98. package/scheduler/sites/workcenters/shift.d.ts +32 -0
  99. package/scheduler/sites/workcenters/shift.js +47 -0
  100. package/scheduler/sites/workcenters/workcenter.d.ts +43 -0
  101. package/scheduler/sites/workcenters/workcenter.js +123 -0
  102. package/scheduler/teams/company/company.d.ts +99 -0
  103. package/scheduler/teams/company/company.js +256 -0
  104. package/scheduler/teams/company/holiday.d.ts +61 -0
  105. package/scheduler/teams/company/holiday.js +116 -0
  106. package/scheduler/teams/company/index.d.ts +3 -0
  107. package/scheduler/teams/company/index.js +19 -0
  108. package/scheduler/teams/company/modperiod.d.ts +21 -0
  109. package/scheduler/teams/company/modperiod.js +24 -0
  110. package/scheduler/teams/contact.d.ts +18 -0
  111. package/scheduler/teams/contact.js +23 -0
  112. package/scheduler/teams/index.d.ts +3 -0
  113. package/scheduler/teams/index.js +19 -0
  114. package/scheduler/teams/specialty.d.ts +18 -0
  115. package/scheduler/teams/specialty.js +23 -0
  116. package/scheduler/teams/team.d.ts +95 -0
  117. package/scheduler/teams/team.js +351 -0
  118. package/users/index.d.ts +2 -0
  119. package/users/index.js +18 -0
  120. package/users/question.d.ts +47 -0
  121. package/users/question.js +68 -0
  122. package/users/user.d.ts +150 -0
  123. package/users/user.js +304 -0
  124. package/users/web.d.ts +49 -0
  125. package/users/web.js +2 -0
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MissionSensor = void 0;
4
+ const images_1 = require("./images");
5
+ const missionSensorOutage_1 = require("./missionSensorOutage");
6
+ const systemdata_1 = require("./systemdata");
7
+ /**
8
+ * this class implements the mission sensor data members and actions.
9
+ */
10
+ class MissionSensor {
11
+ sensorID;
12
+ sensorType;
13
+ preflightMinutes;
14
+ scheduledMinutes;
15
+ executedMinutes;
16
+ postflightMinutes;
17
+ additionalMinutes;
18
+ finalCode;
19
+ kitNumber;
20
+ sensorOutage;
21
+ groundOutage;
22
+ hasHap;
23
+ towerID;
24
+ sortID;
25
+ comments;
26
+ equipment;
27
+ images;
28
+ constructor(ms) {
29
+ this.sensorID = (ms) ? ms.sensorID : '';
30
+ this.sensorType = (ms) ? ms.sensorType : systemdata_1.GeneralTypes.OTHER;
31
+ this.preflightMinutes = (ms) ? ms.preflightMinutes : 0;
32
+ this.scheduledMinutes = (ms) ? ms.scheduledMinutes : 0;
33
+ this.executedMinutes = (ms) ? ms.executedMinutes : 0;
34
+ this.postflightMinutes = (ms) ? ms.postflightMinutes : 0;
35
+ this.additionalMinutes = (ms) ? ms.additionalMinutes : 0;
36
+ this.finalCode = (ms) ? ms.finalCode : 0;
37
+ this.kitNumber = (ms) ? ms.kitNumber : '';
38
+ this.sensorOutage = (ms) ? new missionSensorOutage_1.MissionSensorOutage(ms.sensorOutage)
39
+ : new missionSensorOutage_1.MissionSensorOutage();
40
+ this.groundOutage = (ms) ? ms.groundOutage : 0;
41
+ this.hasHap = (ms) ? ms.hasHap : false;
42
+ this.towerID = (ms) ? ms.towerID : 0;
43
+ this.sortID = (ms) ? ms.sortID : 0;
44
+ this.comments = (ms) ? ms.comments : '';
45
+ if (ms && ms.equipment) {
46
+ this.equipment = [];
47
+ ms.equipment.forEach(eq => {
48
+ this.equipment?.push(eq);
49
+ });
50
+ this.equipment.sort();
51
+ }
52
+ if (ms && ms.images) {
53
+ this.images = [];
54
+ ms.images.forEach(img => {
55
+ this.images?.push(new images_1.ImageType(img));
56
+ });
57
+ this.images.sort((a, b) => a.compareTo(b));
58
+ }
59
+ }
60
+ /**
61
+ * This function is used in sorting this mission sensor from another.
62
+ * @param other The mission sensor object used for comparison.
63
+ * @returns numeric value for the relative position of this to another.
64
+ */
65
+ compareTo(other) {
66
+ if (other) {
67
+ return (this.sortID < other.sortID) ? -1 : 1;
68
+ }
69
+ return -1;
70
+ }
71
+ /**
72
+ * This function will check to ensure the requested equipment is present in the
73
+ * equipment list.
74
+ * @param sid The string value for the equipment to check for.
75
+ * @returns boolean value for whether or not the equipment is in the list.
76
+ */
77
+ equipmentInUse(sid) {
78
+ let answer = false;
79
+ if (this.equipment) {
80
+ this.equipment.forEach(eq => {
81
+ if (eq.toLowerCase() === sid.toLowerCase()) {
82
+ answer = true;
83
+ }
84
+ });
85
+ }
86
+ return answer;
87
+ }
88
+ /**
89
+ * This function will modify the equipment list, adding or removing equipment.
90
+ * @param item The string value for the equipment to add/remove.
91
+ * @param value A string value for a boolean value, true to add, false to remove.
92
+ */
93
+ modifyEquipment(item, value) {
94
+ if (item.toLowerCase() === 'apsplus') {
95
+ item = 'aps+';
96
+ }
97
+ if (value.toLowerCase() === 'true') {
98
+ let found = false;
99
+ if (this.equipment) {
100
+ this.equipment.forEach(eq => {
101
+ if (eq.toLowerCase() === item.toLowerCase()) {
102
+ found = true;
103
+ }
104
+ });
105
+ }
106
+ if (!found) {
107
+ if (!this.equipment) {
108
+ this.equipment = [];
109
+ }
110
+ this.equipment.push(item);
111
+ }
112
+ }
113
+ else {
114
+ let found = -1;
115
+ if (this.equipment) {
116
+ this.equipment.forEach((eq, e) => {
117
+ if (eq.toLowerCase() === item.toLowerCase()) {
118
+ found = e;
119
+ }
120
+ });
121
+ if (found >= 0) {
122
+ this.equipment.splice(found, 1);
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+ exports.MissionSensor = MissionSensor;
@@ -0,0 +1,43 @@
1
+ import { ObjectId } from "mongodb";
2
+ /**
3
+ * This interface defines the data members associated with a ground outage
4
+ */
5
+ export interface IOutage {
6
+ _id?: ObjectId;
7
+ id?: string;
8
+ outageDate: Date;
9
+ groundSystem: string;
10
+ classification: string;
11
+ outageNumber: number;
12
+ outageMinutes: number;
13
+ subSystem: string;
14
+ referenceId: string;
15
+ majorSystem: string;
16
+ problem: string;
17
+ fixAction: string;
18
+ missionOutage: boolean;
19
+ capability?: string;
20
+ }
21
+ export declare class Outage implements IOutage {
22
+ id: string;
23
+ outageDate: Date;
24
+ groundSystem: string;
25
+ classification: string;
26
+ outageNumber: number;
27
+ outageMinutes: number;
28
+ subSystem: string;
29
+ referenceId: string;
30
+ majorSystem: string;
31
+ problem: string;
32
+ fixAction: string;
33
+ missionOutage: boolean;
34
+ capability?: string;
35
+ constructor(outage?: IOutage);
36
+ /**
37
+ * This function is used in sorting outages by comparing the outage's dates and numbers.
38
+ * @param other Another outage object used for comparison
39
+ * @returns A numeric value for the relative position of this object to the other.
40
+ */
41
+ compareTo(other?: Outage): number;
42
+ useOutage(start: Date, end: Date): boolean;
43
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Outage = void 0;
4
+ class Outage {
5
+ id;
6
+ outageDate;
7
+ groundSystem;
8
+ classification;
9
+ outageNumber;
10
+ outageMinutes;
11
+ subSystem;
12
+ referenceId;
13
+ majorSystem;
14
+ problem;
15
+ fixAction;
16
+ missionOutage;
17
+ capability;
18
+ constructor(outage) {
19
+ this.id = (outage && outage.id) ? outage.id : '';
20
+ if (this.id === '') {
21
+ this.id = (outage && outage._id) ? outage?._id?.toString() : '';
22
+ }
23
+ this.outageDate = (outage) ? new Date(outage.outageDate) : new Date();
24
+ this.groundSystem = (outage) ? outage.groundSystem : '';
25
+ this.classification = (outage) ? outage.classification : '';
26
+ this.outageNumber = (outage) ? outage.outageNumber : 0;
27
+ this.outageMinutes = (outage) ? outage.outageMinutes : 0;
28
+ this.subSystem = (outage) ? outage.subSystem : '';
29
+ this.referenceId = (outage) ? outage.referenceId : '';
30
+ this.majorSystem = (outage) ? outage.majorSystem : '';
31
+ this.problem = (outage) ? outage.problem : '';
32
+ this.fixAction = (outage) ? outage.fixAction : '';
33
+ this.missionOutage = (outage) ? outage.missionOutage : false;
34
+ this.capability = (outage && outage.capability) ? outage.capability : undefined;
35
+ }
36
+ /**
37
+ * This function is used in sorting outages by comparing the outage's dates and numbers.
38
+ * @param other Another outage object used for comparison
39
+ * @returns A numeric value for the relative position of this object to the other.
40
+ */
41
+ compareTo(other) {
42
+ if (other) {
43
+ if (this.outageDate.getTime() === other.outageDate.getTime()) {
44
+ return (this.outageNumber < other.outageNumber) ? -1 : 1;
45
+ }
46
+ return (this.outageDate.getTime() < other.outageDate.getTime()) ? -1 : 1;
47
+ }
48
+ return -1;
49
+ }
50
+ useOutage(start, end) {
51
+ return (start.getTime() <= this.outageDate.getTime()
52
+ && end.getTime() > this.outageDate.getTime());
53
+ }
54
+ }
55
+ exports.Outage = Outage;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This interface defines the data members of a classification object.
3
+ */
4
+ export interface IClassification {
5
+ id: string;
6
+ title: string;
7
+ sortID: number;
8
+ }
9
+ /**
10
+ * This class defines the data members and actions for a classification object.
11
+ */
12
+ export declare class Classification implements IClassification {
13
+ id: string;
14
+ title: string;
15
+ sortID: number;
16
+ constructor(cl?: IClassification);
17
+ compareTo(other?: Classification): number;
18
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Classification = void 0;
4
+ /**
5
+ * This class defines the data members and actions for a classification object.
6
+ */
7
+ class Classification {
8
+ id;
9
+ title;
10
+ sortID;
11
+ constructor(cl) {
12
+ this.id = (cl) ? cl.id : '';
13
+ this.title = (cl) ? cl.title : '';
14
+ this.sortID = (cl) ? cl.sortID : 0;
15
+ }
16
+ compareTo(other) {
17
+ if (other) {
18
+ return (this.sortID < other.sortID) ? -1 : 1;
19
+ }
20
+ return -1;
21
+ }
22
+ }
23
+ exports.Classification = Classification;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This interface defines the data members for communications data.
3
+ */
4
+ export interface ICommunication {
5
+ id: string;
6
+ explanation: string;
7
+ exploitations: string[];
8
+ sortID: number;
9
+ }
10
+ /**
11
+ * This class defines the data members plus actions for a communication object.
12
+ */
13
+ export declare class Communication implements ICommunication {
14
+ id: string;
15
+ explanation: string;
16
+ exploitations: string[];
17
+ sortID: number;
18
+ constructor(comm?: ICommunication);
19
+ compareTo(other?: Communication): number;
20
+ hasExploitation(exp: string): boolean;
21
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Communication = void 0;
4
+ /**
5
+ * This class defines the data members plus actions for a communication object.
6
+ */
7
+ class Communication {
8
+ id;
9
+ explanation;
10
+ exploitations;
11
+ sortID;
12
+ constructor(comm) {
13
+ this.id = (comm) ? comm.id : '';
14
+ this.explanation = (comm) ? comm.explanation : '';
15
+ this.exploitations = [];
16
+ if (comm) {
17
+ comm.exploitations.forEach(exp => {
18
+ this.exploitations.push(exp);
19
+ });
20
+ this.exploitations.sort();
21
+ }
22
+ this.sortID = (comm) ? comm.sortID : 0;
23
+ }
24
+ compareTo(other) {
25
+ if (other) {
26
+ return (this.sortID < other.sortID) ? -1 : 1;
27
+ }
28
+ return -1;
29
+ }
30
+ hasExploitation(exp) {
31
+ let answer = false;
32
+ this.exploitations.forEach(exploit => {
33
+ if (exploit.toLowerCase() === exp.toLowerCase()) {
34
+ answer = true;
35
+ }
36
+ });
37
+ return answer;
38
+ }
39
+ }
40
+ exports.Communication = Communication;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This interface is used to list a Distributed Common Ground Station site and the
3
+ * types of exploitation done at that site.
4
+ */
5
+ export interface IDCGS {
6
+ id: string;
7
+ exploitations?: string[];
8
+ sortID: number;
9
+ }
10
+ /**
11
+ * This class implements the DCGS interface plus actions
12
+ */
13
+ export declare class DCGS implements IDCGS {
14
+ id: string;
15
+ exploitations?: string[] | undefined;
16
+ sortID: number;
17
+ constructor(d?: IDCGS);
18
+ compareTo(other?: DCGS): number;
19
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DCGS = void 0;
4
+ /**
5
+ * This class implements the DCGS interface plus actions
6
+ */
7
+ class DCGS {
8
+ id;
9
+ exploitations;
10
+ sortID;
11
+ constructor(d) {
12
+ this.id = (d) ? d.id : '';
13
+ this.sortID = (d) ? d.sortID : 0;
14
+ if (d && d.exploitations) {
15
+ this.exploitations = [];
16
+ d.exploitations.forEach(ex => {
17
+ this.exploitations?.push(ex);
18
+ });
19
+ this.exploitations.sort();
20
+ }
21
+ }
22
+ compareTo(other) {
23
+ if (other) {
24
+ return (this.sortID < other.sortID) ? -1 : 1;
25
+ }
26
+ return -1;
27
+ }
28
+ }
29
+ exports.DCGS = DCGS;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This interface will be used to define a exploitation type by id and explanation.
3
+ */
4
+ export interface IExploitation {
5
+ id: string;
6
+ explanation: string;
7
+ sortID: number;
8
+ }
9
+ /**
10
+ * This class implements the IExploitation interface plus actions
11
+ */
12
+ export declare class Exploitation implements IExploitation {
13
+ id: string;
14
+ explanation: string;
15
+ sortID: number;
16
+ constructor(ex?: IExploitation);
17
+ compareTo(other?: Exploitation): number;
18
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Exploitation = void 0;
4
+ /**
5
+ * This class implements the IExploitation interface plus actions
6
+ */
7
+ class Exploitation {
8
+ id;
9
+ explanation;
10
+ sortID;
11
+ constructor(ex) {
12
+ this.id = (ex) ? ex.id : '';
13
+ this.explanation = (ex) ? ex.explanation : '';
14
+ this.sortID = (ex) ? ex.sortID : 0;
15
+ }
16
+ compareTo(other) {
17
+ if (other) {
18
+ return (this.sortID < other.sortID) ? -1 : 1;
19
+ }
20
+ return -1;
21
+ }
22
+ }
23
+ exports.Exploitation = Exploitation;
@@ -0,0 +1,86 @@
1
+ /**
2
+ * This interface defines the data members associated with a ground system exploitation
3
+ * object.
4
+ */
5
+ export interface IGroundSystemExploitation {
6
+ platformID: string;
7
+ sensorType: string;
8
+ exploitation: string;
9
+ communicationID: string;
10
+ enclaves?: string[];
11
+ }
12
+ /**
13
+ * This class implements the data members of the GroundSystemExploitation interface,
14
+ * plus functions to used the object.
15
+ */
16
+ export declare class GroundSystemExploitation implements IGroundSystemExploitation {
17
+ platformID: string;
18
+ sensorType: string;
19
+ exploitation: string;
20
+ communicationID: string;
21
+ enclaves: string[];
22
+ constructor(gse?: IGroundSystemExploitation);
23
+ /**
24
+ * This function is used in sorting a list of Ground System Exploitation objects.
25
+ * @param other The ground system exploitation object for comparison
26
+ * @returns The numeric value to indicate this object's relative position compared to
27
+ * the other object.
28
+ */
29
+ compareTo(other?: GroundSystemExploitation): number;
30
+ /**
31
+ * This function will indicate if this exploitation should be used based on the
32
+ * information provided.
33
+ * @param platform The string value for the platform
34
+ * @param sensor The string value for the sensor
35
+ * @param exploit The string value for the exploitation
36
+ * @param comm The string value for the communications
37
+ * @param enclave The string value for the enclave
38
+ * @returns boolean value to indicate whether all the conditions are present
39
+ */
40
+ use(platform: string, sensor: string, exploit: string, comm: string, enclave: string): boolean;
41
+ }
42
+ /**
43
+ * This interface defines the data members of a ground system object
44
+ */
45
+ export interface IGroundSystem {
46
+ id: string;
47
+ enclaves: string[];
48
+ showOnGEOINT: boolean;
49
+ showOnGSEG: boolean;
50
+ showOnMIST: boolean;
51
+ showOnXINT: boolean;
52
+ checkForUse?: boolean;
53
+ exploitations: IGroundSystemExploitation[];
54
+ }
55
+ /**
56
+ * This class implements the data members for a ground system, plus all the action to
57
+ * use the object
58
+ */
59
+ export declare class GroundSystem implements IGroundSystem {
60
+ id: string;
61
+ enclaves: string[];
62
+ showOnGEOINT: boolean;
63
+ showOnGSEG: boolean;
64
+ showOnMIST: boolean;
65
+ showOnXINT: boolean;
66
+ checkForUse: boolean;
67
+ exploitations: GroundSystemExploitation[];
68
+ constructor(gs?: IGroundSystem);
69
+ /**
70
+ * This function will be used when sorting a list of ground system objects.
71
+ * @param other The ground system object used for comparison
72
+ * @returns a numeric value for whether this object is before or after the other.
73
+ */
74
+ compareTo(other?: GroundSystem): number;
75
+ /**
76
+ * This function will indicate if this exploitation should be used based on the
77
+ * information provided.
78
+ * @param platform The string value for the platform
79
+ * @param sensor The string value for the sensor
80
+ * @param exploit The string value for the exploitation
81
+ * @param comm The string value for the communications
82
+ * @param enclave The string value for the enclave
83
+ * @returns boolean value to indicate whether all the conditions are present
84
+ */
85
+ useSensor(platform: string, sensor: string, exploit: string, comm: string, enclave: string): boolean;
86
+ }
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GroundSystem = exports.GroundSystemExploitation = void 0;
4
+ /**
5
+ * This class implements the data members of the GroundSystemExploitation interface,
6
+ * plus functions to used the object.
7
+ */
8
+ class GroundSystemExploitation {
9
+ platformID;
10
+ sensorType;
11
+ exploitation;
12
+ communicationID;
13
+ enclaves;
14
+ constructor(gse) {
15
+ this.platformID = (gse) ? gse.platformID : '';
16
+ this.sensorType = (gse) ? gse.sensorType : '';
17
+ this.exploitation = (gse) ? gse.exploitation : '';
18
+ this.communicationID = (gse) ? gse.communicationID : '';
19
+ this.enclaves = [];
20
+ if (gse && gse.enclaves) {
21
+ gse.enclaves.forEach(en => {
22
+ this.enclaves.push(en);
23
+ });
24
+ }
25
+ }
26
+ /**
27
+ * This function is used in sorting a list of Ground System Exploitation objects.
28
+ * @param other The ground system exploitation object for comparison
29
+ * @returns The numeric value to indicate this object's relative position compared to
30
+ * the other object.
31
+ */
32
+ compareTo(other) {
33
+ if (other) {
34
+ if (this.platformID === other.platformID) {
35
+ if (this.sensorType === other.sensorType) {
36
+ if (this.exploitation === other.exploitation) {
37
+ return (this.communicationID < other.communicationID) ? -1 : 1;
38
+ }
39
+ return (this.exploitation < other.exploitation) ? -1 : 1;
40
+ }
41
+ return (this.sensorType < other.sensorType) ? -1 : 1;
42
+ }
43
+ return (this.platformID < other.platformID) ? -1 : 1;
44
+ }
45
+ return -1;
46
+ }
47
+ /**
48
+ * This function will indicate if this exploitation should be used based on the
49
+ * information provided.
50
+ * @param platform The string value for the platform
51
+ * @param sensor The string value for the sensor
52
+ * @param exploit The string value for the exploitation
53
+ * @param comm The string value for the communications
54
+ * @param enclave The string value for the enclave
55
+ * @returns boolean value to indicate whether all the conditions are present
56
+ */
57
+ use(platform, sensor, exploit, comm, enclave) {
58
+ let answer = false;
59
+ if (platform.toLowerCase() === this.platformID.toLowerCase()
60
+ && sensor.toLowerCase() === this.sensorType.toLowerCase()
61
+ && this.exploitation.toLowerCase().indexOf(exploit.toLowerCase()) >= 0
62
+ && comm.toLowerCase() === this.communicationID.toLowerCase()) {
63
+ if (this.enclaves.length === 0)
64
+ return true;
65
+ if (enclave === '')
66
+ return true;
67
+ this.enclaves.forEach(enc => {
68
+ if (enc.toLowerCase() === enclave.toLowerCase()) {
69
+ answer = true;
70
+ }
71
+ });
72
+ }
73
+ return answer;
74
+ }
75
+ }
76
+ exports.GroundSystemExploitation = GroundSystemExploitation;
77
+ /**
78
+ * This class implements the data members for a ground system, plus all the action to
79
+ * use the object
80
+ */
81
+ class GroundSystem {
82
+ id;
83
+ enclaves;
84
+ showOnGEOINT;
85
+ showOnGSEG;
86
+ showOnMIST;
87
+ showOnXINT;
88
+ checkForUse;
89
+ exploitations;
90
+ constructor(gs) {
91
+ this.id = (gs) ? gs.id : '';
92
+ this.enclaves = [];
93
+ if (gs && gs.enclaves.length > 0) {
94
+ gs.enclaves.forEach(en => {
95
+ this.enclaves.push(en);
96
+ });
97
+ }
98
+ this.showOnGEOINT = (gs) ? gs.showOnGEOINT : false;
99
+ this.showOnGSEG = (gs) ? gs.showOnGSEG : false;
100
+ this.showOnMIST = (gs) ? gs.showOnMIST : false;
101
+ this.showOnXINT = (gs) ? gs.showOnXINT : false;
102
+ this.checkForUse = (gs && gs.checkForUse) ? gs.checkForUse : false;
103
+ this.exploitations = [];
104
+ if (gs && gs.exploitations.length > 0) {
105
+ gs.exploitations.forEach(ex => {
106
+ this.exploitations.push(new GroundSystemExploitation(ex));
107
+ });
108
+ }
109
+ }
110
+ /**
111
+ * This function will be used when sorting a list of ground system objects.
112
+ * @param other The ground system object used for comparison
113
+ * @returns a numeric value for whether this object is before or after the other.
114
+ */
115
+ compareTo(other) {
116
+ if (other) {
117
+ return (this.id < other.id) ? -1 : 1;
118
+ }
119
+ return -1;
120
+ }
121
+ /**
122
+ * This function will indicate if this exploitation should be used based on the
123
+ * information provided.
124
+ * @param platform The string value for the platform
125
+ * @param sensor The string value for the sensor
126
+ * @param exploit The string value for the exploitation
127
+ * @param comm The string value for the communications
128
+ * @param enclave The string value for the enclave
129
+ * @returns boolean value to indicate whether all the conditions are present
130
+ */
131
+ useSensor(platform, sensor, exploit, comm, enclave) {
132
+ if (this.exploitations.length === 0)
133
+ return true;
134
+ let answer = false;
135
+ this.exploitations.forEach(exp => {
136
+ if (exp.use(platform, sensor, exploit, comm, enclave)) {
137
+ answer = true;
138
+ }
139
+ });
140
+ return answer;
141
+ }
142
+ }
143
+ exports.GroundSystem = GroundSystem;
@@ -0,0 +1,7 @@
1
+ export * from './classifications';
2
+ export * from './communications';
3
+ export * from './dcgs';
4
+ export * from './exploitations';
5
+ export * from './groundSystems';
6
+ export * from './platform';
7
+ export * from './systeminfo';
@@ -0,0 +1,23 @@
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("./classifications"), exports);
18
+ __exportStar(require("./communications"), exports);
19
+ __exportStar(require("./dcgs"), exports);
20
+ __exportStar(require("./exploitations"), exports);
21
+ __exportStar(require("./groundSystems"), exports);
22
+ __exportStar(require("./platform"), exports);
23
+ __exportStar(require("./systeminfo"), exports);