diff --git a/package.json b/package.json index 102caf8..ae19e9d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "ts-types", + "name": "@owlboard/ts-types", "version": "0.0.1", "description": "Declares Typescript types for the OwlBoard stack", "main": "index.js", diff --git a/src/index.ts b/src/index.ts index e74d330..4097e3b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,9 @@ export { Service, Stop } from './database/timetable' export { User } from './database/user' // Downstream API +export { ApiResponse } from './owlboardApi/apiResponse' export { Versions } from './owlboardApi/versions' +export { StaffLdb, NrccMessage, TrainServices, + ServiceLocation } from './owlboardApi/staffLdb' // Upstream API \ No newline at end of file diff --git a/src/owlboardApi/apiResponse.ts b/src/owlboardApi/apiResponse.ts new file mode 100644 index 0000000..df0afab --- /dev/null +++ b/src/owlboardApi/apiResponse.ts @@ -0,0 +1,5 @@ +export interface ApiResponse { + obStatus: number, + obMsg: string, + data?: T +} \ No newline at end of file diff --git a/src/owlboardApi/staffLdb.ts b/src/owlboardApi/staffLdb.ts new file mode 100644 index 0000000..9de930d --- /dev/null +++ b/src/owlboardApi/staffLdb.ts @@ -0,0 +1,42 @@ +export interface StaffLdb { + generatedAt: Date; + locationName: string; + stationManagerCode: string; + nrccMessages: NrccMessage[]; + trainServices: TrainServices[]; +} + +export interface NrccMessage { + severity: string; + xhtmlMessage: string; +} + +export interface TrainServices { + rid: string; + uid: string; + trainid: string; + operatorCode: string; + isPassengerService?: string; + platform?: string; + platformIsHidden?: string; + serviceIsSupressed?: string; + origin: ServiceLocation[]; + destination: ServiceLocation[]; + isCancelled: string; + cancelReason?: string; + delayReason?: string; + arrivalType?: string; + departureType?: string; + sta?: Date; + eta?: Date; + ata?: Date; + std?: Date; + etd?: Date; + atd?: Date; + +} + +export interface ServiceLocation { + tiploc: string; + name: string; +} \ No newline at end of file