Client for the runs, execution and TEA EEG analysis routes

This commit is contained in:
2026-11-28 06:54:00 -06:00
parent 07212a2083
commit 43b5523f99
24 changed files with 1384 additions and 11 deletions
+36
View File
@@ -0,0 +1,36 @@
/* 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';
import { AnalyzeRequest } from '../../models/analyze-request';
export interface AnalyzeEegs$Params {
body: AnalyzeRequest
}
export function analyzeEegs(http: HttpClient, rootUrl: string, params: AnalyzeEegs$Params, context?: HttpContext): Observable<StrictHttpResponse<{
[key: string]: string;
}>> {
const rb = new RequestBuilder(rootUrl, analyzeEegs.PATH, 'post');
if (params) {
rb.body(params.body, 'application/json');
}
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<{
[key: string]: string;
}>;
})
);
}
analyzeEegs.PATH = '/tea/eegs/analyze';
@@ -0,0 +1,36 @@
/* 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';
import { Health } from '../../models/health';
export interface ExecutionHealth$Params {
mode?: ('sync' | 'local' | 'remote' | null);
scheduler?: (string | null);
reference?: (string | null);
}
export function executionHealth(http: HttpClient, rootUrl: string, params?: ExecutionHealth$Params, context?: HttpContext): Observable<StrictHttpResponse<Health>> {
const rb = new RequestBuilder(rootUrl, executionHealth.PATH, 'get');
if (params) {
rb.query('mode', params.mode, {});
rb.query('scheduler', params.scheduler, {});
rb.query('reference', params.reference, {});
}
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<Health>;
})
);
}
executionHealth.PATH = '/execution/health';
@@ -0,0 +1,30 @@
/* 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';
import { Options } from '../../models/options';
export interface ExecutionOptions$Params {
}
export function executionOptions(http: HttpClient, rootUrl: string, params?: ExecutionOptions$Params, context?: HttpContext): Observable<StrictHttpResponse<Options>> {
const rb = new RequestBuilder(rootUrl, executionOptions.PATH, 'get');
if (params) {
}
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<Options>;
})
);
}
executionOptions.PATH = '/execution/options';
+3
View File
@@ -7,10 +7,12 @@ import { filter, map } from 'rxjs/operators';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';
import { Analyze } from '../../models/analyze';
import { Domain } from '../../models/domain';
export interface Analyze$Params {
domain: Domain;
body?: Analyze
}
export function analyze(http: HttpClient, rootUrl: string, params: Analyze$Params, context?: HttpContext): Observable<StrictHttpResponse<{
@@ -19,6 +21,7 @@ export function analyze(http: HttpClient, rootUrl: string, params: Analyze$Param
const rb = new RequestBuilder(rootUrl, analyze.PATH, 'post');
if (params) {
rb.path('domain', params.domain, {});
rb.body(params.body, 'application/json');
}
return http.request(
+32
View File
@@ -0,0 +1,32 @@
/* 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';
import { Cancel } from '../../models/cancel';
export interface CancelRun$Params {
run_id: string;
}
export function cancelRun(http: HttpClient, rootUrl: string, params: CancelRun$Params, context?: HttpContext): Observable<StrictHttpResponse<Cancel>> {
const rb = new RequestBuilder(rootUrl, cancelRun.PATH, 'post');
if (params) {
rb.path('run_id', params.run_id, {});
}
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<Cancel>;
})
);
}
cancelRun.PATH = '/runs/{run_id}/cancel';
+39
View File
@@ -0,0 +1,39 @@
/* 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';
import { Domain } from '../../models/domain';
import { RunSummary } from '../../models/run-summary';
export interface RunHistory$Params {
job?: (string | null);
domain?: (Domain | null);
limit?: number;
before?: (string | null);
}
export function runHistory(http: HttpClient, rootUrl: string, params?: RunHistory$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<RunSummary>>> {
const rb = new RequestBuilder(rootUrl, runHistory.PATH, 'get');
if (params) {
rb.query('job', params.job, {});
rb.query('domain', params.domain, {});
rb.query('limit', params.limit, {});
rb.query('before', params.before, {});
}
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<RunSummary>>;
})
);
}
runHistory.PATH = '/runs';
+3 -6
View File
@@ -7,14 +7,13 @@ import { filter, map } from 'rxjs/operators';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';
import { Run } from '../../models/run';
export interface RunStatus$Params {
run_id: string;
}
export function runStatus(http: HttpClient, rootUrl: string, params: RunStatus$Params, context?: HttpContext): Observable<StrictHttpResponse<{
[key: string]: string;
}>> {
export function runStatus(http: HttpClient, rootUrl: string, params: RunStatus$Params, context?: HttpContext): Observable<StrictHttpResponse<Run>> {
const rb = new RequestBuilder(rootUrl, runStatus.PATH, 'get');
if (params) {
rb.path('run_id', params.run_id, {});
@@ -25,9 +24,7 @@ export function runStatus(http: HttpClient, rootUrl: string, params: RunStatus$P
).pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<{
[key: string]: string;
}>;
return r as StrictHttpResponse<Run>;
})
);
}
+10
View File
@@ -5,6 +5,10 @@ export type { Domains$Params as Domains$Params } from './fn/operations/domains';
export { domains as domains } from './fn/operations/domains';
export type { Health$Params as Health$Params } from './fn/operations/health';
export { health as health } from './fn/operations/health';
export type { ExecutionHealth$Params as ExecutionHealth$Params } from './fn/execution/execution-health';
export { executionHealth as executionHealth } from './fn/execution/execution-health';
export type { ExecutionOptions$Params as ExecutionOptions$Params } from './fn/execution/execution-options';
export { executionOptions as executionOptions } from './fn/execution/execution-options';
export type { ConceptMaps$Params as ConceptMaps$Params } from './fn/ingest/concept-maps';
export { conceptMaps as conceptMaps } from './fn/ingest/concept-maps';
export type { GetConceptMap$Params as GetConceptMap$Params } from './fn/ingest/get-concept-map';
@@ -59,10 +63,16 @@ 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 { RunHistory$Params as RunHistory$Params } from './fn/runs/run-history';
export { runHistory as runHistory } from './fn/runs/run-history';
export type { RunStatus$Params as RunStatus$Params } from './fn/runs/run-status';
export { runStatus as runStatus } from './fn/runs/run-status';
export type { CancelRun$Params as CancelRun$Params } from './fn/runs/cancel-run';
export { cancelRun as cancelRun } from './fn/runs/cancel-run';
export type { Studies$Params as Studies$Params } from './fn/eeg/studies';
export { studies as studies } from './fn/eeg/studies';
export type { AnalyzeEegs$Params as AnalyzeEegs$Params } from './fn/eeg/analyze-eegs';
export { analyzeEegs as analyzeEegs } from './fn/eeg/analyze-eegs';
export type { Study$Params as Study$Params } from './fn/eeg/study';
export { study as study } from './fn/eeg/study';
export type { PostBundle$Params as PostBundle$Params } from './fn/fhir/post-bundle';
+13
View File
@@ -2,30 +2,43 @@
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export type { Analysis } from './models/analysis';
export type { Analyze } from './models/analyze';
export type { AnalyzeRequest } from './models/analyze-request';
export type { BodyAddClinicalValidation } from './models/body-add-clinical-validation';
export type { BodyUpload } from './models/body-upload';
export type { Cancel } from './models/cancel';
export type { Condition } from './models/condition';
export type { Correction } from './models/correction';
export type { Domain } from './models/domain';
export type { Execution } from './models/execution';
export type { Extract } from './models/extract';
export type { Fhir } from './models/fhir';
export type { Health } from './models/health';
export type { HttpValidationError } from './models/http-validation-error';
export type { Join } from './models/join';
export type { Link } from './models/link';
export type { Map } from './models/map';
export type { Metric } from './models/metric';
export type { Options } from './models/options';
export type { PersonDecision } from './models/person-decision';
export type { Pipeline } from './models/pipeline';
export type { Position } from './models/position';
export type { Progress } from './models/progress';
export type { Read } from './models/read';
export type { Rejection } from './models/rejection';
export type { Route } from './models/route';
export type { Run } from './models/run';
export type { RunRequest } from './models/run-request';
export type { RunSummary } from './models/run-summary';
export type { SavedPipeline } from './models/saved-pipeline';
export type { Scope } from './models/scope';
export type { Source } from './models/source';
export type { SourceRef } from './models/source-ref';
export type { Step } from './models/step';
export type { Study } from './models/study';
export type { Target } from './models/target';
export type { Tasks } from './models/tasks';
export type { Training } from './models/training';
export type { ValidationError } from './models/validation-error';
export type { Version } from './models/version';
export type { Worker } from './models/worker';
+9
View File
@@ -0,0 +1,9 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { Execution } from '../models/execution';
import { Scope } from '../models/scope';
export interface AnalyzeRequest {
execution?: (Execution | null);
scope?: Scope;
}
+7
View File
@@ -0,0 +1,7 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { Execution } from '../models/execution';
export interface Analyze {
execution?: (Execution | null);
}
+8
View File
@@ -0,0 +1,8 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export interface Cancel {
id: string;
state: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelling' | 'cancelled';
status: string;
}
+11
View File
@@ -0,0 +1,11 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
/**
* What a request or a job config carries: None means the deployment's default.
*/
export interface Execution {
mode?: ('sync' | 'local' | 'remote' | null);
scheduler?: (string | null);
}
+20
View File
@@ -0,0 +1,20 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export interface Health {
dashboard_ok?: (boolean | null);
dashboard_url?: (string | null);
error?: (string | null);
expected_workers?: (number | null);
latency_ms?: (number | null);
mode: 'sync' | 'local' | 'remote';
reachable: boolean;
reference?: ({
[key: string]: any;
} | null);
scheduler: (string | null);
threads?: (number | null);
version_error?: (string | null);
versions_ok?: (boolean | null);
workers?: (number | null);
}
+7
View File
@@ -0,0 +1,7 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export interface Options {
default_mode: 'sync' | 'local' | 'remote';
schedulers: Array<string>;
}
+21
View File
@@ -0,0 +1,21 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { Tasks } from '../models/tasks';
import { Worker } from '../models/worker';
/**
* The run tag's JSON; the API returns it as it is.
*/
export interface Progress {
done: number;
elapsed_s: number;
eta_s: (number | null);
mode: 'sync' | 'local' | 'remote';
phase: string;
scheduler: (string | null);
tasks?: (Tasks | null);
total: number;
updated_at: string;
workers?: Array<Worker>;
}
+12
View File
@@ -0,0 +1,12 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export interface RunSummary {
domain: (string | null);
ended: (number | null);
id: string;
job: string;
started: (number | null);
state: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelling' | 'cancelled';
status: string;
}
+19
View File
@@ -0,0 +1,19 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { Progress } from '../models/progress';
import { Step } from '../models/step';
export interface Run {
domain: (string | null);
ended: (number | null);
error: (string | null);
id: string;
info: Array<string>;
job: string;
progress: (Progress | null);
started: (number | null);
state: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelling' | 'cancelled';
status: string;
steps: Array<Step>;
warnings: Array<string>;
}
+13
View File
@@ -0,0 +1,13 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
/**
* Which EEGs an analysis takes: the pending ones, the first `n` of them, or the named
* ones (re-analysis), each named by the `id` that `/tea/eegs` shows.
*/
export interface Scope {
ids?: Array<string>;
mode?: 'pending' | 'first_n' | 'ids';
n?: (number | null);
}
+9
View File
@@ -0,0 +1,9 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export interface Step {
ended: (number | null);
key: string;
started: (number | null);
status: string;
}
+10
View File
@@ -0,0 +1,10 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export interface Tasks {
erred?: number;
memory?: number;
processing?: number;
queued?: number;
waiting?: number;
}
+2
View File
@@ -1,7 +1,9 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { Execution } from '../models/execution';
export interface Training {
as_of?: (string | null);
execution?: (Execution | null);
models?: Array<string>;
}
+11
View File
@@ -0,0 +1,11 @@
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export interface Worker {
cpu_pct: number;
executing: number;
memory_bytes: number;
memory_limit: (number | null);
name: string;
threads: number;
}