integration layer; merge work on indicators from forks with existing ingestion pipeline
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Observable, map, shareReplay } from 'rxjs';
|
||||
import { ConnectorInfo } from './api.types';
|
||||
|
||||
/** GET /imports/connectors: what the server can read. Fetched once per app. */
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ConnectorsApi {
|
||||
private readonly http = inject(HttpClient);
|
||||
private readonly connectors$ = this.http.get<{ connectors: ConnectorInfo[] }>('/imports/connectors').pipe(
|
||||
map((response) => response.connectors),
|
||||
shareReplay({ bufferSize: 1, refCount: false }),
|
||||
);
|
||||
|
||||
list(): Observable<ConnectorInfo[]> {
|
||||
return this.connectors$;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user