@jax-data-science/api-clients 0.0.2-0 → 0.1.0-a.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,27 +1,24 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, inject, InjectionToken, Inject, NgModule } from '@angular/core';
2
+ import { inject, Injectable, InjectionToken, NgModule } from '@angular/core';
3
3
  import { throwError, map, catchError, Observable, BehaviorSubject, combineLatest, tap } from 'rxjs';
4
4
  import { fetchEventSource } from '@microsoft/fetch-event-source';
5
- import * as i1 from '@angular/common/http';
5
+ import { HttpClient } from '@angular/common/http';
6
6
  import { CommonModule } from '@angular/common';
7
7
 
8
8
  class ApiBaseServiceFactory {
9
- http;
10
- constructor(http) {
11
- this.http = http;
12
- }
9
+ http = inject(HttpClient);
13
10
  create(baseUrl) {
14
11
  return new ApiBaseService(this.http, baseUrl);
15
12
  }
16
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ApiBaseServiceFactory, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
17
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ApiBaseServiceFactory, providedIn: 'root' });
13
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ApiBaseServiceFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
14
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ApiBaseServiceFactory, providedIn: 'root' });
18
15
  }
19
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ApiBaseServiceFactory, decorators: [{
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ApiBaseServiceFactory, decorators: [{
20
17
  type: Injectable,
21
18
  args: [{
22
19
  providedIn: 'root'
23
20
  }]
24
- }], ctorParameters: () => [{ type: i1.HttpClient }] });
21
+ }] });
25
22
  class ApiBaseService {
26
23
  http;
27
24
  baseUrl;
@@ -338,10 +335,10 @@ class AsyncTaskService {
338
335
  getHealthCheck() {
339
336
  return this.apiBaseService.get('/monitors/servers/health');
340
337
  }
341
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AsyncTaskService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
342
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AsyncTaskService, providedIn: 'root' });
338
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AsyncTaskService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
339
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AsyncTaskService, providedIn: 'root' });
343
340
  }
344
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AsyncTaskService, decorators: [{
341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AsyncTaskService, decorators: [{
345
342
  type: Injectable,
346
343
  args: [{
347
344
  providedIn: 'root'
@@ -471,10 +468,10 @@ class ISADataService {
471
468
  getHealthCheck() {
472
469
  return this.apiBaseService.get('/monitors/servers/health');
473
470
  }
474
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ISADataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
475
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ISADataService, providedIn: 'root' });
471
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ISADataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
472
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ISADataService, providedIn: 'root' });
476
473
  }
477
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ISADataService, decorators: [{
474
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ISADataService, decorators: [{
478
475
  type: Injectable,
479
476
  args: [{
480
477
  providedIn: 'root'
@@ -524,17 +521,17 @@ const MUS_CHRS = [
524
521
  'Y',
525
522
  ];
526
523
 
524
+ const MVAR_SERVICE_CONFIG = new InjectionToken('MVAR_SERVICE_CONFIG');
525
+
527
526
  class MVarService {
528
- http;
529
- environment;
527
+ config = inject(MVAR_SERVICE_CONFIG);
528
+ http = inject(HttpClient);
530
529
  api;
531
530
  sequenceOntologyMapping = {};
532
531
  soTerms = new BehaviorSubject([]);
533
532
  soTerms$ = this.soTerms.asObservable();
534
- constructor(http, environment) {
535
- this.http = http;
536
- this.environment = environment;
537
- this.api = environment.unsecuredURLs.mvar;
533
+ constructor() {
534
+ this.api = this.config.apiUrl;
538
535
  // create a sequence ontology lookup
539
536
  this.getSequenceOntologyTerms().subscribe((terms) => {
540
537
  terms.forEach((t) => {
@@ -634,37 +631,34 @@ class MVarService {
634
631
  }
635
632
  return displayedRegions;
636
633
  }
637
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MVarService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
638
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MVarService, providedIn: 'root' });
634
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MVarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
635
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MVarService, providedIn: 'root' });
639
636
  }
640
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MVarService, decorators: [{
637
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MVarService, decorators: [{
641
638
  type: Injectable,
642
639
  args: [{
643
640
  providedIn: 'root'
644
641
  }]
645
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
646
- type: Inject,
647
- args: ['environment']
648
- }] }] });
642
+ }], ctorParameters: () => [] });
649
643
 
650
644
  class MvarClientModule {
651
- static forRoot(environment) {
645
+ static forRoot(apiUrl) {
652
646
  return {
653
647
  ngModule: MvarClientModule,
654
648
  providers: [
655
649
  MVarService,
656
650
  {
657
- provide: 'environment', // you can also use InjectionToken
658
- useValue: environment
651
+ provide: MVAR_SERVICE_CONFIG,
652
+ useValue: { apiUrl }
659
653
  }
660
654
  ]
661
655
  };
662
656
  }
663
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MvarClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
664
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: MvarClientModule, imports: [CommonModule] });
665
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MvarClientModule, imports: [CommonModule] });
657
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MvarClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
658
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: MvarClientModule, imports: [CommonModule] });
659
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MvarClientModule, imports: [CommonModule] });
666
660
  }
667
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MvarClientModule, decorators: [{
661
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MvarClientModule, decorators: [{
668
662
  type: NgModule,
669
663
  args: [{
670
664
  imports: [CommonModule],
@@ -691,15 +685,14 @@ function ontologyFromCurie(curie) {
691
685
  }
692
686
 
693
687
  class JaxOntologyService extends OntologyService {
694
- httpClient;
688
+ httpClient = inject(HttpClient);
695
689
  config_location = 'https://raw.githubusercontent.com/TheJacksonLaboratory/ontology-service/refs/heads/main/config/ontologies-internal.json';
696
690
  config;
697
691
  /**
698
692
  * Get the configuration file from the source for the backend api service
699
693
  */
700
- constructor(httpClient) {
694
+ constructor() {
701
695
  super();
702
- this.httpClient = httpClient;
703
696
  this.httpClient.get(this.config_location).subscribe({
704
697
  next: (config) => this.config = config,
705
698
  error: () => {
@@ -794,25 +787,24 @@ class JaxOntologyService extends OntologyService {
794
787
  }
795
788
  return ontology_config.api.base;
796
789
  }
797
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: JaxOntologyService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
798
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: JaxOntologyService, providedIn: 'root' });
790
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: JaxOntologyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
791
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: JaxOntologyService, providedIn: 'root' });
799
792
  }
800
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: JaxOntologyService, decorators: [{
793
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: JaxOntologyService, decorators: [{
801
794
  type: Injectable,
802
795
  args: [{
803
796
  providedIn: 'root'
804
797
  }]
805
- }], ctorParameters: () => [{ type: i1.HttpClient }] });
798
+ }], ctorParameters: () => [] });
806
799
 
807
800
  // ols-ontology.service.ts
808
801
  class OLSOntologyService extends OntologyService {
809
- httpClient;
802
+ httpClient = inject(HttpClient);
810
803
  OLS_SEARCH_BASE = 'https://www.ebi.ac.uk/ols4/api/v2/entities';
811
804
  OLS_ENTITY_BASE = 'https://www.ebi.ac.uk/ols4/api/v2/ontologies';
812
805
  PURL_BASE = 'http://purl.obolibrary.org/obo';
813
- constructor(httpClient) {
806
+ constructor() {
814
807
  super();
815
- this.httpClient = httpClient;
816
808
  }
817
809
  term(id) {
818
810
  const ontology = ontologyFromCurie(id);
@@ -927,24 +919,24 @@ class OLSOntologyService extends OntologyService {
927
919
  name: olsTerm.label && olsTerm.label.length > 0 ? olsTerm.label[0] : 'No label'
928
920
  };
929
921
  }
930
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: OLSOntologyService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
931
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: OLSOntologyService, providedIn: 'root' });
922
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: OLSOntologyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
923
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: OLSOntologyService, providedIn: 'root' });
932
924
  }
933
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: OLSOntologyService, decorators: [{
925
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: OLSOntologyService, decorators: [{
934
926
  type: Injectable,
935
927
  args: [{
936
928
  providedIn: 'root'
937
929
  }]
938
- }], ctorParameters: () => [{ type: i1.HttpClient }] });
930
+ }], ctorParameters: () => [] });
931
+
932
+ const SNP_GRID_SERVICE_CONFIG = new InjectionToken('SNP_GRID_SERVICE_CONFIG');
939
933
 
940
934
  class SnpGridService {
941
- http;
942
- environment;
935
+ config = inject(SNP_GRID_SERVICE_CONFIG);
936
+ http = inject(HttpClient);
943
937
  api;
944
- constructor(http, environment) {
945
- this.http = http;
946
- this.environment = environment;
947
- this.api = environment.securedURLs.genomeMUSter;
938
+ constructor() {
939
+ this.api = this.config.apiUrl;
948
940
  }
949
941
  /**
950
942
  * Returns the result of a health check for the API
@@ -1103,37 +1095,34 @@ class SnpGridService {
1103
1095
  const url = `${this.api}/dataset_strain/?dataset_id=${datasetId}&limit=${limit}`;
1104
1096
  return this.http.get(url);
1105
1097
  }
1106
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SnpGridService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
1107
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SnpGridService, providedIn: 'root' });
1098
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SnpGridService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1099
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SnpGridService, providedIn: 'root' });
1108
1100
  }
1109
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SnpGridService, decorators: [{
1101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SnpGridService, decorators: [{
1110
1102
  type: Injectable,
1111
1103
  args: [{
1112
1104
  providedIn: 'root'
1113
1105
  }]
1114
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1115
- type: Inject,
1116
- args: ['environment']
1117
- }] }] });
1106
+ }], ctorParameters: () => [] });
1118
1107
 
1119
1108
  class SnpGridClientModule {
1120
- static forRoot(environment) {
1109
+ static forRoot(apiUrl) {
1121
1110
  return {
1122
1111
  ngModule: SnpGridClientModule,
1123
1112
  providers: [
1124
1113
  SnpGridService,
1125
1114
  {
1126
- provide: 'environment', // you can also use InjectionToken
1127
- useValue: environment
1115
+ provide: SNP_GRID_SERVICE_CONFIG,
1116
+ useValue: { apiUrl }
1128
1117
  }
1129
1118
  ]
1130
1119
  };
1131
1120
  }
1132
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SnpGridClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1133
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: SnpGridClientModule, imports: [CommonModule] });
1134
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SnpGridClientModule, imports: [CommonModule] });
1121
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SnpGridClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1122
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: SnpGridClientModule, imports: [CommonModule] });
1123
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SnpGridClientModule, imports: [CommonModule] });
1135
1124
  }
1136
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SnpGridClientModule, decorators: [{
1125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SnpGridClientModule, decorators: [{
1137
1126
  type: NgModule,
1138
1127
  args: [{
1139
1128
  imports: [CommonModule],
@@ -1154,5 +1143,5 @@ var DatasetStatus;
1154
1143
  * Generated bundle index. Do not edit.
1155
1144
  */
1156
1145
 
1157
- export { AsyncTaskService, DatasetStatus, ISADataService, ISA_DATA_SERVICE_CONFIG, JaxOntologyService, MUS_CHRS, MVarService, MvarClientModule, OLSOntologyService, OntologyService, SnpGridClientModule, SnpGridService, WorkflowExecutionStatus };
1146
+ export { AsyncTaskService, DatasetStatus, ISADataService, ISA_DATA_SERVICE_CONFIG, JaxOntologyService, MUS_CHRS, MVAR_SERVICE_CONFIG, MVarService, MvarClientModule, OLSOntologyService, OntologyService, SNP_GRID_SERVICE_CONFIG, SnpGridClientModule, SnpGridService, WorkflowExecutionStatus };
1158
1147
  //# sourceMappingURL=jax-data-science-api-clients.mjs.map