@jax-data-science/api-clients 0.0.1 → 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.
- package/LICENSE +21 -0
- package/README.md +124 -12
- package/fesm2022/jax-data-science-api-clients.mjs +61 -92
- package/fesm2022/jax-data-science-api-clients.mjs.map +1 -1
- package/index.d.ts +859 -17
- package/package.json +3 -3
- package/lib/models/base-response.d.ts +0 -4
- package/lib/models/error.d.ts +0 -5
- package/lib/models/isa-data/isa-data.model.d.ts +0 -75
- package/lib/models/paging.d.ts +0 -13
- package/lib/models/response.d.ts +0 -9
- package/lib/services/asynctask/asynctask.model.d.ts +0 -164
- package/lib/services/asynctask/asynctask.service.d.ts +0 -60
- package/lib/services/base.service.d.ts +0 -74
- package/lib/services/isa-data/isa-data.service.d.ts +0 -60
- package/lib/services/mvar/models/response/dtos.d.ts +0 -92
- package/lib/services/mvar/mvar-client.module.d.ts +0 -9
- package/lib/services/mvar/mvar.service.d.ts +0 -35
- package/lib/services/ontology/ontology.model.d.ts +0 -80
- package/lib/services/ontology/ontology.service.base.d.ts +0 -11
- package/lib/services/ontology/ontology.service.jax.d.ts +0 -53
- package/lib/services/ontology/ontology.service.ols.d.ts +0 -22
- package/lib/services/ontology/ontology.shared.d.ts +0 -5
- package/lib/services/snp-grid/models/response/dtos.d.ts +0 -95
- package/lib/services/snp-grid/snp-grid-client.module.d.ts +0 -9
- package/lib/services/snp-grid/snp-grid.service.d.ts +0 -97
- package/lib/tokens/isa-data-config.token.d.ts +0 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 The Jackson Laboratory
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,21 +1,133 @@
|
|
|
1
|
-
# api-clients
|
|
1
|
+
# @jax-data-science/api-clients by The Jackson Laboratory (JAX)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Overview
|
|
4
|
+
The library provides a centralized approach for frontend applications to interact with backend services across
|
|
5
|
+
the [JAX Data Science](https://www.jax.org/research-and-faculty/data-science/tools-and-databases) ecosystem.
|
|
6
|
+
It eliminates code duplication by offering reusable API clients with consistent error handling and authentication.
|
|
7
|
+
The library abstracts service communication details, allowing developers to focus on UI logic. All services are
|
|
8
|
+
configurable, handle errors uniformly, and define type-safe models for robust data handling.
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
Designed primarily for component consumption but usable independently, it ensures consistency and
|
|
11
|
+
maintainability as backend services evolve.
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
## Installation
|
|
8
14
|
|
|
15
|
+
```bash
|
|
16
|
+
npm install @jax-data-science/api-clients
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Available API Clients
|
|
20
|
+
|
|
21
|
+
> **Note**: For a complete list of API clients, visit our [Demo Application](https://jds-apps.jax.org/echo) or check the generated documentation.
|
|
9
22
|
|
|
10
|
-
##
|
|
23
|
+
## Quick Start
|
|
11
24
|
|
|
12
|
-
|
|
13
|
-
subject to change in releases.
|
|
25
|
+
### 1. Set needed service configuration in your application (e.g., base URL, timeout)
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
```typescript
|
|
28
|
+
/**
|
|
29
|
+
* app.module.ts
|
|
30
|
+
*/
|
|
16
31
|
|
|
32
|
+
...
|
|
33
|
+
// MY_SERVICE_CONFIG: injection token used to provide configuration values (like API urls) for MyService
|
|
34
|
+
// MyServiceConfig is an interface that defines the structure of the configuration object
|
|
35
|
+
import { MY_SERVICE_CONFIG, MyServiceConfig } from '@jax-data-science/api-clients';
|
|
36
|
+
...
|
|
37
|
+
|
|
38
|
+
...
|
|
39
|
+
@NgModule({
|
|
40
|
+
declarations: [...],
|
|
41
|
+
...
|
|
42
|
+
providers: [
|
|
43
|
+
{
|
|
44
|
+
provide(MY_SERVICE_CONFIG, {
|
|
45
|
+
useValue: {
|
|
46
|
+
baseUrl: 'https://api.example.com', // could also come from environment variables
|
|
47
|
+
timeout: 5000, // could also come from environment variables
|
|
48
|
+
} as MyServiceConfig
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
})
|
|
17
53
|
```
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### 2. Inject and use the API client in your components or services
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* example.component.ts
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
import { Component, OnInit } from '@angular/core';
|
|
66
|
+
|
|
67
|
+
import { MyService } from '@jax-data-science/api-clients';
|
|
68
|
+
|
|
69
|
+
@Component({
|
|
70
|
+
selector: 'app-example',
|
|
71
|
+
templateUrl: './example.component.html',
|
|
72
|
+
styleUrls: ['./example.component.css']
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
export class ExampleComponent implements OnInit {
|
|
76
|
+
data: any;
|
|
77
|
+
|
|
78
|
+
// Inject MyService into the component
|
|
79
|
+
constructor(private myService: MyService) {}
|
|
80
|
+
|
|
81
|
+
ngOnInit() {
|
|
82
|
+
// Use the service to fetch data
|
|
83
|
+
this.myService.getData().subscribe(
|
|
84
|
+
(response) => {
|
|
85
|
+
this.data = response;
|
|
86
|
+
},
|
|
87
|
+
(error) => {
|
|
88
|
+
console.error('Error fetching data:', error);
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Contributing
|
|
96
|
+
The JAX Data Science team welcomes and encourages collaborations!
|
|
97
|
+
|
|
98
|
+
### Ways to Contribute
|
|
99
|
+
|
|
100
|
+
- API Clients Development
|
|
101
|
+
|
|
102
|
+
- Testing & Quality Assurance
|
|
103
|
+
|
|
104
|
+
- Documentation
|
|
105
|
+
|
|
106
|
+
- Bug Fixes & Enhancements
|
|
107
|
+
|
|
108
|
+
### Reporting Issues
|
|
109
|
+
|
|
110
|
+
Found a bug or have a suggestion? Please email us at: npm@jax.org
|
|
111
|
+
|
|
112
|
+
When reporting issues please include:
|
|
113
|
+
|
|
114
|
+
- a clear description of the problem or suggestion
|
|
115
|
+
- steps to reproduce (for bugs)
|
|
116
|
+
- expected vs. actual behavior
|
|
117
|
+
- screenshots or code examples when applicable
|
|
118
|
+
- environment details (browser, framework version, etc.)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## Changelog
|
|
122
|
+
|
|
123
|
+
For detailed release notes and version history, see [CHANGELOG.md](./CHANGELOG.md).
|
|
124
|
+
|
|
125
|
+
## More Information
|
|
126
|
+
|
|
127
|
+
**GitHub Repo**: [jds-ui-components](https://github.com/TheJacksonLaboratory/jds-ui-components)
|
|
128
|
+
|
|
129
|
+
**Maintained By**: JAX Data Science
|
|
130
|
+
|
|
131
|
+
**Contact**: npm@jax.org
|
|
132
|
+
|
|
133
|
+
**Demo Application**: [View JDS Components](https://jds-apps.jax.org/echo)
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
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
|
|
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: "
|
|
17
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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: "
|
|
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
|
-
}]
|
|
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: "
|
|
342
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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: "
|
|
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: "
|
|
475
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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: "
|
|
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
|
-
|
|
529
|
-
|
|
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(
|
|
535
|
-
this.
|
|
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: "
|
|
638
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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: "
|
|
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: () => [
|
|
646
|
-
type: Inject,
|
|
647
|
-
args: ['environment']
|
|
648
|
-
}] }] });
|
|
642
|
+
}], ctorParameters: () => [] });
|
|
649
643
|
|
|
650
644
|
class MvarClientModule {
|
|
651
|
-
static forRoot(
|
|
645
|
+
static forRoot(apiUrl) {
|
|
652
646
|
return {
|
|
653
647
|
ngModule: MvarClientModule,
|
|
654
648
|
providers: [
|
|
655
649
|
MVarService,
|
|
656
650
|
{
|
|
657
|
-
provide:
|
|
658
|
-
useValue:
|
|
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: "
|
|
664
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
665
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
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: "
|
|
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(
|
|
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: "
|
|
798
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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: "
|
|
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: () => [
|
|
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(
|
|
806
|
+
constructor() {
|
|
814
807
|
super();
|
|
815
|
-
this.httpClient = httpClient;
|
|
816
808
|
}
|
|
817
809
|
term(id) {
|
|
818
810
|
const ontology = ontologyFromCurie(id);
|
|
@@ -927,41 +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: "
|
|
931
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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: "
|
|
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: () => [
|
|
930
|
+
}], ctorParameters: () => [] });
|
|
931
|
+
|
|
932
|
+
const SNP_GRID_SERVICE_CONFIG = new InjectionToken('SNP_GRID_SERVICE_CONFIG');
|
|
939
933
|
|
|
940
934
|
class SnpGridService {
|
|
941
|
-
|
|
942
|
-
|
|
935
|
+
config = inject(SNP_GRID_SERVICE_CONFIG);
|
|
936
|
+
http = inject(HttpClient);
|
|
943
937
|
api;
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
strains = new BehaviorSubject([]);
|
|
947
|
-
strains$ = this.strains.asObservable();
|
|
948
|
-
constructor(http, environment) {
|
|
949
|
-
this.http = http;
|
|
950
|
-
this.environment = environment;
|
|
951
|
-
this.api = environment.securedURLs.genomeMUSter;
|
|
952
|
-
this.getHealthCheck().subscribe({
|
|
953
|
-
error: () => {
|
|
954
|
-
this.apiAvailable = false;
|
|
955
|
-
},
|
|
956
|
-
});
|
|
957
|
-
this.getStrains().subscribe({
|
|
958
|
-
next: (strains) => {
|
|
959
|
-
this.apiAvailable = Boolean(strains.length);
|
|
960
|
-
},
|
|
961
|
-
error: () => {
|
|
962
|
-
this.apiAvailable = false;
|
|
963
|
-
},
|
|
964
|
-
});
|
|
938
|
+
constructor() {
|
|
939
|
+
this.api = this.config.apiUrl;
|
|
965
940
|
}
|
|
966
941
|
/**
|
|
967
942
|
* Returns the result of a health check for the API
|
|
@@ -974,7 +949,6 @@ class SnpGridService {
|
|
|
974
949
|
*/
|
|
975
950
|
getMusterMetadata() {
|
|
976
951
|
return this.http.get(`${this.api}/db_info`).pipe(catchError((err) => {
|
|
977
|
-
this.apiAvailable = false;
|
|
978
952
|
throw err;
|
|
979
953
|
}));
|
|
980
954
|
}
|
|
@@ -984,9 +958,7 @@ class SnpGridService {
|
|
|
984
958
|
* @param limit - maximum number of strains to be returned
|
|
985
959
|
*/
|
|
986
960
|
getStrains(limit = 5000) {
|
|
987
|
-
return this.http
|
|
988
|
-
.get(`${this.api}/strains/?limit=${limit}`)
|
|
989
|
-
.pipe(tap((strains) => this.strains.next(strains.filter((s) => s.mpd_strainid))));
|
|
961
|
+
return this.http.get(`${this.api}/strains/?limit=${limit}`).pipe(map((strains) => strains.filter((s) => s.mpd_strainid)));
|
|
990
962
|
}
|
|
991
963
|
/**
|
|
992
964
|
* Returns a list of known genes whose symbols/coordinates start with the specified value.
|
|
@@ -1123,37 +1095,34 @@ class SnpGridService {
|
|
|
1123
1095
|
const url = `${this.api}/dataset_strain/?dataset_id=${datasetId}&limit=${limit}`;
|
|
1124
1096
|
return this.http.get(url);
|
|
1125
1097
|
}
|
|
1126
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1127
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
1128
1100
|
}
|
|
1129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SnpGridService, decorators: [{
|
|
1130
1102
|
type: Injectable,
|
|
1131
1103
|
args: [{
|
|
1132
1104
|
providedIn: 'root'
|
|
1133
1105
|
}]
|
|
1134
|
-
}], ctorParameters: () => [
|
|
1135
|
-
type: Inject,
|
|
1136
|
-
args: ['environment']
|
|
1137
|
-
}] }] });
|
|
1106
|
+
}], ctorParameters: () => [] });
|
|
1138
1107
|
|
|
1139
1108
|
class SnpGridClientModule {
|
|
1140
|
-
static forRoot(
|
|
1109
|
+
static forRoot(apiUrl) {
|
|
1141
1110
|
return {
|
|
1142
1111
|
ngModule: SnpGridClientModule,
|
|
1143
1112
|
providers: [
|
|
1144
1113
|
SnpGridService,
|
|
1145
1114
|
{
|
|
1146
|
-
provide:
|
|
1147
|
-
useValue:
|
|
1115
|
+
provide: SNP_GRID_SERVICE_CONFIG,
|
|
1116
|
+
useValue: { apiUrl }
|
|
1148
1117
|
}
|
|
1149
1118
|
]
|
|
1150
1119
|
};
|
|
1151
1120
|
}
|
|
1152
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1153
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
1154
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
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] });
|
|
1155
1124
|
}
|
|
1156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SnpGridClientModule, decorators: [{
|
|
1157
1126
|
type: NgModule,
|
|
1158
1127
|
args: [{
|
|
1159
1128
|
imports: [CommonModule],
|
|
@@ -1174,5 +1143,5 @@ var DatasetStatus;
|
|
|
1174
1143
|
* Generated bundle index. Do not edit.
|
|
1175
1144
|
*/
|
|
1176
1145
|
|
|
1177
|
-
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 };
|
|
1178
1147
|
//# sourceMappingURL=jax-data-science-api-clients.mjs.map
|