TimetableAPI-Upgrade #64

Merged
fred.boniface merged 36 commits from TimetableAPI-Upgrade into main 2024-02-11 15:53:17 +00:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit b49b2221d7 - Show all commits

8
package-lock.json generated
View File

@ -24,7 +24,7 @@
"zlib": "^1.0.5"
},
"devDependencies": {
"@owlboard/ts-types": "^0.1.0",
"@owlboard/ts-types": "^0.1.3",
"@types/jest": "^29.5.3",
"eslint": "^8.39.0",
"jest": "^29.6.2",
@ -1983,9 +1983,9 @@
}
},
"node_modules/@owlboard/ts-types": {
"version": "0.1.0",
"resolved": "https://git.fjla.uk/api/packages/OwlBoard/npm/%40owlboard%2Fts-types/-/0.1.0/ts-types-0.1.0.tgz",
"integrity": "sha512-5dLkm1wEimiv+pr5wuJbJvPfSek9WuApl/4SBwoFXVO2bmAIktFIHi+bznXKnhW9a7nJwX/w+bVwwJpBOI3I1g==",
"version": "0.1.3",
"resolved": "https://git.fjla.uk/api/packages/OwlBoard/npm/%40owlboard%2Fts-types/-/0.1.3/ts-types-0.1.3.tgz",
"integrity": "sha512-BKi/tWvA0SN2rgt2GnFnSXEXzG3DNjeTm0ojVuMElnok9MJ9IniTXRjdAdjm+fe5ShebH6EKacO5f1MDAD3qJw==",
"dev": true,
"license": "GPL-3.0-or-later"
},

View File

@ -6,7 +6,7 @@ import { logger } from "../utils/logger.utils";
// This function is deprecated and should no longer be used.
// It will be removed in a later version
async function findByHeadcodeToday(headcode) {
async function findByHeadcodeToday(headcode: string) {
const sanitizedHeadcode = clean.removeNonAlphanumeric(headcode).toUpperCase();
logger.debug(
`trainServiceServices.findByHeadcode: Searching for headcode ${sanitizedHeadcode}`
@ -42,7 +42,7 @@ async function findByHeadcodeToday(headcode) {
}
// Finds a train by its headcode value
async function findByHeadcode(date, headcode) {
async function findByHeadcode(date: string | Date, headcode: string) {
const sanitizedHeadcode = clean.removeNonAlphanumeric(headcode).toUpperCase();
logger.debug(
`trainServiceServices.findByHeadcode: Searching for headcode ${sanitizedHeadcode}`
@ -86,7 +86,7 @@ async function findByHeadcode(date, headcode) {
}
// Finds a train by its trainUid value
async function findByTrainUid(uid, date = new Date()) {
async function findByTrainUid(uid: string, date: Date | string = new Date()) {
let queryDate;
if (date === "now") {
queryDate = new Date();