@codefresh-io/authenticated-entity
Advanced tools
Comparing version 2.4.6 to 2.4.7
@@ -132,2 +132,5 @@ const _ = require('lodash'); | ||
.then(() => { | ||
if (this.isSystemEntity() && !accountId) { | ||
throw new Error(`System entity must to provide accountId`); | ||
} | ||
if (!this.isSystemEntity() && this.getActiveAccount().id === accountId) { | ||
@@ -166,2 +169,18 @@ accountId = undefined; | ||
.then(() => { | ||
if (this.isSystemEntity() && !accountId) { | ||
throw new Error(`System entity must to provide accountId`); | ||
} | ||
if (!this.isSystemEntity() && this.getActiveAccount().id === accountId) { | ||
accountId = undefined; | ||
} | ||
if (!accountId) { | ||
const activeAccount = this.getActiveAccount(); | ||
if (_.get(activeAccount, 'features')) { | ||
const featureValue = activeAccount.features[feature]; | ||
if (_.isUndefined(featureValue)) { | ||
throw new Error(`Feature ${feature} is not valid`); | ||
} | ||
return featureValue; | ||
} | ||
} | ||
const request = getInternalRequestLogic(); | ||
@@ -168,0 +187,0 @@ const qs = {}; |
{ | ||
"name": "@codefresh-io/authenticated-entity", | ||
"version": "2.4.6", | ||
"version": "2.4.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
274097
1523