Compare commits

...

19 Commits
0.1.1 ... main

Author SHA1 Message Date
33164cdfb4 Bump version 2024-11-13 12:11:51 +00:00
05d0b35417 Correct OB_Pis_FullObject 2024-11-13 12:11:25 +00:00
4a97a8bd3c Add new station types 2024-06-30 21:35:30 +01:00
5fde0ce8bf Bump Version 2024-04-21 23:08:04 +01:00
c4416f66af Reuse service detail type from database in API 2024-04-21 23:06:08 +01:00
899450707a Update API types to use ServiceDetail 2024-04-21 23:05:29 +01:00
be062b17e4 Update database types to use ServiceDetail 2024-04-21 23:04:16 +01:00
0b4235ef2e Add pass time, platform, arrLine and depLine to API responeses (Timetable Stop) 2024-04-17 12:44:17 +01:00
5b46b14607 Add booleans to OB_TrainTT_service type 2024-04-15 20:50:15 +01:00
a3a4409e1d Bump version to align with go-types 2024-04-14 22:32:44 +01:00
61909c0015 Remove catering type from Service object 2024-04-08 16:02:40 +01:00
c3094ffcbb Expand database Service document 2024-04-07 21:27:44 +01:00
92ec756bf8 Fix additional PIS type 2024-02-03 21:25:46 +00:00
5165bce5a8 Adjust type for PIS code - should be string vs number. 2024-02-03 21:22:37 +00:00
0a60efae8b Fix timetable types 2023-12-01 21:38:17 +00:00
8409e28136 Add OB_PIS_Full_Object type 2023-11-30 21:35:46 +00:00
2bab790cf5 Bump version - PIS optional element of train detail 2023-11-30 09:13:20 +00:00
0d46756d8e PIS is optional 2023-11-30 09:11:46 +00:00
8f3501b095 Update simple PIS Object 2023-11-29 23:25:58 +00:00
6 changed files with 65 additions and 27 deletions

View File

@ -2,8 +2,8 @@
export { Corpus } from './src/database/corpus'
export { Pis } from './src/database/pis'
export { ReasonCode } from './src/database/reasonCode'
export { Station } from './src/database/station'
export { Service, Stop } from './src/database/timetable'
export { Station, NearestStationResponse } from './src/database/station'
export { Service, Stop, SimpleService, ServiceDetail } from './src/database/timetable'
export { User } from './src/database/user'
// Downstream API
@ -12,6 +12,6 @@ export { Versions } from './src/owlboardApi/versions'
export { StaffLdb, NrccMessage, TrainServices,
ServiceLocation } from './src/owlboardApi/staffLdb'
export { OB_TrainTT_service, OB_TrainTT_stopDetail } from './src/owlboardApi/trainTimetable'
export { OB_Pis_SimpleObject } from './src/owlboardApi/pis'
export { OB_Pis_SimpleObject, OB_Pis_FullObject } from './src/owlboardApi/pis'
// Upstream API

View File

@ -1,6 +1,6 @@
{
"name": "@owlboard/ts-types",
"version": "0.1.1",
"version": "1.2.1",
"description": "Declares Typescript types for the OwlBoard stack",
"main": "index.ts",
"scripts": {

View File

@ -3,6 +3,19 @@ interface Station {
TIPLOC: string;
"3ALPHA": string;
NLCDESC: string;
location: stationLocation;
operator: string;
}
export { Station }
interface stationLocation {
type: "Point";
coordinates: number[];
}
interface NearestStationResponse {
"3ALPHA": string;
NLCDESC: string;
miles: number;
}
export { Station, NearestStationResponse }

View File

@ -3,22 +3,43 @@ interface Stop {
wttDeparture?: string | null;
publicArrival?: string | null;
wttArrival?: string | null;
pass?: string | null;
platform?: string | null;
arrLine?: string | null;
depLine?: string | null;
isPublic: boolean;
tiploc: string;
}
interface SimpleService {
stpIndicator: string;
trainUid: string;
operator: string;
stops: Stop[];
}
interface Service {
transactionType: string;
stpIndicator: string;
operator: string;
trainUid: string;
headcode: string;
powerType: string;
planSpeed: string;
transactionType: string;
stpIndicator: string;
operator: string;
trainUid: string;
headcode: string;
powerType: string;
planSpeed: string;
scheduleStartDate: Date;
scheduleEndDate: Date;
daysRun: string[];
stops: Stop[];
scheduleEndDate: Date;
daysRun: string[];
stops: Stop[];
serviceDetail: ServiceDetail;
}
export { Stop, Service }
interface ServiceDetail {
firstClass: boolean;
catering: boolean;
sleeper: boolean;
vstp: boolean;
guard: boolean
}
export { Stop, Service, SimpleService, ServiceDetail }

View File

@ -1,15 +1,13 @@
export interface OB_Pis_SimpleObject {
code: number;
match: "full" | "partial";
skip?: "first" | "last";
skipCount?: number;
msg?: string;
code: string;
toc: string;
skipCount: number;
skipType?: string;
}
/* NOT IN USE YET
export interface OB_Pis_FullObject {
code: number;
crs: string[];
tiploc?: string[];
code: string;
stops: string[];
toc: string;
tiplocs?: string[];
}
*/

View File

@ -1,4 +1,5 @@
import type { OB_Pis_SimpleObject } from "./pis";
import type { ServiceDetail } from "../database/timetable";
export interface OB_TrainTT_service {
stpIndicator: string;
@ -11,7 +12,8 @@ export interface OB_TrainTT_service {
scheduleEnd: Date;
daysRun: string[];
stops: OB_TrainTT_stopDetail[];
pis: OB_Pis_SimpleObject;
pis?: OB_Pis_SimpleObject;
serviceDetail: ServiceDetail;
}
export interface OB_TrainTT_stopDetail {
@ -19,6 +21,10 @@ export interface OB_TrainTT_stopDetail {
publicArrival?: string;
wttDeparture?: string;
wttArrival?: string;
pass?: string;
platform?: string;
arrLine?: string;
depLine?: string;
tiploc: string;
isPublic: boolean;
}