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.

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