Comparing version 2.3.7 to 3.0.0
{ | ||
"name": "rox-node", | ||
"version": "2.3.7", | ||
"version": "3.0.0", | ||
"description": "Rollout.io ROX JS SDK Node", | ||
@@ -40,8 +40,7 @@ "author": "Rollout.io <support@rollout.io>", | ||
"ROX": { | ||
"api_version": "1.5.0" | ||
"api_version": "1.6.0" | ||
}, | ||
"main": "dist/rox-node.js", | ||
"module": "src/index.js", | ||
"dependencies": { | ||
"rox-base": "^2.3.7" | ||
"rox-base": "^3.0.0" | ||
}, | ||
@@ -75,4 +74,7 @@ "devDependencies": { | ||
"/node_modules/(?!rox-base).+\\.js$" | ||
] | ||
], | ||
"moduleNameMapper": { | ||
"rox-base": "<rootDir>/../rox-base/src" | ||
} | ||
} | ||
} |
@@ -6,7 +6,6 @@ import RoxBase from 'rox-base'; | ||
import Flag from './lib/Flag'; | ||
import FlagOverriderFacade from './lib/FlagOverriderFacade'; | ||
import { startAdminServer } from './lib/httpService'; | ||
import * as overrides from './lib/Overrider'; | ||
Rox.startAdminServer = startAdminServer; | ||
Rox.overrides = FlagOverriderFacade; | ||
Rox.Configuration = RemoteConfiguration; | ||
@@ -16,3 +15,4 @@ Rox.setContext = RoxBase.Context.Manager.setContext; | ||
Rox.Flag = Flag; | ||
Rox.overrides = overrides; | ||
export default Rox; |
import RoxCache from './RoxCache'; | ||
import RoxBase from 'rox-base'; | ||
@@ -43,1 +44,8 @@ const OVERRIDE_CACHE_KEY = 'roxOverrideValues'; | ||
} | ||
export function getOriginalValue(name) { | ||
if (!name) throw new Error('Missing name'); | ||
const flag = RoxBase.Repositories.Flags.flagWithName(name); | ||
if (!flag) return null; | ||
return flag._originalValue(); | ||
} |
import RoxBase from 'rox-base'; | ||
const { RoxLogger, Config: configuration } = RoxBase; | ||
const { RoxLogger, Config: configuration, Repositories } = RoxBase; | ||
import client from './RoxClient'; | ||
@@ -42,2 +42,11 @@ | ||
} | ||
fetch() { | ||
client && client.fetch(); | ||
} | ||
get flags() { | ||
return Repositories.Flags.flags; | ||
} | ||
} | ||
@@ -44,0 +53,0 @@ |
@@ -12,8 +12,9 @@ import RoxBase from 'rox-base'; | ||
super(defaultValue, options, name); | ||
this._freezable = false; | ||
} | ||
getActiveValue(context) { | ||
getActiveValue(callContext, context) { | ||
if (this.condition) { | ||
let mergedContext = Context.Actions.getMergedContextWithGlobal(context); | ||
const evaluatedResult = parser.evaluateExpression(this.condition, mergedContext); | ||
const evaluatedResult = parser.evaluateExpression(this.condition, callContext, mergedContext); | ||
if (typeof evaluatedResult !== 'undefined' && this._options.indexOf(evaluatedResult) !== -1) { | ||
@@ -26,3 +27,3 @@ return evaluatedResult; | ||
getValue(context, dontInvokeFlagImpression) { | ||
getInternalValue(callContext, context) { | ||
const overridenValue = this.overridenValue; | ||
@@ -32,9 +33,16 @@ if (overridenValue) { | ||
} | ||
const value = this.getActiveValue(context); | ||
dontInvokeFlagImpression || this._flagImpression(value, context); | ||
const value = this.getActiveValue(callContext, context); | ||
callContext.dontInvokeFlagImpression || this._flagImpression(value, context); | ||
return value; | ||
} | ||
getValue(context, dontInvokeFlagImpression) { | ||
let callContext = { dontInvokeFlagImpression: dontInvokeFlagImpression }; | ||
return this.getInternalValue(callContext, context); | ||
} | ||
peek(context) { | ||
return this.getValue(context, true); | ||
let callContext = { dontInvokeFlagImpression: true }; | ||
return this.getInternalValue(callContext, context); | ||
} | ||
@@ -41,0 +49,0 @@ |
Sorry, the diff of this file is too big to display
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
374924
9913
13
24
6
+ Addedrox-base@3.2.5(transitive)
- Removedrox-base@2.3.7(transitive)
Updatedrox-base@^3.0.0