@optimizely/optimizely-sdk
Advanced tools
Comparing version 3.2.0-alpha to 3.2.0-beta
@@ -10,2 +10,16 @@ # Changelog | ||
## [3.2.0-beta] - May 16th, 2019 | ||
### Bug Fixes: | ||
- Clear timeout created in onReady call for timeout promise as soon as project config manager's ready promise fulfills | ||
### New Features | ||
- Added 60 second timeout for all datafile requests | ||
### Changed | ||
- Updated datafile request polling behavior: | ||
- Start update interval timer immediately after request | ||
- When update interval timer fires during request, wait until request completes, then immediately start next request | ||
- Update TypeScript definitions to account for new methods (`onReady`, `close`) and new properties on object accepted by createInstance (`datafileOptions`, `sdkKey`) | ||
## [3.2.0-alpha] - April 26nd, 2019 | ||
@@ -12,0 +26,0 @@ |
@@ -122,3 +122,3 @@ /** | ||
assert.instanceOf(optlyInstance, Optimizely); | ||
assert.equal(optlyInstance.clientVersion, '3.2.0-alpha'); | ||
assert.equal(optlyInstance.clientVersion, '3.2.0-beta'); | ||
}); | ||
@@ -125,0 +125,0 @@ |
@@ -18,9 +18,31 @@ /** | ||
declare module '@optimizely/optimizely-sdk' { | ||
import enums = require('@optimizely/optimizely-sdk/lib/utils/enums'); | ||
export namespace enums { | ||
enum LOG_LEVEL { | ||
NOTSET = 0, | ||
DEBUG = 1, | ||
INFO = 2, | ||
WARNING = 3, | ||
ERROR = 4, | ||
} | ||
enum NOTIFICATION_TYPES { | ||
ACTIVATE = 'ACTIVATE:experiment, user_id,attributes, variation, event', | ||
DECISION = 'DECISION:type, userId, attributes, decisionInfo', | ||
OPTIMIZELY_CONFIG_UPDATE = 'OPTIMIZELY_CONFIG_UPDATE', | ||
TRACK = 'TRACK:event_key, user_id, attributes, event_tags, event', | ||
} | ||
} | ||
export function createInstance(config: Config): Client; | ||
interface DatafileOptions { | ||
autoUpdate?: boolean; | ||
updateInterval?: number; | ||
urlTemplate?: string; | ||
} | ||
// The options object given to Optimizely.createInstance. | ||
export interface Config { | ||
datafile: object; | ||
datafile?: object | string; | ||
datafileOptions?: DatafileOptions, | ||
errorHandler?: object; | ||
@@ -35,2 +57,3 @@ eventDispatcher?: object; | ||
eventFlushInterval?: number | ||
sdkKey?: string; | ||
} | ||
@@ -51,2 +74,4 @@ | ||
getFeatureVariableString(featureKey: string, variableKey: string, userId: string, attributes?: UserAttributes): string | null; | ||
onReady(options?: { timeout?: number }): Promise<void> | ||
close(): void | ||
} | ||
@@ -151,3 +176,3 @@ | ||
declare module '@optimizely/optimizely-sdk/lib/utils/enums'{ | ||
export enum LOG_LEVEL{ | ||
export enum LOG_LEVEL { | ||
NOTSET = 0, | ||
@@ -159,4 +184,7 @@ DEBUG = 1, | ||
} | ||
export enum NOTIFICATION_TYPES { | ||
ACTIVATE = 'ACTIVATE:experiment, user_id, attributes, variation, events', | ||
ACTIVATE = 'ACTIVATE:experiment, user_id,attributes, variation, event', | ||
DECISION = 'DECISION:type, userId, attributes, decisionInfo', | ||
OPTIMIZELY_CONFIG_UPDATE = 'OPTIMIZELY_CONFIG_UPDATE', | ||
TRACK = 'TRACK:event_key, user_id, attributes, event_tags, event', | ||
@@ -188,2 +216,2 @@ } | ||
export function createNoOpLogger(): Optimizely.Logger; | ||
} | ||
} |
@@ -93,3 +93,3 @@ /** | ||
assert.instanceOf(optlyInstance, Optimizely); | ||
assert.equal(optlyInstance.clientVersion, '3.2.0-alpha'); | ||
assert.equal(optlyInstance.clientVersion, '3.2.0-beta'); | ||
}); | ||
@@ -96,0 +96,0 @@ }); |
@@ -939,2 +939,10 @@ /**************************************************************************** | ||
this.__readyPromise.then(function() { | ||
clearTimeout(readyTimeout); | ||
delete this.__readyTimeouts[timeoutId]; | ||
resolveTimeoutPromise({ | ||
success: true, | ||
}); | ||
}.bind(this)); | ||
return Promise.race([this.__readyPromise, timeoutPromise]); | ||
@@ -941,0 +949,0 @@ }; |
@@ -157,3 +157,3 @@ /**************************************************************************** | ||
exports.NODE_CLIENT_ENGINE = 'node-sdk'; | ||
exports.NODE_CLIENT_VERSION = '3.2.0-alpha'; | ||
exports.NODE_CLIENT_VERSION = '3.2.0-beta'; | ||
@@ -160,0 +160,0 @@ /* |
{ | ||
"name": "@optimizely/optimizely-sdk", | ||
"version": "3.2.0-alpha", | ||
"version": "3.2.0-beta", | ||
"description": "JavaScript SDK for Optimizely X Full Stack", | ||
@@ -35,3 +35,3 @@ "main": "lib/index.node.js", | ||
"dependencies": { | ||
"@optimizely/js-sdk-datafile-manager": "^0.2.0", | ||
"@optimizely/js-sdk-datafile-manager": "^0.3.0", | ||
"@optimizely/js-sdk-event-processor": "^0.2.0", | ||
@@ -38,0 +38,0 @@ "@optimizely/js-sdk-logging": "^0.1.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1357651
30101
+ Added@optimizely/js-sdk-datafile-manager@0.3.0(transitive)
- Removed@optimizely/js-sdk-datafile-manager@0.2.0(transitive)