Options
All
  • Public
  • Public/Protected
  • All
Menu

An instance of a RDS Catalog. A basic building block to interact with a RDS API. Includes methods to query catalog related information.

example
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)
 );

Hierarchy

Index

Constructors

constructor

  • Create a new RdsCatalog which provides methods to interact with catalog-related endpoints on the RDS API.

    Parameters

    • server: RdsServer

      the RDS API server on which this catalog exists

    • catalogId: string

      the ID of this specific catalog

    • Default value resolve: boolean = false

      whether to automatically start resolving all the catalog's own properties, defaults to false

    Returns RdsCatalog

Properties

Optional catalogCount

catalogCount: undefined | number

Readonly catalogId

catalogId: string

the ID of this specific catalog

Optional catalogs

catalogs: Array<Catalog>

Optional dataProductCount

dataProductCount: undefined | number

Optional dataProducts

dataProducts: Array<DataProduct>

Optional description

description: undefined | string

Optional documentation

documentation: undefined | string

Optional exclusion

exclusion: undefined | string

Optional id

id: undefined | string

Optional isPrivate

isPrivate: undefined | false | true

Optional isPublic

isPublic: undefined | false | true

Optional keywordCount

keywordCount: undefined | number

Optional keywords

keywords: Array<string>

Optional label

label: undefined | string

Optional lastUpdate

lastUpdate: Date

Optional name

name: undefined | string

Protected Readonly server

server: RdsServer

the RDS API server on which this catalog exists

Optional uri

uri: undefined | string

Optional urlCount

urlCount: undefined | number

Optional urls

urls: Array<string>

Accessors

apiUrl

  • get apiUrl(): string

catalogUrl

  • get catalogUrl(): string

Methods

getDataProduct

  • getDataProduct(dataProductId: string, resolve?: boolean): RdsDataProduct
  • 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:

    const dataProduct = new RdsServer('https://covid19.richdataservices.com/rds')
                         .getCatalog('int')
                         .getDataProduct('jhu_country');

    and

    const server = new RdsServer('https://covid19.richdataservices.com/rds');
    const catalog = new RdsCatalog(server, 'int');
    const dataProduct = new RdsDataProduct(catalog, 'jhu_country');

    Parameters

    • dataProductId: string

      the ID of the specific data product

    • Default value resolve: boolean = false

      whether to automatically start resolving all the data product's own properties, defaults to false

    Returns RdsDataProduct

    a new RdsDataProduct

getMetadata

  • 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 Promise<HttpResponse<DataSetMetadata>>

    metadata about the specified catalog

isResolved

  • isResolved(): boolean

isResolving

  • isResolving(): boolean

registerResolutionListener

resolve

  • resolve(): Promise<void>
  • 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 Promise<void>

    a promise that completes once the catalog is resolved

Protected setResolved

  • setResolved(resolved: boolean): void

Protected setResolving

  • setResolving(resolving: boolean): void

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Protected property
  • Protected method
  • Private property
  • Static method

Generated using TypeDoc