C1a: code only, no comments, no Markdown
Remove 125 JavaScript, TypeScript, and stylesheet comments and nine configuration comments. The submodule had zero tracked Markdown files. Remove the Markdown-only EditorConfig section. Keep the generated client headers and tool directives. Delete other comments in place without regenerating the client or changing OpenAPI data.
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
# Editor configuration, see https://editorconfig.org
|
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
@@ -11,7 +10,3 @@ trim_trailing_whitespace = true
|
|||||||
[*.ts]
|
[*.ts]
|
||||||
quote_type = single
|
quote_type = single
|
||||||
ij_typescript_use_double_quotes = false
|
ij_typescript_use_double_quotes = false
|
||||||
|
|
||||||
[*.md]
|
|
||||||
max_line_length = off
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|||||||
@@ -1,17 +1,12 @@
|
|||||||
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
|
|
||||||
|
|
||||||
# Compiled output
|
|
||||||
/dist
|
/dist
|
||||||
/tmp
|
/tmp
|
||||||
/out-tsc
|
/out-tsc
|
||||||
/bazel-out
|
/bazel-out
|
||||||
|
|
||||||
# Node
|
|
||||||
/node_modules
|
/node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
|
||||||
# IDEs and editors
|
|
||||||
.idea/
|
.idea/
|
||||||
.project
|
.project
|
||||||
.classpath
|
.classpath
|
||||||
@@ -20,7 +15,6 @@ yarn-error.log
|
|||||||
.settings/
|
.settings/
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
|
|
||||||
# Visual Studio Code
|
|
||||||
.vscode/*
|
.vscode/*
|
||||||
!.vscode/settings.json
|
!.vscode/settings.json
|
||||||
!.vscode/tasks.json
|
!.vscode/tasks.json
|
||||||
@@ -29,7 +23,6 @@ yarn-error.log
|
|||||||
!.vscode/mcp.json
|
!.vscode/mcp.json
|
||||||
.history/*
|
.history/*
|
||||||
|
|
||||||
# Miscellaneous
|
|
||||||
/.angular/cache
|
/.angular/cache
|
||||||
.sass-cache/
|
.sass-cache/
|
||||||
/connect.lock
|
/connect.lock
|
||||||
@@ -39,10 +32,8 @@ testem.log
|
|||||||
/typings
|
/typings
|
||||||
__screenshots__/
|
__screenshots__/
|
||||||
|
|
||||||
# System files
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
# Playwright
|
|
||||||
/test-results/
|
/test-results/
|
||||||
/playwright-report/
|
/playwright-report/
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
// This file was generated by running 'ng generate @angular/material:theme-color'.
|
|
||||||
// Proceed with caution if making changes to this file.
|
|
||||||
|
|
||||||
@use 'sass:map';
|
@use 'sass:map';
|
||||||
@use '@angular/material' as mat;
|
@use '@angular/material' as mat;
|
||||||
|
|
||||||
// Note: Color palettes are generated from primary: #a8c243, tertiary: #5f9ea0
|
|
||||||
$_palettes: (
|
$_palettes: (
|
||||||
primary: (
|
primary: (
|
||||||
0: #000000,
|
0: #000000,
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the ApiConfiguration configuration object with a given root URL.
|
|
||||||
*/
|
|
||||||
export function provideApiConfiguration(rootUrl: string) {
|
export function provideApiConfiguration(rootUrl: string) {
|
||||||
var config = new ApiConfiguration();
|
var config = new ApiConfiguration();
|
||||||
config.rootUrl = rootUrl;
|
config.rootUrl = rootUrl;
|
||||||
@@ -15,9 +12,6 @@ export function provideApiConfiguration(rootUrl: string) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Global configuration
|
|
||||||
*/
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ import { StrictHttpResponse } from './strict-http-response';
|
|||||||
export type ApiFnOptional<P, R> = (http: HttpClient, rootUrl: string, params?: P, context?: HttpContext) => Observable<StrictHttpResponse<R>>;
|
export type ApiFnOptional<P, R> = (http: HttpClient, rootUrl: string, params?: P, context?: HttpContext) => Observable<StrictHttpResponse<R>>;
|
||||||
export type ApiFnRequired<P, R> = (http: HttpClient, rootUrl: string, params: P, context?: HttpContext) => Observable<StrictHttpResponse<R>>;
|
export type ApiFnRequired<P, R> = (http: HttpClient, rootUrl: string, params: P, context?: HttpContext) => Observable<StrictHttpResponse<R>>;
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper service to call API functions directly
|
|
||||||
*/
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class Api {
|
export class Api {
|
||||||
constructor(
|
constructor(
|
||||||
@@ -24,24 +21,14 @@ export class Api {
|
|||||||
|
|
||||||
private _rootUrl?: string;
|
private _rootUrl?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the root url for API operations. If not set directly here,
|
|
||||||
* will fallback to `ApiConfiguration.rootUrl`.
|
|
||||||
*/
|
|
||||||
get rootUrl(): string {
|
get rootUrl(): string {
|
||||||
return this._rootUrl || this.config.rootUrl;
|
return this._rootUrl || this.config.rootUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the root URL for API operations
|
|
||||||
*/
|
|
||||||
set rootUrl(rootUrl: string) {
|
set rootUrl(rootUrl: string) {
|
||||||
this._rootUrl = rootUrl;
|
this._rootUrl = rootUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Executes an API call, returning the response body only
|
|
||||||
*/
|
|
||||||
invoke<P, R>(fn: ApiFnRequired<P, R>, params: P, context?: HttpContext): Promise<R>;
|
invoke<P, R>(fn: ApiFnRequired<P, R>, params: P, context?: HttpContext): Promise<R>;
|
||||||
invoke<P, R>(fn: ApiFnOptional<P, R>, params?: P, context?: HttpContext): Promise<R>;
|
invoke<P, R>(fn: ApiFnOptional<P, R>, params?: P, context?: HttpContext): Promise<R>;
|
||||||
async invoke<P, R>(fn: ApiFnRequired<P, R> | ApiFnOptional<P, R>, params: P, context?: HttpContext): Promise<R> {
|
async invoke<P, R>(fn: ApiFnRequired<P, R> | ApiFnOptional<P, R>, params: P, context?: HttpContext): Promise<R> {
|
||||||
@@ -49,9 +36,6 @@ export class Api {
|
|||||||
return (await resp).body;
|
return (await resp).body;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Executes an API call, returning the entire response
|
|
||||||
*/
|
|
||||||
invoke$Response<P, R>(fn: ApiFnRequired<P, R>, params: P, context?: HttpContext): Promise<StrictHttpResponse<R>>;
|
invoke$Response<P, R>(fn: ApiFnRequired<P, R>, params: P, context?: HttpContext): Promise<StrictHttpResponse<R>>;
|
||||||
invoke$Response<P, R>(fn: ApiFnOptional<P, R>, params?: P, context?: HttpContext): Promise<StrictHttpResponse<R>>;
|
invoke$Response<P, R>(fn: ApiFnOptional<P, R>, params?: P, context?: HttpContext): Promise<StrictHttpResponse<R>>;
|
||||||
invoke$Response<P, R>(fn: ApiFnRequired<P, R> | ApiFnOptional<P, R>, params: P, context?: HttpContext): Promise<StrictHttpResponse<R>> {
|
invoke$Response<P, R>(fn: ApiFnRequired<P, R> | ApiFnOptional<P, R>, params: P, context?: HttpContext): Promise<StrictHttpResponse<R>> {
|
||||||
|
|||||||
@@ -12,19 +12,10 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface EegSummary$Params {
|
export interface EegSummary$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* months: the domain's follow-up list over that window up to the cut-off
|
|
||||||
*/
|
|
||||||
'follow-up-window'?: (number | null);
|
'follow-up-window'?: (number | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* explicit window start that overrides follow-up-window
|
|
||||||
*/
|
|
||||||
'follow-up-start'?: (string | null);
|
'follow-up-start'?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* default: the last day with data
|
|
||||||
*/
|
|
||||||
'follow-up-cutoff'?: (string | null);
|
'follow-up-cutoff'?: (string | null);
|
||||||
'follow-up-status'?: (string | null);
|
'follow-up-status'?: (string | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface PostBundle$Params {
|
export interface PostBundle$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* the sender's pipeline (its fhir nodes read this inbox)
|
|
||||||
*/
|
|
||||||
sender: string;
|
sender: string;
|
||||||
body: {
|
body: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchCondition$Params {
|
export interface SearchCondition$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchDiagnosticReport$Params {
|
export interface SearchDiagnosticReport$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchEncounter$Params {
|
export interface SearchEncounter$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -12,24 +12,12 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchMeasureReport$Params {
|
export interface SearchMeasureReport$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* the Measure's id or canonical URL
|
|
||||||
*/
|
|
||||||
measure: string;
|
measure: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* semesters (2025-S1) or months (2025-03), comma-separated
|
|
||||||
*/
|
|
||||||
'reporting-period': string;
|
'reporting-period': string;
|
||||||
|
|
||||||
/**
|
|
||||||
* count only what was known by then
|
|
||||||
*/
|
|
||||||
'as-of'?: (string | null);
|
'as-of'?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* durations count to this day
|
|
||||||
*/
|
|
||||||
'event-cutoff'?: (string | null);
|
'event-cutoff'?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchObservation$Params {
|
export interface SearchObservation$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -13,50 +13,23 @@ export interface SearchPatient$Params {
|
|||||||
domain: Domain;
|
domain: Domain;
|
||||||
'_id'?: (string | null);
|
'_id'?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* months: the domain's follow-up list over that window up to the cut-off
|
|
||||||
*/
|
|
||||||
'follow-up-window'?: (number | null);
|
'follow-up-window'?: (number | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* explicit window start that overrides follow-up-window
|
|
||||||
*/
|
|
||||||
'follow-up-start'?: (string | null);
|
'follow-up-start'?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* default: the last day with data
|
|
||||||
*/
|
|
||||||
'follow-up-cutoff'?: (string | null);
|
'follow-up-cutoff'?: (string | null);
|
||||||
'follow-up-status'?: (string | null);
|
'follow-up-status'?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* each word starts a word of her name (case and accents ignored)
|
|
||||||
*/
|
|
||||||
name?: (string | null);
|
name?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* [system|]value: a CURP or record number (case ignored)
|
|
||||||
*/
|
|
||||||
identifier?: (string | null);
|
identifier?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* -recent or -risk-<outcome>
|
|
||||||
*/
|
|
||||||
'_sort'?: string;
|
'_sort'?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* years
|
|
||||||
*/
|
|
||||||
'risk-horizon'?: (number | null);
|
'risk-horizon'?: (number | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* any of ('DiagnosticReport:subject', 'RiskAssessment:subject', 'Observation:subject')
|
|
||||||
*/
|
|
||||||
'_revinclude'?: Array<string>;
|
'_revinclude'?: Array<string>;
|
||||||
|
|
||||||
/**
|
|
||||||
* DiagnosticReport:result
|
|
||||||
*/
|
|
||||||
'_include:iterate'?: Array<string>;
|
'_include:iterate'?: Array<string>;
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchProcedure$Params {
|
export interface SearchProcedure$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchRiskAssessment$Params {
|
export interface SearchRiskAssessment$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -3,14 +3,8 @@
|
|||||||
|
|
||||||
export interface Condition {
|
export interface Condition {
|
||||||
|
|
||||||
/**
|
|
||||||
* Por ejemplo «text», el texto leído del documento.
|
|
||||||
*/
|
|
||||||
column: string;
|
column: string;
|
||||||
op: 'equals' | 'contains' | 'matches' | 'present';
|
op: 'equals' | 'contains' | 'matches' | 'present';
|
||||||
|
|
||||||
/**
|
|
||||||
* Lo que se busca; por ejemplo «citología».
|
|
||||||
*/
|
|
||||||
value?: string;
|
value?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* One field of one record as a reviewer read it in the source document: an identity
|
|
||||||
* field (a mistyped record number) or a study's (a stage the scan made unreadable).
|
|
||||||
*/
|
|
||||||
export interface Correction {
|
export interface Correction {
|
||||||
entity?: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
entity?: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
||||||
field: string;
|
field: string;
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
|
|
||||||
import { Domain } from './domain';
|
import { Domain } from './domain';
|
||||||
|
|
||||||
/**
|
|
||||||
* Each possible value of `Domain`
|
|
||||||
*/
|
|
||||||
export const DOMAIN: Domain[] = [
|
export const DOMAIN: Domain[] = [
|
||||||
'cacu',
|
'cacu',
|
||||||
'cama',
|
'cama',
|
||||||
|
|||||||
@@ -3,30 +3,12 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* EDF files (a column of file hashes) to the facts their header holds: patient code, sex,
|
|
||||||
* birth date, recording date, record code, duration and channel count, as `edf_*` columns.
|
|
||||||
* An unreadable file keeps its row with `edf_error` set.
|
|
||||||
*
|
|
||||||
* Use a filesystem source (`dlt.sources.filesystem:filesystem`) with the uploads folder as
|
|
||||||
* `bucket_url`, `file_glob: "*.edf"`, and `then: "persistance.readers:read_bytes"`. Read its
|
|
||||||
* `content` column with this node. Map `edf_patient_code`, `edf_birth_date`, and `edf_sex` to
|
|
||||||
* identity's `record_number`, `birth_date`, and `sex`, using the site's formats and ConceptMap.
|
|
||||||
*
|
|
||||||
* The patient code must match the hospital's record number including its prefix. Feed the
|
|
||||||
* identity map into the pipeline's link node alongside the hospital identity source. Map
|
|
||||||
* `edf_study_date` to `study_date` (format `%Y-%m-%d`), `edf_record_code` to `lab_record_id`,
|
|
||||||
* and `content` to `edf`, then feed that map and the link into a target with entity `eeg`.
|
|
||||||
*/
|
|
||||||
export interface Edf {
|
export interface Edf {
|
||||||
column: string;
|
column: string;
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'edf';
|
kind?: 'edf';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* 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 {
|
export interface Execution {
|
||||||
mode?: ('sync' | 'local' | 'remote' | null);
|
mode?: ('sync' | 'local' | 'remote' | null);
|
||||||
scheduler?: (string | null);
|
scheduler?: (string | null);
|
||||||
|
|||||||
@@ -3,50 +3,27 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Platform fields read from text, each kept with the text it was read from.
|
|
||||||
*
|
|
||||||
* `auto` asks the LLM when one is configured and answering, else applies `patterns`;
|
|
||||||
* with neither, the row is held. Patterns are regexes with one group, per field (the
|
|
||||||
* LLM can propose them from sample documents); their values go through the ConceptMap
|
|
||||||
* and `formats` as in `map`.
|
|
||||||
*/
|
|
||||||
export interface Extract {
|
export interface Extract {
|
||||||
column: (string | Array<string>);
|
column: (string | Array<string>);
|
||||||
|
|
||||||
/**
|
|
||||||
* Dato → columna, sin leer el texto.
|
|
||||||
*/
|
|
||||||
columns?: {
|
columns?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
concept_map?: (string | null);
|
concept_map?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Qué estudio se saca del documento.
|
|
||||||
*/
|
|
||||||
entity: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
entity: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
||||||
formats?: {
|
formats?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Para el modelo de lenguaje.
|
|
||||||
*/
|
|
||||||
hints?: string;
|
hints?: string;
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'extract';
|
kind?: 'extract';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
method?: 'auto' | 'llm' | 'patterns';
|
method?: 'auto' | 'llm' | 'patterns';
|
||||||
|
|
||||||
/**
|
|
||||||
* Dato → expresión con un grupo ( ).
|
|
||||||
*/
|
|
||||||
patterns?: {
|
patterns?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* FHIR R4 Bundles a standard hospital sent (a column of their JSON) as rows of one
|
|
||||||
* entity: identity, death or a study (core.fhir_in). The sender's own codes go through
|
|
||||||
* its ConceptMap.
|
|
||||||
*/
|
|
||||||
export interface Fhir {
|
export interface Fhir {
|
||||||
column?: string;
|
column?: string;
|
||||||
concept_map?: (string | null);
|
concept_map?: (string | null);
|
||||||
@@ -16,9 +11,6 @@ export interface Fhir {
|
|||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'fhir';
|
kind?: 'fhir';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
|
|
||||||
export interface FolderTrainingSource {
|
export interface FolderTrainingSource {
|
||||||
|
|
||||||
/**
|
|
||||||
* Carpeta dentro de TEA_REFERENCE_ROOT
|
|
||||||
*/
|
|
||||||
folder: string;
|
folder: string;
|
||||||
kind: 'folder';
|
kind: 'folder';
|
||||||
line_hz?: 50 | 60;
|
line_hz?: 50 | 60;
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* How the Conectar dialog drew a source: its type (core.sources) and the answers given.
|
|
||||||
* The node's dlt fields are made from them; drawn by hand ("Avanzado"), a node has none.
|
|
||||||
*/
|
|
||||||
export interface Guided {
|
export interface Guided {
|
||||||
answers?: {
|
answers?: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
|
|||||||
@@ -3,23 +3,14 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Two inputs side by side where their columns match.
|
|
||||||
*/
|
|
||||||
export interface Join {
|
export interface Join {
|
||||||
how?: 'inner' | 'left';
|
how?: 'inner' | 'left';
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'join';
|
kind?: 'join';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Columna de la primera entrada = columna de la segunda.
|
|
||||||
*/
|
|
||||||
on: Array<[string, string]>;
|
on: Array<[string, string]>;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,33 +3,16 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Identity rows from every input, grouped into persons (Splink).
|
|
||||||
*
|
|
||||||
* Two records are the same person when any rule holds (Splink's SQL rule syntax, `l.`
|
|
||||||
* and `r.` for the two records); persons are the connected groups. A person whose
|
|
||||||
* records disagree on birth date or sex is held for review as a whole. Pairs Splink
|
|
||||||
* scores above `review` that ended up apart are queued as possible matches.
|
|
||||||
*/
|
|
||||||
export interface Link {
|
export interface Link {
|
||||||
fields?: Array<string>;
|
fields?: Array<string>;
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'link';
|
kind?: 'link';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Parecidos por encima de esto los ve un revisor.
|
|
||||||
*/
|
|
||||||
review?: number;
|
review?: number;
|
||||||
|
|
||||||
/**
|
|
||||||
* Vacío: las de siempre (mismo identificador, o misma fecha de nacimiento y nombre).
|
|
||||||
*/
|
|
||||||
rules?: Array<string>;
|
rules?: Array<string>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* What "Probar conexión" shows: a database's tables (the resources of `source`, built
|
|
||||||
* from `args`), or the first rows the type's own node reads (files, records).
|
|
||||||
*/
|
|
||||||
export interface Listing {
|
export interface Listing {
|
||||||
args?: {
|
args?: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
|
|||||||
@@ -3,27 +3,14 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Columns to platform fields, the site's codes translated by its ConceptMap
|
|
||||||
* (core.concept_map), and its date formats.
|
|
||||||
*/
|
|
||||||
export interface Map {
|
export interface Map {
|
||||||
|
|
||||||
/**
|
|
||||||
* La tabla de códigos del sitio.
|
|
||||||
*/
|
|
||||||
concept_map?: (string | null);
|
concept_map?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Dato de la plataforma → columna del sitio.
|
|
||||||
*/
|
|
||||||
fields: {
|
fields: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Por ejemplo %d/%m/%Y.
|
|
||||||
*/
|
|
||||||
formats?: {
|
formats?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
@@ -31,15 +18,9 @@ export interface Map {
|
|||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'map';
|
kind?: 'map';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Un dato igual para todas las filas.
|
|
||||||
*/
|
|
||||||
values?: {
|
values?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
import { Tasks } from '../models/tasks';
|
import { Tasks } from '../models/tasks';
|
||||||
import { Worker } from '../models/worker';
|
import { Worker } from '../models/worker';
|
||||||
|
|
||||||
/**
|
|
||||||
* The run tag's JSON; the API returns it as it is.
|
|
||||||
*/
|
|
||||||
export interface Progress {
|
export interface Progress {
|
||||||
done: number;
|
done: number;
|
||||||
elapsed_s: number;
|
elapsed_s: number;
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A sign-in button's OAuth 2.0 provider (authorization code flow).
|
|
||||||
*/
|
|
||||||
export interface Provider {
|
export interface Provider {
|
||||||
authorize_params?: {
|
authorize_params?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
|
|||||||
@@ -3,22 +3,13 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Files in a column (PDF, Word, Excel, scans...) to text (MarkItDown, OCRmyPDF).
|
|
||||||
*/
|
|
||||||
export interface Read {
|
export interface Read {
|
||||||
|
|
||||||
/**
|
|
||||||
* Donde la entrada trae cada documento.
|
|
||||||
*/
|
|
||||||
column: string;
|
column: string;
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'read';
|
kind?: 'read';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,24 +4,13 @@
|
|||||||
import { Condition } from '../models/condition';
|
import { Condition } from '../models/condition';
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Only the rows where every condition holds (e.g. reports titled "Citología"). An
|
|
||||||
* `otherwise` route takes the rows of its input that none of the other routes on that
|
|
||||||
* input take (documents nobody recognises, for a reviewer), then its own conditions.
|
|
||||||
*/
|
|
||||||
export interface Route {
|
export interface Route {
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'route';
|
kind?: 'route';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Recoge lo que nadie reconoce, para revisarlo.
|
|
||||||
*/
|
|
||||||
otherwise?: boolean;
|
otherwise?: boolean;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
when?: Array<Condition>;
|
when?: Array<Condition>;
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* 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 {
|
export interface Scope {
|
||||||
ids?: Array<string>;
|
ids?: Array<string>;
|
||||||
mode?: 'pending' | 'first_n' | 'ids';
|
mode?: 'pending' | 'first_n' | 'ids';
|
||||||
|
|||||||
@@ -4,15 +4,8 @@
|
|||||||
import { Guided } from '../models/guided';
|
import { Guided } from '../models/guided';
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* One table, file set or API resource, copied as it is (dlt). Merged on the source's
|
|
||||||
* own primary key or `primary_key`; replaced whole when it has none.
|
|
||||||
*/
|
|
||||||
export interface Source {
|
export interface Source {
|
||||||
|
|
||||||
/**
|
|
||||||
* Los de la fuente dlt.
|
|
||||||
*/
|
|
||||||
args?: {
|
args?: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
};
|
};
|
||||||
@@ -21,29 +14,14 @@ export interface Source {
|
|||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'source';
|
kind?: 'source';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Columnas que identifican una fila.
|
|
||||||
*/
|
|
||||||
primary_key?: Array<string>;
|
primary_key?: Array<string>;
|
||||||
|
|
||||||
/**
|
|
||||||
* Cuál, si la fuente ofrece varios (una tabla).
|
|
||||||
*/
|
|
||||||
resource?: (string | null);
|
resource?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Módulo:función de la fuente dlt.
|
|
||||||
*/
|
|
||||||
source: string;
|
source: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Transformador dlt para los archivos.
|
|
||||||
*/
|
|
||||||
then?: (string | null);
|
then?: (string | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,23 +3,13 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Rows of platform fields into one platform entity, each row given its person by the
|
|
||||||
* one `link` node among the inputs. Rule breaks are held for review.
|
|
||||||
*/
|
|
||||||
export interface Target {
|
export interface Target {
|
||||||
|
|
||||||
/**
|
|
||||||
* En qué estudio de la plataforma se guarda.
|
|
||||||
*/
|
|
||||||
entity: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
entity: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'target';
|
kind?: 'target';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ import { Execution } from '../models/execution';
|
|||||||
import { TrainingSource } from '../models/training-source';
|
import { TrainingSource } from '../models/training-source';
|
||||||
export interface Training {
|
export interface Training {
|
||||||
|
|
||||||
/**
|
|
||||||
* Fecha de corte de los datos (por omisión, hoy)
|
|
||||||
*/
|
|
||||||
as_of?: (string | null);
|
as_of?: (string | null);
|
||||||
execution?: (Execution | null);
|
execution?: (Execution | null);
|
||||||
models?: Array<string>;
|
models?: Array<string>;
|
||||||
|
|||||||
@@ -3,10 +3,6 @@
|
|||||||
|
|
||||||
import { HttpRequest, HttpParameterCodec, HttpParams, HttpHeaders, HttpContext } from '@angular/common/http';
|
import { HttpRequest, HttpParameterCodec, HttpParams, HttpHeaders, HttpContext } from '@angular/common/http';
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom parameter codec to correctly handle the plus sign in parameter
|
|
||||||
* values. See https://github.com/angular/angular/issues/18261
|
|
||||||
*/
|
|
||||||
class ParameterCodec implements HttpParameterCodec {
|
class ParameterCodec implements HttpParameterCodec {
|
||||||
encodeKey(key: string): string {
|
encodeKey(key: string): string {
|
||||||
return encodeURIComponent(key);
|
return encodeURIComponent(key);
|
||||||
@@ -26,17 +22,11 @@ class ParameterCodec implements HttpParameterCodec {
|
|||||||
}
|
}
|
||||||
const ParameterCodecInstance = new ParameterCodec();
|
const ParameterCodecInstance = new ParameterCodec();
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines the options for appending a parameter
|
|
||||||
*/
|
|
||||||
interface ParameterOptions {
|
interface ParameterOptions {
|
||||||
style?: string;
|
style?: string;
|
||||||
explode?: boolean;
|
explode?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Base class for a parameter
|
|
||||||
*/
|
|
||||||
abstract class Parameter {
|
abstract class Parameter {
|
||||||
constructor(public name: string, public value: any, public options: ParameterOptions, defaultStyle: string, defaultExplode: boolean) {
|
constructor(public name: string, public value: any, public options: ParameterOptions, defaultStyle: string, defaultExplode: boolean) {
|
||||||
this.options = options || {};
|
this.options = options || {};
|
||||||
@@ -74,9 +64,6 @@ abstract class Parameter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A parameter in the operation path
|
|
||||||
*/
|
|
||||||
class PathParameter extends Parameter {
|
class PathParameter extends Parameter {
|
||||||
constructor(name: string, value: any, options: ParameterOptions) {
|
constructor(name: string, value: any, options: ParameterOptions) {
|
||||||
super(name, value, options, 'simple', false);
|
super(name, value, options, 'simple', false);
|
||||||
@@ -91,24 +78,20 @@ class PathParameter extends Parameter {
|
|||||||
let separator = this.options.explode ? prefix === '' ? ',' : prefix : ',';
|
let separator = this.options.explode ? prefix === '' ? ',' : prefix : ',';
|
||||||
let alreadySerialized = false;
|
let alreadySerialized = false;
|
||||||
if (this.options.style === 'matrix') {
|
if (this.options.style === 'matrix') {
|
||||||
// The parameter name is just used as prefix, except in some cases...
|
|
||||||
prefix = `;${this.name}=`;
|
prefix = `;${this.name}=`;
|
||||||
if (this.options.explode && typeof value === 'object') {
|
if (this.options.explode && typeof value === 'object') {
|
||||||
prefix = ';';
|
prefix = ';';
|
||||||
if (value instanceof Array) {
|
if (value instanceof Array) {
|
||||||
// For arrays we have to repeat the name for each element
|
|
||||||
value = value.map(v => `${this.name}=${this.serializeValue(v, ';')}`);
|
value = value.map(v => `${this.name}=${this.serializeValue(v, ';')}`);
|
||||||
value = value.join(';');
|
value = value.join(';');
|
||||||
alreadySerialized = true;
|
alreadySerialized = true;
|
||||||
} else {
|
} else {
|
||||||
// For objects we have to put each the key / value pairs
|
|
||||||
value = this.serializeValue(value, ';');
|
value = this.serializeValue(value, ';');
|
||||||
alreadySerialized = true
|
alreadySerialized = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
value = prefix + (alreadySerialized ? value : this.serializeValue(value, separator));
|
value = prefix + (alreadySerialized ? value : this.serializeValue(value, separator));
|
||||||
// Replace both the plain variable and the corresponding variant taking in the prefix and explode into account
|
|
||||||
path = path.replace(`{${this.name}}`, value);
|
path = path.replace(`{${this.name}}`, value);
|
||||||
path = path.replace(`{${prefix}${this.name}${this.options.explode ? '*' : ''}}`, value);
|
path = path.replace(`{${prefix}${this.name}${this.options.explode ? '*' : ''}}`, value);
|
||||||
return path;
|
return path;
|
||||||
@@ -124,9 +107,6 @@ class PathParameter extends Parameter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A parameter in the query
|
|
||||||
*/
|
|
||||||
class QueryParameter extends Parameter {
|
class QueryParameter extends Parameter {
|
||||||
constructor(name: string, value: any, options: ParameterOptions) {
|
constructor(name: string, value: any, options: ParameterOptions) {
|
||||||
super(name, value, options, 'form', true);
|
super(name, value, options, 'form', true);
|
||||||
@@ -134,7 +114,6 @@ class QueryParameter extends Parameter {
|
|||||||
|
|
||||||
append(params: HttpParams): HttpParams {
|
append(params: HttpParams): HttpParams {
|
||||||
if (this.value instanceof Array) {
|
if (this.value instanceof Array) {
|
||||||
// Array serialization
|
|
||||||
if (this.options.explode) {
|
if (this.options.explode) {
|
||||||
for (const v of this.value) {
|
for (const v of this.value) {
|
||||||
params = params.append(this.name, this.serializeValue(v));
|
params = params.append(this.name, this.serializeValue(v));
|
||||||
@@ -146,9 +125,7 @@ class QueryParameter extends Parameter {
|
|||||||
return params.append(this.name, this.serializeValue(this.value, separator));
|
return params.append(this.name, this.serializeValue(this.value, separator));
|
||||||
}
|
}
|
||||||
} else if (this.value !== null && typeof this.value === 'object') {
|
} else if (this.value !== null && typeof this.value === 'object') {
|
||||||
// Object serialization
|
|
||||||
if (this.options.style === 'deepObject') {
|
if (this.options.style === 'deepObject') {
|
||||||
// Append a parameter for each key, in the form `name[key]`
|
|
||||||
for (const key of Object.keys(this.value)) {
|
for (const key of Object.keys(this.value)) {
|
||||||
const propVal = this.value[key];
|
const propVal = this.value[key];
|
||||||
if (propVal !== null && propVal !== undefined) {
|
if (propVal !== null && propVal !== undefined) {
|
||||||
@@ -156,7 +133,6 @@ class QueryParameter extends Parameter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (this.options.explode) {
|
} else if (this.options.explode) {
|
||||||
// Append a parameter for each key without using the parameter name
|
|
||||||
for (const key of Object.keys(this.value)) {
|
for (const key of Object.keys(this.value)) {
|
||||||
const propVal = this.value[key];
|
const propVal = this.value[key];
|
||||||
if (propVal !== null && propVal !== undefined) {
|
if (propVal !== null && propVal !== undefined) {
|
||||||
@@ -164,7 +140,6 @@ class QueryParameter extends Parameter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Append a single parameter whose values are a comma-separated list of key,value,key,value...
|
|
||||||
const array: any[] = [];
|
const array: any[] = [];
|
||||||
for (const key of Object.keys(this.value)) {
|
for (const key of Object.keys(this.value)) {
|
||||||
const propVal = this.value[key];
|
const propVal = this.value[key];
|
||||||
@@ -176,16 +151,12 @@ class QueryParameter extends Parameter {
|
|||||||
params = params.append(this.name, this.serializeValue(array));
|
params = params.append(this.name, this.serializeValue(array));
|
||||||
}
|
}
|
||||||
} else if (this.value !== null && this.value !== undefined) {
|
} else if (this.value !== null && this.value !== undefined) {
|
||||||
// Plain value
|
|
||||||
params = params.append(this.name, this.serializeValue(this.value));
|
params = params.append(this.name, this.serializeValue(this.value));
|
||||||
}
|
}
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A parameter in the HTTP request header
|
|
||||||
*/
|
|
||||||
class HeaderParameter extends Parameter {
|
class HeaderParameter extends Parameter {
|
||||||
constructor(name: string, value: any, options: ParameterOptions) {
|
constructor(name: string, value: any, options: ParameterOptions) {
|
||||||
super(name, value, options, 'simple', false);
|
super(name, value, options, 'simple', false);
|
||||||
@@ -205,9 +176,6 @@ class HeaderParameter extends Parameter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper to build http requests from parameters
|
|
||||||
*/
|
|
||||||
export class RequestBuilder {
|
export class RequestBuilder {
|
||||||
|
|
||||||
private _path = new Map<string, PathParameter>();
|
private _path = new Map<string, PathParameter>();
|
||||||
@@ -222,30 +190,18 @@ export class RequestBuilder {
|
|||||||
public method: string) {
|
public method: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets a path parameter
|
|
||||||
*/
|
|
||||||
path(name: string, value: any, options?: ParameterOptions): void {
|
path(name: string, value: any, options?: ParameterOptions): void {
|
||||||
this._path.set(name, new PathParameter(name, value, options || {}));
|
this._path.set(name, new PathParameter(name, value, options || {}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets a query parameter
|
|
||||||
*/
|
|
||||||
query(name: string, value: any, options?: ParameterOptions): void {
|
query(name: string, value: any, options?: ParameterOptions): void {
|
||||||
this._query.set(name, new QueryParameter(name, value, options || {}));
|
this._query.set(name, new QueryParameter(name, value, options || {}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets a header parameter
|
|
||||||
*/
|
|
||||||
header(name: string, value: any, options?: ParameterOptions): void {
|
header(name: string, value: any, options?: ParameterOptions): void {
|
||||||
this._header.set(name, new HeaderParameter(name, value, options || {}));
|
this._header.set(name, new HeaderParameter(name, value, options || {}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the body content, along with the content type
|
|
||||||
*/
|
|
||||||
body(value: any, contentType = 'application/json'): void {
|
body(value: any, contentType = 'application/json'): void {
|
||||||
if (value instanceof Blob) {
|
if (value instanceof Blob) {
|
||||||
this._bodyContentType = value.type;
|
this._bodyContentType = value.type;
|
||||||
@@ -253,7 +209,6 @@ export class RequestBuilder {
|
|||||||
this._bodyContentType = contentType;
|
this._bodyContentType = contentType;
|
||||||
}
|
}
|
||||||
if (this._bodyContentType === 'application/x-www-form-urlencoded' && value !== null && typeof value === 'object') {
|
if (this._bodyContentType === 'application/x-www-form-urlencoded' && value !== null && typeof value === 'object') {
|
||||||
// Handle URL-encoded data
|
|
||||||
const pairs: Array<[string, string]> = [];
|
const pairs: Array<[string, string]> = [];
|
||||||
for (const key of Object.keys(value)) {
|
for (const key of Object.keys(value)) {
|
||||||
let val = value[key];
|
let val = value[key];
|
||||||
@@ -269,7 +224,6 @@ export class RequestBuilder {
|
|||||||
}
|
}
|
||||||
this._bodyContent = pairs.map(p => `${encodeURIComponent(p[0])}=${encodeURIComponent(p[1])}`).join('&');
|
this._bodyContent = pairs.map(p => `${encodeURIComponent(p[0])}=${encodeURIComponent(p[1])}`).join('&');
|
||||||
} else if (this._bodyContentType === 'multipart/form-data') {
|
} else if (this._bodyContentType === 'multipart/form-data') {
|
||||||
// Handle multipart form data
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
if (value !== null && value !== undefined) {
|
if (value !== null && value !== undefined) {
|
||||||
for (const key of Object.keys(value)) {
|
for (const key of Object.keys(value)) {
|
||||||
@@ -291,7 +245,6 @@ export class RequestBuilder {
|
|||||||
}
|
}
|
||||||
this._bodyContent = formData;
|
this._bodyContent = formData;
|
||||||
} else {
|
} else {
|
||||||
// The body is the plain content
|
|
||||||
this._bodyContent = value;
|
this._bodyContent = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,33 +262,24 @@ export class RequestBuilder {
|
|||||||
return String(value);
|
return String(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Builds the request with the current set parameters
|
|
||||||
*/
|
|
||||||
build<T = any>(options?: {
|
build<T = any>(options?: {
|
||||||
/** Which content types to accept */
|
|
||||||
accept?: string;
|
accept?: string;
|
||||||
|
|
||||||
/** The expected response type */
|
|
||||||
responseType?: 'json' | 'text' | 'blob' | 'arraybuffer';
|
responseType?: 'json' | 'text' | 'blob' | 'arraybuffer';
|
||||||
|
|
||||||
/** Whether to report progress on uploads / downloads */
|
|
||||||
reportProgress?: boolean;
|
reportProgress?: boolean;
|
||||||
|
|
||||||
/** Allow passing HttpContext for HttpClient */
|
|
||||||
context?: HttpContext;
|
context?: HttpContext;
|
||||||
}): HttpRequest<T> {
|
}): HttpRequest<T> {
|
||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
// Path parameters
|
|
||||||
let path = this.operationPath;
|
let path = this.operationPath;
|
||||||
for (const pathParam of this._path.values()) {
|
for (const pathParam of this._path.values()) {
|
||||||
path = pathParam.append(path);
|
path = pathParam.append(path);
|
||||||
}
|
}
|
||||||
const url = this.rootUrl + path;
|
const url = this.rootUrl + path;
|
||||||
|
|
||||||
// Query parameters
|
|
||||||
let httpParams = new HttpParams({
|
let httpParams = new HttpParams({
|
||||||
encoder: ParameterCodecInstance
|
encoder: ParameterCodecInstance
|
||||||
});
|
});
|
||||||
@@ -343,7 +287,6 @@ export class RequestBuilder {
|
|||||||
httpParams = queryParam.append(httpParams);
|
httpParams = queryParam.append(httpParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header parameters
|
|
||||||
let httpHeaders = new HttpHeaders();
|
let httpHeaders = new HttpHeaders();
|
||||||
if (options.accept) {
|
if (options.accept) {
|
||||||
httpHeaders = httpHeaders.append('Accept', options.accept);
|
httpHeaders = httpHeaders.append('Accept', options.accept);
|
||||||
@@ -352,12 +295,10 @@ export class RequestBuilder {
|
|||||||
httpHeaders = headerParam.append(httpHeaders);
|
httpHeaders = headerParam.append(httpHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request content headers
|
|
||||||
if (this._bodyContentType && !(this._bodyContent instanceof FormData)) {
|
if (this._bodyContentType && !(this._bodyContent instanceof FormData)) {
|
||||||
httpHeaders = httpHeaders.set('Content-Type', this._bodyContentType);
|
httpHeaders = httpHeaders.set('Content-Type', this._bodyContentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform the request
|
|
||||||
return new HttpRequest<T>(this.method.toUpperCase(), url, this._bodyContent, {
|
return new HttpRequest<T>(this.method.toUpperCase(), url, this._bodyContent, {
|
||||||
params: httpParams,
|
params: httpParams,
|
||||||
headers: httpHeaders,
|
headers: httpHeaders,
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
|
|
||||||
import { HttpResponse } from '@angular/common/http';
|
import { HttpResponse } from '@angular/common/http';
|
||||||
|
|
||||||
/**
|
|
||||||
* Constrains the http response to not have the body defined as `T | null`, but `T` only.
|
|
||||||
*/
|
|
||||||
export type StrictHttpResponse<T> = HttpResponse<T> & {
|
export type StrictHttpResponse<T> = HttpResponse<T> & {
|
||||||
readonly body: T;
|
readonly body: T;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
||||||
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
||||||
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
||||||
{
|
{
|
||||||
"compileOnSave": false,
|
"compileOnSave": false,
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
||||||
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
|||||||
Reference in New Issue
Block a user