Commit Graph

453 Commits

Author SHA1 Message Date
D. Berge
712b20c596 Add API endpoint to retrieve line name properties.
This will be needed by the configuration GUI.
2025-07-09 16:38:41 +02:00
D. Berge
8bbe3aee70 Make planned line names configurable.
Line names are made up based on:

* Certain properties defined by the system
* Values assigned to those properties either by the system
  or by the user (line number, sequence, attempt, etc.)
* A line format specification configured by the user for each
  project (`online.line.lineNameBuilder.fields`)

Closes #129.
2025-07-09 16:30:26 +02:00
D. Berge
9ef551db76 Fix logical→physical path conversion for absolute paths 2025-06-26 23:57:19 +02:00
D. Berge
e398f2d3cd Stop attempt at sending a spurious 404.
This was resulting in a bunch of "headers already sent" messages.
2024-05-09 14:18:56 +02:00
D. Berge
d154e75797 Add more info to diagnostics endpoint 2024-05-09 14:02:18 +02:00
D. Berge
af0df23cc4 Add diagnostics API endpoint.
Only available with write access and above.

Reports used and available filesystem sizes and database space
usage.
2024-05-08 16:27:32 +02:00
D. Berge
4368cb8571 Update minimum required database schema to 0.5.0 2024-05-04 17:30:34 +02:00
D. Berge
efe64f0a8c Implement PUT method for project configuration endpoint.
In short:

POST creates a new project
PUT overwrites a project configuration with a new one
PATCH merges the request body with the existing configuration
2024-05-01 10:40:04 +02:00
D. Berge
313e9687bd Bring all the lib/utils from the frontend to the backend.
The idea being that eventually we will symlink the lib/utils
directory so that the same routines are available on both the
frontend and the backend.
2024-05-01 10:40:04 +02:00
D. Berge
a9270157ea Process JWT messages over WebSockets 2024-05-01 10:06:35 +02:00
D. Berge
d2f94dbb88 Refactor JWT token verification 2024-05-01 10:05:48 +02:00
D. Berge
1056122fff Fix missing parenthesis 2024-04-28 18:37:30 +02:00
D. Berge
9bd0aca18f Add debugging statements to ETag middleware 2023-11-04 10:45:50 +01:00
D. Berge
60932300c1 Ensure that project is defined.
Which would not be in the case of the `project` event unless we
look at the `new` and `old` properties.
2023-11-04 10:45:50 +01:00
D. Berge
12307b7ae6 Refactor ETag watcher to use path-to-regexp.
Simplifies the code and makes it easier to look at.
2023-11-04 10:45:50 +01:00
D. Berge
ceeaa4a8f3 Add path-to-regexp depedency. 2023-11-04 10:45:50 +01:00
D. Berge
7076b51a25 Add auth.access.role(roles) higher order middleware 2023-11-03 21:22:02 +01:00
D. Berge
fe5ca06060 Return a JSON response for all 404s.
When an endpoint did not exist, the default expressjs response
was being returned, which is text/html.
2023-11-03 18:52:31 +01:00
D. Berge
71467dddf9 Report also request body size, if applicable 2023-11-03 18:51:43 +01:00
D. Berge
246f01efbe Report requested URLs and user data in debug mode 2023-11-02 23:52:15 +01:00
D. Berge
68bf853594 Add comments 2023-11-02 23:51:53 +01:00
D. Berge
4a18cb8a81 Remove useless code 2023-11-02 23:51:05 +01:00
D. Berge
c615727acf Don't require authentication for the /version endpoint.
It will still hide the `db` and `os` values from non-admins though.
2023-11-02 23:48:46 +01:00
D. Berge
2e21526fca Simplify versions handling 2023-11-02 23:47:13 +01:00
D. Berge
3709070985 Add a start script to package.json.
So that `npm start` will run.
2023-11-02 23:40:41 +01:00
D. Berge
2ac963aa4f Update redoc-cli version 2023-11-02 20:23:04 +01:00
D. Berge
fa031d5fc9 Update API specification 2023-11-02 19:59:02 +01:00
D. Berge
620d5ccf47 Add /version API endpoint 2023-11-02 19:48:30 +01:00
D. Berge
f0fa2b75d5 Add more details to version() return value 2023-11-02 19:46:44 +01:00
D. Berge
f968cf3b3c Bump the required database schema version 2023-11-02 13:25:34 +01:00
D. Berge
b148ed2368 Add refresh-project-summary periodic task.
It listens for events that might indicate that the project_summary
materialised view needs to be refreshed and schedules a refresh.

Refreshes are throttled to a maximum of one every throttlePeriod
milliseconds so that things don't get too crazy for instance when
importing a lot of data.
2023-11-02 13:25:34 +01:00
D. Berge
cb35e340e1 Change the periodic tasks interface to support an init() function.
When a task needs to keep state, it can do so via a closure.
2023-11-02 13:25:34 +01:00
D. Berge
6c00f16b7e Add a refresh() method to db.project.summary 2023-11-02 13:25:34 +01:00
D. Berge
656f776262 Do not cache any responses containing cookies 2023-11-02 13:24:40 +01:00
D. Berge
98021441bc Revert "Rename websocket /ws → /dougal-websocket."
This reverts commit 4a8d3a99c1.
2023-11-02 13:18:37 +01:00
D. Berge
4a8d3a99c1 Rename websocket /ws → /dougal-websocket.
The Webpack dev server seems to really like /ws and ignores any
attempts to set a different path, so we just rename our websocket
instead.
2023-11-02 11:39:49 +01:00
D. Berge
7dee457fa1 Add FIXME comment 2023-11-02 11:38:27 +01:00
D. Berge
9136e9655d Return the archived project configuration value.
This value indicates whether the project should receive updates
from external sources.
2023-10-29 20:38:58 +01:00
D. Berge
1498891004 Update API specification 2023-10-29 20:38:58 +01:00
D. Berge
89cb237f8d Use setContentDisposition() 2023-10-29 20:38:58 +01:00
D. Berge
3386c57670 Add setContentDisposition() utility function.
It checks if a request has a `filename` search parameter and if
so, set the Content-Disposition response header to attachment
with the provided filename.
2023-10-29 20:38:58 +01:00
D. Berge
b2a97a1987 Fix typo in SQL query.
Fixes #284.
2023-10-29 20:38:58 +01:00
D. Berge
31419e860e Update API specification 2023-10-28 11:21:43 +02:00
D. Berge
65481d3086 Return the group project configuration value.
This value (expected to be an array of strings) can be used to
link related projects.

Closes #186.
2023-10-28 11:15:26 +02: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
d9a6c77d0c Update API description 2023-10-23 19:25:48 +02: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
f26e746c2b Add flatEntries utility 2023-10-23 18:58:37 +02:00
D. Berge
39eaf17121 Update API description 2023-10-23 18:48:05 +02:00