diff --git a/openapi.json b/openapi.json index 77e232e..62f1427 100644 --- a/openapi.json +++ b/openapi.json @@ -878,7 +878,7 @@ }, "Route": { "additionalProperties": false, - "description": "Only the rows where every condition holds (e.g. reports titled \"Citolog\u00eda\").", + "description": "Only the rows where every condition holds (e.g. reports titled \"Citolog\u00eda\"). An\n`otherwise` route takes the rows of its input that none of the other routes on that\ninput take (documents nobody recognises, for a reviewer), then its own conditions.", "properties": { "id": { "maxLength": 40, @@ -907,6 +907,11 @@ "title": "Label", "type": "string" }, + "otherwise": { + "default": false, + "title": "Otherwise", + "type": "boolean" + }, "position": { "anyOf": [ { @@ -918,6 +923,7 @@ ] }, "when": { + "default": [], "items": { "$ref": "#/components/schemas/Condition" }, @@ -926,8 +932,7 @@ } }, "required": [ - "id", - "when" + "id" ], "title": "Route", "type": "object" @@ -2730,6 +2735,56 @@ ] } }, + "/review/unrecognised": { + "get": { + "description": "Documents a pipeline's routes don't recognise (what its `otherwise` routes took):\na new layout, a study the platform doesn't know, a scan nothing could read.", + "operationId": "unrecognised", + "parameters": [ + { + "in": "query", + "name": "pipeline", + "required": true, + "schema": { + "maxLength": 40, + "pattern": "^[a-z][a-z0-9_]*$", + "title": "Pipeline", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Response Unrecognised", + "type": "array" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Unrecognised", + "tags": [ + "review" + ] + } + }, "/runs/{run_id}": { "get": { "operationId": "run_status", diff --git a/src/app/api/fn/review/unrecognised.ts b/src/app/api/fn/review/unrecognised.ts new file mode 100644 index 0000000..6dae77a --- /dev/null +++ b/src/app/api/fn/review/unrecognised.ts @@ -0,0 +1,35 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { filter, map } from 'rxjs/operators'; +import { StrictHttpResponse } from '../../strict-http-response'; +import { RequestBuilder } from '../../request-builder'; + + +export interface Unrecognised$Params { + pipeline: string; +} + +export function unrecognised(http: HttpClient, rootUrl: string, params: Unrecognised$Params, context?: HttpContext): Observable>> { + const rb = new RequestBuilder(rootUrl, unrecognised.PATH, 'get'); + if (params) { + rb.query('pipeline', params.pipeline, {}); + } + + return http.request( + rb.build({ responseType: 'json', accept: 'application/json', context }) + ).pipe( + filter((r: any): r is HttpResponse => r instanceof HttpResponse), + map((r: HttpResponse) => { + return r as StrictHttpResponse>; + }) + ); +} + +unrecognised.PATH = '/review/unrecognised'; diff --git a/src/app/api/functions.ts b/src/app/api/functions.ts index eb51e68..83cb499 100644 --- a/src/app/api/functions.ts +++ b/src/app/api/functions.ts @@ -59,6 +59,8 @@ export type { DecidePersons$Params as DecidePersons$Params } from './fn/review/d export { decidePersons as decidePersons } from './fn/review/decide-persons'; export type { Reject$Params as Reject$Params } from './fn/review/reject'; export { reject as reject } from './fn/review/reject'; +export type { Unrecognised$Params as Unrecognised$Params } from './fn/review/unrecognised'; +export { unrecognised as unrecognised } from './fn/review/unrecognised'; export type { RunStatus$Params as RunStatus$Params } from './fn/runs/run-status'; export { runStatus as runStatus } from './fn/runs/run-status'; export type { Studies$Params as Studies$Params } from './fn/eeg/studies'; diff --git a/src/app/api/models/route.ts b/src/app/api/models/route.ts index 47395e6..de24e93 100644 --- a/src/app/api/models/route.ts +++ b/src/app/api/models/route.ts @@ -5,13 +5,16 @@ import { Condition } from '../models/condition'; import { Position } from '../models/position'; /** - * Only the rows where every condition holds (e.g. reports titled "CitologĂ­a"). + * Only the rows where every condition holds (e.g. reports titled "CitologĂ­a"). An + * `otherwise` route takes the rows of its input that none of the other routes on that + * input take (documents nobody recognises, for a reviewer), then its own conditions. */ export interface Route { id: string; inputs?: Array; kind?: 'route'; label?: string; + otherwise?: boolean; position?: (Position | null); - when: Array; + when?: Array; }