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.

58 lines 2.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRequestConfig = void 0; const tslib_1 = require("tslib"); const constants = tslib_1.__importStar(require("./constants")); const request_types_1 = require("./core/request-types"); const utils_1 = require("./utils"); const configs = { [request_types_1.RequestType.HistoricalData]: { operation: constants.HISTORICAL_DATA_OPERATION, service: constants.REF_DATA_SERVICE }, [request_types_1.RequestType.ReferenceData]: { operation: constants.REFERENCE_DATA_OPERATION, service: constants.REF_DATA_SERVICE }, [request_types_1.RequestType.IntraDayBar]: { operation: constants.INTRADAY_BAR_OPERATION, service: constants.REF_DATA_SERVICE }, [request_types_1.RequestType.IntraDayTick]: { operation: constants.INTRADAY_TICK_OPERATION, service: constants.REF_DATA_SERVICE }, [request_types_1.RequestType.InstrumentList]: { operation: constants.INSTRUMENT_LIST_OPERATION, service: constants.INSTRUMENTS_SERVICE }, [request_types_1.RequestType.Snapshot]: { operation: constants.SNAPSHOT_OPERATION, service: constants.MARKET_LIST_SERVICE }, [request_types_1.RequestType.FieldList]: { operation: constants.FIELD_LIST_OPERATION, service: constants.FIELDS_SERVICE }, [request_types_1.RequestType.FieldSearch]: { operation: constants.FIELD_SEARCH_OPERATION, service: constants.FIELDS_SERVICE }, [request_types_1.RequestType.UserEntitlements]: { operation: constants.USER_ENTITLEMENTS_OPERATION, service: constants.AUTH_SERVICE }, [request_types_1.RequestType.MarketSubscription]: { service: constants.MARKET_DATA_SERVICE, operation: undefined } }; function getRequestConfig(requestType) { const config = configs[requestType]; if (utils_1.isNullOrUndefined(config)) { throw new TypeError(`Unsupported request type ${requestType}.`); } return config; } exports.getRequestConfig = getRequestConfig; //# sourceMappingURL=request-configs.js.map