Comparing version 1.2.9 to 2.0.2
{ | ||
"name": "rox-node", | ||
"version": "1.2.9", | ||
"version": "2.0.2", | ||
"description": "Rollout.io ROX JS SDK Node", | ||
@@ -45,3 +45,3 @@ "author": "Rollout.io <support@rollout.io>", | ||
"dependencies": { | ||
"rox-base": "^1.2.9" | ||
"rox-base": "^2.0.2" | ||
}, | ||
@@ -65,6 +65,12 @@ "devDependencies": { | ||
"jest": { | ||
"moduleFileExtensions": ["js"], | ||
"moduleDirectories": ["node_modules"], | ||
"transformIgnorePatterns": ["/node_modules/(?!rox-base).+\\.js$"] | ||
"moduleFileExtensions": [ | ||
"js" | ||
], | ||
"moduleDirectories": [ | ||
"node_modules" | ||
], | ||
"transformIgnorePatterns": [ | ||
"/node_modules/(?!rox-base).+\\.js$" | ||
] | ||
} | ||
} |
export const defaultSetupOptions = { | ||
distinctId: null, | ||
version: '0', | ||
syncCompletionHandler: null, | ||
configurationFetchedHandler: function() {}, | ||
flagImpressionHandler: null, | ||
fetchIntervalInSec: 60, | ||
devModeSecret: null | ||
}; |
import RoxBase from 'rox-base'; | ||
import Manifest from '../manifest'; | ||
import RoxCache from './RoxCache'; | ||
@@ -27,2 +28,2 @@ const { DeviceProperties: DevicePropertiesBase } = RoxBase; | ||
export default new DeviceProperties() | ||
export default new DeviceProperties(RoxCache); |
@@ -1,7 +0,7 @@ | ||
import Rox from 'rox-base' | ||
import * as Overrider from './Overrider'; | ||
export default { | ||
hasFlagOverride: Rox.Overrider.hasOverride, | ||
resetFlagOverride: Rox.Overrider.clearOverride, | ||
setFlagValue: Rox.Overrider.setOverride | ||
} | ||
hasFlagOverride: Overrider.hasOverride, | ||
resetFlagOverride: Overrider.clearOverride, | ||
setFlagValue: Overrider.setOverride | ||
}; |
import { ROUTES, TYPES } from './httpConst'; | ||
import roxBase from 'rox-base'; | ||
import * as Overrider from './Overrider'; | ||
@@ -70,3 +71,3 @@ const flagsPattern = new RegExp(`^${ROUTES.FLAGS}\/?(.+)?`); | ||
if (!name || !value) return; | ||
roxBase.Overrider.setOverride(name, value); | ||
Overrider.setOverride(name, value); | ||
}); | ||
@@ -86,6 +87,6 @@ return allFlagsJSON(); | ||
// delete specific override | ||
roxBase.Overrider.clearOverride(matched[1]); | ||
Overrider.clearOverride(matched[1]); | ||
} else { | ||
// delete all overrides | ||
roxBase.Overrider.clearAllOverrides(); | ||
Overrider.clearAllOverrides(); | ||
} | ||
@@ -92,0 +93,0 @@ } else { |
import RoxBase from 'rox-base'; | ||
const { RoxLogger, Config: configuration, ConfigurationFetcher } = RoxBase; | ||
const { RoxLogger, Config: configuration } = RoxBase; | ||
import client from './RoxClient'; | ||
@@ -19,14 +19,3 @@ | ||
return client | ||
.setup(options) | ||
.then(() => { | ||
this.configurationFetcher = new ConfigurationFetcher( | ||
client.appKey, | ||
client.deviceProperties, | ||
client.devModeSecret | ||
); | ||
return this.configurationFetcher.fetchFromNetwork(); | ||
}) | ||
.then(response => this.configurationFetcher.process(response)) | ||
.then(() => client.fetchPeriodically()); | ||
return client.setup(options).then(() => client.fetchPeriodically()); | ||
} | ||
@@ -33,0 +22,0 @@ |
@@ -5,2 +5,3 @@ import RoxBase from 'rox-base'; | ||
import { getDefaultCustomProperties } from './DefaultProperties'; | ||
import RoxCache from './RoxCache'; | ||
@@ -12,3 +13,4 @@ const { createRoxClient } = RoxBase; | ||
getDefaultCustomProperties, | ||
DefaultSetupOptions | ||
DefaultSetupOptions, | ||
cacheService: RoxCache | ||
}); |
import RoxBase from 'rox-base'; | ||
import * as Overrider from './Overrider'; | ||
const { Variant: BaseVariant } = RoxBase.Entities; | ||
@@ -17,3 +18,5 @@ const { RoxxParser } = RoxBase.Parsers; | ||
const evaluatedResult = parser.evaluateExpression(this.condition, mergedContext); | ||
if (typeof evaluatedResult !== 'undefined') return evaluatedResult; | ||
if (typeof evaluatedResult !== 'undefined' && this._options.indexOf(evaluatedResult) !== -1) { | ||
return evaluatedResult; | ||
} | ||
} | ||
@@ -23,10 +26,19 @@ return this._defaultValue; | ||
getValue(context) { | ||
getValue(context, dontInvokeFlagImpression) { | ||
const overridenValue = this.overridenValue; | ||
return overridenValue ? overridenValue : this.getActiveValue(context); | ||
if (overridenValue) { | ||
return overridenValue; | ||
} | ||
const value = this.getActiveValue(context); | ||
dontInvokeFlagImpression || this._flagImpression(value, context); | ||
return value; | ||
} | ||
_peek() { | ||
return this.getValue(); | ||
peek(context) { | ||
return this.getValue(context, true); | ||
} | ||
get overrider() { | ||
return Overrider; | ||
} | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
22
225343
6432
5
+ Addedrox-base@2.3.7(transitive)
- Removedaxios@0.17.1(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcharenc@0.0.2(transitive)
- Removedcrypt@0.0.2(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedlodash.clonedeep@4.5.0(transitive)
- Removedloglevel@1.9.2(transitive)
- Removedlscache@1.3.2(transitive)
- Removedmd5@2.3.0(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedqs@6.13.1(transitive)
- Removedrox-base@1.2.9(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedside-channel@1.0.6(transitive)
- Removeduuid@3.4.0(transitive)
Updatedrox-base@^2.0.2