Skip to content

Commit 405bdd0

Browse files
authored
chore: Export OptimizelyConfig interface and UserAttributes type Definitions 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
1 parent 4e790fd commit 405bdd0

File tree

8 files changed

+30
-20
lines changed

8 files changed

+30
-20
lines changed

packages/optimizely-sdk/CHANGELOG.MD

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## [4.3.1] - October 5, 2020
11+
12+
### Bug fixes
13+
14+
- Exported `OptimizelyConfig` and `UserAttributes` type in TypeScript type definitions ([#587](https://github.com/optimizely/javascript-sdk/pull/587))
15+
1016
## [4.3.0] - October 1, 2020
1117

1218
### New Features

packages/optimizely-sdk/lib/index.browser.tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ describe('javascript-sdk', function() {
148148
optlyInstance.onReady().catch(function() {});
149149

150150
assert.instanceOf(optlyInstance, Optimizely);
151-
assert.equal(optlyInstance.clientVersion, '4.3.0');
151+
assert.equal(optlyInstance.clientVersion, '4.3.1');
152152
});
153153

154154
it('should set the JavaScript client engine and version', function() {

packages/optimizely-sdk/lib/index.d.ts

+18-14
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ declare module '@optimizely/optimizely-sdk' {
3030

3131
export const eventDispatcher: EventDispatcher;
3232

33+
export type UserAttributes = import('./shared_types').UserAttributes;
34+
35+
export type OptimizelyConfig = import('./shared_types').OptimizelyConfig;
36+
3337
interface DatafileOptions {
3438
autoUpdate?: boolean;
3539
updateInterval?: number;
@@ -66,72 +70,72 @@ declare module '@optimizely/optimizely-sdk' {
6670
activate(
6771
experimentKey: string,
6872
userId: string,
69-
attributes?: import('./shared_types').UserAttributes
73+
attributes?: UserAttributes
7074
): string | null;
7175
track(
7276
eventKey: string,
7377
userId: string,
74-
attributes?: import('./shared_types').UserAttributes,
78+
attributes?: UserAttributes,
7579
eventTags?: EventTags
7680
): void;
7781
getVariation(
7882
experimentKey: string,
7983
userId: string,
80-
attributes?: import('./shared_types').UserAttributes
84+
attributes?: UserAttributes
8185
): string | null;
8286
setForcedVariation(experimentKey: string, userId: string, variationKey: string | null): boolean;
8387
getForcedVariation(experimentKey: string, userId: string): string | null;
8488
isFeatureEnabled(
8589
featureKey: string,
8690
userId: string,
87-
attributes?: import('./shared_types').UserAttributes
91+
attributes?: UserAttributes
8892
): boolean;
8993
getEnabledFeatures(
9094
userId: string,
91-
attributes?: import('./shared_types').UserAttributes
95+
attributes?: UserAttributes
9296
): string[];
9397
getFeatureVariable(
9498
featureKey: string,
9599
variableKey: string,
96100
userId: string,
97-
attributes?: import('./shared_types').UserAttributes
101+
attributes?: UserAttributes
98102
): unknown;
99103
getFeatureVariableBoolean(
100104
featureKey: string,
101105
variableKey: string,
102106
userId: string,
103-
attributes?: import('./shared_types').UserAttributes
107+
attributes?: UserAttributes
104108
): boolean | null;
105109
getFeatureVariableDouble(
106110
featureKey: string,
107111
variableKey: string,
108112
userId: string,
109-
attributes?: import('./shared_types').UserAttributes
113+
attributes?: UserAttributes
110114
): number | null;
111115
getFeatureVariableInteger(
112116
featureKey: string,
113117
variableKey: string,
114118
userId: string,
115-
attributes?: import('./shared_types').UserAttributes
119+
attributes?: UserAttributes
116120
): number | null;
117121
getFeatureVariableString(
118122
featureKey: string,
119123
variableKey: string,
120124
userId: string,
121-
attributes?: import('./shared_types').UserAttributes
125+
attributes?: UserAttributes
122126
): string | null;
123127
getFeatureVariableJSON(
124128
featureKey: string,
125129
variableKey: string,
126130
userId: string,
127-
attributes?: import('./shared_types').UserAttributes
131+
attributes?: UserAttributes
128132
): unknown;
129133
getAllFeatureVariables(
130134
featureKey: string,
131135
userId: string,
132-
attributes?: import('./shared_types').UserAttributes
136+
attributes?: UserAttributes
133137
): { [variableKey: string]: unknown };
134-
getOptimizelyConfig(): import('./shared_types').OptimizelyConfig | null;
138+
getOptimizelyConfig(): OptimizelyConfig | null;
135139
onReady(options?: { timeout?: number }): Promise<{ success: boolean; reason?: string }>;
136140
close(): Promise<{ success: boolean; reason?: string }>;
137141
}
@@ -175,7 +179,7 @@ declare module '@optimizely/optimizely-sdk' {
175179

176180
export interface ListenerPayload {
177181
userId: string;
178-
attributes: import('./shared_types').UserAttributes;
182+
attributes: UserAttributes;
179183
}
180184

181185
export interface ActivateListenerPayload extends ListenerPayload {

packages/optimizely-sdk/lib/index.node.tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('optimizelyFactory', function() {
9090
optlyInstance.onReady().catch(function() {});
9191

9292
assert.instanceOf(optlyInstance, Optimizely);
93-
assert.equal(optlyInstance.clientVersion, '4.3.0');
93+
assert.equal(optlyInstance.clientVersion, '4.3.1');
9494
});
9595

9696
describe('event processor configuration', function() {

packages/optimizely-sdk/lib/index.react_native.tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('javascript-sdk/react-native', function() {
8989
optlyInstance.onReady().catch(function() {});
9090

9191
assert.instanceOf(optlyInstance, Optimizely);
92-
assert.equal(optlyInstance.clientVersion, '4.3.0');
92+
assert.equal(optlyInstance.clientVersion, '4.3.1');
9393
});
9494

9595
it('should set the Javascript client engine and version', function() {

packages/optimizely-sdk/lib/utils/enums/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export const CONTROL_ATTRIBUTES = {
173173
export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk';
174174
export const NODE_CLIENT_ENGINE = 'node-sdk';
175175
export const REACT_CLIENT_ENGINE = 'react-sdk';
176-
export const NODE_CLIENT_VERSION = '4.3.0';
176+
export const NODE_CLIENT_VERSION = '4.3.1';
177177

178178
export const VALID_CLIENT_ENGINES = [
179179
NODE_CLIENT_ENGINE,

packages/optimizely-sdk/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/optimizely-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@optimizely/optimizely-sdk",
3-
"version": "4.3.0",
3+
"version": "4.3.1",
44
"description": "JavaScript SDK for Optimizely X Full Stack",
55
"module": "dist/optimizely.browser.es.min.js",
66
"main": "dist/optimizely.node.min.js",

0 commit comments

Comments
 (0)