Commit Graph

121 Commits

Author SHA1 Message Date
D. Berge
acf58df59f Return events in structured sequence export format.
The events endpoint will return data in the format
agreed with Multiseis if the request has an
Accept: application/vnd.seis+json
header.

Related to #12.
2020-09-26 22:55:11 +02:00
D. Berge
b76f1f166b Refactor events middleware.
The reason for refactoring was to accommodate
Multiseis / client sequence exports, which will be
served by this endpoint via a specific Content-Type.

In the process, the cache has been fixed and redesigned.

Related to #12.
2020-09-26 17:41:47 +02:00
D. Berge
42d453f714 Cache event responses at the middleware level.
This is not really a substitute for proper database
design but if deemed useful it might be refactored
into a more generic caching middleware and applied
to other requests as a low-cost alternative to
database refactoring while we gain usage and
performance information.
2020-09-25 18:29:40 +02:00
D. Berge
80e8ccef9c Add endpoints for setting and retrieving metadata 2020-09-20 18:11:33 +02:00
D. Berge
db25878fdd Add info API endpoint.
It queries a project's `info` table.
2020-09-09 15:55:04 +02:00
D. Berge
eded667d79 Add endpoint for retrieving real-time data as GeoJSON 2020-09-01 10:58:37 +02:00
D. Berge
557d87de72 Add endpoint to retrieve real-time input data 2020-09-01 10:56:25 +02:00
D. Berge
e5bc5a0757 Refactor project summaries to use database views 2020-08-26 20:20:53 +02:00
D. Berge
f486b4835e Instrument alerts for HTTP backend.
An alert is sent whenever an endpoint returns
an error other than an explicit failure (e.g.,
it won't send an alert if a middleware intentionally
returns a {status: XXX} object).
2020-08-25 11:32:13 +02:00
D. Berge
721dae4084 Catch all middleware errors 2020-08-24 13:25:14 +02:00
D. Berge
949defd2f6 Add event API endpoints 2020-08-22 20:46:15 +02:00
D. Berge
a55046ed93 Add a meta property to requests.
Using the meta(key, value) middleware factory, the user
can add a property req.meta[key] = value to the request.
2020-08-22 20:46:15 +02:00
D. Berge
0c4d91c603 Implement event DELETE middleware 2020-08-22 20:46:15 +02:00
D. Berge
5349708fb8 Implement event PUT middleware 2020-08-22 20:46:15 +02:00
D. Berge
58694ac1c1 Refactor event POST middleware.
It can now take some parameters from the request URL.
If present, request URL parameters take precedence over
request body values.
2020-08-22 20:45:59 +02:00
D. Berge
c93188a5a7 Add event POST middleware to API 2020-08-16 10:50:58 +02:00
D. Berge
2bfa340b52 Add API endpoint to retrieve survey configuration.
The endpoint /project/:project/configuration/:path(*)?
returns the contents of the survey configuration YAML
file for a given project.

To retrieve the full configuration:
 * /project/:project/configuration

To retrieve a specific subset (e.g., binning parameters):

 * /project/:project/configuration/binning

To retrieve a specific value (e.g., inline bin width):

 * /project/:project/configuration/binning/I_width
2020-08-16 10:06:43 +02:00
D. Berge
a73376572b API: Add label querying endpoint.
Labels can be associated with events and can have
display properties such as a description and colour,
this is why we need an endpoint for the client to
retrieve them.
2020-08-12 11:41:28 +02:00
D. Berge
d52f8f8bc2 API: Add event querying endpoint.
Events may be filtered by sequence(s):
   …/event?sequence=1
   …/event?sequence=1;3;7

Events may be filtered by date:
   …/event?date0=1970-01-01

Events may be filtered by a date interval:
   …/event?date0=1970-01-01&date1=1980-01-01

Events may also be paginated.
2020-08-12 11:35:57 +02:00
D. Berge
91f6fc3763 Remove debugging statement 2020-08-11 20:21:19 +02:00
D. Berge
4c5d29494c Initial commit 2020-08-08 23:59:13 +02:00