gooddata
Advanced tools
Comparing version 6.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-09T08-56-25-113Z to 6.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-12T11-39-26-822Z
// Copyright (C) 2007-2017, GoodData(R) Corporation. All rights reserved. | ||
import { AFM, Execution } from '@gooddata/typings'; | ||
import { AFM, Execution, VisualizationObject } from '@gooddata/typings'; | ||
@@ -124,6 +124,11 @@ export type SortDirection = 'asc' | 'desc'; | ||
setCustomDomain(d: string): void; | ||
getDomain(): string; | ||
getCustomDomain(): string; | ||
setJsPackage(name: string, version: string): void; | ||
getJsPackage(): { name: string, version: string }; | ||
setRequestHeader(key: string, value: string): void; | ||
getRequestHeader(key: string): string; | ||
@@ -381,2 +386,8 @@ } | ||
export interface IUtils { | ||
loadAttributesMap(projectId: string, attributeDisplayFormUris: string[]): Promise<any>; | ||
getAttributesDisplayForms(mdObject: VisualizationObject.IVisualizationObject): string[]; | ||
} | ||
export interface IXhrMockInBeforeSend { | ||
@@ -409,2 +420,3 @@ setRequestHeader(key: string, value: string): void; | ||
clone(): ISdk; | ||
utils: IUtils; | ||
} | ||
@@ -411,0 +423,0 @@ |
@@ -6,3 +6,2 @@ 'use strict'; | ||
}); | ||
exports.getAttributesDisplayForms = exports.loadAttributesMap = undefined; | ||
@@ -15,10 +14,2 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _attributesMapLoader = require('./utils/attributesMapLoader'); | ||
var _visualizationObjectHelper = require('./utils/visualizationObjectHelper'); | ||
exports.loadAttributesMap = _attributesMapLoader.loadAttributesMap; | ||
exports.getAttributesDisplayForms = _visualizationObjectHelper.getAttributesDisplayForms; | ||
var REQUEST_DEFAULTS = { | ||
@@ -25,0 +16,0 @@ types: ['attribute', 'metric', 'fact'], |
@@ -10,4 +10,5 @@ 'use strict'; | ||
exports.sanitizeDomain = sanitizeDomain; | ||
exports.sanitizeConfig = sanitizeConfig; | ||
exports.createModule = createModule; | ||
exports.sanitizeConfig = sanitizeConfig; | ||
@@ -46,2 +47,16 @@ var _lodash = require('lodash'); | ||
/** | ||
* Returns sanitized config | ||
* | ||
* @method sanitizeConfig | ||
* @return {object|undefiend} config with sanitized domain | ||
*/ | ||
function sanitizeConfig(config) { | ||
var sanitized = _extends({}, config); | ||
if (config.domain) { | ||
sanitized.domain = sanitizeDomain(config.domain); | ||
} | ||
return sanitized; | ||
} | ||
/** | ||
* Config factory | ||
@@ -53,4 +68,6 @@ * | ||
*/ | ||
function createModule() { | ||
var configStorage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
function createModule(configStorage) { | ||
if (arguments.length !== 1) { | ||
throw new Error('Config module has to be called with exactly one argument.'); | ||
} | ||
@@ -73,5 +90,5 @@ /** | ||
* | ||
* @method getDomain | ||
* @method getCustomDomain | ||
*/ | ||
function getDomain() { | ||
function getCustomDomain() { | ||
return configStorage.domain; | ||
@@ -86,2 +103,3 @@ } | ||
* @param {String} version package version (semver) | ||
* @private | ||
*/ | ||
@@ -100,2 +118,3 @@ function setJsPackage(name, version) { | ||
* @return {object} with 'name' and 'version' properties | ||
* @private | ||
*/ | ||
@@ -116,3 +135,3 @@ function getJsPackage() { | ||
setCustomDomain: setCustomDomain, | ||
getDomain: getDomain, | ||
getCustomDomain: getCustomDomain, | ||
setJsPackage: setJsPackage, | ||
@@ -123,16 +142,2 @@ getJsPackage: getJsPackage, | ||
}; | ||
} | ||
/** | ||
* Returns sanitized config | ||
* | ||
* @method sanitizeConfig | ||
* @return {object|undefiend} config with sanitized domain | ||
*/ | ||
function sanitizeConfig(config) { | ||
var sanitized = _extends({}, config); | ||
if (config.domain) { | ||
sanitized.domain = sanitizeDomain(config.domain); | ||
} | ||
return sanitized; | ||
} |
@@ -30,2 +30,6 @@ 'use strict'; | ||
var _attributesMapLoader = require('./utils/attributesMapLoader'); | ||
var _visualizationObjectHelper = require('./utils/visualizationObjectHelper'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -66,2 +70,6 @@ | ||
this.admin = (0, _admin.createModule)(this.xhr); | ||
this.utils = { | ||
loadAttributesMap: (0, _attributesMapLoader.createModule)(this.md), | ||
getAttributesDisplayForms: _visualizationObjectHelper.getAttributesDisplayForms | ||
}; | ||
} | ||
@@ -68,0 +76,0 @@ |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.parseJSON = undefined; | ||
exports.originPackageHeaders = exports.parseJSON = undefined; | ||
@@ -106,3 +106,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // Copyright (C) 2007-2013, GoodData(R) Corporation. All rights reserved. | ||
var originPackageHeaders = function originPackageHeaders(_ref) { | ||
var originPackageHeaders = exports.originPackageHeaders = function originPackageHeaders(_ref) { | ||
var name = _ref.name, | ||
@@ -151,3 +151,2 @@ version = _ref.version; | ||
function ajaxSetup(settings) { | ||
// TODO TEST!! was: config.xhrSettings = Object.assign({}, config.xhrSettings, settings); | ||
Object.assign(configStorage.xhrSettings, settings); | ||
@@ -154,0 +153,0 @@ } |
{ | ||
"name": "gooddata", | ||
"version": "6.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-09T08-56-25-113Z", | ||
"version": "6.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-12T11-39-26-822Z", | ||
"author": "GoodData", | ||
@@ -38,2 +38,3 @@ "description": "GoodData JavaScript SDK", | ||
"devDependencies": { | ||
"@gooddata/typings": "2.0.0-alpha0", | ||
"async": "2.1.5", | ||
@@ -48,3 +49,3 @@ "babel-cli": "6.23.0", | ||
"babel-register": "6.23.0", | ||
"eslint-config-gooddata": "0.0.17", | ||
"eslint-config-gooddata": "0.0.18", | ||
"exports-loader": "0.6.3", | ||
@@ -74,3 +75,2 @@ "fast-levenshtein": "2.0.6", | ||
"dependencies": { | ||
"@gooddata/typings": "1.0.0", | ||
"es6-promise": "3.0.2", | ||
@@ -77,0 +77,0 @@ "fetch-cookie": "0.4.0", |
import { get, find, omit, cloneDeep } from 'lodash'; | ||
import { loadAttributesMap } from './utils/attributesMapLoader'; | ||
import { getAttributesDisplayForms } from './utils/visualizationObjectHelper'; | ||
export { loadAttributesMap, getAttributesDisplayForms }; | ||
const REQUEST_DEFAULTS = { | ||
@@ -9,0 +4,0 @@ types: ['attribute', 'metric', 'fact'], |
@@ -18,3 +18,3 @@ // Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved. | ||
function sanitizeDomain(domain) { | ||
export function sanitizeDomain(domain) { | ||
if (domain === null) { | ||
@@ -34,3 +34,18 @@ return undefined; | ||
/** | ||
* Returns sanitized config | ||
* | ||
* @method sanitizeConfig | ||
* @return {object|undefiend} config with sanitized domain | ||
*/ | ||
export function sanitizeConfig(config) { | ||
const sanitized = { ...config }; | ||
if (config.domain) { | ||
sanitized.domain = sanitizeDomain(config.domain); | ||
} | ||
return sanitized; | ||
} | ||
/** | ||
* Config factory | ||
@@ -42,3 +57,7 @@ * | ||
*/ | ||
export function createModule(configStorage = {}) { | ||
export function createModule(configStorage) { | ||
if (arguments.length !== 1) { | ||
throw new Error('Config module has to be called with exactly one argument.'); | ||
} | ||
/** | ||
@@ -60,5 +79,5 @@ * Sets custom domain. Parameter is url which has always to be https:// | ||
* | ||
* @method getDomain | ||
* @method getCustomDomain | ||
*/ | ||
function getDomain() { | ||
function getCustomDomain() { | ||
return configStorage.domain; | ||
@@ -73,2 +92,3 @@ } | ||
* @param {String} version package version (semver) | ||
* @private | ||
*/ | ||
@@ -86,2 +106,3 @@ function setJsPackage(name, version) { | ||
* @return {object} with 'name' and 'version' properties | ||
* @private | ||
*/ | ||
@@ -102,3 +123,3 @@ function getJsPackage() { | ||
setCustomDomain, | ||
getDomain, | ||
getCustomDomain, | ||
setJsPackage, | ||
@@ -110,15 +131,1 @@ getJsPackage, | ||
} | ||
/** | ||
* Returns sanitized config | ||
* | ||
* @method sanitizeConfig | ||
* @return {object|undefiend} config with sanitized domain | ||
*/ | ||
export function sanitizeConfig(config) { | ||
const sanitized = { ...config }; | ||
if (config.domain) { | ||
sanitized.domain = sanitizeDomain(config.domain); | ||
} | ||
return sanitized; | ||
} |
@@ -12,2 +12,4 @@ // Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved. | ||
import { createModule as loadAttributesMapFactory } from './utils/attributesMapLoader'; | ||
import { getAttributesDisplayForms } from './utils/visualizationObjectHelper'; | ||
@@ -43,2 +45,6 @@ /** | ||
this.admin = adminFactory(this.xhr); | ||
this.utils = { | ||
loadAttributesMap: loadAttributesMapFactory(this.md), | ||
getAttributesDisplayForms | ||
}; | ||
} | ||
@@ -45,0 +51,0 @@ |
@@ -94,3 +94,3 @@ // Copyright (C) 2007-2013, GoodData(R) Corporation. All rights reserved. | ||
const originPackageHeaders = ({ name, version }) => ({ | ||
export const originPackageHeaders = ({ name, version }) => ({ | ||
'X-GDC-JS-PKG': name, | ||
@@ -140,3 +140,2 @@ 'X-GDC-JS-PKG-VERSION': version | ||
function ajaxSetup(settings) { | ||
// TODO TEST!! was: config.xhrSettings = Object.assign({}, config.xhrSettings, settings); | ||
Object.assign(configStorage.xhrSettings, settings); | ||
@@ -143,0 +142,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1185855
7
27658
33
- Removed@gooddata/typings@1.0.0
- Removed@gooddata/typings@1.0.0(transitive)