diff options
Diffstat (limited to 'lib/API.hs')
-rw-r--r-- | lib/API.hs | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -40,6 +40,7 @@ type API = "stations" :> Get '[JSON] (Map StationID Station) -- debug things :<|> "debug" :> "state" :> Get '[JSON] (Map Token [TripPing]) :<|> "gtfs" :> GtfsRealtimeAPI + -- TODO: this should be behind auth / OpenID or something :<|> "admin" :> AdminAPI -- | The API used for publishing gtfs realtime updates @@ -49,10 +50,10 @@ type GtfsRealtimeAPI = "servicealerts" :> Get '[Proto] FeedMessage -- | Admin API used for short-term timetable changes etc. ("leitstelle") type AdminAPI = - "trip" :> "announce" :> Capture "Trip ID" TripID :> QueryParam "day" Day :> ReqBody '[JSON] Text :> Post '[JSON] UUID + "trip" :> "announce" :> ReqBody '[JSON] Announcement :> Post '[JSON] UUID :<|> "trip" :> "announce" :> "delete" :> Capture "Announcement ID" UUID :> Post '[JSON] () - :<|> "trip" :> "date" :> "add" :> Capture "Trip ID" TripID :> Post '[JSON] () - :<|> "trip" :> "date" :> "cancel" :> Capture "Trip ID" TripID :> Post '[JSON] () + :<|> "trip" :> "date" :> "add" :> Capture "Trip ID" TripID :> Capture "day" Day :> Post '[JSON] () + :<|> "trip" :> "date" :> "cancel" :> Capture "Trip ID" TripID :> Capture "day" Day :> Post '[JSON] () -- TODO for this to be useful there ought to be a half-deep Trip type -- (that has stops but not shapes) :<|> "extraordinary" :> "trip" :> ReqBody '[JSON] (Trip Deep Shallow) :> Post '[JSON] () |