import { Catalog } from '@mtna/pojo-consumer-ui'; import { AsyncResource } from './models/async/async-resource'; import { DataSetMetadata } from './models/data-set-metadata'; import { HttpResponse } from './models/http-response'; import { RdsDataProduct } from './rds-data-product'; import { RdsServer } from './rds-server'; /** * An instance of a RDS Catalog. * A basic building block to interact with a RDS API. * Includes methods to query catalog related information. * * @example * ```ts * const covidServer = new RdsServer('https://covid19.richdataservices.com/rds'); * const covidCatalog = new RdsCatalog(covidServer, 'int'); * covidCatalog * .getMetadata() * .then( * res => console.log('Catalog metadata:', res.parsedBody), * error => console.error('Oh no!', error) * ); * ``` */ export interface RdsCatalog extends Catalog { } export declare class RdsCatalog extends AsyncResource { protected readonly server: RdsServer; readonly catalogId: string; /** The url to the RDS API */ get apiUrl(): string; /** The url for catalog related API endpoints */ get catalogUrl(): string; /** * Create a new RdsCatalog which provides * methods to interact with catalog-related * endpoints on the RDS API. * * @param server the RDS API server on which this catalog exists * @param catalogId the ID of this specific catalog * @param resolve whether to automatically start resolving all the catalog's own properties, defaults to false */ constructor(server: RdsServer, catalogId: string, resolve?: boolean); /** * Create and get an instance of a RDS Data Product that exists on * this RdsCatalog. This is a convenience method, these two code snippets * are equivalent: * ```ts * const dataProduct = new RdsServer('https://covid19.richdataservices.com/rds') * .getCatalog('int') * .getDataProduct('jhu_country'); * ``` * and * ```ts * const server = new RdsServer('https://covid19.richdataservices.com/rds'); * const catalog = new RdsCatalog(server, 'int'); * const dataProduct = new RdsDataProduct(catalog, 'jhu_country'); * ``` * @param dataProductId the ID of the specific data product * @param resolve whether to automatically start resolving all the data product's own properties, defaults to false * @returns a new RdsDataProduct */ getDataProduct(dataProductId: string, resolve?: boolean): RdsDataProduct; /** * Get catalog metadata. * This will retrieve the metadata for all of the data products * that are in the specified catalog. For each data product there * will be a record layout with its variables along with any * classifications that are referenced by the variables. * * @returns metadata about the specified catalog */ getMetadata(): Promise>; /** * Resolve this 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. * * @returns a promise that completes once the catalog is resolved */ resolve(): Promise; }