From 43b5523f9964711c0f02c95a25e4420f590e1f5d Mon Sep 17 00:00:00 2001 From: alberto Date: Sat, 28 Nov 2026 06:54:00 -0600 Subject: [PATCH] Client for the runs, execution and TEA EEG analysis routes --- openapi.json | 1028 ++++++++++++++++- src/app/api/fn/eeg/analyze-eegs.ts | 36 + src/app/api/fn/execution/execution-health.ts | 36 + src/app/api/fn/execution/execution-options.ts | 30 + src/app/api/fn/models/analyze.ts | 3 + src/app/api/fn/runs/cancel-run.ts | 32 + src/app/api/fn/runs/run-history.ts | 39 + src/app/api/fn/runs/run-status.ts | 9 +- src/app/api/functions.ts | 10 + src/app/api/models.ts | 13 + src/app/api/models/analyze-request.ts | 9 + src/app/api/models/analyze.ts | 7 + src/app/api/models/cancel.ts | 8 + src/app/api/models/execution.ts | 11 + src/app/api/models/health.ts | 20 + src/app/api/models/options.ts | 7 + src/app/api/models/progress.ts | 21 + src/app/api/models/run-summary.ts | 12 + src/app/api/models/run.ts | 19 + src/app/api/models/scope.ts | 13 + src/app/api/models/step.ts | 9 + src/app/api/models/tasks.ts | 10 + src/app/api/models/training.ts | 2 + src/app/api/models/worker.ts | 11 + 24 files changed, 1384 insertions(+), 11 deletions(-) create mode 100644 src/app/api/fn/eeg/analyze-eegs.ts create mode 100644 src/app/api/fn/execution/execution-health.ts create mode 100644 src/app/api/fn/execution/execution-options.ts create mode 100644 src/app/api/fn/runs/cancel-run.ts create mode 100644 src/app/api/fn/runs/run-history.ts create mode 100644 src/app/api/models/analyze-request.ts create mode 100644 src/app/api/models/analyze.ts create mode 100644 src/app/api/models/cancel.ts create mode 100644 src/app/api/models/execution.ts create mode 100644 src/app/api/models/health.ts create mode 100644 src/app/api/models/options.ts create mode 100644 src/app/api/models/progress.ts create mode 100644 src/app/api/models/run-summary.ts create mode 100644 src/app/api/models/run.ts create mode 100644 src/app/api/models/scope.ts create mode 100644 src/app/api/models/step.ts create mode 100644 src/app/api/models/tasks.ts create mode 100644 src/app/api/models/worker.ts diff --git a/openapi.json b/openapi.json index ca0cacd..a61df2d 100644 --- a/openapi.json +++ b/openapi.json @@ -58,6 +58,45 @@ "title": "Analysis", "type": "object" }, + "Analyze": { + "properties": { + "execution": { + "anyOf": [ + { + "$ref": "#/components/schemas/Execution" + }, + { + "type": "null" + } + ] + } + }, + "title": "Analyze", + "type": "object" + }, + "AnalyzeRequest": { + "properties": { + "execution": { + "anyOf": [ + { + "$ref": "#/components/schemas/Execution" + }, + { + "type": "null" + } + ] + }, + "scope": { + "$ref": "#/components/schemas/Scope", + "default": { + "ids": [], + "mode": "pending" + } + } + }, + "title": "AnalyzeRequest", + "type": "object" + }, "Body_add_clinical_validation": { "properties": { "file": { @@ -86,6 +125,37 @@ "title": "Body_upload", "type": "object" }, + "Cancel": { + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "state": { + "enum": [ + "queued", + "running", + "succeeded", + "failed", + "cancelling", + "cancelled" + ], + "title": "State", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "required": [ + "id", + "status", + "state" + ], + "title": "Cancel", + "type": "object" + }, "Condition": { "properties": { "column": { @@ -166,6 +236,41 @@ "title": "Domain", "type": "string" }, + "Execution": { + "additionalProperties": false, + "description": "What a request or a job config carries: None means the deployment's default.", + "properties": { + "mode": { + "anyOf": [ + { + "enum": [ + "sync", + "local", + "remote" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Mode" + }, + "scheduler": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Scheduler" + } + }, + "title": "Execution", + "type": "object" + }, "Extract": { "additionalProperties": false, "description": "Platform fields read from text, each kept with the text it was read from.\n\n`auto` asks the LLM when one is configured and answering, else applies `patterns`;\nwith neither, the row is held. Patterns are regexes with one group, per field (the\nLLM can propose them from sample documents); their values go through the ConceptMap\nand `formats` as in `map`.", @@ -388,6 +493,152 @@ "title": "HTTPValidationError", "type": "object" }, + "Health": { + "properties": { + "dashboard_ok": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Dashboard Ok" + }, + "dashboard_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Dashboard Url" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error" + }, + "expected_workers": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Expected Workers" + }, + "latency_ms": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Latency Ms" + }, + "mode": { + "enum": [ + "sync", + "local", + "remote" + ], + "title": "Mode", + "type": "string" + }, + "reachable": { + "title": "Reachable", + "type": "boolean" + }, + "reference": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Reference" + }, + "scheduler": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Scheduler" + }, + "threads": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Threads" + }, + "version_error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Version Error" + }, + "versions_ok": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Versions Ok" + }, + "workers": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Workers" + } + }, + "required": [ + "mode", + "scheduler", + "reachable" + ], + "title": "Health", + "type": "object" + }, "Join": { "additionalProperties": false, "description": "Two inputs side by side where their columns match.", @@ -680,6 +931,32 @@ "title": "Metric", "type": "object" }, + "Options": { + "properties": { + "default_mode": { + "enum": [ + "sync", + "local", + "remote" + ], + "title": "Default Mode", + "type": "string" + }, + "schedulers": { + "items": { + "type": "string" + }, + "title": "Schedulers", + "type": "array" + } + }, + "required": [ + "default_mode", + "schedulers" + ], + "title": "Options", + "type": "object" + }, "PersonDecision": { "properties": { "candidate": { @@ -779,6 +1056,92 @@ "title": "Position", "type": "object" }, + "Progress": { + "description": "The run tag's JSON; the API returns it as it is.", + "properties": { + "done": { + "title": "Done", + "type": "integer" + }, + "elapsed_s": { + "title": "Elapsed S", + "type": "number" + }, + "eta_s": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Eta S" + }, + "mode": { + "enum": [ + "sync", + "local", + "remote" + ], + "title": "Mode", + "type": "string" + }, + "phase": { + "title": "Phase", + "type": "string" + }, + "scheduler": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Scheduler" + }, + "tasks": { + "anyOf": [ + { + "$ref": "#/components/schemas/Tasks" + }, + { + "type": "null" + } + ] + }, + "total": { + "title": "Total", + "type": "integer" + }, + "updated_at": { + "title": "Updated At", + "type": "string" + }, + "workers": { + "default": [], + "items": { + "$ref": "#/components/schemas/Worker" + }, + "title": "Workers", + "type": "array" + } + }, + "required": [ + "phase", + "done", + "total", + "elapsed_s", + "eta_s", + "mode", + "scheduler", + "updated_at" + ], + "title": "Progress", + "type": "object" + }, "Read": { "additionalProperties": false, "description": "Files in a column (PDF, Word, Excel, scans...) to text (MarkItDown, OCRmyPDF).", @@ -924,6 +1287,125 @@ "title": "Route", "type": "object" }, + "Run": { + "properties": { + "domain": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Domain" + }, + "ended": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Ended" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error" + }, + "id": { + "title": "Id", + "type": "string" + }, + "info": { + "items": { + "type": "string" + }, + "title": "Info", + "type": "array" + }, + "job": { + "title": "Job", + "type": "string" + }, + "progress": { + "anyOf": [ + { + "$ref": "#/components/schemas/Progress" + }, + { + "type": "null" + } + ] + }, + "started": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Started" + }, + "state": { + "enum": [ + "queued", + "running", + "succeeded", + "failed", + "cancelling", + "cancelled" + ], + "title": "State", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + }, + "steps": { + "items": { + "$ref": "#/components/schemas/Step" + }, + "title": "Steps", + "type": "array" + }, + "warnings": { + "items": { + "type": "string" + }, + "title": "Warnings", + "type": "array" + } + }, + "required": [ + "id", + "job", + "domain", + "status", + "state", + "started", + "ended", + "progress", + "steps", + "info", + "warnings", + "error" + ], + "title": "Run", + "type": "object" + }, "RunRequest": { "properties": { "version": { @@ -941,6 +1423,78 @@ "title": "RunRequest", "type": "object" }, + "RunSummary": { + "properties": { + "domain": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Domain" + }, + "ended": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Ended" + }, + "id": { + "title": "Id", + "type": "string" + }, + "job": { + "title": "Job", + "type": "string" + }, + "started": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Started" + }, + "state": { + "enum": [ + "queued", + "running", + "succeeded", + "failed", + "cancelling", + "cancelled" + ], + "title": "State", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "required": [ + "id", + "job", + "domain", + "status", + "state", + "started", + "ended" + ], + "title": "RunSummary", + "type": "object" + }, "SavedPipeline": { "properties": { "pipeline": { @@ -958,6 +1512,44 @@ "title": "SavedPipeline", "type": "object" }, + "Scope": { + "additionalProperties": false, + "description": "Which EEGs an analysis takes: the pending ones, the first `n` of them, or the named\nones (re-analysis), each named by the `id` that `/tea/eegs` shows.", + "properties": { + "ids": { + "default": [], + "items": { + "type": "string" + }, + "title": "Ids", + "type": "array" + }, + "mode": { + "default": "pending", + "enum": [ + "pending", + "first_n", + "ids" + ], + "title": "Mode", + "type": "string" + }, + "n": { + "anyOf": [ + { + "minimum": 1.0, + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "N" + } + }, + "title": "Scope", + "type": "object" + }, "Source": { "additionalProperties": false, "description": "One table, file set or API resource, copied as it is (dlt). Merged on the source's\nown primary key or `primary_key`; replaced whole when it has none.", @@ -1069,6 +1661,48 @@ "title": "SourceRef", "type": "object" }, + "Step": { + "properties": { + "ended": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Ended" + }, + "key": { + "title": "Key", + "type": "string" + }, + "started": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Started" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "required": [ + "key", + "status", + "started", + "ended" + ], + "title": "Step", + "type": "object" + }, "Study": { "properties": { "analysed": { @@ -1199,6 +1833,37 @@ "title": "Target", "type": "object" }, + "Tasks": { + "properties": { + "erred": { + "default": 0, + "title": "Erred", + "type": "integer" + }, + "memory": { + "default": 0, + "title": "Memory", + "type": "integer" + }, + "processing": { + "default": 0, + "title": "Processing", + "type": "integer" + }, + "queued": { + "default": 0, + "title": "Queued", + "type": "integer" + }, + "waiting": { + "default": 0, + "title": "Waiting", + "type": "integer" + } + }, + "title": "Tasks", + "type": "object" + }, "Training": { "properties": { "as_of": { @@ -1213,6 +1878,16 @@ ], "title": "As Of" }, + "execution": { + "anyOf": [ + { + "$ref": "#/components/schemas/Execution" + }, + { + "type": "null" + } + ] + }, "models": { "default": [], "items": { @@ -1314,6 +1989,51 @@ ], "title": "Version", "type": "object" + }, + "Worker": { + "properties": { + "cpu_pct": { + "title": "Cpu Pct", + "type": "number" + }, + "executing": { + "title": "Executing", + "type": "integer" + }, + "memory_bytes": { + "title": "Memory Bytes", + "type": "integer" + }, + "memory_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Memory Limit" + }, + "name": { + "title": "Name", + "type": "string" + }, + "threads": { + "title": "Threads", + "type": "integer" + } + }, + "required": [ + "name", + "cpu_pct", + "memory_bytes", + "memory_limit", + "executing", + "threads" + ], + "title": "Worker", + "type": "object" } } }, @@ -1345,6 +2065,113 @@ "summary": "Domains" } }, + "/execution/health": { + "get": { + "operationId": "execution_health", + "parameters": [ + { + "in": "query", + "name": "mode", + "required": false, + "schema": { + "anyOf": [ + { + "enum": [ + "sync", + "local", + "remote" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Mode" + } + }, + { + "in": "query", + "name": "scheduler", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Scheduler" + } + }, + { + "in": "query", + "name": "reference", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Reference" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Health" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Execution Health", + "tags": [ + "execution" + ] + } + }, + "/execution/options": { + "get": { + "operationId": "execution_options", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Options" + } + } + }, + "description": "Successful Response" + } + }, + "summary": "Execution Options", + "tags": [ + "execution" + ] + } + }, "/health": { "get": { "operationId": "health", @@ -2012,6 +2839,16 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Analyze", + "default": {} + } + } + } + }, "responses": { "200": { "content": { @@ -2722,6 +3559,103 @@ ] } }, + "/runs": { + "get": { + "operationId": "run_history", + "parameters": [ + { + "in": "query", + "name": "job", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Job" + } + }, + { + "in": "query", + "name": "domain", + "required": false, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/Domain" + }, + { + "type": "null" + } + ], + "title": "Domain" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 50, + "maximum": 200, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "before", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Before" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/RunSummary" + }, + "title": "Response Run History", + "type": "array" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Run History", + "tags": [ + "runs" + ] + } + }, "/runs/{run_id}": { "get": { "operationId": "run_status", @@ -2741,11 +3675,7 @@ "content": { "application/json": { "schema": { - "additionalProperties": { - "type": "string" - }, - "title": "Response Run Status", - "type": "object" + "$ref": "#/components/schemas/Run" } } }, @@ -2768,6 +3698,48 @@ ] } }, + "/runs/{run_id}/cancel": { + "post": { + "operationId": "cancel_run", + "parameters": [ + { + "in": "path", + "name": "run_id", + "required": true, + "schema": { + "title": "Run Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Cancel" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Cancel Run", + "tags": [ + "runs" + ] + } + }, "/tea/eegs": { "get": { "operationId": "studies", @@ -2793,6 +3765,52 @@ ] } }, + "/tea/eegs/analyze": { + "post": { + "description": "Starts `tea_eeg`: analyse the EEGs in scope, score the curves, rebuild gold.", + "operationId": "analyze_eegs", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnalyzeRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "title": "Response Analyze Eegs", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Analyze Eegs", + "tags": [ + "eeg" + ] + } + }, "/tea/eegs/{eeg_id}": { "get": { "operationId": "study", diff --git a/src/app/api/fn/eeg/analyze-eegs.ts b/src/app/api/fn/eeg/analyze-eegs.ts new file mode 100644 index 0000000..5ddfa35 --- /dev/null +++ b/src/app/api/fn/eeg/analyze-eegs.ts @@ -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> { + 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 => r instanceof HttpResponse), + map((r: HttpResponse) => { + return r as StrictHttpResponse<{ + [key: string]: string; + }>; + }) + ); +} + +analyzeEegs.PATH = '/tea/eegs/analyze'; diff --git a/src/app/api/fn/execution/execution-health.ts b/src/app/api/fn/execution/execution-health.ts new file mode 100644 index 0000000..b16cfde --- /dev/null +++ b/src/app/api/fn/execution/execution-health.ts @@ -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> { + 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 => r instanceof HttpResponse), + map((r: HttpResponse) => { + return r as StrictHttpResponse; + }) + ); +} + +executionHealth.PATH = '/execution/health'; diff --git a/src/app/api/fn/execution/execution-options.ts b/src/app/api/fn/execution/execution-options.ts new file mode 100644 index 0000000..eaf9f28 --- /dev/null +++ b/src/app/api/fn/execution/execution-options.ts @@ -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> { + 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 => r instanceof HttpResponse), + map((r: HttpResponse) => { + return r as StrictHttpResponse; + }) + ); +} + +executionOptions.PATH = '/execution/options'; diff --git a/src/app/api/fn/models/analyze.ts b/src/app/api/fn/models/analyze.ts index 9dc92b8..1c0055e 100644 --- a/src/app/api/fn/models/analyze.ts +++ b/src/app/api/fn/models/analyze.ts @@ -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> { + 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 => r instanceof HttpResponse), + map((r: HttpResponse) => { + return r as StrictHttpResponse; + }) + ); +} + +cancelRun.PATH = '/runs/{run_id}/cancel'; diff --git a/src/app/api/fn/runs/run-history.ts b/src/app/api/fn/runs/run-history.ts new file mode 100644 index 0000000..52b037a --- /dev/null +++ b/src/app/api/fn/runs/run-history.ts @@ -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>> { + 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 => r instanceof HttpResponse), + map((r: HttpResponse) => { + return r as StrictHttpResponse>; + }) + ); +} + +runHistory.PATH = '/runs'; diff --git a/src/app/api/fn/runs/run-status.ts b/src/app/api/fn/runs/run-status.ts index d7379b0..3fad0d4 100644 --- a/src/app/api/fn/runs/run-status.ts +++ b/src/app/api/fn/runs/run-status.ts @@ -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> { +export function runStatus(http: HttpClient, rootUrl: string, params: RunStatus$Params, context?: HttpContext): Observable> { 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 => r instanceof HttpResponse), map((r: HttpResponse) => { - return r as StrictHttpResponse<{ - [key: string]: string; - }>; + return r as StrictHttpResponse; }) ); } diff --git a/src/app/api/functions.ts b/src/app/api/functions.ts index eb51e68..6012282 100644 --- a/src/app/api/functions.ts +++ b/src/app/api/functions.ts @@ -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'; diff --git a/src/app/api/models.ts b/src/app/api/models.ts index 12a9984..d9513dc 100644 --- a/src/app/api/models.ts +++ b/src/app/api/models.ts @@ -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'; diff --git a/src/app/api/models/analyze-request.ts b/src/app/api/models/analyze-request.ts new file mode 100644 index 0000000..7239995 --- /dev/null +++ b/src/app/api/models/analyze-request.ts @@ -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; +} diff --git a/src/app/api/models/analyze.ts b/src/app/api/models/analyze.ts new file mode 100644 index 0000000..10ba4ca --- /dev/null +++ b/src/app/api/models/analyze.ts @@ -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); +} diff --git a/src/app/api/models/cancel.ts b/src/app/api/models/cancel.ts new file mode 100644 index 0000000..f7e6dd8 --- /dev/null +++ b/src/app/api/models/cancel.ts @@ -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; +} diff --git a/src/app/api/models/execution.ts b/src/app/api/models/execution.ts new file mode 100644 index 0000000..b8a6ccd --- /dev/null +++ b/src/app/api/models/execution.ts @@ -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); +} diff --git a/src/app/api/models/health.ts b/src/app/api/models/health.ts new file mode 100644 index 0000000..b79c5d6 --- /dev/null +++ b/src/app/api/models/health.ts @@ -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); +} diff --git a/src/app/api/models/options.ts b/src/app/api/models/options.ts new file mode 100644 index 0000000..386aa94 --- /dev/null +++ b/src/app/api/models/options.ts @@ -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; +} diff --git a/src/app/api/models/progress.ts b/src/app/api/models/progress.ts new file mode 100644 index 0000000..1b97efe --- /dev/null +++ b/src/app/api/models/progress.ts @@ -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; +} diff --git a/src/app/api/models/run-summary.ts b/src/app/api/models/run-summary.ts new file mode 100644 index 0000000..57f8358 --- /dev/null +++ b/src/app/api/models/run-summary.ts @@ -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; +} diff --git a/src/app/api/models/run.ts b/src/app/api/models/run.ts new file mode 100644 index 0000000..122c66b --- /dev/null +++ b/src/app/api/models/run.ts @@ -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; + job: string; + progress: (Progress | null); + started: (number | null); + state: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelling' | 'cancelled'; + status: string; + steps: Array; + warnings: Array; +} diff --git a/src/app/api/models/scope.ts b/src/app/api/models/scope.ts new file mode 100644 index 0000000..e0aa5d0 --- /dev/null +++ b/src/app/api/models/scope.ts @@ -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; + mode?: 'pending' | 'first_n' | 'ids'; + n?: (number | null); +} diff --git a/src/app/api/models/step.ts b/src/app/api/models/step.ts new file mode 100644 index 0000000..650fcb1 --- /dev/null +++ b/src/app/api/models/step.ts @@ -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; +} diff --git a/src/app/api/models/tasks.ts b/src/app/api/models/tasks.ts new file mode 100644 index 0000000..5398426 --- /dev/null +++ b/src/app/api/models/tasks.ts @@ -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; +} diff --git a/src/app/api/models/training.ts b/src/app/api/models/training.ts index f3f0626..1bea9a7 100644 --- a/src/app/api/models/training.ts +++ b/src/app/api/models/training.ts @@ -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; } diff --git a/src/app/api/models/worker.ts b/src/app/api/models/worker.ts new file mode 100644 index 0000000..31abedb --- /dev/null +++ b/src/app/api/models/worker.ts @@ -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; +}