Skip to content

Commit

Permalink
dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Oct 29, 2024
1 parent 15bd7be commit b0554c7
Show file tree
Hide file tree
Showing 64 changed files with 4,765 additions and 1,994 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ app.use(csurf({
cookie: true
}));
app.use(rateLimit({
windowMs: 10000,
windowMs: 10_000,
max: 200
}));
const abuseCheckHandler = abuseCheck();
Expand Down
3 changes: 0 additions & 3 deletions app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable import/no-named-as-default-member */

import path from 'node:path'

import { abuseCheck } from '@cityssm/express-abuse-points'
Expand Down
2 changes: 1 addition & 1 deletion bin/www.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (process.env.STARTUP_TEST === 'true') {
setTimeout(() => {
debug('Killing processes');
process.exit(0);
}, 10000);
}, 10_000);
}
else {
fork('./tasks/databaseCleanup.js');
Expand Down
2 changes: 1 addition & 1 deletion database/addAbsenceType.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function addAbsenceType(form, sessionUser) {
async function getAvailableAbsenceTypeKey(absenceType) {
const absenceTypeKeyRoot = camelCase(absenceType).slice(0, 10);
const pool = await sqlPoolConnect(getConfigProperty('mssql'));
for (let index = 0; index <= 9999999999; index += 1) {
for (let index = 0; index <= 9_999_999_999; index += 1) {
const indexString = index.toString();
const absenceTypeKey = index === 0
? absenceTypeKeyRoot
Expand Down
2 changes: 1 addition & 1 deletion database/getAbsenceRecords.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function getAbsenceRecords(filters, options, sessionUser) {
(hasPermission(sessionUser, 'attendance.absences.canUpdate') &&
absenceRecord.recordCreate_userName === sessionUser.userName &&
Date.now() - absenceRecord.recordCreate_dateTime.getTime() <=
getConfigProperty('settings.updateDays') * 86400 * 1000);
getConfigProperty('settings.updateDays') * 86_400 * 1000);
if (options.includeCallOutListIds ?? false) {
absenceRecord.callOutLists = await getCallOutLists({
employeeNumber: absenceRecord.employeeNumber,
Expand Down
2 changes: 1 addition & 1 deletion database/getAfterHoursRecords.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function getAfterHoursRecords(filters, sessionUser) {
(afterHoursRecord.recordCreate_userName === sessionUser.userName &&
Date.now() -
afterHoursRecord.recordCreate_dateTime.getTime() <=
getConfigProperty('settings.updateDays') * 86400 * 1000);
getConfigProperty('settings.updateDays') * 86_400 * 1000);
}
}
return afterHoursRecords;
Expand Down
2 changes: 1 addition & 1 deletion database/getReturnToWorkRecords.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function getReturnToWorkRecords(filters, sessionUser) {
(returnToWorkRecord.recordCreate_userName === sessionUser.userName &&
Date.now() -
returnToWorkRecord.recordCreate_dateTime.getTime() <=
getConfigProperty('settings.updateDays') * 86400 * 1000);
getConfigProperty('settings.updateDays') * 86_400 * 1000);
}
}
return returnToWorkRecords;
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-get/employees.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): Promise<void>;
export default handler;
1 change: 0 additions & 1 deletion handlers/admin-get/tables.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): Promise<void>;
export default handler;
1 change: 0 additions & 1 deletion handlers/admin-get/users.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): Promise<void>;
export default handler;
1 change: 0 additions & 1 deletion handlers/admin-post/doAddAbsenceType.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AbsenceType } from '../../types/recordTypes.js';
export interface DoAddAbsenceTypeResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doAddAfterHoursReason.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AfterHoursReason } from '../../types/recordTypes.js';
export interface DoAddAfterHoursReasonResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doAddCallOutResponseType.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutResponseType } from '../../types/recordTypes.js';
export interface DoAddCallOutResponseTypeResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doAddEmployee.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { Employee } from '../../types/recordTypes.js';
export type DoAddEmployeeResponse = {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doClearUserPermissions.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export interface DoClearUserPermissionsResponse {
success: boolean;
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doDeleteAbsenceType.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AbsenceType } from '../../types/recordTypes.js';
export interface DoDeleteAbsenceTypeResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doDeleteAfterHoursReason.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AfterHoursReason } from '../../types/recordTypes.js';
export interface DoDeleteAfterHoursReasonResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doDeleteCallOutResponseType.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutResponseType } from '../../types/recordTypes.js';
export interface DoDeleteCallOutResponseTypeResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doDeleteEmployee.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { Employee } from '../../types/recordTypes.js';
export interface DoDeleteEmployeeResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doGetEmployeeProperties.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { EmployeeProperty } from '../../types/recordTypes.js';
export interface DoGetEmployeePropertiesResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doGetUserPermissions.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import { type GetUserPermissionsReturn } from '../../database/getUserPermissions.js';
export interface DoGetUserPermissionsResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doModifyEmployeeProperty.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { EmployeeProperty } from '../../types/recordTypes.js';
export interface DoModifyEmployeePropertyResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doModifyUser.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export interface DoModifyUserResponse {
success: boolean;
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doMoveAbsenceType.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AbsenceType } from '../../types/recordTypes.js';
export interface DoMoveAbsenceTypeResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doMoveAfterHoursReason.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AfterHoursReason } from '../../types/recordTypes.js';
export interface DoMoveAfterHoursReasonResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doMoveCallOutResponseType.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutResponseType } from '../../types/recordTypes.js';
export interface DoMoveCallOutResponseTypeResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doSetUserPermission.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export interface DoSetUserPermissionResponse {
success: boolean;
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doUpdateAbsenceType.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export interface DoUpdateAbsenceTypeResponse {
success: boolean;
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doUpdateAfterHoursReason.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export interface DoUpdateAfterHoursReasonResponse {
success: boolean;
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doUpdateCallOutResponseType.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export interface DoUpdateCallOutResponseTypeResponse {
success: boolean;
Expand Down
1 change: 0 additions & 1 deletion handlers/admin-post/doUpdateEmployee.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { Employee } from '../../types/recordTypes.js';
export interface DoUpdateEmployeeResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-get/attendance.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): Promise<void>;
export default handler;
1 change: 0 additions & 1 deletion handlers/attendance-post/doAddAfterHoursRecord.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AfterHoursRecord } from '../../types/recordTypes.js';
export interface DoAddAfterHoursRecordResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doAddCallOutListMember.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutListMember } from '../../types/recordTypes.js';
export interface DoAddCallOutListMemberResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doAddCallOutRecord.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutRecord } from '../../types/recordTypes.js';
export interface DoAddCallOutRecordResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doCreateCallOutList.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutList } from '../../types/recordTypes.js';
export interface DoCreateCallOutListResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doDeleteAbsenceRecord.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AbsenceRecord } from '../../types/recordTypes.js';
export type DoDeleteAbsenceRecordResponse = {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doDeleteAfterHoursRecord.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AfterHoursRecord } from '../../types/recordTypes.js';
export type DoDeleteAfterHoursRecordResponse = {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doDeleteCallOutList.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutList } from '../../types/recordTypes.js';
export interface DoDeleteCallOutListResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doDeleteCallOutListMember.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutListMember } from '../../types/recordTypes.js';
export interface DoDeleteCallOutListMemberResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doDeleteCallOutRecord.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutRecord } from '../../types/recordTypes.js';
export interface DoDeleteCallOutRecordResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doDeleteReturnToWorkRecord.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { ReturnToWorkRecord } from '../../types/recordTypes.js';
export type DoDeleteReturnToWorkRecordResponse = {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doGetAttendanceRecords.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AbsenceRecord, CallOutRecord, ReturnToWorkRecord } from '../../types/recordTypes.js';
export interface DoGetAttendanceRecordsResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doGetCallOutListMembers.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AbsenceRecord, CallOutListMember, Employee } from '../../types/recordTypes.js';
export interface DoGetCallOutListMembersResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doGetCallOutRecords.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutRecord } from '../../types/recordTypes.js';
export interface DoGetCallOutRecordsResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doRecordCallIn.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { AbsenceRecord, ReturnToWorkRecord } from '../../types/recordTypes.js';
export interface DoRecordCallInResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doToggleFavouriteCallOutList.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutList } from '../../types/recordTypes.js';
export interface DoToggleFavouriteCallOutListResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doUpdateCallOutList.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutList, CallOutListMember, Employee } from '../../types/recordTypes.js';
export interface DoUpdateCallOutListResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/attendance-post/doUpdateCallOutRecord.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
import type { CallOutRecord } from '../../types/recordTypes.js';
export interface DoUpdateCallOutRecordResponse {
Expand Down
1 change: 0 additions & 1 deletion handlers/dashboard-get/dashboard.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): Promise<void>;
export default handler;
1 change: 0 additions & 1 deletion handlers/print-get/screen.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): Promise<void>;
export default handler;
1 change: 0 additions & 1 deletion handlers/reports-get/reportName.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): Promise<void>;
export default handler;
1 change: 0 additions & 1 deletion handlers/reports-get/reports.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): void;
export default handler;
1 change: 0 additions & 1 deletion handlers/selfService-get/selfService.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): void;
export default handler;
1 change: 0 additions & 1 deletion handlers/selfService-post/doAddEmployeeToCallOutList.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): Promise<void>;
export default handler;
1 change: 0 additions & 1 deletion handlers/selfService-post/doGetAvailableCallOutLists.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): Promise<void>;
export default handler;
1 change: 0 additions & 1 deletion handlers/selfService-post/doValidateEmployee.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request, Response } from 'express';
export declare function handler(request: Request, response: Response): Promise<void>;
export default handler;
1 change: 0 additions & 1 deletion helpers/functions.selfService.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request } from 'express';
type EmployeeValidation = {
success: true;
Expand Down
1 change: 0 additions & 1 deletion helpers/functions.user.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="cookie-parser" />
import type { Request } from 'express';
export interface APIRequest {
params?: {
Expand Down
Loading

0 comments on commit b0554c7

Please sign in to comment.