@shoutem/api-sdk
Advanced tools
Comparing version 1.1.14-rc.0 to 1.1.14-rc.1
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _get2 = require('lodash/get'); | ||
var _get3 = _interopRequireDefault(_get2); | ||
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; }; | ||
@@ -12,6 +16,2 @@ | ||
var _lodash = require('lodash'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _resources = require('../resources'); | ||
@@ -106,3 +106,3 @@ | ||
return this.get(config).then(function (extension) { | ||
return _lodash2.default.get(extension, 'attributes.settings'); | ||
return (0, _get3.default)(extension, 'attributes.settings'); | ||
}); | ||
@@ -109,0 +109,0 @@ } |
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _get2 = require('lodash/get'); | ||
var _get3 = _interopRequireDefault(_get2); | ||
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; }; | ||
@@ -12,6 +16,2 @@ | ||
var _lodash = require('lodash'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _resources = require('../resources'); | ||
@@ -106,3 +106,3 @@ | ||
return this.get(config).then(function (shortcut) { | ||
return _lodash2.default.get(shortcut, 'attributes.settings'); | ||
return (0, _get3.default)(shortcut, 'attributes.settings'); | ||
}); | ||
@@ -109,0 +109,0 @@ } |
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _get2 = require('lodash/get'); | ||
var _get3 = _interopRequireDefault(_get2); | ||
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; }; | ||
@@ -12,6 +16,2 @@ | ||
var _lodash = require('lodash'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _resources = require('../resources'); | ||
@@ -106,3 +106,3 @@ | ||
return this.get(config).then(function (theme) { | ||
return _lodash2.default.get(theme, 'attributes.settings'); | ||
return (0, _get3.default)(theme, 'attributes.settings'); | ||
}); | ||
@@ -109,0 +109,0 @@ } |
@@ -8,2 +8,30 @@ 'use strict'; | ||
var _isNil2 = require('lodash/isNil'); | ||
var _isNil3 = _interopRequireDefault(_isNil2); | ||
var _omitBy2 = require('lodash/omitBy'); | ||
var _omitBy3 = _interopRequireDefault(_omitBy2); | ||
var _pick2 = require('lodash/pick'); | ||
var _pick3 = _interopRequireDefault(_pick2); | ||
var _flow2 = require('lodash/flow'); | ||
var _flow3 = _interopRequireDefault(_flow2); | ||
var _mapKeys2 = require('lodash/mapKeys'); | ||
var _mapKeys3 = _interopRequireDefault(_mapKeys2); | ||
var _omit2 = require('lodash/omit'); | ||
var _omit3 = _interopRequireDefault(_omit2); | ||
var _merge2 = require('lodash/merge'); | ||
var _merge3 = _interopRequireDefault(_merge2); | ||
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; }; | ||
@@ -15,6 +43,2 @@ | ||
var _lodash = require('lodash'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _URITemplate = require('urijs/src/URITemplate'); | ||
@@ -59,3 +83,3 @@ | ||
var jsonApiResource = _lodash2.default.merge({}, defaultResource, { | ||
var jsonApiResource = (0, _merge3.default)({}, defaultResource, { | ||
request: { | ||
@@ -92,7 +116,7 @@ headers: { | ||
var resource = _lodash2.default.merge({}, templateResource, resourceConfig); | ||
var resource = (0, _merge3.default)({}, templateResource, resourceConfig); | ||
var actions = resource.actions; | ||
this.resourceConfig = _lodash2.default.omit(resource, 'actions'); | ||
this.resourceConfig = (0, _omit3.default)(resource, 'actions'); | ||
this.actions = actions; | ||
@@ -108,4 +132,4 @@ | ||
_lodash2.default.mapKeys(this.actions, function (actionConfig, actionKey) { | ||
var resource = _lodash2.default.merge({}, _this.resourceConfig, actionConfig); | ||
(0, _mapKeys3.default)(this.actions, function (actionConfig, actionKey) { | ||
var resource = (0, _merge3.default)({}, _this.resourceConfig, actionConfig); | ||
_this[actionKey] = function () { | ||
@@ -115,3 +139,3 @@ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var resolvedEndpoint = new _URITemplate2.default(resource.request.endpoint).expand(params); | ||
return _lodash2.default.merge({}, resource, { | ||
return (0, _merge3.default)({}, resource, { | ||
request: { | ||
@@ -143,6 +167,6 @@ endpoint: resolvedEndpoint | ||
var fetchOptionsResolver = _lodash2.default.flow([function (options) { | ||
return _lodash2.default.pick(options, ['method', 'body', 'headers', 'credentials']); | ||
var fetchOptionsResolver = (0, _flow3.default)([function (options) { | ||
return (0, _pick3.default)(options, ['method', 'body', 'headers', 'credentials']); | ||
}, function (options) { | ||
return _lodash2.default.omitBy(options, _lodash2.default.isNil); | ||
return (0, _omitBy3.default)(options, _isNil3.default); | ||
}]); | ||
@@ -149,0 +173,0 @@ |
@@ -6,9 +6,10 @@ 'use strict'; | ||
}); | ||
var _get2 = require('lodash/get'); | ||
var _get3 = _interopRequireDefault(_get2); | ||
exports.getError = getError; | ||
exports.getErrorCode = getErrorCode; | ||
var _lodash = require('lodash'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -18,3 +19,3 @@ | ||
return response.clone().json().then(function (jsonResponse) { | ||
return _lodash2.default.get(jsonResponse, 'errors', []); | ||
return (0, _get3.default)(jsonResponse, 'errors', []); | ||
}); | ||
@@ -25,4 +26,4 @@ } | ||
return getError(response).then(function (error) { | ||
return _lodash2.default.get(error, 'code'); | ||
return (0, _get3.default)(error, 'code'); | ||
}); | ||
} |
@@ -6,8 +6,17 @@ 'use strict'; | ||
}); | ||
exports.initializeFetchTokenInterceptor = initializeFetchTokenInterceptor; | ||
var _lodash = require('lodash'); | ||
var _get2 = require('lodash/get'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _get3 = _interopRequireDefault(_get2); | ||
var _join2 = require('lodash/join'); | ||
var _join3 = _interopRequireDefault(_join2); | ||
var _isEmpty2 = require('lodash/isEmpty'); | ||
var _isEmpty3 = _interopRequireDefault(_isEmpty2); | ||
exports.initializeFetchTokenInterceptor = initializeFetchTokenInterceptor; | ||
var _urijs = require('urijs'); | ||
@@ -63,4 +72,4 @@ | ||
var apiSubdomainRegex = new RegExp('^([.a-z0-9]*?).*(localhost|' + baseApi + ')', 'g'); | ||
if (!_lodash2.default.isEmpty(additionalApiEndpoints)) { | ||
var additionalEndpoints = _lodash2.default.join(additionalApiEndpoints, '|'); | ||
if (!(0, _isEmpty3.default)(additionalApiEndpoints)) { | ||
var additionalEndpoints = (0, _join3.default)(additionalApiEndpoints, '|'); | ||
apiSubdomainRegex = new RegExp('^([.a-z0-9]*?).*(localhost|' + baseApi + '|' + additionalEndpoints + ')', 'g'); | ||
@@ -82,3 +91,3 @@ } | ||
return response.clone().json().then(function (jsonData) { | ||
return _lodash2.default.get(jsonData, 'data.attributes.token'); | ||
return (0, _get3.default)(jsonData, 'data.attributes.token'); | ||
}); | ||
@@ -98,3 +107,3 @@ } | ||
return response.clone().json().then(function (jsonData) { | ||
return _lodash2.default.get(jsonData, 'meta.invalidateAccessToken', false); | ||
return (0, _get3.default)(jsonData, 'meta.invalidateAccessToken', false); | ||
}, function () { | ||
@@ -101,0 +110,0 @@ return false; |
@@ -6,9 +6,26 @@ 'use strict'; | ||
}); | ||
var _get2 = require('lodash/get'); | ||
var _get3 = _interopRequireDefault(_get2); | ||
var _mergeWith2 = require('lodash/mergeWith'); | ||
var _mergeWith3 = _interopRequireDefault(_mergeWith2); | ||
var _pick2 = require('lodash/pick'); | ||
var _pick3 = _interopRequireDefault(_pick2); | ||
var _keys2 = require('lodash/keys'); | ||
var _keys3 = _interopRequireDefault(_keys2); | ||
var _isArray2 = require('lodash/isArray'); | ||
var _isArray3 = _interopRequireDefault(_isArray2); | ||
exports.mergeSettings = mergeSettings; | ||
exports.getSettings = getSettings; | ||
var _lodash = require('lodash'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -18,3 +35,3 @@ | ||
// do not concatenate arrays, just replace them | ||
if (_lodash2.default.isArray(objValue)) { | ||
if ((0, _isArray3.default)(objValue)) { | ||
return srcValue; | ||
@@ -27,9 +44,9 @@ } | ||
function mergeSettings(originalSettings, patchSettings) { | ||
var patchProperties = _lodash2.default.keys(patchSettings); | ||
var currentSettings = _lodash2.default.pick(originalSettings, patchProperties); | ||
return _lodash2.default.mergeWith(currentSettings, patchSettings, mergeCustomizer); | ||
var patchProperties = (0, _keys3.default)(patchSettings); | ||
var currentSettings = (0, _pick3.default)(originalSettings, patchProperties); | ||
return (0, _mergeWith3.default)(currentSettings, patchSettings, mergeCustomizer); | ||
} | ||
function getSettings(originalObject) { | ||
return _lodash2.default.get(originalObject, 'settings'); | ||
return (0, _get3.default)(originalObject, 'settings'); | ||
} |
{ | ||
"name": "@shoutem/api-sdk", | ||
"version": "1.1.14-rc.0", | ||
"version": "1.1.14-rc.1", | ||
"description": "Javascript SDK for Shoutem API using fetch", | ||
@@ -5,0 +5,0 @@ "main": "build/lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37398
836