Client for otherwise routes and unrecognised documents

This commit is contained in:
Roberto Treviño
2026-11-27 19:17:49 -06:00
parent 672091d19a
commit cc22840c3c
4 changed files with 100 additions and 5 deletions
+58 -3
View File
@@ -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",
+35
View File
@@ -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<StrictHttpResponse<Array<{
[key: string]: any;
}>>> {
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<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<Array<{
[key: string]: any;
}>>;
})
);
}
unrecognised.PATH = '/review/unrecognised';
+2
View File
@@ -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';
+5 -2
View File
@@ -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<string>;
kind?: 'route';
label?: string;
otherwise?: boolean;
position?: (Position | null);
when: Array<Condition>;
when?: Array<Condition>;
}