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

View File

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

View File

@ -3,6 +3,19 @@ interface Station {
TIPLOC: string; TIPLOC: string;
"3ALPHA": string; "3ALPHA": string;
NLCDESC: 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; wttDeparture?: string | null;
publicArrival?: string | null; publicArrival?: string | null;
wttArrival?: string | null; wttArrival?: string | null;
pass?: string | null;
platform?: string | null;
arrLine?: string | null;
depLine?: string | null;
isPublic: boolean; isPublic: boolean;
tiploc: string; tiploc: string;
} }
interface SimpleService {
stpIndicator: string;
trainUid: string;
operator: string;
stops: Stop[];
}
interface Service { interface Service {
transactionType: string; transactionType: string;
stpIndicator: string; stpIndicator: string;
operator: string; operator: string;
trainUid: string; trainUid: string;
headcode: string; headcode: string;
powerType: string; powerType: string;
planSpeed: string; planSpeed: string;
scheduleStartDate: Date; scheduleStartDate: Date;
scheduleEndDate: Date; scheduleEndDate: Date;
daysRun: string[]; daysRun: string[];
stops: Stop[]; 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 { export interface OB_Pis_SimpleObject {
code: number; code: string;
match: "full" | "partial"; toc: string;
skip?: "first" | "last"; skipCount: number;
skipCount?: number; skipType?: string;
msg?: string;
} }
/* NOT IN USE YET
export interface OB_Pis_FullObject { export interface OB_Pis_FullObject {
code: number; code: string;
crs: string[]; stops: string[];
tiploc?: string[]; toc: string;
tiplocs?: string[];
} }
*/

View File

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