import { HttpClient } from '@angular/common/http'; import { Observable, ReplaySubject } from 'rxjs'; import { CodeSearchResponse } from '@mtna/classification-service-core-ui'; import { MtnaLogger } from '@mtna/lib-ui'; import { Catalog, Classification, ClassificationSummary, Code, DataProduct, DataSource, Variable, VariableSummary } from '@mtna/pojo-consumer-ui'; import { CodeOptions } from '@mtna/rds-base-ui'; import { VariableSummariesParameters } from '../models'; import { RdsFormattedVariableProfile } from '../models/formatted-variable-profile.model'; import { RdsProfileParameters } from '../models/profile-parameters.model'; import { RdsApiService } from './rds-api.service'; /** * Represents * */ export declare class RdsMetadataService { protected apiService: RdsApiService; protected http: HttpClient; protected logger: MtnaLogger; /** base url for the service */ protected get CATALOG_URL(): string; /** url with ID of the selected catalog */ protected get CATALOG_ID_URL(): string; /** url with ID of the selected data product */ protected get DATA_PRODUCT_URL(): string; protected _rootCatalogCache$: ReplaySubject; protected _rootCatalogRequest$: Observable; protected _catalogCache: Map; protected _dataProductCache: Map; protected _dataSourcesCache: Map; protected _classificationSummaryCache: Map; protected _classificationCache: Map; protected _codesCache: Map; protected _codeSearchCache: Map; protected _variableSummaryCache: Map; protected _variableCountCache: Map; protected _variableCache: Map; protected _frequenciesCache: Map; protected _variableProfilesCache: Map; constructor(apiService: RdsApiService, http: HttpClient, logger: MtnaLogger); /** * Get the root catalog of the system. This will hold a list of all the catalogs and data products that are available on this server. * This would ideally be used to power an entry point into an application. The catalog provides a starting point for users to view what * is available to them and drill down into a catalog or data product of their interest. The catalogs and products may have descriptive * metadata on them that is useful to display. * @remarks This method uses caching, returns a hot observable. * @param refresh forces a cache refresh, will update all subscribers. Defaults to false. * @returns the root catalog */ getRootCatalog(refresh?: boolean): Observable; /** * Get catalog. Returns the specified catalog. This allows a more specific view of a catalog and its data products, * it is a subset of the root catalog and holds no additional information to what can be found in the broader get catalog endpoint. * @remarks This method uses caching, returns a cold observable. * @param refresh forces a cache refresh, will fetch a new value from the API. Defaults to false. * @returns the `RdsApiService`'s selected catalog */ getCatalog(refresh?: boolean): Observable; /** * Get data product. Returns the specified data product. This shows just a single data product in a catalog, * there is no additional information in this call, it simply limits the scope of what is returned. * @remarks This method uses caching, returns a cold observable. * @param refresh forces a cache refresh, will fetch a new value from the API. Defaults to false. * @returns the `RdsApiService`'s selected data product */ getDataProduct(refresh?: boolean): Observable; /** * Get data sources. Gets the specified data products data sources. This is an administrative end point for * viewing data source connection information. This information is typically hidden from the general user * however,for the administrator it allows them to see connection information that they may need to edit * if there are changes to their database. * @remarks This method uses caching, returns a cold observable. * @param refresh forces a cache refresh, will fetch a new value from the API. Defaults to false. * @returns data sources for the `RdsApiService`'s selected data product */ getDataSources(refresh?: boolean): Observable; /** * Get classifications. Get the classifications of a specific data product. * Returns a list of summary objects about any classifications that are used in the specified data product. * These summary objects hold the classification uri and id (among other things) * either of which can be used to get more information about the classification. * @remarks This method uses caching, returns a cold observable. * @param refresh forces a cache refresh, will fetch a new value from the API. Defaults to false. * @returns classification summaries for the `RdsApiService`'s selected data product */ getClassifications(refresh?: boolean): Observable; /** * Get classification. Returns the specified classification with more detail than the summary. * Codes will be excluded from this object, the idea being that this classification could have * a large amount of codes and clients can build these codes up through the used of the codes endpoints. * @remarks This method uses caching, returns a cold observable. * @privateRemarks In the future, we should support caching classifications to be used across data products. * @param classificationId The ID or URI the classification to return. * @param refresh forces a cache refresh, will fetch a new value from the API. Defaults to false. * @returns the specified classification for the `RdsApiService`'s selected data product */ getClassification(classificationId: string, refresh?: boolean): Observable; /** * Get codes. This allows the client to page through or build up the codes of the classification as desired. * @remarks This method uses caching, returns a cold observable. * @param classificationId The ID or URI the classification to return. * @param options extra options for filtering/sorting/paging * @param includeParents whether parent URI should be included on the code (if they are available). Defaults to false. * @param includeChildren whether child codes should be included on the code (if they are available). Defaults to false. * @param refresh forces a cache refresh, will fetch a new value from the API. Defaults to false. * @returns the specified codes within the specified classification for the `RdsApiService`'s selected data product */ getCodes(classificationId: string, options?: CodeOptions, includeParents?: boolean, includeChildren?: boolean, refresh?: boolean): Observable; /** * Search for codes within a given classification. * @remarks This method uses caching, returns a cold observable. * @param classificationId The ID or URI of the classification that contains the codes. * @param searchText The text to search on (optional). Will search for this text within a code's value and/or name * @param offset The starting index of the codes * @param limit The max number of codes to return * @param refresh forces a cache refresh, will fetch a new value from the API. Defaults to false. * @returns the Codes that were found based on the search text. */ searchCodes(classificationId: string, searchText?: string, offset?: number, limit?: number, refresh?: boolean): Observable; /** * Get variable summaries. Get the variables of a specific data product. * Returns a list of summary objects about any variables that are used in the specified data product. * These summaries contain both the variable URI and ID, which can be used to get more detailed information about the variable. * @remarks This method uses caching, returns a cold observable. * @param params optional parameters * @param refresh forces a cache refresh, will fetch a new value from the API. Defaults to false. * @returns the variable summaries for the `RdsApiService`'s selected data product */ getVariableSummaries(params?: VariableSummariesParameters, refresh?: boolean): Observable; /** * Get total number of variable summaries for a query. * @remarks This method uses caching, returns a cold observable. * @param params optional parameters * @param refresh forces a cache refresh, will fetch a new value from the API. Defaults to false. * @returns the number of variable summaries for the query */ getVariableSummariesCount(params?: VariableSummariesParameters, refresh?: boolean): Observable; /** * Get variable. Returns a variable with more detail than what is provided by the summary object. * If the variable has a classification, its URI should be available on the variable which can be used to retrieve the classification. * @remarks This method uses caching, returns a cold observable. * @privateRemarks In the future, we should support caching variables to be used across data products. * @param variableId The Id or URI of the variable that is desired * @param refresh forces a cache refresh, will fetch a new value from the API. Defaults to false. * @returns the specified variable for the `RdsApiService`'s selected data product */ getVariable(variableId: string, refresh?: boolean): Observable; /** Get the frequencies for a specified variable of a data product */ /** * Get frequencies. Get the frequencies for a specified variable of a data product. * This method is primarily available to get the frequencies in a format that is * consumable by the supported charting serializations. If there are no frequencies available the call will return null. * @remarks This method uses caching, returns a cold observable. * @param variableId The Id or URI of the variable that contains the desired frequencies. * @param inject Whether to inject code values * @param format Response format * @param refresh forces a cache refresh, will fetch a new value from the API. Defaults to false. * @returns the frequencies for a specified variable for the `RdsApiService`'s selected data product */ getVariableFrequency(variableId: string, inject?: boolean, format?: string, refresh?: boolean): Observable<{ sets: Array; }>; getVariableProfiles(params: RdsProfileParameters, refresh?: boolean): Observable<{ [id: string]: RdsFormattedVariableProfile; }>; /** * Combines the ID of the `RdsApiService`'s selected catalog and data product to be used as a cache map key. * @returns map key for a specific catalog and data product */ private _getCatalogDataProductMapKey; }