Commit Graph

145 Commits

Author SHA1 Message Date
D. Berge
656f776262 Do not cache any responses containing cookies 2023-11-02 13:24:40 +01:00
D. Berge
89cb237f8d Use setContentDisposition() 2023-10-29 20:38:58 +01:00
D. Berge
2365789d48 Merge branch '281-modify-planner-endpoint-s' into 'devel'
Resolve "Modify planner endpoint(s)"

Closes #281

See merge request wgp/dougal/software!49
2023-10-25 14:26:23 +00:00
D. Berge
b5aafe42ad Add YAML support to events GET endpoint 2023-10-23 19:24:03 +02:00
D. Berge
025f3f774d Add YAML and CSV support to project configuration GET endpoint 2023-10-23 19:22:50 +02:00
D. Berge
1bb06938b1 Add CSV export handler to main event log endpoint.
Closes #245.
2023-10-23 17:28:30 +02:00
D. Berge
851369a0b4 Invalidate planner endpoint cache when setting remarks 2023-10-23 14:58:41 +02:00
D. Berge
2d1e1e9532 Modify return payload of planner endpoint.
Previous:

[
  { sequence: …},
  { sequence: …},
  …
]

Current:

{
  remarks: "…",
  sequences: [
    { sequence: …},
    { sequence: …},
    …
  ]
}
2023-10-23 14:53:32 +02:00
D. Berge
f231acf109 Add events change middleware 2023-10-17 11:15:06 +02:00
D. Berge
0829ea3ea1 Save a copy of the headers not the original.
Otherwise ExpressJS will complain about trying to modify
headers that have already been sent.
2023-09-24 12:17:16 +02:00
D. Berge
33618b6b82 Do not cache Set-Cookie headers 2023-09-14 13:13:47 +02:00
D. Berge
5a2af5c49e Add CSV output option for events log 2023-09-13 21:58:06 +02:00
D. Berge
707889be42 Refactor layer API endpoint and database functions.
- A single get() function is used both to list all available
  layers, if no layer name is given, or a single layer.
- The database no longer holds the actual layer contents,
  only the path to the layer file(s), so the list() function
  is now redundant as we return the full payload in every case.
- The /gis/layer and /gis/layer/:name endpoints now have the same
  payload structure.
2023-09-12 19:29:02 +02:00
D. Berge
36d5862375 Add map layer middleware and API endpoints 2023-09-11 10:15:19 +02:00
D. Berge
4f165b0c83 Revert behaviour of new jwt-express version.
Fixes breakage introduced in commit
cd00f8b995.
2023-09-10 14:09:01 +02:00
D. Berge
2c86944a51 Merge branch '262-preset-remarks-and-labels-no-longer-working-with-api-0-4-0' into 'devel'
Resolve "Preset remarks and labels no longer working with API 0.4.0"

Closes #262

See merge request wgp/dougal/software!36
2023-09-10 10:10:22 +00:00
D. Berge
941d15c1bc Return labels directly from project configuration.
NOTE: This is a breaking API change. Before this it returned an
array of labels, now it returns an object.
2023-09-10 11:59:38 +02:00
D. Berge
cd00f8b995 Breaking-change Node package udpates (server) 2023-09-10 11:49:56 +02:00
D. Berge
e8b1cb27f1 Add ETag middleware 2023-09-02 15:29:24 +02:00
D. Berge
70cf59bb4c Add API files endpoint.
Used to download files. It relies on `imports.paths` being set
appropriately in `etc/config.yaml` to indicate which parts of
the filesystem are accessible to users via Dougal.
2023-08-30 13:51:31 +02:00
D. Berge
675c19f060 Fix whitespace 2023-08-30 13:47:51 +02:00
D. Berge
6721b1b96b Add API endpoint for patching a project 2023-08-30 13:47:02 +02:00
D. Berge
fe9d3563a0 Add API endpoint to delete a project 2023-08-23 19:26:27 +02:00
D. Berge
38a07dffc6 Add API endpoint to retrieve project configuration.
Only available to users with at least `write` access.
2023-08-23 19:26:27 +02:00
D. Berge
1a6500308f Add API endpoint for creating a project 2023-08-23 19:26:27 +02:00
D. Berge
6033b45ed3 Refactor API middleware.
The middleware naming is kept consistent with the HTTP verb that
they handle.
2023-08-23 19:17:20 +02:00
D. Berge
aa7cbed611 Do not require authentication to query API version 2023-05-18 18:32:26 +02:00
D. Berge
546bc45861 Remove dead code 2022-05-04 18:35:20 +02:00
D. Berge
bb9340a0af Add QC results accept/unaccept middleware.
This middleware can only deal with shot QCs, not sequence-wide QCs.
2022-05-04 17:22:18 +02:00
D. Berge
e3a3bdb153 Clean up whitespace.
Commands used:

find . -type f -name '*.js'| while read FILE; do if echo $FILE |grep -qv node_modules; then sed -ri 's/^\s+$//' "$FILE"; fi; done
find . -type f -name '*.vue'| while read FILE; do if echo $FILE |grep -qv node_modules; then sed -ri 's/^\s+$//' "$FILE"; fi; done
find . -type f -name '*.py'| while read FILE; do if echo $FILE |grep -qv node_modules; then sed -ri 's/^\s+$//' "$FILE"; fi; done
2022-04-29 14:48:21 +02:00
D. Berge
74d6f0b9a0 Accept mime query parameter 2022-04-16 17:18:04 +02:00
D. Berge
cf475ce2df Adapt middleware to new database schema.
As introduced by commit 0c6567d8f8.
2022-04-16 17:18:04 +02:00
D. Berge
c8ce786e39 Add API middleware for returning QC results 2022-03-09 17:41:27 +01:00
D. Berge
cb952d37f7 Fix: do not require file that no longer exists 2022-02-28 21:25:00 +01:00
D. Berge
d7d75f34cd Remove event caching.
That was a horrible kludge and should not be necessary with the
new schema, which is simpler and much faster.
2022-02-27 19:56:21 +01:00
D. Berge
950582a5c6 Refactor event middleware and db code to use new tables 2022-02-27 19:56:21 +01:00
D. Berge
4d2efd1e04 Move sequence events middleware to a different path.
This is to make room for a new endpoint to retrieve
data for individual events.
2022-02-27 19:56:21 +01:00
D. Berge
920ea83ece Add API endpoint to retrieve a single shotpoint.
This will be used by the new event dialogue in the
frontend to get shotpoint information when creating
or editing events.
2022-02-27 19:56:21 +01:00
D. Berge
f10103d396 Enfore info key access restrictions on the API.
Obviously, those keys can be edited freely at the database
level. This is intended.
2022-02-06 22:40:53 +01:00
D. Berge
c7784aa52f Add ASAQC queue endpoints to API 2021-10-04 02:21:00 +02:00
D. Berge
45fe467a21 Implement sequence/get API endpoint.
It returns data for all individual points in a sequence.
2021-09-11 12:19:06 +02:00
D. Berge
f0b1fc2fe6 Show missed shot events in HTML, PDF exports 2021-09-04 23:29:58 +02:00
D. Berge
d5980d9154 Add CSV planner output option 2021-06-19 19:04:05 +02:00
D. Berge
594233c965 Add HTML & PDF planner output options.
Coupled with a suitable Nunjucks template, this is effectively the
24-hour (or whatever period of time) lookahead.
2021-05-31 02:29:50 +02:00
D. Berge
041878096d Accept a mime query parameter to force MIME type 2021-05-31 02:29:50 +02:00
D. Berge
9d2ccd75dd Do not try to use line name if there isn't one 2021-05-25 03:19:00 +02:00
D. Berge
3985a6226b Suggest ${lineName}-NavLog.${extension} as file name.
This is for the usual case where only one sequence is requested.

When more than one sequence is requested, the suggested name comes out
as ${projectId}-${sequenceList}.${extension}, where `sequenceList` is
the list of sequence numbers separated by semicolons, e.g.:
eq21203-37;38;39.html.

Closes #116.
2021-05-25 02:23:41 +02:00
D. Berge
39d85a692b Use default Nunjucks template if necessary.
If the survey configuration does not itself have a template
we will use the one in etc/defaults/templates/sequence.html.njk.

It is not very likely that the template will be changed all that
often and it avoids issues when people forget to copy it across
to a new survey, etc.
2021-05-20 20:38:39 +02:00
D. Berge
315733eec0 Refactor events export middleware.
Uses the `prepare` method for better reusability.
2021-05-20 18:35:56 +02:00
D. Berge
4ee65ef284 Implement info/delete middleware 2021-05-20 18:18:26 +02:00