UNPKG

@glue42/bbg-market-data

Version:

A high-level API that wraps existing Glue42 Bloomberg Bridge Market Data interop methods. The API is based on the jBloomberg open source wrapper.

53 lines (52 loc) 1.81 kB
import * as constants from "./constants"; import { RequestType } from './core/request-types'; import { isNullOrUndefined } from './utils'; const configs = { [RequestType.HistoricalData]: { operation: constants.HISTORICAL_DATA_OPERATION, service: constants.REF_DATA_SERVICE }, [RequestType.ReferenceData]: { operation: constants.REFERENCE_DATA_OPERATION, service: constants.REF_DATA_SERVICE }, [RequestType.IntraDayBar]: { operation: constants.INTRADAY_BAR_OPERATION, service: constants.REF_DATA_SERVICE }, [RequestType.IntraDayTick]: { operation: constants.INTRADAY_TICK_OPERATION, service: constants.REF_DATA_SERVICE }, [RequestType.InstrumentList]: { operation: constants.INSTRUMENT_LIST_OPERATION, service: constants.INSTRUMENTS_SERVICE }, [RequestType.Snapshot]: { operation: constants.SNAPSHOT_OPERATION, service: constants.MARKET_LIST_SERVICE }, [RequestType.FieldList]: { operation: constants.FIELD_LIST_OPERATION, service: constants.FIELDS_SERVICE }, [RequestType.FieldSearch]: { operation: constants.FIELD_SEARCH_OPERATION, service: constants.FIELDS_SERVICE }, [RequestType.UserEntitlements]: { operation: constants.USER_ENTITLEMENTS_OPERATION, service: constants.AUTH_SERVICE }, [RequestType.MarketSubscription]: { service: constants.MARKET_DATA_SERVICE, operation: undefined } }; export function getRequestConfig(requestType) { const config = configs[requestType]; if (isNullOrUndefined(config)) { throw new TypeError(`Unsupported request type ${requestType}.`); } return config; }