Skip to content

Commit

Permalink
chore: Export OptimizelyConfig interface and UserAttributes type Defi…
Browse files Browse the repository at this point in the history
…nitions from TS type definitions and prepare for release 4.3.1 (#587)

* Add missing OptimizelyConfig and UserAttributes to TS definitions

* Include pull request number to changelog

* Prepare for 4.3.1 release

* Fix date in Changelog
  • Loading branch information
yavorona authored Oct 5, 2020
1 parent 4e790fd commit 405bdd0
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 20 deletions.
6 changes: 6 additions & 0 deletions packages/optimizely-sdk/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/index.browser.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
32 changes: 18 additions & 14 deletions packages/optimizely-sdk/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 }>;
}
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/index.node.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/index.react_native.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/utils/enums/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/optimizely-sdk/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 405bdd0

Please sign in to comment.