gooddata
Advanced tools
Comparing version 5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-01T19-58-48-123Z to 5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-01T20-39-09-074Z
@@ -391,6 +391,4 @@ // Copyright (C) 2007-2017, GoodData(R) Corporation. All rights reserved. | ||
ajaxSetup(settings: IXhrSettings): void; | ||
setSdkPackage(value: string): void; | ||
setSdkPackageVersion(value: string): void; | ||
setSdkComponent(value: string): void; | ||
setSdkComponentProps(value: string): void; | ||
setSdkPackage(name: string, version: string): void; | ||
setSdkComponent(component: string, props?: Object): void; | ||
} | ||
@@ -397,0 +395,0 @@ |
@@ -137,19 +137,19 @@ 'use strict'; | ||
function setHeaderIfEmpty(header, value) { | ||
if (!(0, _lodash.get)(configStorage.xhrSettings, ['headers', header])) { | ||
(0, _lodash.set)(configStorage.xhrSettings, ['headers', header], value); | ||
function setHeaderIfEmpty(key, value) { | ||
if (!(0, _lodash.get)(configStorage, ['xhrSettings', 'headers', key])) { | ||
(0, _lodash.set)(configStorage, ['xhrSettings', 'headers', key], value); | ||
} | ||
} | ||
function setSdkPackage(value) { | ||
setHeaderIfEmpty('X-GDC-UISDK-PKG', value); | ||
function setSdkPackage(name, version) { | ||
setHeaderIfEmpty('X-GDC-UISDK-PKG', name); | ||
setHeaderIfEmpty('X-GDC-UISDK-PKG-VERSION', version); | ||
} | ||
function setSdkPackageVersion(value) { | ||
setHeaderIfEmpty('X-GDC-UISDK-PKG-VERSION', value); | ||
function setSdkComponent(component) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; | ||
setHeaderIfEmpty('X-GDC-UISDK-COMP', component); | ||
if ((0, _lodash.isObject)(props)) { | ||
setHeaderIfEmpty('X-GDC-UISDK-COMP-PROPS', Object.keys(props).join(',')); | ||
} | ||
} | ||
function setSdkComponent(value) { | ||
setHeaderIfEmpty('X-GDC-UISDK-COMP', value); | ||
} | ||
function setSdkComponentProps(value) { | ||
setHeaderIfEmpty('X-GDC-UISDK-COMP-PROPS', value); | ||
} | ||
@@ -296,7 +296,5 @@ function continueAfterTokenRequest(url, settings) { | ||
setSdkPackage: setSdkPackage, | ||
setSdkPackageVersion: setSdkPackageVersion, | ||
setSdkComponent: setSdkComponent, | ||
setSdkComponentProps: setSdkComponentProps, | ||
parseJSON: parseJSON | ||
}; | ||
} |
{ | ||
"name": "gooddata", | ||
"version": "5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-01T19-58-48-123Z", | ||
"version": "5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-01T20-39-09-074Z", | ||
"author": "GoodData", | ||
@@ -5,0 +5,0 @@ "description": "GoodData JavaScript SDK", |
// Copyright (C) 2007-2013, GoodData(R) Corporation. All rights reserved. | ||
import { | ||
isPlainObject, | ||
isObject, | ||
isFunction, | ||
@@ -134,19 +135,17 @@ has, | ||
function setHeaderIfEmpty(header, value) { | ||
if (!_get(configStorage.xhrSettings, ['headers', header])) { | ||
_set(configStorage.xhrSettings, ['headers', header], value); | ||
function setHeaderIfEmpty(key, value) { | ||
if (!_get(configStorage, ['xhrSettings', 'headers', key])) { | ||
_set(configStorage, ['xhrSettings', 'headers', key], value); | ||
} | ||
} | ||
function setSdkPackage(value) { | ||
setHeaderIfEmpty('X-GDC-UISDK-PKG', value); | ||
function setSdkPackage(name, version) { | ||
setHeaderIfEmpty('X-GDC-UISDK-PKG', name); | ||
setHeaderIfEmpty('X-GDC-UISDK-PKG-VERSION', version); | ||
} | ||
function setSdkPackageVersion(value) { | ||
setHeaderIfEmpty('X-GDC-UISDK-PKG-VERSION', value); | ||
function setSdkComponent(component, props = undefined) { | ||
setHeaderIfEmpty('X-GDC-UISDK-COMP', component); | ||
if (isObject(props)) { | ||
setHeaderIfEmpty('X-GDC-UISDK-COMP-PROPS', Object.keys(props).join(',')); | ||
} | ||
} | ||
function setSdkComponent(value) { | ||
setHeaderIfEmpty('X-GDC-UISDK-COMP', value); | ||
} | ||
function setSdkComponentProps(value) { | ||
setHeaderIfEmpty('X-GDC-UISDK-COMP-PROPS', value); | ||
} | ||
@@ -286,7 +285,5 @@ function continueAfterTokenRequest(url, settings) { | ||
setSdkPackage, | ||
setSdkPackageVersion, | ||
setSdkComponent, | ||
setSdkComponentProps, | ||
parseJSON | ||
}; | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1168922
27277