Skip to content

chore: Export OptimizelyConfig interface and UserAttributes type Definitions from TS type definitions and prepare for release 4.3.1 #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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