scheduler-node-models 1.1.37 → 1.1.44

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 (151) hide show
  1. package/package.json +6 -6
  2. package/general/emailer.d.ts +0 -1
  3. package/general/emailer.js +0 -31
  4. package/general/general.d.ts +0 -12
  5. package/general/general.js +0 -2
  6. package/general/index.d.ts +0 -5
  7. package/general/index.js +0 -21
  8. package/general/logger.d.ts +0 -10
  9. package/general/logger.js +0 -90
  10. package/general/report.d.ts +0 -25
  11. package/general/report.js +0 -76
  12. package/general/reportStyle.d.ts +0 -0
  13. package/general/reportStyle.js +0 -1
  14. package/general/viewstate.d.ts +0 -5
  15. package/general/viewstate.js +0 -9
  16. package/index.d.ts +0 -0
  17. package/index.js +0 -1
  18. package/metrics/images.d.ts +0 -22
  19. package/metrics/images.js +0 -33
  20. package/metrics/index.d.ts +0 -5
  21. package/metrics/index.js +0 -21
  22. package/metrics/mission.d.ts +0 -47
  23. package/metrics/mission.js +0 -81
  24. package/metrics/missionSensorOutage.d.ts +0 -11
  25. package/metrics/missionSensorOutage.js +0 -14
  26. package/metrics/missionsensor.d.ts +0 -67
  27. package/metrics/missionsensor.js +0 -128
  28. package/metrics/outage.d.ts +0 -43
  29. package/metrics/outage.js +0 -55
  30. package/metrics/reports/drawSummary.d.ts +0 -24
  31. package/metrics/reports/drawSummary.js +0 -311
  32. package/metrics/reports/index.d.ts +0 -5
  33. package/metrics/reports/index.js +0 -21
  34. package/metrics/reports/missionDay.d.ts +0 -8
  35. package/metrics/reports/missionDay.js +0 -23
  36. package/metrics/reports/missionSummary.d.ts +0 -25
  37. package/metrics/reports/missionSummary.js +0 -421
  38. package/metrics/reports/missionType.d.ts +0 -20
  39. package/metrics/reports/missionType.js +0 -314
  40. package/metrics/reports/outageDay.d.ts +0 -8
  41. package/metrics/reports/outageDay.js +0 -23
  42. package/metrics/systemdata/classifications.d.ts +0 -18
  43. package/metrics/systemdata/classifications.js +0 -23
  44. package/metrics/systemdata/communications.d.ts +0 -21
  45. package/metrics/systemdata/communications.js +0 -40
  46. package/metrics/systemdata/dcgs.d.ts +0 -19
  47. package/metrics/systemdata/dcgs.js +0 -29
  48. package/metrics/systemdata/exploitations.d.ts +0 -18
  49. package/metrics/systemdata/exploitations.js +0 -23
  50. package/metrics/systemdata/groundSystems.d.ts +0 -86
  51. package/metrics/systemdata/groundSystems.js +0 -143
  52. package/metrics/systemdata/index.d.ts +0 -7
  53. package/metrics/systemdata/index.js +0 -23
  54. package/metrics/systemdata/platform.d.ts +0 -124
  55. package/metrics/systemdata/platform.js +0 -176
  56. package/metrics/systemdata/systeminfo.d.ts +0 -28
  57. package/metrics/systemdata/systeminfo.js +0 -64
  58. package/scheduler/employees/assignment.d.ts +0 -139
  59. package/scheduler/employees/assignment.js +0 -304
  60. package/scheduler/employees/balance.d.ts +0 -35
  61. package/scheduler/employees/balance.js +0 -39
  62. package/scheduler/employees/companyinfo.d.ts +0 -16
  63. package/scheduler/employees/companyinfo.js +0 -6
  64. package/scheduler/employees/contact.d.ts +0 -36
  65. package/scheduler/employees/contact.js +0 -40
  66. package/scheduler/employees/employee.d.ts +0 -427
  67. package/scheduler/employees/employee.js +0 -1887
  68. package/scheduler/employees/employeename.d.ts +0 -48
  69. package/scheduler/employees/employeename.js +0 -97
  70. package/scheduler/employees/index.d.ts +0 -14
  71. package/scheduler/employees/index.js +0 -30
  72. package/scheduler/employees/labor.d.ts +0 -31
  73. package/scheduler/employees/labor.js +0 -39
  74. package/scheduler/employees/leave.d.ts +0 -58
  75. package/scheduler/employees/leave.js +0 -73
  76. package/scheduler/employees/leaverequest.d.ts +0 -105
  77. package/scheduler/employees/leaverequest.js +0 -226
  78. package/scheduler/employees/specialty.d.ts +0 -35
  79. package/scheduler/employees/specialty.js +0 -40
  80. package/scheduler/employees/variation.d.ts +0 -80
  81. package/scheduler/employees/variation.js +0 -132
  82. package/scheduler/employees/web.d.ts +0 -6
  83. package/scheduler/employees/web.js +0 -2
  84. package/scheduler/employees/work.d.ts +0 -96
  85. package/scheduler/employees/work.js +0 -133
  86. package/scheduler/employees/workday.d.ts +0 -91
  87. package/scheduler/employees/workday.js +0 -170
  88. package/scheduler/labor/index.d.ts +0 -2
  89. package/scheduler/labor/index.js +0 -18
  90. package/scheduler/labor/laborcode.d.ts +0 -33
  91. package/scheduler/labor/laborcode.js +0 -55
  92. package/scheduler/labor/workcode.d.ts +0 -28
  93. package/scheduler/labor/workcode.js +0 -35
  94. package/scheduler/reports/chargeStatus.d.ts +0 -66
  95. package/scheduler/reports/chargeStatus.js +0 -752
  96. package/scheduler/reports/cofsReports.d.ts +0 -11
  97. package/scheduler/reports/cofsReports.js +0 -36
  98. package/scheduler/reports/enterpriseSchedule.d.ts +0 -18
  99. package/scheduler/reports/enterpriseSchedule.js +0 -159
  100. package/scheduler/reports/index.d.ts +0 -6
  101. package/scheduler/reports/index.js +0 -22
  102. package/scheduler/reports/leaveReport.d.ts +0 -52
  103. package/scheduler/reports/leaveReport.js +0 -755
  104. package/scheduler/reports/leaves.d.ts +0 -24
  105. package/scheduler/reports/leaves.js +0 -110
  106. package/scheduler/reports/scheduleReport.d.ts +0 -17
  107. package/scheduler/reports/scheduleReport.js +0 -311
  108. package/scheduler/sites/index.d.ts +0 -1
  109. package/scheduler/sites/index.js +0 -17
  110. package/scheduler/sites/reports/cofsReport.d.ts +0 -41
  111. package/scheduler/sites/reports/cofsReport.js +0 -104
  112. package/scheduler/sites/reports/forecast.d.ts +0 -57
  113. package/scheduler/sites/reports/forecast.js +0 -205
  114. package/scheduler/sites/reports/index.d.ts +0 -4
  115. package/scheduler/sites/reports/index.js +0 -20
  116. package/scheduler/sites/reports/period.d.ts +0 -11
  117. package/scheduler/sites/reports/period.js +0 -27
  118. package/scheduler/sites/reports/section.d.ts +0 -63
  119. package/scheduler/sites/reports/section.js +0 -186
  120. package/scheduler/sites/site.d.ts +0 -39
  121. package/scheduler/sites/site.js +0 -68
  122. package/scheduler/sites/workcenters/index.d.ts +0 -3
  123. package/scheduler/sites/workcenters/index.js +0 -19
  124. package/scheduler/sites/workcenters/position.d.ts +0 -27
  125. package/scheduler/sites/workcenters/position.js +0 -36
  126. package/scheduler/sites/workcenters/shift.d.ts +0 -32
  127. package/scheduler/sites/workcenters/shift.js +0 -47
  128. package/scheduler/sites/workcenters/workcenter.d.ts +0 -43
  129. package/scheduler/sites/workcenters/workcenter.js +0 -123
  130. package/scheduler/teams/company/company.d.ts +0 -99
  131. package/scheduler/teams/company/company.js +0 -256
  132. package/scheduler/teams/company/holiday.d.ts +0 -61
  133. package/scheduler/teams/company/holiday.js +0 -116
  134. package/scheduler/teams/company/index.d.ts +0 -3
  135. package/scheduler/teams/company/index.js +0 -19
  136. package/scheduler/teams/company/modperiod.d.ts +0 -21
  137. package/scheduler/teams/company/modperiod.js +0 -24
  138. package/scheduler/teams/contact.d.ts +0 -18
  139. package/scheduler/teams/contact.js +0 -23
  140. package/scheduler/teams/index.d.ts +0 -3
  141. package/scheduler/teams/index.js +0 -19
  142. package/scheduler/teams/specialty.d.ts +0 -18
  143. package/scheduler/teams/specialty.js +0 -23
  144. package/scheduler/teams/team.d.ts +0 -95
  145. package/scheduler/teams/team.js +0 -351
  146. package/users/index.d.ts +0 -2
  147. package/users/index.js +0 -18
  148. package/users/user.d.ts +0 -130
  149. package/users/user.js +0 -256
  150. package/users/web.d.ts +0 -48
  151. package/users/web.js +0 -2
package/users/user.js DELETED
@@ -1,256 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.User = void 0;
4
- const bcrypt_ts_1 = require("bcrypt-ts");
5
- /**
6
- * This class represents a user and all the actions available to the user object.
7
- * The main class members are:
8
- * id (primary key),
9
- * email address (used in authentication and email messages for reset),
10
- * password (authentication), password expires (old use -
11
- * to determine the when the password would expire, but new use is to track when
12
- * created to allow for the warning to change after 90 days and requiring after 1 year),
13
- * badAttempts (count of number of mismatch of password since last known good
14
- * authentication),
15
- * first, middle and last names (name - middle is optional),
16
- * workgroups (string array to provide identificationn of permission within an
17
- * application),
18
- * resetToken and resettokenexp (a storage location or a reset token used in forgot
19
- * password change, plus token expiration date/time the reset token expires)
20
- */
21
- class User {
22
- id;
23
- emailAddress;
24
- password;
25
- passwordExpires;
26
- badAttempts;
27
- firstName;
28
- middleName;
29
- lastName;
30
- workgroups;
31
- resettoken;
32
- resettokenexp;
33
- additionalEmails;
34
- constructor(user) {
35
- this.id = (user && user.id) ? user.id : '';
36
- if (this.id === '') {
37
- this.id = (user && user._id) ? user._id.toString() : '';
38
- }
39
- this.emailAddress = (user) ? user.emailAddress : '';
40
- this.password = (user) ? user.password : undefined;
41
- this.passwordExpires = (user) ? new Date(user.passwordExpires) : new Date();
42
- this.badAttempts = (user) ? user.badAttempts : 0;
43
- this.firstName = (user) ? user.firstName : '';
44
- this.middleName = (user) ? user.middleName : undefined;
45
- this.lastName = (user) ? user.lastName : '';
46
- this.workgroups = [];
47
- if (user) {
48
- user.workgroups.forEach(wg => {
49
- this.workgroups.push(wg);
50
- });
51
- user.workgroups.sort((a, b) => (a < b) ? -1 : 1);
52
- }
53
- this.resettoken = (user && user.resettoken) ? user.resettoken : undefined;
54
- this.resettokenexp = (user && user.resettokenexp)
55
- ? new Date(user.resettokenexp) : undefined;
56
- this.additionalEmails = [];
57
- if (user && user.additionalEmails) {
58
- user.additionalEmails.forEach(em => {
59
- this.additionalEmails?.push(em);
60
- });
61
- this.additionalEmails.sort();
62
- }
63
- }
64
- /**
65
- * This function is used to sort this class' objects into an ordered list. The order
66
- * is determined by last, first and middle names
67
- * @param other Another user object used during comparison
68
- * @returns a numeric value to show the object is before or after the other object.
69
- * -1 is for before and 1 is for after.
70
- */
71
- compareTo(other) {
72
- if (other) {
73
- if (other.lastName === this.lastName) {
74
- if (other.firstName === this.firstName) {
75
- if (this.middleName && other.middleName) {
76
- return (this.middleName < other.middleName) ? -1 : 1;
77
- }
78
- else if (!this.middleName) {
79
- return -1;
80
- }
81
- else {
82
- return 1;
83
- }
84
- }
85
- return (this.firstName < other.firstName) ? -1 : 1;
86
- }
87
- return (this.lastName < other.lastName) ? -1 : 1;
88
- }
89
- return -1;
90
- }
91
- /**
92
- * This function provides a copy of the user object to the web client. We don't want to
93
- * pass the password, reset token or expiration date/time.
94
- * @returns A new User interface for passing
95
- */
96
- cloneForOutput() {
97
- const output = new User(this);
98
- output.password = undefined;
99
- output.resettoken = undefined;
100
- output.resettokenexp = undefined;
101
- return output;
102
- }
103
- /**
104
- * This function will reset the password, bad attemtps and expiration date. The new
105
- * password will be excrypted for storage.
106
- * @param passwd The string value for the new password
107
- */
108
- setPassword(passwd) {
109
- const salt = (0, bcrypt_ts_1.genSaltSync)(12);
110
- const result = (0, bcrypt_ts_1.hashSync)(passwd, salt);
111
- this.password = result;
112
- this.passwordExpires = new Date();
113
- this.badAttempts = 0;
114
- }
115
- /**
116
- * This function will be used in authentication to verify if the password provided is
117
- * equivelent to the stored one.
118
- * @param pwd The string value to compare against the encrypted password.
119
- * @throws An error if the account is locked or there is a mismatch with the password.
120
- */
121
- checkPassword(pwd) {
122
- if (this.password && (0, bcrypt_ts_1.compareSync)(pwd, this.password)) {
123
- if (this.badAttempts > 2) {
124
- throw new Error("Account Locked");
125
- }
126
- this.badAttempts = 0;
127
- return;
128
- }
129
- else {
130
- this.badAttempts++;
131
- throw new Error("Account Mismatch");
132
- }
133
- }
134
- /**
135
- * This function will provide a random 16 character password.
136
- * @returns A string value representing the new random password.
137
- */
138
- createRandomPassword() {
139
- let result = '';
140
- const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
141
- + '0123456789';
142
- const charLength = characters.length;
143
- for (let i = 0; i < 16; i++) {
144
- result += characters.charAt(Math.floor(Math.random() * charLength));
145
- }
146
- this.setPassword(result);
147
- this.badAttempts = -1;
148
- return result;
149
- }
150
- /**
151
- * This function will unlock the user account to allow for access.
152
- */
153
- unlock() {
154
- this.badAttempts = 0;
155
- }
156
- /**
157
- * This function will provide the user's name in the form first middle and last.
158
- * @returns A string value for the user's name.
159
- */
160
- getFullName() {
161
- if (!this.middleName) {
162
- return this.firstName + ' ' + this.lastName;
163
- }
164
- return this.firstName + ' ' + this.middleName.substring(0, 1) + '. '
165
- + this.lastName;
166
- }
167
- /**
168
- * This function will provide the user's name in the form first last.
169
- * @returns A string value for the user's name.
170
- */
171
- getFirstLast() {
172
- return this.firstName + ' ' + this.lastName;
173
- }
174
- /**
175
- * This function will provide the user's name in the form last, first.
176
- * @returns A string value for the user's name.
177
- */
178
- getLastFirst() {
179
- return this.lastName + ', ' + this.firstName;
180
- }
181
- /**
182
- * This function will create a random string used as a token to reset the user's
183
- * password when the user had forgotten it. It will be emailed to the user's
184
- * email addresses. The token will be good for 1 hour, so an expiration date/time
185
- * is also set.
186
- * @returns A string value for the reset token.
187
- */
188
- createResetToken() {
189
- let result = '';
190
- const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
191
- + '0123456789';
192
- const charLength = characters.length;
193
- for (let i = 0; i < 16; i++) {
194
- result += characters.charAt(Math.floor(Math.random() * charLength));
195
- }
196
- let now = new Date();
197
- this.resettokenexp = new Date(now.getTime() + 3600000);
198
- this.resettoken = result;
199
- return result;
200
- }
201
- /**
202
- * This function will verify the provided string token in comparison to that recorded
203
- * in the user's record. The process also checks to ensure the token isn't expired.
204
- * @param token A string value for the comparison token.
205
- * @returns A boolean value to indicate if the token matches and not expired.
206
- */
207
- checkResetToken(token) {
208
- const now = new Date();
209
- if (this.resettoken && this.resettokenexp) {
210
- if (this.resettoken === token
211
- && now.getTime() < this.resettokenexp?.getTime()) {
212
- return true;
213
- }
214
- else {
215
- if (this.resettokenexp.getTime() < now.getTime()) {
216
- throw new Error("Reset Token Expired");
217
- }
218
- throw new Error("Reset Token Error");
219
- }
220
- }
221
- return false;
222
- }
223
- /**
224
- * This function will add a new email address, if it isn't already in the list
225
- * @param email The string value for the email to add.
226
- */
227
- addAdditionalEmail(email) {
228
- let found = false;
229
- this.additionalEmails.forEach(em => {
230
- if (em.toLowerCase() === email.toLowerCase()) {
231
- found = true;
232
- }
233
- });
234
- if (!found) {
235
- this.additionalEmails.push(email);
236
- this.additionalEmails.sort();
237
- }
238
- }
239
- /**
240
- * This function will remove an email address from the user's additional email
241
- * address list.
242
- * @param email The string value for the email to remove.
243
- */
244
- deleteAdditionalEmail(email) {
245
- let found = -1;
246
- this.additionalEmails.forEach((em, e) => {
247
- if (em.toLowerCase() === email.toLowerCase()) {
248
- found = e;
249
- }
250
- });
251
- if (found >= 0) {
252
- this.additionalEmails.splice(found, 1);
253
- }
254
- }
255
- }
256
- exports.User = User;
package/users/web.d.ts DELETED
@@ -1,48 +0,0 @@
1
- /**
2
- * This interface will be used to authenticate with the application through the api
3
- * server.
4
- */
5
- export interface AuthenticationRequest {
6
- emailAddress: string;
7
- password: string;
8
- application?: string;
9
- }
10
- /**
11
- * This interface will be used between the client and the api server to request a new
12
- * user. All fields are required.
13
- */
14
- export interface AddUserRequest {
15
- emailAddress: string;
16
- firstName: string;
17
- middleName?: string;
18
- lastName: string;
19
- password: string;
20
- application: string;
21
- permissions?: string[];
22
- }
23
- /**
24
- * This interface will be used to update a user with a call from the client to the
25
- * api server. All fields would be required.
26
- */
27
- export interface UpdateUserRequest {
28
- id: string;
29
- field: string;
30
- value: string;
31
- }
32
- /**
33
- * This interface is used in the first part of the forgot password process where the
34
- * requestor passes his/her email address used as the user identifier for the account.
35
- */
36
- export interface ForgotPasswordRequest {
37
- emailAddress: string;
38
- }
39
- /**
40
- * This interface is used in the second part of the forgot password process, to provide
41
- * the user's account email address, password and the passed reset token sent via email
42
- * to the user's accounts.
43
- */
44
- export interface PasswordResetRequest {
45
- emailAddress: string;
46
- password: string;
47
- resettoken: string;
48
- }
package/users/web.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });