diff --git a/packages/optimizely-sdk/CHANGELOG.MD b/packages/optimizely-sdk/CHANGELOG.MD index cbcae5156..da022239f 100644 --- a/packages/optimizely-sdk/CHANGELOG.MD +++ b/packages/optimizely-sdk/CHANGELOG.MD @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [4.3.1] - October 5, 2020 + +### Bug fixes + +- Exported `OptimizelyConfig` and `UserAttributes` type in TypeScript type definitions ([#587](https://github.com/optimizely/javascript-sdk/pull/587)) + ## [4.3.0] - October 1, 2020 ### New Features diff --git a/packages/optimizely-sdk/lib/index.browser.tests.js b/packages/optimizely-sdk/lib/index.browser.tests.js index 2c49a6a59..5d7cec571 100644 --- a/packages/optimizely-sdk/lib/index.browser.tests.js +++ b/packages/optimizely-sdk/lib/index.browser.tests.js @@ -148,7 +148,7 @@ describe('javascript-sdk', function() { optlyInstance.onReady().catch(function() {}); assert.instanceOf(optlyInstance, Optimizely); - assert.equal(optlyInstance.clientVersion, '4.3.0'); + assert.equal(optlyInstance.clientVersion, '4.3.1'); }); it('should set the JavaScript client engine and version', function() { diff --git a/packages/optimizely-sdk/lib/index.d.ts b/packages/optimizely-sdk/lib/index.d.ts index 3bc79687c..7222ea530 100644 --- a/packages/optimizely-sdk/lib/index.d.ts +++ b/packages/optimizely-sdk/lib/index.d.ts @@ -30,6 +30,10 @@ declare module '@optimizely/optimizely-sdk' { export const eventDispatcher: EventDispatcher; + export type UserAttributes = import('./shared_types').UserAttributes; + + export type OptimizelyConfig = import('./shared_types').OptimizelyConfig; + interface DatafileOptions { autoUpdate?: boolean; updateInterval?: number; @@ -66,72 +70,72 @@ declare module '@optimizely/optimizely-sdk' { activate( experimentKey: string, userId: string, - attributes?: import('./shared_types').UserAttributes + attributes?: UserAttributes ): string | null; track( eventKey: string, userId: string, - attributes?: import('./shared_types').UserAttributes, + attributes?: UserAttributes, eventTags?: EventTags ): void; getVariation( experimentKey: string, userId: string, - attributes?: import('./shared_types').UserAttributes + attributes?: UserAttributes ): string | null; setForcedVariation(experimentKey: string, userId: string, variationKey: string | null): boolean; getForcedVariation(experimentKey: string, userId: string): string | null; isFeatureEnabled( featureKey: string, userId: string, - attributes?: import('./shared_types').UserAttributes + attributes?: UserAttributes ): boolean; getEnabledFeatures( userId: string, - attributes?: import('./shared_types').UserAttributes + attributes?: UserAttributes ): string[]; getFeatureVariable( featureKey: string, variableKey: string, userId: string, - attributes?: import('./shared_types').UserAttributes + attributes?: UserAttributes ): unknown; getFeatureVariableBoolean( featureKey: string, variableKey: string, userId: string, - attributes?: import('./shared_types').UserAttributes + attributes?: UserAttributes ): boolean | null; getFeatureVariableDouble( featureKey: string, variableKey: string, userId: string, - attributes?: import('./shared_types').UserAttributes + attributes?: UserAttributes ): number | null; getFeatureVariableInteger( featureKey: string, variableKey: string, userId: string, - attributes?: import('./shared_types').UserAttributes + attributes?: UserAttributes ): number | null; getFeatureVariableString( featureKey: string, variableKey: string, userId: string, - attributes?: import('./shared_types').UserAttributes + attributes?: UserAttributes ): string | null; getFeatureVariableJSON( featureKey: string, variableKey: string, userId: string, - attributes?: import('./shared_types').UserAttributes + attributes?: UserAttributes ): unknown; getAllFeatureVariables( featureKey: string, userId: string, - attributes?: import('./shared_types').UserAttributes + attributes?: UserAttributes ): { [variableKey: string]: unknown }; - getOptimizelyConfig(): import('./shared_types').OptimizelyConfig | null; + getOptimizelyConfig(): OptimizelyConfig | null; onReady(options?: { timeout?: number }): Promise<{ success: boolean; reason?: string }>; close(): Promise<{ success: boolean; reason?: string }>; } @@ -175,7 +179,7 @@ declare module '@optimizely/optimizely-sdk' { export interface ListenerPayload { userId: string; - attributes: import('./shared_types').UserAttributes; + attributes: UserAttributes; } export interface ActivateListenerPayload extends ListenerPayload { diff --git a/packages/optimizely-sdk/lib/index.node.tests.js b/packages/optimizely-sdk/lib/index.node.tests.js index bf04ee20c..273239eeb 100644 --- a/packages/optimizely-sdk/lib/index.node.tests.js +++ b/packages/optimizely-sdk/lib/index.node.tests.js @@ -90,7 +90,7 @@ describe('optimizelyFactory', function() { optlyInstance.onReady().catch(function() {}); assert.instanceOf(optlyInstance, Optimizely); - assert.equal(optlyInstance.clientVersion, '4.3.0'); + assert.equal(optlyInstance.clientVersion, '4.3.1'); }); describe('event processor configuration', function() { diff --git a/packages/optimizely-sdk/lib/index.react_native.tests.js b/packages/optimizely-sdk/lib/index.react_native.tests.js index a1ab74270..556451847 100644 --- a/packages/optimizely-sdk/lib/index.react_native.tests.js +++ b/packages/optimizely-sdk/lib/index.react_native.tests.js @@ -89,7 +89,7 @@ describe('javascript-sdk/react-native', function() { optlyInstance.onReady().catch(function() {}); assert.instanceOf(optlyInstance, Optimizely); - assert.equal(optlyInstance.clientVersion, '4.3.0'); + assert.equal(optlyInstance.clientVersion, '4.3.1'); }); it('should set the Javascript client engine and version', function() { diff --git a/packages/optimizely-sdk/lib/utils/enums/index.ts b/packages/optimizely-sdk/lib/utils/enums/index.ts index e4dde2d48..af8e18af2 100644 --- a/packages/optimizely-sdk/lib/utils/enums/index.ts +++ b/packages/optimizely-sdk/lib/utils/enums/index.ts @@ -173,7 +173,7 @@ export const CONTROL_ATTRIBUTES = { export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk'; export const NODE_CLIENT_ENGINE = 'node-sdk'; export const REACT_CLIENT_ENGINE = 'react-sdk'; -export const NODE_CLIENT_VERSION = '4.3.0'; +export const NODE_CLIENT_VERSION = '4.3.1'; export const VALID_CLIENT_ENGINES = [ NODE_CLIENT_ENGINE, diff --git a/packages/optimizely-sdk/package-lock.json b/packages/optimizely-sdk/package-lock.json index b066ba741..3abaf9915 100644 --- a/packages/optimizely-sdk/package-lock.json +++ b/packages/optimizely-sdk/package-lock.json @@ -1,6 +1,6 @@ { "name": "@optimizely/optimizely-sdk", - "version": "4.3.0", + "version": "4.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/optimizely-sdk/package.json b/packages/optimizely-sdk/package.json index 05294ee12..6dae0c7ea 100644 --- a/packages/optimizely-sdk/package.json +++ b/packages/optimizely-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@optimizely/optimizely-sdk", - "version": "4.3.0", + "version": "4.3.1", "description": "JavaScript SDK for Optimizely X Full Stack", "module": "dist/optimizely.browser.es.min.js", "main": "dist/optimizely.node.min.js",