"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_CONFIG_SCHEMA = void 0;
const get_position_1 = require("../util/get-position");
const config_interfaces_1 = require("./config.interfaces");
const contracts_1 = require("./contracts");
exports.DEFAULT_CONFIG_SCHEMA = {
    platform: {
        default: contracts_1.DEFAULT_CONFIG_PLATFORM,
        doc: 'Environment variable which platform we are working on (beta/prod/feat1/....)',
        env: 'RDPLIB_ENV',
        format: String,
    },
    dir: {
        default: contracts_1.DEFAULT_CONFIG_DIR,
        doc: 'Directory where configuration files are saved',
        env: 'RDPLIB_ENV_DIR',
        format: String,
    },
    'config-change-notifications-enabled': {
        default: false,
        doc: 'Is watch mode for configuration files is enabled',
        format: Boolean,
    },
    http: {
        'request-timeout': {
            default: 10,
            doc: 'Max timeout for any HTTP request sent by a library',
            format: Number,
        },
    },
    logs: {
        level: {
            default: 'info',
            doc: 'Level of logs to be printed',
            format: [
                0,
                1,
                2,
                3,
                4,
                5,
                'trace',
                'debug',
                'info',
                'warn',
                'error',
                'silent',
                'TRACE',
                'DEBUG',
                'INFO',
                'WARN',
                'ERROR',
                'SILENT',
            ],
        },
        filter: {
            default: '*',
            doc: 'Filter logs by module name. By default all logs are printed',
            format: String,
        },
        transports: {
            console: {
                enabled: {
                    default: true,
                    doc: 'Defines if logs will be written into the console',
                    format: Boolean,
                },
            },
            file: {
                enabled: {
                    default: true,
                    doc: 'Defines if logs will be written into the file',
                    format: Boolean,
                },
                name: {
                    default: 'refinitiv-data-lib',
                    doc: 'File to save logs of the RDP TS Library',
                    format: String,
                },
                size: {
                    default: '10M',
                    doc: 'Maximum size of a single log file',
                    format: String,
                },
                interval: {
                    default: '1d',
                    doc: 'Period of log files rotation. Default to every midnight',
                    format: String,
                },
                maxFiles: {
                    default: 10,
                    doc: 'Maximum count of log files for te current process',
                    format: Number,
                },
                maxSize: {
                    default: '1G',
                    doc: 'Maximum total size of all log files together for the current process',
                    format: String,
                },
                history: {
                    default: 'log-rotation',
                    doc: 'Name of the file to save logs rotation history',
                    format: String,
                },
            },
        },
    },
    sessions: {
        platform: {
            'default-session': {
                'auto-reconnect': {
                    default: false,
                    doc: 'This flag defines should the session automatically re-authenticate when an access token becomes expired',
                },
                'base-url': {
                    default: 'https://api.refinitiv.com',
                    doc: 'Platform session base url',
                    format: String,
                },
                'realtime-distribution-system': {
                    url: {
                        default: '',
                        doc: 'Real-Time Distribution System url.',
                        format: String,
                    },
                    dacs: {
                        username: {
                            default: '',
                            doc: 'Default user name to be used for the connection through the Real-Time Distribution System.',
                            format: String,
                        },
                        'application-id': {
                            default: '',
                            doc: 'Default application id to be used for the connection through the Real-Time Distribution System.',
                            format: String,
                        },
                        position: {
                            default: (0, get_position_1.getPosition)(),
                            doc: 'Default position identifier for the Real-Time Distribution System.',
                            format: String,
                        },
                    },
                },
                auth: {
                    url: {
                        default: '/auth/oauth2/v1',
                        doc: 'Base url path for "Auth" endpoint',
                        format: String,
                    },
                    authorize: {
                        default: '/authorize',
                        doc: 'Subpath for Auth endpoint to authorize a user',
                        format: String,
                    },
                    token: {
                        default: '/token',
                        doc: 'Subpath for Auth endpoint to retrieve an access token',
                        format: String,
                    },
                },
            },
        },
        desktop: {
            'default-session': {
                'base-url': {
                    default: 'http://localhost:9000',
                    doc: 'Desktop session base url',
                    env: 'DP_PROXY_BASE_URL',
                    format: String,
                },
                'platform-paths': {
                    rdp: {
                        default: '/api/rdp',
                        doc: 'RDP platform root path',
                        format: String,
                    },
                    udf: {
                        default: '/api/udf',
                        doc: 'UDF root path',
                        format: String,
                    },
                    tsi: {
                        default: '/api/tsi',
                        doc: 'TSI root path',
                        format: String,
                    },
                },
                'handshake-url': {
                    default: '/api/handshake',
                    doc: 'Handshake endpoint for desktop-session handshake',
                    format: String,
                },
            },
        },
    },
    apis: {
        data: {
            'historical-pricing': {
                url: {
                    default: '/data/historical-pricing/v1',
                    doc: 'Base url path for "HistoricalPricing" endpoint',
                    format: String,
                },
                endpoints: {
                    events: {
                        default: '/views/events',
                        doc: 'Subpath for HistoricalPricing endpoint to retrieve the "events" data',
                        format: String,
                    },
                    'interday-summaries': {
                        default: '/views/interday-summaries',
                        doc: 'Subpath for HistoricalPricing endpoint to retrieve the "events" data',
                        format: String,
                    },
                    'intraday-summaries': {
                        default: '/views/intraday-summaries',
                        doc: 'Subpath for HistoricalPricing endpoint to retrieve the "events" data',
                        format: String,
                    },
                },
            },
            'quantitative-analytics-financial-contracts': {
                url: {
                    default: '/data/quantitative-analytics/v1',
                    doc: 'Base url path for the "financial-contracts" content object',
                    format: String,
                },
                endpoints: {
                    'financial-contracts': {
                        default: '/financial-contracts',
                        doc: 'Subpath for the Quantitative Analytics endpoint to retrieve the "financial-contracts" data',
                        format: String,
                    },
                },
            },
            'quantitative-analytics-curves-and-surfaces': {
                url: {
                    default: '/data/quantitative-analytics-curves-and-surfaces/v1',
                    doc: 'Base url path for the "curves-and-surfaces" content object',
                    format: String,
                },
                endpoints: {
                    'forward-curves': {
                        default: '/curves/forward-curves',
                        doc: 'Subpath for the Quantitative Analytics endpoint to retrieve the "forward-curves" data',
                        format: String,
                    },
                    surfaces: {
                        default: '/surfaces',
                        doc: 'Subpath for the Quantitative Analytics endpoint to retrieve the "surfaces" data',
                        format: String,
                    },
                    'zc-curves': {
                        default: '/curves/zc-curves',
                        doc: 'Subpath for the Quantitative Analytics endpoint to retrieve the "zc-curves" data',
                        format: String,
                    },
                    'zc-curve-definitions': {
                        default: '/curves/zc-curve-definitions',
                        doc: 'Subpath for the Quantitative Analytics endpoint to retrieve the "zc-curve-definitions" data',
                        format: String,
                    },
                },
            },
            'quantitative-analytics-dates-and-calendars': {
                url: {
                    default: '/data/quantitative-analytics-dates-and-calendars/v1',
                    doc: 'Base url path for the "dates-and-calendars" content object',
                    format: String,
                },
                endpoints: {
                    'add-periods': {
                        default: '/add-periods',
                        doc: 'Subpath for the Quantitative Analytics endpoint to retrieve the "add-periods" data',
                        format: String,
                    },
                    c3: {
                        default: '/c3',
                        doc: 'Subpath for the Quantitative Analytics endpoint to retrieve the "c3" data',
                        format: String,
                    },
                    'count-periods': {
                        default: '/count-periods',
                        doc: 'Subpath for the Quantitative Analytics endpoint to retrieve the "count-periods" data',
                        format: String,
                    },
                    'date-schedule': {
                        default: '/date-schedule',
                        doc: 'Subpath for the Quantitative Analytics endpoint to retrieve the "date-schedule" data',
                        format: String,
                    },
                    holidays: {
                        default: '/holidays',
                        doc: 'Subpath for the Quantitative Analytics endpoint to retrieve the "holidays" data',
                        format: String,
                    },
                    'is-working-day': {
                        default: '/is-working-day',
                        doc: 'Subpath for the Quantitative Analytics endpoint to retrieve the "is-working-day" data',
                        format: String,
                    },
                },
            },
            news: {
                url: {
                    default: '/data/news/v1',
                    doc: 'Base url path for the "news" content object',
                    format: String,
                },
                endpoints: {
                    headlines: {
                        default: '/headlines',
                        doc: 'Subpath for the News endpoint to retrieve the "headlines" data',
                        format: String,
                    },
                    stories: {
                        default: '/stories',
                        doc: 'Subpath for the News endpoint to retrieve the "stories" data',
                        format: String,
                    },
                },
            },
            'environmental-social-governance': {
                url: {
                    default: '/data/environmental-social-governance/v1',
                    doc: 'Base url path for the "environmental-social-governance" content object',
                    format: String,
                },
                endpoints: {
                    universe: {
                        default: '/universe',
                        doc: 'Subpath for the Environmental Social Governance endpoint to retrieve the "universe" data',
                        format: String,
                    },
                    basic: {
                        default: '/views/basic',
                        doc: 'Subpath for the Environmental Social Governance endpoint to retrieve the "basic" data',
                        format: String,
                    },
                    'measures-full': {
                        default: '/views/measures-full',
                        doc: 'Subpath for the Environmental Social Governance endpoint to retrieve the "measures-full" data',
                        format: String,
                    },
                    'measures-standard': {
                        default: '/views/measures-standard',
                        doc: 'Subpath for the Environmental Social Governance endpoint to retrieve the "measures-standard" data',
                        format: String,
                    },
                    'scores-full': {
                        default: '/views/scores-full',
                        doc: 'Subpath for the Environmental Social Governance endpoint to retrieve the "scores-full" data',
                        format: String,
                    },
                    'scores-standard': {
                        default: '/views/scores-standard',
                        doc: 'Subpath for the Environmental Social Governance endpoint to retrieve the "scores-standard" data',
                        format: String,
                    },
                },
            },
            datagrid: {
                url: {
                    default: '/api/udf',
                    doc: 'Base url path for the "datagrid" content object',
                    format: String,
                },
                endpoints: {
                    standard: {
                        default: '/',
                        doc: 'Subpath for the Datagrid endpoint to retrieve the "standard" data',
                        format: String,
                    },
                },
                'underlying-platform': {
                    default: "udf" /* UDF */,
                    doc: 'Platform type',
                    format: ["rdp" /* RDP */, "udf" /* UDF */],
                },
                layout: {
                    ["rdp" /* RDP */]: {
                        output: {
                            default: 'Col,T|Va,Row,In,date|',
                            doc: 'Response output formatting',
                            format: String,
                        },
                    },
                    ["udf" /* UDF */]: {
                        layout: {
                            columns: {
                                default: [{ item: 'dataitem' }],
                                doc: 'Udf layout columns',
                                format: Array,
                            },
                            rows: {
                                default: [{ item: 'instrument' }, { item: 'date' }],
                                doc: 'Udf layout rows',
                                format: Array,
                            },
                        },
                    },
                },
            },
        },
        discovery: {
            search: {
                url: {
                    default: '/discovery/search/v1',
                    doc: 'Base url path for the "search" content object',
                    format: String,
                },
                endpoints: {
                    search: {
                        default: '/',
                        doc: 'Subpath for the Search endpoint to retrieve all the "search" data',
                        format: String,
                    },
                    lookup: {
                        default: '/lookup',
                        doc: 'Subpath for the Search endpoint to retrieve the "lookup" data',
                        format: String,
                    },
                    metadata: {
                        default: '/metadata/views',
                        doc: 'Subpath for the Search endpoint to retrieve the "metadata" data',
                        format: String,
                    },
                },
            },
        },
        tsi: {
            metadata: {
                url: {
                    default: '/',
                    doc: 'Base url path for the historical pricing metadata content objects',
                    format: String,
                },
                endpoints: {
                    'global-metadata': {
                        default: '/global-metadata',
                        doc: 'Subpath for the global-metadata endpoint to retrieve the "global-metadata" data',
                        format: String,
                    },
                    'instrument-metadata': {
                        default: '/instrument-metadata',
                        doc: 'Subpath for the instrument-metadata endpoint to retrieve the "instrument-metadata" data',
                        format: String,
                    },
                    partialbar: {
                        default: '/partialbar',
                        doc: 'Subpath for the partialbar endpoint to retrieve the "partialbar" data',
                        format: String,
                    },
                    viewlist: {
                        default: '/viewlist',
                        doc: 'Subpath for the viewlist endpoint to retrieve the "viewlist" data',
                        format: String,
                    },
                },
            },
        },
        streaming: {
            pricing: {
                url: {
                    default: '/streaming/pricing/v1',
                    doc: 'Base url for the streaming pricing service discovery',
                    format: String,
                },
                endpoints: {
                    main: {
                        locations: {
                            default: [],
                            doc: 'Locations list allowed for this type of streaming connection',
                            format: Array,
                        },
                        path: {
                            default: '/',
                            doc: 'Service path',
                            format: String,
                        },
                        protocols: {
                            default: [config_interfaces_1.StreamingType.OMM],
                            doc: 'Streaming protocol types',
                            format: Array,
                        },
                        'websocket-url': {
                            default: '',
                            doc: 'Allows to force the websocket URL. When this parameter is set, the library does not need to send a request to the discovery endpoint but should just use this url to open the websocket',
                            format: String,
                        },
                    },
                },
            },
            'trading-analytics': {
                url: {
                    default: '/streaming/trading-analytics/trade-data/beta1',
                    doc: 'Base url for the trading-analytics service discovery',
                    format: String,
                },
                endpoints: {
                    redi: {
                        locations: {
                            default: [],
                            doc: 'Locations list allowed for this type of streaming connection',
                            format: Array,
                        },
                        path: {
                            default: '/redi',
                            doc: 'Service path',
                            format: String,
                        },
                        protocols: {
                            default: [config_interfaces_1.StreamingType.OMM, config_interfaces_1.StreamingType.RDP],
                            doc: 'Streaming protocol types',
                            format: Array,
                        },
                        'websocket-url': {
                            default: '',
                            doc: 'Allows to force the websocket URL. When this parameter is set, the library does not need to send a request to the discovery endpoint but should just use this url to open the websocket',
                            format: String,
                        },
                    },
                },
            },
            'quantitative-analytics': {
                url: {
                    default: '/streaming/quantitative-analytics/beta1',
                    doc: 'Base url for the QPS service discovery',
                    format: String,
                },
                endpoints: {
                    'financial-contracts': {
                        locations: {
                            default: [],
                            doc: 'Locations list allowed for this type of streaming connection',
                            format: Array,
                        },
                        path: {
                            default: '/financial-contracts',
                            doc: 'Service path',
                            format: String,
                        },
                        protocols: {
                            default: [config_interfaces_1.StreamingType.RDP],
                            doc: 'Streaming protocol types',
                            format: Array,
                        },
                        'websocket-url': {
                            default: '',
                            doc: 'Allows to force the websocket URL. When this parameter is set, the library does not need to send a request to the discovery endpoint but should just use this url to open the websocket',
                            format: String,
                        },
                    },
                },
            },
            benchmark: {
                url: {
                    default: '/streaming/benchmark/v1',
                    doc: 'Base url for the Benchmark service discovery',
                    format: String,
                },
                endpoints: {
                    resource: {
                        locations: {
                            default: [],
                            doc: 'Locations list allowed for this type of streaming connection',
                            format: Array,
                        },
                        path: {
                            default: '/resource',
                            doc: 'Service path',
                            format: String,
                        },
                        protocols: {
                            default: [config_interfaces_1.StreamingType.RDP],
                            doc: 'Streaming protocol types',
                            format: Array,
                        },
                        'websocket-url': {
                            default: '',
                            doc: 'Allows to force the websocket URL. When this parameter is set, the library does not need to send a request to the discovery endpoint but should just use this url to open the websocket',
                            format: String,
                        },
                    },
                },
            },
            'custom-instruments': {
                url: {
                    default: '/streaming/custom-instruments/v1',
                    doc: 'Base url for the streaming custom instruments service discovery',
                    format: String,
                },
                endpoints: {
                    resource: {
                        locations: {
                            default: [],
                            doc: 'Locations list allowed for this type of streaming connection',
                            format: Array,
                        },
                        path: {
                            default: '/resource',
                            doc: 'Service path',
                            format: String,
                        },
                        protocols: {
                            default: [config_interfaces_1.StreamingType.OMM],
                            doc: 'Streaming protocol types',
                            format: Array,
                        },
                        'websocket-url': {
                            default: '',
                            doc: 'Allows to force the websocket URL. When this parameter is set, the library does not need to send a request to the discovery endpoint but should just use this url to open the websocket',
                            format: String,
                        },
                    },
                },
            },
        },
    },
};
//# sourceMappingURL=data:application/json;base64, 