diff --git a/e2e/pages.spec.ts b/e2e/pages.spec.ts index 6e54e0a..f6d3651 100644 --- a/e2e/pages.spec.ts +++ b/e2e/pages.spec.ts @@ -9,6 +9,32 @@ function watch(page: Page): string[] { return problems; } +// The pages show only to someone signed in (the API itself answers everyone). +test.beforeEach(async ({ page }) => { + const signed = await page.request.post('/api/auth/login', { + form: { username: 'admin@isssteleon.test', password: 'solo-para-pruebas' }, + }); + expect(signed.status()).toBe(204); +}); + +test('login: the pages wait for a sign-in, and a wrong password says so', async ({ browser }) => { + const page = await browser.newPage({ baseURL: 'http://127.0.0.1:4310' }); + await page.goto('/conectar'); + await expect(page).toHaveURL(/\/login\?next=%2Fconectar/); + await expect(page.getByRole('heading', { name: 'Inicio de sesión' })).toBeVisible(); + await page.getByRole('textbox', { name: 'Usuario' }).fill('admin@isssteleon.test'); + await page.getByRole('textbox', { name: 'Contraseña' }).fill('otra'); + await page.getByRole('button', { name: 'Ingresar' }).click(); + await expect(page.getByText('Usuario o contraseña incorrectos.')).toBeVisible(); + await page.getByRole('textbox', { name: 'Contraseña' }).fill('solo-para-pruebas'); + await page.getByRole('button', { name: 'Ingresar' }).click(); + await expect(page).toHaveURL(/\/conectar$/); + await page.getByRole('button', { name: 'Cuenta' }).click(); + await page.getByRole('menuitem', { name: 'Salir' }).click(); + await expect(page).toHaveURL(/\/login/); + await page.close(); +}); + test("indicators: the KPIs are the API's MeasureReports, every tab and the patient view load", async ({ page, }) => { @@ -71,12 +97,12 @@ test('conectar: open the hospital pipeline, preview a source, run it to success' await page.goto('/conectar'); await page.getByText('cacu', { exact: true }).click(); await expect(page.locator('vflow')).toBeVisible(); - await page.getByText('Fuente · Patients').click(); - await expect(page.locator('formly-form')).toBeVisible(); + await page.getByText('Fuente de datos · Patients').click(); + await expect(page.locator('formly-form')).toBeVisible(); // drawn by hand: its raw form await page.getByRole('button', { name: 'Vista previa' }).click(); await expect(page.locator('.preview tr[mat-row]').first()).toBeVisible(); // A map node shows the site's codes in platform terms (its ConceptMap), editable as rows. - await page.getByText('Mapear · cytology', { exact: true }).click(); + await page.getByText('Traducir códigos · cytology', { exact: true }).click(); await expect(page.getByText('Códigos del sitio')).toBeVisible(); await expect .poll(() => @@ -90,7 +116,9 @@ test('conectar: open the hospital pipeline, preview a source, run it to success' expect(problems).toEqual([]); }); -test('revision: what the hospital source holds, and a decision through the page', async ({ page }) => { +test('revision: what the hospital source holds, and a decision through the page', async ({ + page, +}) => { const problems = watch(page); await page.goto('/revision'); await page.getByRole('tab', { name: 'Personas' }).click(); @@ -116,3 +144,37 @@ test('gobernanza: a version with its reports, its curves, and promotion refused await expect(page.getByText('No se promovió')).toContainText('clinical_validation'); expect(problems.filter((p) => !p.includes('409'))).toEqual([]); }); + +test('conectar: someone who knows nothing of databases connects the SQL Server with the dialog', async ({ + page, +}) => { + const site = new URL((process.env['SITE_URL'] ?? '').replace(/^mssql\+pymssql/, 'http')); + const problems = watch(page); + await page.goto('/conectar'); + await page.getByLabel('Nueva canalización').fill('asistente'); + await page.getByLabel('Nueva canalización').press('Enter'); + await page.getByRole('button', { name: 'Fuente de datos' }).click(); + await expect(page.getByText('¿Dónde están los datos?')).toBeVisible(); + await page.locator('[data-type="sqlserver"]').click(); + await page.locator('[data-field="host"]').fill(site.hostname); + await page.locator('[data-field="database"]').fill(site.pathname.slice(1)); + await page.locator('[data-field="user"]').fill(decodeURIComponent(site.username)); + await page.locator('[data-field="password"]').fill(decodeURIComponent(site.password)); + await page.getByRole('button', { name: 'Probar conexión' }).click(); + await expect(page.getByText('Conexión correcta: 1 tabla.')).toBeVisible(); + await page.locator('mat-select[data-field="table"]').click(); + await page.getByRole('option', { name: 'ResultadoSubrogado' }).click(); + await expect(page.getByText(/Primeras \d+ filas/)).toBeVisible(); + await page.getByLabel('Nombre de esta fuente').fill('Resultados'); + await page.getByRole('button', { name: 'Guardar', exact: true }).last().click(); + await expect(page.getByText('Fuente de datos · Resultados')).toBeVisible(); + // A wrong password says so in words, not a stack trace. + await page.getByRole('button', { name: 'Editar conexión' }).click(); + await page.locator('[data-field="password"]').fill('not-it'); + await page.getByRole('button', { name: 'Probar conexión' }).click(); + await expect(page.getByText(/usuario o la contraseña no son correctos/)).toBeVisible(); + await page.getByRole('button', { name: 'Cancelar' }).click(); + await page.getByRole('button', { name: 'Guardar', exact: true }).click(); + await expect(page.getByText('Versión 1 guardada.')).toBeVisible(); + expect(problems).toEqual([]); +}); diff --git a/openapi.json b/openapi.json index 62f1427..fb5c0c3 100644 --- a/openapi.json +++ b/openapi.json @@ -58,6 +58,47 @@ "title": "Analysis", "type": "object" }, + "Answers": { + "properties": { + "answers": { + "additionalProperties": true, + "default": {}, + "title": "Answers", + "type": "object" + }, + "node": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Node" + }, + "pipeline": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Pipeline" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "Answers", + "type": "object" + }, "Body_add_clinical_validation": { "properties": { "file": { @@ -74,22 +115,118 @@ }, "Body_upload": { "properties": { - "file": { - "contentMediaType": "application/octet-stream", - "title": "File", - "type": "string" + "files": { + "items": { + "contentMediaType": "application/octet-stream", + "type": "string" + }, + "title": "Files", + "type": "array" + }, + "folder": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Folder" } }, "required": [ - "file" + "files" ], "title": "Body_upload", "type": "object" }, + "Browsed": { + "properties": { + "entries": { + "items": { + "$ref": "#/components/schemas/Entry" + }, + "title": "Entries", + "type": "array" + }, + "parent": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Parent" + }, + "path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Path" + } + }, + "required": [ + "path", + "parent", + "entries" + ], + "title": "Browsed", + "type": "object" + }, + "Catalog": { + "additionalProperties": false, + "properties": { + "formats": { + "items": { + "$ref": "#/components/schemas/Option" + }, + "title": "Formats", + "type": "array" + }, + "groups": { + "additionalProperties": { + "$ref": "#/components/schemas/Group" + }, + "title": "Groups", + "type": "object" + }, + "providers": { + "additionalProperties": { + "$ref": "#/components/schemas/Provider" + }, + "title": "Providers", + "type": "object" + }, + "types": { + "additionalProperties": { + "$ref": "#/components/schemas/SourceType" + }, + "title": "Types", + "type": "object" + } + }, + "required": [ + "groups", + "providers", + "formats", + "types" + ], + "title": "Catalog", + "type": "object" + }, "Condition": { "properties": { "column": { - "title": "Column", + "description": "Por ejemplo \u00abtext\u00bb, el texto le\u00eddo del documento.", + "title": "Columna", "type": "string" }, "op": { @@ -99,12 +236,37 @@ "matches", "present" ], - "title": "Op", - "type": "string" + "title": "Condici\u00f3n", + "type": "string", + "widget": { + "formlyConfig": { + "props": { + "options": [ + { + "label": "es igual a", + "value": "equals" + }, + { + "label": "contiene", + "value": "contains" + }, + { + "label": "coincide con la expresi\u00f3n", + "value": "matches" + }, + { + "label": "tiene alg\u00fan valor", + "value": "present" + } + ] + } + } + } }, "value": { "default": "", - "title": "Value", + "description": "Lo que se busca; por ejemplo \u00abcitolog\u00eda\u00bb.", + "title": "Valor", "type": "string" } }, @@ -166,6 +328,67 @@ "title": "Domain", "type": "string" }, + "Entry": { + "properties": { + "kind": { + "enum": [ + "folder", + "file" + ], + "title": "Kind", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "path": { + "title": "Path", + "type": "string" + }, + "size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Size" + } + }, + "required": [ + "name", + "path", + "kind" + ], + "title": "Entry", + "type": "object" + }, + "ErrorModel": { + "properties": { + "detail": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], + "title": "Detail" + } + }, + "required": [ + "detail" + ], + "title": "ErrorModel", + "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`.", @@ -182,14 +405,15 @@ "type": "array" } ], - "title": "Column" + "title": "Columna con el texto" }, "columns": { "additionalProperties": { "type": "string" }, "default": {}, - "title": "Columns", + "description": "Dato \u2192 columna, sin leer el texto.", + "title": "Datos tomados de columnas", "type": "object" }, "concept_map": { @@ -203,9 +427,10 @@ "type": "null" } ], - "title": "Concept Map" + "title": "Equivalencias de c\u00f3digos" }, "entity": { + "description": "Qu\u00e9 estudio se saca del documento.", "enum": [ "identity", "cervical_cytology", @@ -219,7 +444,7 @@ "ados2", "eeg" ], - "title": "Entity", + "title": "Estudio", "type": "string" }, "formats": { @@ -227,12 +452,13 @@ "type": "string" }, "default": {}, - "title": "Formats", + "title": "Formatos de fecha", "type": "object" }, "hints": { "default": "", - "title": "Hints", + "description": "Para el modelo de lenguaje.", + "title": "Indicaciones", "type": "string" }, "id": { @@ -259,7 +485,8 @@ }, "label": { "default": "", - "title": "Label", + "description": "C\u00f3mo se ve en el diagrama.", + "title": "Nombre", "type": "string" }, "method": { @@ -269,15 +496,36 @@ "llm", "patterns" ], - "title": "Method", - "type": "string" + "title": "C\u00f3mo leer", + "type": "string", + "widget": { + "formlyConfig": { + "props": { + "options": [ + { + "label": "Autom\u00e1tico", + "value": "auto" + }, + { + "label": "Con el modelo de lenguaje", + "value": "llm" + }, + { + "label": "Con patrones", + "value": "patterns" + } + ] + } + } + } }, "patterns": { "additionalProperties": { "type": "string" }, "default": {}, - "title": "Patterns", + "description": "Dato \u2192 expresi\u00f3n con un grupo ( ).", + "title": "Patrones", "type": "object" }, "position": { @@ -305,7 +553,7 @@ "properties": { "column": { "default": "doc", - "title": "Column", + "title": "Columna con el FHIR", "type": "string" }, "concept_map": { @@ -319,7 +567,7 @@ "type": "null" } ], - "title": "Concept Map" + "title": "Equivalencias de c\u00f3digos" }, "entity": { "enum": [ @@ -335,7 +583,7 @@ "ados2", "eeg" ], - "title": "Entity", + "title": "Estudio", "type": "string" }, "id": { @@ -362,7 +610,8 @@ }, "label": { "default": "", - "title": "Label", + "description": "C\u00f3mo se ve en el diagrama.", + "title": "Nombre", "type": "string" }, "position": { @@ -383,6 +632,120 @@ "title": "Fhir", "type": "object" }, + "FieldSpec": { + "additionalProperties": false, + "properties": { + "advanced": { + "default": false, + "title": "Advanced", + "type": "boolean" + }, + "default": { + "title": "Default" + }, + "help": { + "default": "", + "title": "Help", + "type": "string" + }, + "label": { + "title": "Label", + "type": "string" + }, + "options": { + "default": [], + "items": { + "$ref": "#/components/schemas/Option" + }, + "title": "Options", + "type": "array" + }, + "placeholder": { + "default": "", + "title": "Placeholder", + "type": "string" + }, + "provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Provider" + }, + "required": { + "default": true, + "title": "Required", + "type": "boolean" + }, + "type": { + "default": "text", + "enum": [ + "text", + "number", + "password", + "select", + "folder", + "server_file", + "upload", + "url", + "oauth", + "table", + "format" + ], + "title": "Type", + "type": "string" + } + }, + "required": [ + "label" + ], + "title": "FieldSpec", + "type": "object" + }, + "Group": { + "additionalProperties": false, + "properties": { + "description": { + "title": "Description", + "type": "string" + }, + "title": { + "title": "Title", + "type": "string" + } + }, + "required": [ + "title", + "description" + ], + "title": "Group", + "type": "object" + }, + "Guided": { + "additionalProperties": false, + "description": "How the Conectar dialog drew a source: its type (core.sources) and the answers given.\nThe node's dlt fields are made from them; drawn by hand (\"Avanzado\"), a node has none.", + "properties": { + "answers": { + "additionalProperties": true, + "default": {}, + "title": "Answers", + "type": "object" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "Guided", + "type": "object" + }, "HTTPValidationError": { "properties": { "detail": { @@ -406,8 +769,24 @@ "inner", "left" ], - "title": "How", - "type": "string" + "title": "Cu\u00e1les quedan", + "type": "string", + "widget": { + "formlyConfig": { + "props": { + "options": [ + { + "label": "Solo las que tienen pareja", + "value": "inner" + }, + { + "label": "Todas las de la izquierda", + "value": "left" + } + ] + } + } + } }, "id": { "maxLength": 40, @@ -433,10 +812,12 @@ }, "label": { "default": "", - "title": "Label", + "description": "C\u00f3mo se ve en el diagrama.", + "title": "Nombre", "type": "string" }, "on": { + "description": "Pares [columna izquierda, derecha].", "items": { "maxItems": 2, "minItems": 2, @@ -450,7 +831,7 @@ ], "type": "array" }, - "title": "On", + "title": "Columnas iguales", "type": "array" }, "position": { @@ -487,7 +868,7 @@ "items": { "type": "string" }, - "title": "Fields", + "title": "Datos que comparar", "type": "array" }, "id": { @@ -514,7 +895,8 @@ }, "label": { "default": "", - "title": "Label", + "description": "C\u00f3mo se ve en el diagrama.", + "title": "Nombre", "type": "string" }, "position": { @@ -529,17 +911,19 @@ }, "review": { "default": 0.5, + "description": "Parecidos por encima de esto los ve un revisor.", "exclusiveMinimum": 0.0, "maximum": 1.0, - "title": "Review", + "title": "Umbral para revisar", "type": "number" }, "rules": { "default": [], + "description": "Vac\u00edo: las de siempre (mismo identificador, o misma fecha de nacimiento y nombre).", "items": { "type": "string" }, - "title": "Rules", + "title": "Reglas", "type": "array" } }, @@ -549,6 +933,42 @@ "title": "Link", "type": "object" }, + "Listing": { + "additionalProperties": false, + "description": "What \"Probar conexi\u00f3n\" shows: a database's tables (the resources of `source`, built\nfrom `args`), or the first rows the type's own node reads (files, records).", + "properties": { + "args": { + "additionalProperties": true, + "default": {}, + "title": "Args", + "type": "object" + }, + "kind": { + "enum": [ + "tables", + "rows" + ], + "title": "Kind", + "type": "string" + }, + "source": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Source" + } + }, + "required": [ + "kind" + ], + "title": "Listing", + "type": "object" + }, "Map": { "additionalProperties": false, "description": "Columns to platform fields, the site's codes translated by its ConceptMap\n(core.concept_map), and its date formats.", @@ -564,13 +984,15 @@ "type": "null" } ], - "title": "Concept Map" + "description": "La tabla de c\u00f3digos del sitio.", + "title": "Equivalencias de c\u00f3digos" }, "fields": { "additionalProperties": { "type": "string" }, - "title": "Fields", + "description": "Dato de la plataforma \u2192 columna del sitio.", + "title": "Campos", "type": "object" }, "formats": { @@ -578,7 +1000,8 @@ "type": "string" }, "default": {}, - "title": "Formats", + "description": "Por ejemplo %d/%m/%Y.", + "title": "Formatos de fecha", "type": "object" }, "id": { @@ -605,7 +1028,8 @@ }, "label": { "default": "", - "title": "Label", + "description": "C\u00f3mo se ve en el diagrama.", + "title": "Nombre", "type": "string" }, "position": { @@ -623,7 +1047,8 @@ "type": "string" }, "default": {}, - "title": "Values", + "description": "Un dato igual para todas las filas.", + "title": "Valores fijos", "type": "object" } }, @@ -688,6 +1113,24 @@ "title": "Metric", "type": "object" }, + "Option": { + "additionalProperties": false, + "properties": { + "label": { + "title": "Label", + "type": "string" + }, + "value": { + "title": "Value" + } + }, + "required": [ + "value", + "label" + ], + "title": "Option", + "type": "object" + }, "PersonDecision": { "properties": { "candidate": { @@ -787,12 +1230,56 @@ "title": "Position", "type": "object" }, + "Provider": { + "additionalProperties": false, + "description": "A sign-in button's OAuth 2.0 provider (authorization code flow).", + "properties": { + "authorize_params": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "title": "Authorize Params", + "type": "object" + }, + "authorize_url": { + "title": "Authorize Url", + "type": "string" + }, + "env": { + "title": "Env", + "type": "string" + }, + "scope": { + "title": "Scope", + "type": "string" + }, + "title": { + "title": "Title", + "type": "string" + }, + "token_url": { + "title": "Token Url", + "type": "string" + } + }, + "required": [ + "title", + "env", + "authorize_url", + "token_url", + "scope" + ], + "title": "Provider", + "type": "object" + }, "Read": { "additionalProperties": false, "description": "Files in a column (PDF, Word, Excel, scans...) to text (MarkItDown, OCRmyPDF).", "properties": { "column": { - "title": "Column", + "description": "Donde la entrada trae cada documento.", + "title": "Columna con los archivos", "type": "string" }, "id": { @@ -819,7 +1306,8 @@ }, "label": { "default": "", - "title": "Label", + "description": "C\u00f3mo se ve en el diagrama.", + "title": "Nombre", "type": "string" }, "position": { @@ -904,12 +1392,14 @@ }, "label": { "default": "", - "title": "Label", + "description": "C\u00f3mo se ve en el diagrama.", + "title": "Nombre", "type": "string" }, "otherwise": { "default": false, - "title": "Otherwise", + "description": "Recoge lo que nadie reconoce, para revisarlo.", + "title": "Lo que ning\u00fan otro tome", "type": "boolean" }, "position": { @@ -927,7 +1417,7 @@ "items": { "$ref": "#/components/schemas/Condition" }, - "title": "When", + "title": "Pasan las filas donde", "type": "array" } }, @@ -971,6 +1461,24 @@ "title": "SavedPipeline", "type": "object" }, + "SignIn": { + "properties": { + "state": { + "title": "State", + "type": "string" + }, + "url": { + "title": "Url", + "type": "string" + } + }, + "required": [ + "url", + "state" + ], + "title": "SignIn", + "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.", @@ -978,9 +1486,20 @@ "args": { "additionalProperties": true, "default": {}, - "title": "Args", + "description": "Los de la fuente dlt.", + "title": "Argumentos (JSON)", "type": "object" }, + "guided": { + "anyOf": [ + { + "$ref": "#/components/schemas/Guided" + }, + { + "type": "null" + } + ] + }, "id": { "maxLength": 40, "pattern": "^[a-z][a-z0-9_]*$", @@ -1005,7 +1524,8 @@ }, "label": { "default": "", - "title": "Label", + "description": "C\u00f3mo se ve en el diagrama.", + "title": "Nombre", "type": "string" }, "position": { @@ -1020,10 +1540,11 @@ }, "primary_key": { "default": [], + "description": "Columnas que identifican una fila.", "items": { "type": "string" }, - "title": "Primary Key", + "title": "Llave", "type": "array" }, "resource": { @@ -1035,11 +1556,13 @@ "type": "null" } ], - "title": "Resource" + "description": "Cu\u00e1l, si la fuente ofrece varios (una tabla).", + "title": "Recurso" }, "source": { + "description": "M\u00f3dulo:funci\u00f3n de la fuente dlt.", "pattern": "^[A-Za-z_][\\w.]*:[A-Za-z_]\\w*$", - "title": "Source", + "title": "Fuente dlt", "type": "string" }, "then": { @@ -1052,7 +1575,8 @@ "type": "null" } ], - "title": "Then" + "description": "Transformador dlt para los archivos.", + "title": "Lector" } }, "required": [ @@ -1082,6 +1606,94 @@ "title": "SourceRef", "type": "object" }, + "SourceType": { + "additionalProperties": false, + "properties": { + "args": { + "additionalProperties": true, + "default": {}, + "title": "Args", + "type": "object" + }, + "description": { + "title": "Description", + "type": "string" + }, + "fields": { + "additionalProperties": { + "$ref": "#/components/schemas/FieldSpec" + }, + "title": "Fields", + "type": "object" + }, + "group": { + "title": "Group", + "type": "string" + }, + "icon": { + "title": "Icon", + "type": "string" + }, + "listing": { + "anyOf": [ + { + "$ref": "#/components/schemas/Listing" + }, + { + "type": "null" + } + ] + }, + "primary_key": { + "default": [], + "items": { + "type": "string" + }, + "title": "Primary Key", + "type": "array" + }, + "resource": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Resource" + }, + "source": { + "title": "Source", + "type": "string" + }, + "then": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Then" + }, + "title": { + "title": "Title", + "type": "string" + } + }, + "required": [ + "group", + "title", + "description", + "icon", + "fields", + "source" + ], + "title": "SourceType", + "type": "object" + }, "Study": { "properties": { "analysed": { @@ -1151,6 +1763,7 @@ "description": "Rows of platform fields into one platform entity, each row given its person by the\none `link` node among the inputs. Rule breaks are held for review.", "properties": { "entity": { + "description": "En qu\u00e9 estudio de la plataforma se guarda.", "enum": [ "identity", "cervical_cytology", @@ -1164,7 +1777,7 @@ "ados2", "eeg" ], - "title": "Entity", + "title": "Estudio", "type": "string" }, "id": { @@ -1191,7 +1804,8 @@ }, "label": { "default": "", - "title": "Label", + "description": "C\u00f3mo se ve en el diagrama.", + "title": "Nombre", "type": "string" }, "position": { @@ -1212,6 +1826,52 @@ "title": "Target", "type": "object" }, + "Tested": { + "properties": { + "detail": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Detail" + }, + "message": { + "title": "Message", + "type": "string" + }, + "ok": { + "title": "Ok", + "type": "boolean" + }, + "rows": { + "default": [], + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Rows", + "type": "array" + }, + "tables": { + "default": [], + "items": { + "type": "string" + }, + "title": "Tables", + "type": "array" + } + }, + "required": [ + "ok", + "message" + ], + "title": "Tested", + "type": "object" + }, "Training": { "properties": { "as_of": { @@ -1238,6 +1898,230 @@ "title": "Training", "type": "object" }, + "Uploaded": { + "properties": { + "bucket_url": { + "title": "Bucket Url", + "type": "string" + }, + "files": { + "items": { + "type": "string" + }, + "title": "Files", + "type": "array" + } + }, + "required": [ + "bucket_url", + "files" + ], + "title": "Uploaded", + "type": "object" + }, + "UserCreate": { + "properties": { + "domains": { + "default": [], + "items": { + "$ref": "#/components/schemas/Domain" + }, + "title": "Domains", + "type": "array" + }, + "email": { + "format": "email", + "title": "Email", + "type": "string" + }, + "is_active": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "title": "Is Active" + }, + "is_superuser": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "title": "Is Superuser" + }, + "is_verified": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "title": "Is Verified" + }, + "name": { + "default": "", + "title": "Name", + "type": "string" + }, + "password": { + "title": "Password", + "type": "string" + } + }, + "required": [ + "email", + "password" + ], + "title": "UserCreate", + "type": "object" + }, + "UserRead": { + "properties": { + "domains": { + "default": [], + "items": { + "$ref": "#/components/schemas/Domain" + }, + "title": "Domains", + "type": "array" + }, + "email": { + "format": "email", + "title": "Email", + "type": "string" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "is_active": { + "default": true, + "title": "Is Active", + "type": "boolean" + }, + "is_superuser": { + "default": false, + "title": "Is Superuser", + "type": "boolean" + }, + "is_verified": { + "default": false, + "title": "Is Verified", + "type": "boolean" + }, + "name": { + "default": "", + "title": "Name", + "type": "string" + } + }, + "required": [ + "id", + "email" + ], + "title": "UserRead", + "type": "object" + }, + "UserUpdate": { + "properties": { + "domains": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/Domain" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Domains" + }, + "email": { + "anyOf": [ + { + "format": "email", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Email" + }, + "is_active": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Is Active" + }, + "is_superuser": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Is Superuser" + }, + "is_verified": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Is Verified" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "password": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Password" + } + }, + "title": "UserUpdate", + "type": "object" + }, "ValidationError": { "properties": { "ctx": { @@ -1327,6 +2211,72 @@ ], "title": "Version", "type": "object" + }, + "login": { + "properties": { + "client_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Client Id" + }, + "client_secret": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "format": "password", + "title": "Client Secret" + }, + "grant_type": { + "anyOf": [ + { + "pattern": "^password$", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Grant Type" + }, + "password": { + "format": "password", + "title": "Password", + "type": "string" + }, + "scope": { + "default": "", + "title": "Scope", + "type": "string" + }, + "username": { + "title": "Username", + "type": "string" + } + }, + "required": [ + "username", + "password" + ], + "title": "Body_auth:cookie.login", + "type": "object" + } + }, + "securitySchemes": { + "APIKeyCookie": { + "in": "cookie", + "name": "isssteleon_session", + "type": "apiKey" } } }, @@ -1336,6 +2286,102 @@ }, "openapi": "3.1.0", "paths": { + "/auth/login": { + "post": { + "operationId": "auth:cookie.login", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/login" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "204": { + "description": "No Content" + }, + "400": { + "content": { + "application/json": { + "examples": { + "LOGIN_BAD_CREDENTIALS": { + "summary": "Bad credentials or the user is inactive.", + "value": { + "detail": "LOGIN_BAD_CREDENTIALS" + } + }, + "LOGIN_USER_NOT_VERIFIED": { + "summary": "The user is not verified.", + "value": { + "detail": "LOGIN_USER_NOT_VERIFIED" + } + } + }, + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Auth:Cookie.Login", + "tags": [ + "auth" + ] + } + }, + "/auth/logout": { + "post": { + "operationId": "auth:cookie.logout", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Missing token or inactive user." + } + }, + "security": [ + { + "APIKeyCookie": [] + } + ], + "summary": "Auth:Cookie.Logout", + "tags": [ + "auth" + ] + } + }, "/domains": { "get": { "operationId": "domains", @@ -1813,6 +2859,108 @@ ] } }, + "/ingest/sources/browse": { + "get": { + "description": "The server folders a source may read: the roots, or what one folder under them\nholds. Nothing outside the roots is shown.", + "operationId": "browse", + "parameters": [ + { + "in": "query", + "name": "path", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Path" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Browsed" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Browse", + "tags": [ + "ingest" + ] + } + }, + "/ingest/sources/oauth/{provider}/start": { + "get": { + "description": "The provider's sign-in address. `origin` is the web app's (where the user returns:\n`{origin}/api/\u2026/callback`, the address IT registered).", + "operationId": "oauth_start", + "parameters": [ + { + "in": "path", + "name": "provider", + "required": true, + "schema": { + "title": "Provider", + "type": "string" + } + }, + { + "in": "query", + "name": "origin", + "required": true, + "schema": { + "title": "Origin", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SignIn" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Oauth Start", + "tags": [ + "ingest" + ] + } + }, "/ingest/sources/preview": { "post": { "description": "The first rows a source node would load.", @@ -1920,9 +3068,87 @@ ] } }, + "/ingest/sources/test": { + "post": { + "description": "\"Probar conexi\u00f3n\": reaches the source with the answers given. A database lists its\ntables (until one is picked; then its first rows); files and records show their first\nrows. Never a server error: what went wrong comes back in plain words.", + "operationId": "test_source", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 20, + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Answers" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tested" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Test Source", + "tags": [ + "ingest" + ] + } + }, + "/ingest/sources/types": { + "get": { + "description": "Every kind of source the dialog offers, grouped, with the fields each one asks.", + "operationId": "source_types", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Catalog" + } + } + }, + "description": "Successful Response" + } + }, + "summary": "Source Types", + "tags": [ + "ingest" + ] + } + }, "/ingest/uploads": { "post": { - "description": "A CSV, Excel or document file for a `filesystem` source: use `bucket_url`.", + "description": "Files from the operator's computer (one, many, or a whole folder), kept on the\nserver for a `filesystem` source; streamed to disk, so large recordings fit. Send\n`folder` from a previous answer to add to the same set.", "operationId": "upload", "requestBody": { "content": { @@ -1939,11 +3165,7 @@ "content": { "application/json": { "schema": { - "additionalProperties": { - "type": "string" - }, - "title": "Response Upload", - "type": "object" + "$ref": "#/components/schemas/Uploaded" } } }, @@ -2583,7 +3805,7 @@ }, "/review/persons": { "get": { - "description": "Persons to settle (with their possible owners) and torn persons (with their\nrecords) left by a pipeline's link node.", + "description": "Persons to settle (with their possible owners), torn persons and persons nothing\nnames (with their records) left by a pipeline's link node.", "operationId": "persons", "parameters": [ { @@ -2898,6 +4120,376 @@ ] } }, + "/users/me": { + "get": { + "operationId": "users:current_user", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRead" + } + } + }, + "description": "Successful Response" + }, + "401": { + "description": "Missing token or inactive user." + } + }, + "security": [ + { + "APIKeyCookie": [] + } + ], + "summary": "Users:Current User", + "tags": [ + "users" + ] + }, + "patch": { + "operationId": "users:patch_current_user", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserUpdate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRead" + } + } + }, + "description": "Successful Response" + }, + "400": { + "content": { + "application/json": { + "examples": { + "UPDATE_USER_EMAIL_ALREADY_EXISTS": { + "summary": "A user with this email already exists.", + "value": { + "detail": "UPDATE_USER_EMAIL_ALREADY_EXISTS" + } + }, + "UPDATE_USER_INVALID_PASSWORD": { + "summary": "Password validation failed.", + "value": { + "detail": { + "code": "UPDATE_USER_INVALID_PASSWORD", + "reason": "Password should beat least 3 characters" + } + } + } + }, + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "description": "Missing token or inactive user." + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyCookie": [] + } + ], + "summary": "Users:Patch Current User", + "tags": [ + "users" + ] + } + }, + "/users/register": { + "post": { + "operationId": "register:register", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserCreate" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRead" + } + } + }, + "description": "Successful Response" + }, + "400": { + "content": { + "application/json": { + "examples": { + "REGISTER_INVALID_PASSWORD": { + "summary": "Password validation failed.", + "value": { + "detail": { + "code": "REGISTER_INVALID_PASSWORD", + "reason": "Password should beat least 3 characters" + } + } + }, + "REGISTER_USER_ALREADY_EXISTS": { + "summary": "A user with this email already exists.", + "value": { + "detail": "REGISTER_USER_ALREADY_EXISTS" + } + } + }, + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyCookie": [] + } + ], + "summary": "Register:Register", + "tags": [ + "users" + ] + } + }, + "/users/{id}": { + "delete": { + "operationId": "users:delete_user", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "title": "Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "401": { + "description": "Missing token or inactive user." + }, + "403": { + "description": "Not a superuser." + }, + "404": { + "description": "The user does not exist." + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyCookie": [] + } + ], + "summary": "Users:Delete User", + "tags": [ + "users" + ] + }, + "get": { + "operationId": "users:user", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "title": "Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRead" + } + } + }, + "description": "Successful Response" + }, + "401": { + "description": "Missing token or inactive user." + }, + "403": { + "description": "Not a superuser." + }, + "404": { + "description": "The user does not exist." + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyCookie": [] + } + ], + "summary": "Users:User", + "tags": [ + "users" + ] + }, + "patch": { + "operationId": "users:patch_user", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "title": "Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserUpdate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRead" + } + } + }, + "description": "Successful Response" + }, + "400": { + "content": { + "application/json": { + "examples": { + "UPDATE_USER_EMAIL_ALREADY_EXISTS": { + "summary": "A user with this email already exists.", + "value": { + "detail": "UPDATE_USER_EMAIL_ALREADY_EXISTS" + } + }, + "UPDATE_USER_INVALID_PASSWORD": { + "summary": "Password validation failed.", + "value": { + "detail": { + "code": "UPDATE_USER_INVALID_PASSWORD", + "reason": "Password should beat least 3 characters" + } + } + } + }, + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "description": "Missing token or inactive user." + }, + "403": { + "description": "Not a superuser." + }, + "404": { + "description": "The user does not exist." + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyCookie": [] + } + ], + "summary": "Users:Patch User", + "tags": [ + "users" + ] + } + }, "/{domain}/fhir": { "post": { "description": "A standard hospital's Bundle: checked as FHIR, kept as sent in the sender's inbox,\nand placed by the sender's pipeline (a run starts; follow it at the Location).", diff --git a/src/app/api/fn/auth/auth-cookie-login.ts b/src/app/api/fn/auth/auth-cookie-login.ts new file mode 100644 index 0000000..01a450b --- /dev/null +++ b/src/app/api/fn/auth/auth-cookie-login.ts @@ -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 { Login } from '../../models/login'; + +export interface AuthCookieLogin$Params { + body: Login +} + +export function authCookieLogin(http: HttpClient, rootUrl: string, params: AuthCookieLogin$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, authCookieLogin.PATH, 'post'); + if (params) { + rb.body(params.body, 'application/x-www-form-urlencoded'); + } + + 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; + }) + ); +} + +authCookieLogin.PATH = '/auth/login'; diff --git a/src/app/api/fn/auth/auth-cookie-logout.ts b/src/app/api/fn/auth/auth-cookie-logout.ts new file mode 100644 index 0000000..ff5ac75 --- /dev/null +++ b/src/app/api/fn/auth/auth-cookie-logout.ts @@ -0,0 +1,29 @@ +/* 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 AuthCookieLogout$Params { +} + +export function authCookieLogout(http: HttpClient, rootUrl: string, params?: AuthCookieLogout$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, authCookieLogout.PATH, 'post'); + 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; + }) + ); +} + +authCookieLogout.PATH = '/auth/logout'; diff --git a/src/app/api/fn/ingest/browse.ts b/src/app/api/fn/ingest/browse.ts new file mode 100644 index 0000000..ba99f04 --- /dev/null +++ b/src/app/api/fn/ingest/browse.ts @@ -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 { Browsed } from '../../models/browsed'; + +export interface Browse$Params { + path?: (string | null); +} + +export function browse(http: HttpClient, rootUrl: string, params?: Browse$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, browse.PATH, 'get'); + if (params) { + rb.query('path', params.path, {}); + } + + 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; + }) + ); +} + +browse.PATH = '/ingest/sources/browse'; diff --git a/src/app/api/fn/ingest/oauth-start.ts b/src/app/api/fn/ingest/oauth-start.ts new file mode 100644 index 0000000..0e61283 --- /dev/null +++ b/src/app/api/fn/ingest/oauth-start.ts @@ -0,0 +1,34 @@ +/* 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 { SignIn } from '../../models/sign-in'; + +export interface OauthStart$Params { + provider: string; + origin: string; +} + +export function oauthStart(http: HttpClient, rootUrl: string, params: OauthStart$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, oauthStart.PATH, 'get'); + if (params) { + rb.path('provider', params.provider, {}); + rb.query('origin', params.origin, {}); + } + + 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; + }) + ); +} + +oauthStart.PATH = '/ingest/sources/oauth/{provider}/start'; diff --git a/src/app/api/fn/ingest/source-types.ts b/src/app/api/fn/ingest/source-types.ts new file mode 100644 index 0000000..62b7206 --- /dev/null +++ b/src/app/api/fn/ingest/source-types.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 { Catalog } from '../../models/catalog'; + +export interface SourceTypes$Params { +} + +export function sourceTypes(http: HttpClient, rootUrl: string, params?: SourceTypes$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, sourceTypes.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; + }) + ); +} + +sourceTypes.PATH = '/ingest/sources/types'; diff --git a/src/app/api/fn/ingest/test-source.ts b/src/app/api/fn/ingest/test-source.ts new file mode 100644 index 0000000..3f2b67c --- /dev/null +++ b/src/app/api/fn/ingest/test-source.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'; + +import { Answers } from '../../models/answers'; +import { Tested } from '../../models/tested'; + +export interface TestSource$Params { + limit?: number; + body: Answers +} + +export function testSource(http: HttpClient, rootUrl: string, params: TestSource$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, testSource.PATH, 'post'); + if (params) { + rb.query('limit', params.limit, {}); + 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; + }) + ); +} + +testSource.PATH = '/ingest/sources/test'; diff --git a/src/app/api/fn/ingest/upload.ts b/src/app/api/fn/ingest/upload.ts index f5055fe..c35dc19 100644 --- a/src/app/api/fn/ingest/upload.ts +++ b/src/app/api/fn/ingest/upload.ts @@ -8,14 +8,13 @@ import { StrictHttpResponse } from '../../strict-http-response'; import { RequestBuilder } from '../../request-builder'; import { BodyUpload } from '../../models/body-upload'; +import { Uploaded } from '../../models/uploaded'; export interface Upload$Params { body: BodyUpload } -export function upload(http: HttpClient, rootUrl: string, params: Upload$Params, context?: HttpContext): Observable> { +export function upload(http: HttpClient, rootUrl: string, params: Upload$Params, context?: HttpContext): Observable> { const rb = new RequestBuilder(rootUrl, upload.PATH, 'post'); if (params) { rb.body(params.body, 'multipart/form-data'); @@ -26,9 +25,7 @@ export function upload(http: HttpClient, rootUrl: string, params: Upload$Params, ).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/fn/users/register-register.ts b/src/app/api/fn/users/register-register.ts new file mode 100644 index 0000000..7c1d739 --- /dev/null +++ b/src/app/api/fn/users/register-register.ts @@ -0,0 +1,33 @@ +/* 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 { UserCreate } from '../../models/user-create'; +import { UserRead } from '../../models/user-read'; + +export interface RegisterRegister$Params { + body: UserCreate +} + +export function registerRegister(http: HttpClient, rootUrl: string, params: RegisterRegister$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, registerRegister.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; + }) + ); +} + +registerRegister.PATH = '/users/register'; diff --git a/src/app/api/fn/users/users-current-user.ts b/src/app/api/fn/users/users-current-user.ts new file mode 100644 index 0000000..c208f35 --- /dev/null +++ b/src/app/api/fn/users/users-current-user.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 { UserRead } from '../../models/user-read'; + +export interface UsersCurrentUser$Params { +} + +export function usersCurrentUser(http: HttpClient, rootUrl: string, params?: UsersCurrentUser$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, usersCurrentUser.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; + }) + ); +} + +usersCurrentUser.PATH = '/users/me'; diff --git a/src/app/api/fn/users/users-delete-user.ts b/src/app/api/fn/users/users-delete-user.ts new file mode 100644 index 0000000..256549f --- /dev/null +++ b/src/app/api/fn/users/users-delete-user.ts @@ -0,0 +1,31 @@ +/* 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 UsersDeleteUser$Params { + id: string; +} + +export function usersDeleteUser(http: HttpClient, rootUrl: string, params: UsersDeleteUser$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, usersDeleteUser.PATH, 'delete'); + if (params) { + rb.path('id', params.id, {}); + } + + return http.request( + rb.build({ responseType: 'text', accept: '*/*', context }) + ).pipe( + filter((r: any): r is HttpResponse => r instanceof HttpResponse), + map((r: HttpResponse) => { + return (r as HttpResponse).clone({ body: undefined }) as StrictHttpResponse; + }) + ); +} + +usersDeleteUser.PATH = '/users/{id}'; diff --git a/src/app/api/fn/users/users-patch-current-user.ts b/src/app/api/fn/users/users-patch-current-user.ts new file mode 100644 index 0000000..5e611bf --- /dev/null +++ b/src/app/api/fn/users/users-patch-current-user.ts @@ -0,0 +1,33 @@ +/* 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 { UserRead } from '../../models/user-read'; +import { UserUpdate } from '../../models/user-update'; + +export interface UsersPatchCurrentUser$Params { + body: UserUpdate +} + +export function usersPatchCurrentUser(http: HttpClient, rootUrl: string, params: UsersPatchCurrentUser$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, usersPatchCurrentUser.PATH, 'patch'); + 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; + }) + ); +} + +usersPatchCurrentUser.PATH = '/users/me'; diff --git a/src/app/api/fn/users/users-patch-user.ts b/src/app/api/fn/users/users-patch-user.ts new file mode 100644 index 0000000..c1534d7 --- /dev/null +++ b/src/app/api/fn/users/users-patch-user.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'; + +import { UserRead } from '../../models/user-read'; +import { UserUpdate } from '../../models/user-update'; + +export interface UsersPatchUser$Params { + id: string; + body: UserUpdate +} + +export function usersPatchUser(http: HttpClient, rootUrl: string, params: UsersPatchUser$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, usersPatchUser.PATH, 'patch'); + if (params) { + rb.path('id', params.id, {}); + 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; + }) + ); +} + +usersPatchUser.PATH = '/users/{id}'; diff --git a/src/app/api/fn/users/users-user.ts b/src/app/api/fn/users/users-user.ts new file mode 100644 index 0000000..f58fe4e --- /dev/null +++ b/src/app/api/fn/users/users-user.ts @@ -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 { UserRead } from '../../models/user-read'; + +export interface UsersUser$Params { + id: string; +} + +export function usersUser(http: HttpClient, rootUrl: string, params: UsersUser$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, usersUser.PATH, 'get'); + if (params) { + rb.path('id', params.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; + }) + ); +} + +usersUser.PATH = '/users/{id}'; diff --git a/src/app/api/functions.ts b/src/app/api/functions.ts index 83cb499..2e4b639 100644 --- a/src/app/api/functions.ts +++ b/src/app/api/functions.ts @@ -1,6 +1,10 @@ /* eslint-disable */ /* Code generated by ng-openapi-gen DO NOT EDIT. */ +export type { AuthCookieLogin$Params as AuthCookieLogin$Params } from './fn/auth/auth-cookie-login'; +export { authCookieLogin as authCookieLogin } from './fn/auth/auth-cookie-login'; +export type { AuthCookieLogout$Params as AuthCookieLogout$Params } from './fn/auth/auth-cookie-logout'; +export { authCookieLogout as authCookieLogout } from './fn/auth/auth-cookie-logout'; 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'; @@ -23,10 +27,18 @@ export type { StartRun$Params as StartRun$Params } from './fn/ingest/start-run'; export { startRun as startRun } from './fn/ingest/start-run'; export type { Schema$Params as Schema$Params } from './fn/ingest/schema'; export { schema as schema } from './fn/ingest/schema'; +export type { Browse$Params as Browse$Params } from './fn/ingest/browse'; +export { browse as browse } from './fn/ingest/browse'; +export type { OauthStart$Params as OauthStart$Params } from './fn/ingest/oauth-start'; +export { oauthStart as oauthStart } from './fn/ingest/oauth-start'; export type { SourcePreview$Params as SourcePreview$Params } from './fn/ingest/source-preview'; export { sourcePreview as sourcePreview } from './fn/ingest/source-preview'; export type { SourceResources$Params as SourceResources$Params } from './fn/ingest/source-resources'; export { sourceResources as sourceResources } from './fn/ingest/source-resources'; +export type { TestSource$Params as TestSource$Params } from './fn/ingest/test-source'; +export { testSource as testSource } from './fn/ingest/test-source'; +export type { SourceTypes$Params as SourceTypes$Params } from './fn/ingest/source-types'; +export { sourceTypes as sourceTypes } from './fn/ingest/source-types'; export type { Upload$Params as Upload$Params } from './fn/ingest/upload'; export { upload as upload } from './fn/ingest/upload'; export type { Models$Params as Models$Params } from './fn/models/models'; @@ -67,6 +79,18 @@ export type { Studies$Params as Studies$Params } from './fn/eeg/studies'; export { studies as studies } from './fn/eeg/studies'; export type { Study$Params as Study$Params } from './fn/eeg/study'; export { study as study } from './fn/eeg/study'; +export type { UsersCurrentUser$Params as UsersCurrentUser$Params } from './fn/users/users-current-user'; +export { usersCurrentUser as usersCurrentUser } from './fn/users/users-current-user'; +export type { UsersPatchCurrentUser$Params as UsersPatchCurrentUser$Params } from './fn/users/users-patch-current-user'; +export { usersPatchCurrentUser as usersPatchCurrentUser } from './fn/users/users-patch-current-user'; +export type { RegisterRegister$Params as RegisterRegister$Params } from './fn/users/register-register'; +export { registerRegister as registerRegister } from './fn/users/register-register'; +export type { UsersUser$Params as UsersUser$Params } from './fn/users/users-user'; +export { usersUser as usersUser } from './fn/users/users-user'; +export type { UsersDeleteUser$Params as UsersDeleteUser$Params } from './fn/users/users-delete-user'; +export { usersDeleteUser as usersDeleteUser } from './fn/users/users-delete-user'; +export type { UsersPatchUser$Params as UsersPatchUser$Params } from './fn/users/users-patch-user'; +export { usersPatchUser as usersPatchUser } from './fn/users/users-patch-user'; export type { PostBundle$Params as PostBundle$Params } from './fn/fhir/post-bundle'; export { postBundle as postBundle } from './fn/fhir/post-bundle'; export type { SearchCondition$Params as SearchCondition$Params } from './fn/fhir/search-condition'; diff --git a/src/app/api/models.ts b/src/app/api/models.ts index 12a9984..0521c53 100644 --- a/src/app/api/models.ts +++ b/src/app/api/models.ts @@ -2,30 +2,49 @@ /* Code generated by ng-openapi-gen DO NOT EDIT. */ export type { Analysis } from './models/analysis'; +export type { Answers } from './models/answers'; export type { BodyAddClinicalValidation } from './models/body-add-clinical-validation'; export type { BodyUpload } from './models/body-upload'; +export type { Browsed } from './models/browsed'; +export type { Catalog } from './models/catalog'; export type { Condition } from './models/condition'; export type { Correction } from './models/correction'; export type { Domain } from './models/domain'; +export type { Entry } from './models/entry'; +export type { ErrorModel } from './models/error-model'; export type { Extract } from './models/extract'; export type { Fhir } from './models/fhir'; +export type { FieldSpec } from './models/field-spec'; +export type { Group } from './models/group'; +export type { Guided } from './models/guided'; export type { HttpValidationError } from './models/http-validation-error'; export type { Join } from './models/join'; export type { Link } from './models/link'; +export type { Listing } from './models/listing'; +export type { Login } from './models/login'; export type { Map } from './models/map'; export type { Metric } from './models/metric'; +export type { Option } from './models/option'; export type { PersonDecision } from './models/person-decision'; export type { Pipeline } from './models/pipeline'; export type { Position } from './models/position'; +export type { Provider } from './models/provider'; export type { Read } from './models/read'; export type { Rejection } from './models/rejection'; export type { Route } from './models/route'; export type { RunRequest } from './models/run-request'; export type { SavedPipeline } from './models/saved-pipeline'; +export type { SignIn } from './models/sign-in'; export type { Source } from './models/source'; export type { SourceRef } from './models/source-ref'; +export type { SourceType } from './models/source-type'; export type { Study } from './models/study'; export type { Target } from './models/target'; +export type { Tested } from './models/tested'; export type { Training } from './models/training'; +export type { Uploaded } from './models/uploaded'; +export type { UserCreate } from './models/user-create'; +export type { UserRead } from './models/user-read'; +export type { UserUpdate } from './models/user-update'; export type { ValidationError } from './models/validation-error'; export type { Version } from './models/version'; diff --git a/src/app/api/models/answers.ts b/src/app/api/models/answers.ts new file mode 100644 index 0000000..45da8fa --- /dev/null +++ b/src/app/api/models/answers.ts @@ -0,0 +1,11 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +export interface Answers { + answers?: { +[key: string]: any; +}; + node?: (string | null); + pipeline?: (string | null); + type: string; +} diff --git a/src/app/api/models/body-upload.ts b/src/app/api/models/body-upload.ts index 0600f02..28c29b7 100644 --- a/src/app/api/models/body-upload.ts +++ b/src/app/api/models/body-upload.ts @@ -2,5 +2,6 @@ /* Code generated by ng-openapi-gen DO NOT EDIT. */ export interface BodyUpload { - file: string; + files: Array; + folder?: (string | null); } diff --git a/src/app/api/models/browsed.ts b/src/app/api/models/browsed.ts new file mode 100644 index 0000000..7a18d7e --- /dev/null +++ b/src/app/api/models/browsed.ts @@ -0,0 +1,9 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +import { Entry } from '../models/entry'; +export interface Browsed { + entries: Array; + parent: (string | null); + path: (string | null); +} diff --git a/src/app/api/models/catalog.ts b/src/app/api/models/catalog.ts new file mode 100644 index 0000000..f377243 --- /dev/null +++ b/src/app/api/models/catalog.ts @@ -0,0 +1,19 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +import { Group } from '../models/group'; +import { Option } from '../models/option'; +import { Provider } from '../models/provider'; +import { SourceType } from '../models/source-type'; +export interface Catalog { + formats: Array