Release v19.029 (from 40dd8ca8)

Fixes tradingview/charting_library#614
Fixes tradingview/charting_library#2701
Fixes tradingview/charting_library#2858
Fixes tradingview/charting_library#4019
Fixes tradingview/charting_library#4056
Fixes tradingview/charting_library#4116
Fixes tradingview/charting_library#4473
Fixes tradingview/charting_library#4674
Fixes tradingview/charting_library#4742
Fixes tradingview/charting_library#4746
Fixes tradingview/charting_library#4764
Fixes tradingview/charting_library#4769
Fixes tradingview/charting_library#4986
Fixes tradingview/charting_library#5022
Fixes tradingview/charting_library#5082
Fixes tradingview/charting_library#5228
Fixes tradingview/charting_library#5305
Fixes tradingview/charting_library#5312
Fixes tradingview/charting_library#5354
Fixes tradingview/charting_library#5397
Fixes tradingview/charting_library#5410
Fixes tradingview/charting_library#5429
Fixes tradingview/charting_library#5433
Fixes tradingview/charting_library#5455
Fixes tradingview/charting_library#5466
Fixes tradingview/charting_library#5470
Fixes tradingview/charting_library#5486
Fixes tradingview/charting_library#5488
Fixes tradingview/charting_library#5491
Fixes tradingview/charting_library#5494
Fixes tradingview/charting_library#5531
Fixes tradingview/charting_library#5557
Fixes tradingview/charting_library#5581
Fixes tradingview/charting_library#5598
Fixes tradingview/charting_library#5611
Fixes tradingview/charting_library#5638
Fixes tradingview/charting_library#5706
This commit is contained in:
jenkins@nwork.local
2021-06-04 12:50:20 +00:00
parent e0319ac205
commit 649cefa032
443 changed files with 1803 additions and 1580 deletions

File diff suppressed because one or more lines are too long

View File

@@ -53,7 +53,12 @@ var DataPulseProvider = /** @class */ (function () {
// BEWARE: please note we really need 2 bars, not the only last one
// see the explanation below. `10` is the `large enough` value to work around holidays
var rangeStartTime = rangeEndTime - periodLengthSeconds(subscriptionRecord.resolution, 10);
return this._historyProvider.getBars(subscriptionRecord.symbolInfo, subscriptionRecord.resolution, rangeStartTime, rangeEndTime)
return this._historyProvider.getBars(subscriptionRecord.symbolInfo, subscriptionRecord.resolution, {
from: rangeStartTime,
to: rangeEndTime,
countBack: 2,
firstDataRequest: false,
})
.then(function (result) {
_this._onSubscriberDataReceived(listenerGuid, result);
});

View File

@@ -4,14 +4,17 @@ var HistoryProvider = /** @class */ (function () {
this._datafeedUrl = datafeedUrl;
this._requester = requester;
}
HistoryProvider.prototype.getBars = function (symbolInfo, resolution, rangeStartDate, rangeEndDate) {
HistoryProvider.prototype.getBars = function (symbolInfo, resolution, periodParams) {
var _this = this;
var requestParams = {
symbol: symbolInfo.ticker || '',
resolution: resolution,
from: rangeStartDate,
to: rangeEndDate,
from: periodParams.from,
to: periodParams.to,
};
if (periodParams.countBack !== undefined) {
requestParams.countback = periodParams.countBack;
}
if (symbolInfo.currency_code !== undefined) {
requestParams.currencyCode = symbolInfo.currency_code;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -155,7 +155,6 @@ var SymbolsStorage = /** @class */ (function () {
session: extractField(data, 'session-regular', symbolIndex),
timezone: extractField(data, 'timezone', symbolIndex),
supported_resolutions: definedValueOrDefault(extractField(data, 'supported-resolutions', symbolIndex, true), this._datafeedSupportedResolutions),
force_session_rebuild: extractField(data, 'force-session-rebuild', symbolIndex),
has_daily: definedValueOrDefault(extractField(data, 'has-daily', symbolIndex), true),
intraday_multipliers: definedValueOrDefault(extractField(data, 'intraday-multipliers', symbolIndex, true), ['1', '5', '15', '30', '60']),
has_weekly_and_monthly: extractField(data, 'has-weekly-and-monthly', symbolIndex),

View File

@@ -46,9 +46,6 @@ var UDFCompatibleDatafeedBase = /** @class */ (function () {
UDFCompatibleDatafeedBase.prototype.unsubscribeQuotes = function (listenerGuid) {
this._quotesPulseProvider.unsubscribeQuotes(listenerGuid);
};
UDFCompatibleDatafeedBase.prototype.calculateHistoryDepth = function (resolution, resolutionBack, intervalBack) {
return undefined;
};
UDFCompatibleDatafeedBase.prototype.getMarks = function (symbolInfo, from, to, onDataCallback, resolution) {
if (!this._configuration.supports_marks) {
return;
@@ -197,8 +194,8 @@ var UDFCompatibleDatafeedBase = /** @class */ (function () {
this._symbolsStorage.resolveSymbol(symbolName, currencyCode).then(onResultReady).catch(onError);
}
};
UDFCompatibleDatafeedBase.prototype.getBars = function (symbolInfo, resolution, rangeStartDate, rangeEndDate, onResult, onError) {
this._historyProvider.getBars(symbolInfo, resolution, rangeStartDate, rangeEndDate)
UDFCompatibleDatafeedBase.prototype.getBars = function (symbolInfo, resolution, periodParams, onResult, onError) {
this._historyProvider.getBars(symbolInfo, resolution, periodParams)
.then(function (result) {
onResult(result.bars, result.meta);
})

View File

@@ -2,15 +2,15 @@
"private": true,
"dependencies": {
"promise-polyfill": "6.0.2",
"tslib": "1.11.1",
"tslib": "2.0.3",
"whatwg-fetch": "2.0.3"
},
"devDependencies": {
"rollup": "0.49.2",
"rollup-plugin-buble": "0.15.0",
"rollup-plugin-node-resolve": "3.0.0",
"rollup-plugin-uglify": "2.0.1",
"typescript": "3.9.6"
"@rollup/plugin-buble": "~0.21.3",
"@rollup/plugin-node-resolve": "~9.0.0",
"rollup": "~2.28.2",
"rollup-plugin-uglify": "~6.0.4",
"typescript": "4.1.2"
},
"scripts": {
"compile": "tsc",

View File

@@ -1,37 +1,35 @@
/* globals process */
var buble = require('rollup-plugin-buble');
var uglify = require('rollup-plugin-uglify');
var nodeResolve = require('rollup-plugin-node-resolve');
import buble from '@rollup/plugin-buble';
import { uglify } from 'rollup-plugin-uglify';
import { nodeResolve } from '@rollup/plugin-node-resolve';
var environment = process.env.ENV || 'development';
var isDevelopmentEnv = (environment === 'development');
const environment = process.env.ENV || 'development';
const isDevelopmentEnv = (environment === 'development');
module.exports = [
export default [
{
input: 'lib/udf-compatible-datafeed.js',
name: 'Datafeeds',
sourceMap: false,
output: {
name: 'Datafeeds',
format: 'umd',
file: 'dist/bundle.js',
},
plugins: [
nodeResolve({ jsnext: true, main: true }),
nodeResolve(),
buble(),
!isDevelopmentEnv && uglify({ output: { inline_script: true } }),
],
},
{
input: 'src/polyfills.es6',
sourceMap: false,
context: 'window',
output: {
format: 'iife',
file: 'dist/polyfills.js',
},
plugins: [
nodeResolve({ jsnext: true, main: true }),
nodeResolve(),
buble(),
uglify({ output: { inline_script: true } }),
],

View File

@@ -84,7 +84,15 @@ export class DataPulseProvider {
// see the explanation below. `10` is the `large enough` value to work around holidays
const rangeStartTime = rangeEndTime - periodLengthSeconds(subscriptionRecord.resolution, 10);
return this._historyProvider.getBars(subscriptionRecord.symbolInfo, subscriptionRecord.resolution, rangeStartTime, rangeEndTime)
return this._historyProvider.getBars(
subscriptionRecord.symbolInfo,
subscriptionRecord.resolution,
{
from: rangeStartTime,
to: rangeEndTime,
countBack: 2,
firstDataRequest: false,
})
.then((result: GetBarsResult) => {
this._onSubscriberDataReceived(listenerGuid, result);
});

View File

@@ -2,6 +2,7 @@ import {
Bar,
HistoryMetadata,
LibrarySymbolInfo,
PeriodParams,
} from '../../../charting_library/datafeed-api';
import {
@@ -39,6 +40,8 @@ interface HistoryNoDataResponse extends UdfResponse {
type HistoryResponse = HistoryFullDataResponse | HistoryPartialDataResponse | HistoryNoDataResponse;
export type PeriodParamsWithOptionalCountback = Omit<PeriodParams, 'countBack'> & { countBack?: number };
export interface GetBarsResult {
bars: Bar[];
meta: HistoryMetadata;
@@ -53,13 +56,16 @@ export class HistoryProvider {
this._requester = requester;
}
public getBars(symbolInfo: LibrarySymbolInfo, resolution: string, rangeStartDate: number, rangeEndDate: number): Promise<GetBarsResult> {
public getBars(symbolInfo: LibrarySymbolInfo, resolution: string, periodParams: PeriodParamsWithOptionalCountback): Promise<GetBarsResult> {
const requestParams: RequestParams = {
symbol: symbolInfo.ticker || '',
resolution: resolution,
from: rangeStartDate,
to: rangeEndDate,
from: periodParams.from,
to: periodParams.to,
};
if (periodParams.countBack !== undefined) {
requestParams.countback = periodParams.countBack;
}
if (symbolInfo.currency_code !== undefined) {
requestParams.currencyCode = symbolInfo.currency_code;

View File

@@ -37,8 +37,6 @@ interface ExchangeDataResponseSymbolData {
'minmov'?: number;
'minmovement'?: number;
'force-session-rebuild'?: boolean;
'supported-resolutions'?: ResolutionString[];
'intraday-multipliers'?: string[];
@@ -259,7 +257,6 @@ export class SymbolsStorage {
session: extractField(data, 'session-regular', symbolIndex),
timezone: extractField(data, 'timezone', symbolIndex),
supported_resolutions: definedValueOrDefault(extractField(data, 'supported-resolutions', symbolIndex, true), this._datafeedSupportedResolutions),
force_session_rebuild: extractField(data, 'force-session-rebuild', symbolIndex),
has_daily: definedValueOrDefault(extractField(data, 'has-daily', symbolIndex), true),
intraday_multipliers: definedValueOrDefault(extractField(data, 'intraday-multipliers', symbolIndex, true), ['1', '5', '15', '30', '60']),
has_weekly_and_monthly: extractField(data, 'has-weekly-and-monthly', symbolIndex),

View File

@@ -3,7 +3,6 @@ import {
ErrorCallback,
GetMarksCallback,
HistoryCallback,
HistoryDepth,
IDatafeedChartApi,
IDatafeedQuotesApi,
IExternalDatafeed,
@@ -11,7 +10,6 @@ import {
Mark,
OnReadyCallback,
QuotesCallback,
ResolutionBackValues,
ResolutionString,
ResolveCallback,
SearchSymbolResultItem,
@@ -32,6 +30,7 @@ import {
import {
GetBarsResult,
HistoryProvider,
PeriodParamsWithOptionalCountback,
} from './history-provider';
import { IQuotesProvider } from './iquotes-provider';
@@ -132,10 +131,6 @@ export class UDFCompatibleDatafeedBase implements IExternalDatafeed, IDatafeedQu
this._quotesPulseProvider.unsubscribeQuotes(listenerGuid);
}
public calculateHistoryDepth(resolution: ResolutionString, resolutionBack: ResolutionBackValues, intervalBack: number): HistoryDepth | undefined {
return undefined;
}
public getMarks(symbolInfo: LibrarySymbolInfo, from: number, to: number, onDataCallback: GetMarksCallback<Mark>, resolution: ResolutionString): void {
if (!this._configuration.supports_marks) {
return;
@@ -303,8 +298,8 @@ export class UDFCompatibleDatafeedBase implements IExternalDatafeed, IDatafeedQu
}
}
public getBars(symbolInfo: LibrarySymbolInfo, resolution: ResolutionString, rangeStartDate: number, rangeEndDate: number, onResult: HistoryCallback, onError: ErrorCallback): void {
this._historyProvider.getBars(symbolInfo, resolution, rangeStartDate, rangeEndDate)
public getBars(symbolInfo: LibrarySymbolInfo, resolution: ResolutionString, periodParams: PeriodParamsWithOptionalCountback, onResult: HistoryCallback, onError: ErrorCallback): void {
this._historyProvider.getBars(symbolInfo, resolution, periodParams)
.then((result: GetBarsResult) => {
onResult(result.bars, result.meta);
})