Skip to content

Commit ae8d2e2

Browse files
committed
linting
1 parent 49fc0bb commit ae8d2e2

14 files changed

+29
-33
lines changed

data/config.defaultValues.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { ADWebAuthAuthenticatorConfiguration, ActiveDirectoryAuthenticatorConfiguration, PlainTextAuthenticatorConfiguration } from '@cityssm/authentication-helper';
2+
import type { nodeSchedule } from '@cityssm/scheduled-task';
23
import type { AccessOptions } from 'basic-ftp';
34
import type { config as MSSQLConfig } from 'mssql';
4-
import type { Spec } from 'node-schedule';
55
import type { ConfigFileSuffixXlsx, ConfigScheduledFtpReport } from '../types/config.helperTypes.js';
66
import type { ConfigFasterWeb } from '../types/config.types.js';
77
export declare const configDefaultValues: {
88
'modules.tempFolderCleanup.isEnabled': boolean;
9-
'modules.tempFolderCleanup.schedule': Spec;
9+
'modules.tempFolderCleanup.schedule': nodeSchedule.Spec;
1010
'modules.tempFolderCleanup.maxAgeDays': number;
1111
'modules.integrityChecker.isEnabled': boolean;
1212
'modules.integrityChecker.fasterAssets.isEnabled': boolean;

data/config.defaultValues.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import type {
66
ActiveDirectoryAuthenticatorConfiguration,
77
PlainTextAuthenticatorConfiguration
88
} from '@cityssm/authentication-helper'
9+
import type { nodeSchedule } from '@cityssm/scheduled-task'
910
import { hoursToMillis } from '@cityssm/to-millis'
1011
import type { AccessOptions } from 'basic-ftp'
1112
import type { config as MSSQLConfig } from 'mssql'
12-
import type { Spec } from 'node-schedule'
1313

1414
import integrityCheckerDefaultValues from '../modules/integrityChecker/config/defaultValues.js'
1515
import inventoryScannerDefaultValues from '../modules/inventoryScanner/config/defaultValues.js'
@@ -92,6 +92,6 @@ export const configDefaultValues = {
9292
hour: 1,
9393
minute: 0,
9494
second: 0
95-
} as unknown as Spec,
95+
} as unknown as nodeSchedule.Spec,
9696
'modules.tempFolderCleanup.maxAgeDays': 35
9797
}

index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import cluster from 'node:cluster';
22
import os from 'node:os';
3-
import { secondsToMillis } from '@cityssm/to-millis';
3+
import { nodeSchedule } from '@cityssm/scheduled-task';
4+
import { millisecondsInOneSecond } from '@cityssm/to-millis';
45
import Debug from 'debug';
56
import { asyncExitHook } from 'exit-hook';
6-
import schedule from 'node-schedule';
77
import { DEBUG_ENABLE_NAMESPACES, DEBUG_NAMESPACE } from './debug.config.js';
88
import { registerChildProcesses, relayMessageToChildProcess } from './helpers/childProcesses.helpers.js';
99
import { getConfigProperty } from './helpers/config.helpers.js';
@@ -39,9 +39,9 @@ async function initializeModuleTasks() {
3939
}
4040
await Promise.all(promises);
4141
asyncExitHook(async () => {
42-
await schedule.gracefulShutdown();
42+
await nodeSchedule.gracefulShutdown();
4343
}, {
44-
wait: secondsToMillis(1)
44+
wait: millisecondsInOneSecond
4545
});
4646
}
4747
const maxAppProcesses = 4;

index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import cluster, { type Worker } from 'node:cluster'
22
import os from 'node:os'
33

4-
import { secondsToMillis } from '@cityssm/to-millis'
4+
import { nodeSchedule } from '@cityssm/scheduled-task'
5+
import { millisecondsInOneSecond } from '@cityssm/to-millis'
56
import Debug from 'debug'
67
import { asyncExitHook } from 'exit-hook'
7-
import schedule from 'node-schedule'
88

99
import { DEBUG_ENABLE_NAMESPACES, DEBUG_NAMESPACE } from './debug.config.js'
1010
import {
@@ -69,10 +69,10 @@ async function initializeModuleTasks(): Promise<void> {
6969

7070
asyncExitHook(
7171
async () => {
72-
await schedule.gracefulShutdown()
72+
await nodeSchedule.gracefulShutdown()
7373
},
7474
{
75-
wait: secondsToMillis(1)
75+
wait: millisecondsInOneSecond
7676
}
7777
)
7878
}

modules/inventoryScanner/tasks/updateRecordsFromValidation.task.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { ScheduledTask } from '@cityssm/scheduled-task';
1+
import { ScheduledTask, nodeSchedule } from '@cityssm/scheduled-task';
22
import { minutesToMillis } from '@cityssm/to-millis';
3-
import schedule from 'node-schedule';
43
import { getConfigProperty } from '../../../helpers/config.helpers.js';
54
import { getItemValidationRecordsByItemNumber } from '../database/getItemValidationRecords.js';
65
import getScannerRecords from '../database/getScannerRecords.js';
@@ -47,7 +46,7 @@ const scheduledTask = new ScheduledTask(taskName, updateRecordsFromValidation, {
4746
schedule: {
4847
dayOfWeek: getConfigProperty('application.workDays'),
4948
hour: getConfigProperty('application.workHours'),
50-
minute: new schedule.Range(0, 55, 5),
49+
minute: new nodeSchedule.Range(0, 55, 5),
5150
second: 0
5251
},
5352
minimumIntervalMillis: minutesToMillis(2),

modules/inventoryScanner/tasks/updateRecordsFromValidation.task.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { ScheduledTask } from '@cityssm/scheduled-task'
1+
import { ScheduledTask, nodeSchedule } from '@cityssm/scheduled-task'
22
import { minutesToMillis } from '@cityssm/to-millis'
3-
import schedule from 'node-schedule'
43

54
import { getConfigProperty } from '../../../helpers/config.helpers.js'
65
import { getItemValidationRecordsByItemNumber } from '../database/getItemValidationRecords.js'
@@ -85,7 +84,7 @@ const scheduledTask = new ScheduledTask(taskName, updateRecordsFromValidation, {
8584
schedule: {
8685
dayOfWeek: getConfigProperty('application.workDays'),
8786
hour: getConfigProperty('application.workHours'),
88-
minute: new schedule.Range(0, 55, 5),
87+
minute: new nodeSchedule.Range(0, 55, 5),
8988
second: 0
9089
},
9190
minimumIntervalMillis: minutesToMillis(2),
@@ -104,4 +103,4 @@ process.on('message', (_message: unknown) => {
104103
* Run the task on initialization
105104
*/
106105

107-
void scheduledTask.runTask()
106+
void scheduledTask.runTask()

modules/tempFolderCleanup/initializeTempFolderCleanupModule.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1+
import { nodeSchedule } from '@cityssm/scheduled-task';
12
import { dateToString, dateToTimePeriodString } from '@cityssm/utils-datetime';
23
import camelCase from 'camelcase';
34
import Debug from 'debug';
45
import exitHook from 'exit-hook';
5-
import schedule from 'node-schedule';
66
import { DEBUG_NAMESPACE } from '../../debug.config.js';
77
import { getConfigProperty } from '../../helpers/config.helpers.js';
88
import { moduleName } from './helpers/moduleHelpers.js';
99
import runTempFolderCleanupTask, { taskName as tempFolderCleanupTaskName } from './tasks/tempFolderCleanupTask.js';
1010
const debug = Debug(`${DEBUG_NAMESPACE}:${camelCase(moduleName)}`);
1111
export function initializeTempFolderCleanupTask() {
1212
debug(`Initializing "${moduleName}"...`);
13-
const tempFolderCleanupJob = schedule.scheduleJob(tempFolderCleanupTaskName, getConfigProperty('modules.tempFolderCleanup.schedule'), runTempFolderCleanupTask);
13+
const tempFolderCleanupJob = nodeSchedule.scheduleJob(tempFolderCleanupTaskName, getConfigProperty('modules.tempFolderCleanup.schedule'), runTempFolderCleanupTask);
1414
const tempFolderCleanupFirstRunDate = new Date(tempFolderCleanupJob.nextInvocation().getTime());
1515
debug(`Scheduled to run "${tempFolderCleanupTaskName}" on ${dateToString(tempFolderCleanupFirstRunDate)} at ${dateToTimePeriodString(tempFolderCleanupFirstRunDate)}`);
1616
/*

modules/tempFolderCleanup/initializeTempFolderCleanupModule.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { nodeSchedule } from '@cityssm/scheduled-task'
12
import { dateToString, dateToTimePeriodString } from '@cityssm/utils-datetime'
23
import camelCase from 'camelcase'
34
import Debug from 'debug'
45
import exitHook from 'exit-hook'
5-
import schedule from 'node-schedule'
66

77
import { DEBUG_NAMESPACE } from '../../debug.config.js'
88
import { getConfigProperty } from '../../helpers/config.helpers.js'
@@ -17,7 +17,7 @@ const debug = Debug(`${DEBUG_NAMESPACE}:${camelCase(moduleName)}`)
1717
export function initializeTempFolderCleanupTask(): void {
1818
debug(`Initializing "${moduleName}"...`)
1919

20-
const tempFolderCleanupJob = schedule.scheduleJob(
20+
const tempFolderCleanupJob = nodeSchedule.scheduleJob(
2121
tempFolderCleanupTaskName,
2222
getConfigProperty('modules.tempFolderCleanup.schedule'),
2323
runTempFolderCleanupTask

package-lock.json

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"exit-hook": "^4.0.0",
5353
"express": "^4.21.2",
5454
"express-session": "^1.18.1",
55-
"node-schedule": "^2.1.1",
5655
"nodemailer": "^6.10.0",
5756
"session-file-store": "^1.5.0"
5857
},

types/config.helperTypes.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Spec } from 'node-schedule';
1+
import type { nodeSchedule } from "@cityssm/scheduled-task";
22
export interface ConfigFtpPath<S extends string> {
33
directory: string;
44
filePrefix?: string;
@@ -7,7 +7,7 @@ export interface ConfigFtpPath<S extends string> {
77
}
88
export interface ConfigScheduledFtpReport<S extends string> {
99
ftpPath: ConfigFtpPath<S>;
10-
schedule: Spec;
10+
schedule: nodeSchedule.Spec;
1111
}
1212
export type ConfigFileSuffixXlsx = `${string}.xlsx` | `${string}.XLSX`;
1313
export interface ConfigNtfyTopic {

types/config.helperTypes.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Spec } from 'node-schedule'
1+
import type { nodeSchedule } from "@cityssm/scheduled-task"
22

33
export interface ConfigFtpPath<S extends string> {
44
directory: string
@@ -9,7 +9,7 @@ export interface ConfigFtpPath<S extends string> {
99

1010
export interface ConfigScheduledFtpReport<S extends string> {
1111
ftpPath: ConfigFtpPath<S>
12-
schedule: Spec
12+
schedule: nodeSchedule.Spec
1313
}
1414

1515
export type ConfigFileSuffixXlsx = `${string}.xlsx` | `${string}.XLSX`

types/config.types.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ADWebAuthAuthenticatorConfiguration, ActiveDirectoryAuthenticatorConfiguration, PlainTextAuthenticatorConfiguration } from '@cityssm/authentication-helper';
22
import type { mssql } from '@cityssm/mssql-multi-pool';
3+
import type { nodeSchedule } from '@cityssm/scheduled-task';
34
import type { AccessOptions } from 'basic-ftp';
4-
import type { Spec } from 'node-schedule';
55
import type SMTPTransport from 'nodemailer/lib/smtp-transport/index.js';
66
import type { ConfigModuleIntegrityChecker } from '../modules/integrityChecker/config/types.js';
77
import type { ConfigModuleInventoryScanner } from '../modules/inventoryScanner/config/types.js';
@@ -73,7 +73,7 @@ interface ConfigModuleAutocomplete {
7373
};
7474
}
7575
interface ConfigModuleTempFolderCleanup {
76-
schedule?: Spec;
76+
schedule?: nodeSchedule.Spec;
7777
maxAgeDays?: number;
7878
}
7979
export {};

types/config.types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import type {
44
PlainTextAuthenticatorConfiguration
55
} from '@cityssm/authentication-helper'
66
import type { mssql } from '@cityssm/mssql-multi-pool'
7+
import type { nodeSchedule } from '@cityssm/scheduled-task'
78
import type { AccessOptions } from 'basic-ftp'
8-
import type { Spec } from 'node-schedule'
99
import type SMTPTransport from 'nodemailer/lib/smtp-transport/index.js'
1010

1111
import type { ConfigModuleIntegrityChecker } from '../modules/integrityChecker/config/types.js'
@@ -102,6 +102,6 @@ interface ConfigModuleAutocomplete {
102102
}
103103

104104
interface ConfigModuleTempFolderCleanup {
105-
schedule?: Spec
105+
schedule?: nodeSchedule.Spec
106106
maxAgeDays?: number
107107
}

0 commit comments

Comments
 (0)