When a client makes a request for `/` (the root of
the API), the OpenAPI description is served in an
appropriate format according to the `Accept` request
header, as follows:
Accept: text/html => HTML version
Accept: application/json => JSON version
Accept: * => YAML version
When running `npm install`, a self-contained HTML document
with the contents of the OpenAPI specification is saved as
openapi.html in the same directory as openapi.yaml.
If there are other lines in the planner, we increment the
highest numbered sequence in the planner by one.
If there are no planned lines, we take the highest numbered
raw sequence and increment by one.
The user is authenticated by one of the following
methods, in order of priority:
* The presence of a valid JWT.
* Its IP.
* Its hostname.
In the case of the latter two methods, if authentication
is successful a JWT valid for 15 minutes will be generated
and passed back to the user in a cookie.
If the user sends a patch to a line with
a `name` which is exactly `null` or the
empty string `""`, the server will regenerate
the name based on the defaults script.
It's kind of pointless at the moment (we will probably
want a separate QC for online data) and it may cause shots
to be, at least temporarily, flagged as having missing
gun data.
Closes#29.
If present and truthy, it will cause the output
to contain two extra fields: missing_raw and
missing_final, each consisting of a JSON array
containing missing raw and final shots for the
corresponding sequence.
In the event that the option was passed but
there are no missing shots, the two aforementioned
fields will still be present and consist of
empty arrays.
Note that this makes the query significantly
slower.
Not sure if this is going to do anything in
terms of improving the handling of and reacting
to events, but it doesn't seem to hurt terribly.
Eventually, all this will probably need to be
refactored to use EventEmitter.
We try to ensure that for each sequence we have
at least FSP and LSP entries. We do this by:
* If there exists a FGSP / LGSP, we clone those as
FSP / LSP respectively.
* Otherwise, we take the first and last shots
found in the final P1 which have a preplot.
We also include log comments whenever possible and
format the azimuth a bit better.