@featurevisor/sdk 0.19.0 → 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
@@ -1,40 +1,65 @@
1
- import { Attributes, VariationValue, VariableValue, Feature, DatafileContent, BucketValue, FeatureKey, VariationType, VariableType, StickyFeatures, InitialFeatures } from "@featurevisor/types";
1
+ import { Attributes, BucketValue, DatafileContent, Feature, FeatureKey, InitialFeatures, StickyFeatures, VariableType, VariableValue, VariationType, VariationValue } from "@featurevisor/types";
2
2
  import { Logger } from "./logger";
3
3
  import { Emitter } from "./emitter";
4
- import { Statuses } from "./statuses";
4
+ export type ReadyCallback = () => void;
5
5
  export type ActivationCallback = (featureName: string, variation: VariationValue, attributes: Attributes, captureAttributes: Attributes) => void;
6
6
  export type ConfigureBucketValue = (feature: any, attributes: any, bucketValue: BucketValue) => BucketValue;
7
- export interface SdkOptions {
8
- datafile: DatafileContent | string;
9
- onActivation?: ActivationCallback;
7
+ export interface Statuses {
8
+ ready: boolean;
9
+ refreshInProgress: boolean;
10
+ }
11
+ export interface InstanceOptions {
10
12
  configureBucketValue?: ConfigureBucketValue;
11
- logger?: Logger;
12
- emitter?: Emitter;
13
+ datafile?: DatafileContent | string;
14
+ datafileUrl?: string;
15
+ handleDatafileFetch?: (datafileUrl: string) => Promise<DatafileContent>;
16
+ initialFeatures?: InitialFeatures;
13
17
  interceptAttributes?: (attributes: Attributes) => Attributes;
18
+ logger?: Logger;
19
+ onActivation?: ActivationCallback;
20
+ onReady?: ReadyCallback;
21
+ onRefresh?: () => void;
22
+ onUpdate?: () => void;
23
+ refreshInterval?: number;
14
24
  stickyFeatures?: StickyFeatures;
15
- initialFeatures?: InitialFeatures;
16
- statuses?: Statuses;
17
- fromInstance?: boolean;
18
25
  }
26
+ export type DatafileFetchHandler = (datafileUrl: string) => Promise<DatafileContent>;
19
27
  type FieldType = VariationType | VariableType;
20
28
  type ValueType = VariableValue;
21
29
  export declare function getValueByType(value: ValueType, fieldType: FieldType): ValueType;
22
- export declare class FeaturevisorSDK {
23
- private onActivation?;
24
- private datafileReader;
30
+ export declare class FeaturevisorInstance {
25
31
  private configureBucketValue?;
26
- private logger;
27
- private emitter?;
32
+ private datafileUrl?;
33
+ private handleDatafileFetch?;
34
+ private initialFeatures?;
28
35
  private interceptAttributes?;
36
+ private logger;
37
+ private refreshInterval?;
29
38
  private stickyFeatures?;
30
- private initialFeatures?;
31
- private statuses?;
32
- private fromInstance;
33
- constructor(options: SdkOptions);
39
+ private datafileReader;
40
+ private emitter;
41
+ private statuses;
42
+ private intervalId?;
43
+ on: Emitter["addListener"];
44
+ addListener: Emitter["addListener"];
45
+ off: Emitter["removeListener"];
46
+ removeListener: Emitter["removeListener"];
47
+ removeAllListeners: Emitter["removeAllListeners"];
48
+ constructor(options: InstanceOptions);
34
49
  setDatafile(datafile: DatafileContent | string): void;
35
50
  setStickyFeatures(stickyFeatures: StickyFeatures | undefined): void;
36
51
  getRevision(): string;
37
52
  private getFeature;
53
+ /**
54
+ * Statuses
55
+ */
56
+ isReady(): boolean;
57
+ /**
58
+ * Refresh
59
+ */
60
+ refresh(): void;
61
+ startRefreshing(): void;
62
+ stopRefreshing(): void;
38
63
  /**
39
64
  * Bucketing
40
65
  */
@@ -68,4 +93,5 @@ export declare class FeaturevisorSDK {
68
93
  getVariableObject<T>(featureKey: FeatureKey | Feature, variableKey: string, attributes?: Attributes): T | undefined;
69
94
  getVariableJSON<T>(featureKey: FeatureKey | Feature, variableKey: string, attributes?: Attributes): T | undefined;
70
95
  }
96
+ export declare function createInstance(options: InstanceOptions): FeaturevisorInstance;
71
97
  export {};
@@ -1,7 +1,21 @@
1
+ import { createLogger } from "./logger";
1
2
  import { DatafileReader } from "./datafileReader";
2
- import { getBucketedVariation, getBucketedVariableValue, getForcedVariation, getForcedVariableValue, } from "./feature";
3
+ import { Emitter } from "./emitter";
3
4
  import { getBucketedNumber } from "./bucket";
4
- import { createLogger } from "./logger";
5
+ import { getBucketedVariation, getBucketedVariableValue, getForcedVariation, getForcedVariableValue, } from "./feature";
6
+ var emptyDatafile = {
7
+ schemaVersion: "1",
8
+ revision: "unknown",
9
+ attributes: [],
10
+ segments: [],
11
+ features: [],
12
+ };
13
+ function fetchDatafileContent(datafileUrl, handleDatafileFetch) {
14
+ if (handleDatafileFetch) {
15
+ return handleDatafileFetch(datafileUrl);
16
+ }
17
+ return fetch(datafileUrl).then(function (res) { return res.json(); });
18
+ }
5
19
  export function getValueByType(value, fieldType) {
6
20
  if (value === undefined) {
7
21
  return undefined;
@@ -24,36 +38,73 @@ export function getValueByType(value, fieldType) {
24
38
  return value;
25
39
  }
26
40
  }
27
- // @TODO: change it to FeaturevisorEngine in next breaking semver
28
- // @TODO: move activate*() methods to FeaturevisorInstance in next breaking semver
29
- var FeaturevisorSDK = /** @class */ (function () {
30
- function FeaturevisorSDK(options) {
31
- if (options.onActivation) {
32
- this.onActivation = options.onActivation;
41
+ var FeaturevisorInstance = /** @class */ (function () {
42
+ function FeaturevisorInstance(options) {
43
+ var _this = this;
44
+ // from options
45
+ this.configureBucketValue = options.configureBucketValue;
46
+ this.datafileUrl = options.datafileUrl;
47
+ this.handleDatafileFetch = options.handleDatafileFetch;
48
+ this.initialFeatures = options.initialFeatures;
49
+ this.interceptAttributes = options.interceptAttributes;
50
+ this.logger = options.logger || createLogger();
51
+ this.refreshInterval = options.refreshInterval;
52
+ this.stickyFeatures = options.stickyFeatures;
53
+ // internal
54
+ this.emitter = new Emitter();
55
+ this.statuses = {
56
+ ready: false,
57
+ refreshInProgress: false,
58
+ };
59
+ // register events
60
+ if (options.onReady) {
61
+ this.emitter.addListener("ready", options.onReady);
33
62
  }
34
- if (options.configureBucketValue) {
35
- this.configureBucketValue = options.configureBucketValue;
63
+ if (options.onRefresh) {
64
+ this.emitter.addListener("refresh", options.onRefresh);
36
65
  }
37
- this.logger = options.logger || createLogger();
38
- if (options.interceptAttributes) {
39
- this.interceptAttributes = options.interceptAttributes;
66
+ if (options.onUpdate) {
67
+ this.emitter.addListener("update", options.onUpdate);
40
68
  }
41
- if (options.emitter) {
42
- this.emitter = options.emitter;
69
+ if (options.onActivation) {
70
+ this.emitter.addListener("activation", options.onActivation);
43
71
  }
44
- if (options.stickyFeatures) {
45
- this.stickyFeatures = options.stickyFeatures;
72
+ // expose emitter methods
73
+ var on = this.emitter.addListener.bind(this.emitter);
74
+ this.on = on;
75
+ this.addListener = on;
76
+ var off = this.emitter.removeListener.bind(this.emitter);
77
+ this.off = off;
78
+ this.removeListener = off;
79
+ this.removeAllListeners = this.emitter.removeAllListeners.bind(this.emitter);
80
+ // datafile
81
+ if (options.datafileUrl) {
82
+ this.setDatafile(options.datafile || emptyDatafile);
83
+ fetchDatafileContent(options.datafileUrl, options.handleDatafileFetch)
84
+ .then(function (datafile) {
85
+ _this.setDatafile(datafile);
86
+ _this.statuses.ready = true;
87
+ _this.emitter.emit("ready");
88
+ if (_this.refreshInterval) {
89
+ _this.startRefreshing();
90
+ }
91
+ })
92
+ .catch(function (e) {
93
+ _this.logger.error("failed to fetch datafile", { error: e });
94
+ });
46
95
  }
47
- if (options.initialFeatures) {
48
- this.initialFeatures = options.initialFeatures;
96
+ else if (options.datafile) {
97
+ this.setDatafile(options.datafile);
98
+ this.statuses.ready = true;
99
+ setTimeout(function () {
100
+ _this.emitter.emit("ready");
101
+ }, 0);
49
102
  }
50
- if (options.statuses) {
51
- this.statuses = options.statuses;
103
+ else {
104
+ throw new Error("Featurevisor SDK instance cannot be created without both `datafile` and `datafileUrl` options");
52
105
  }
53
- this.setDatafile(options.datafile);
54
- this.fromInstance = options.fromInstance || false;
55
106
  }
56
- FeaturevisorSDK.prototype.setDatafile = function (datafile) {
107
+ FeaturevisorInstance.prototype.setDatafile = function (datafile) {
57
108
  try {
58
109
  this.datafileReader = new DatafileReader(typeof datafile === "string" ? JSON.parse(datafile) : datafile);
59
110
  }
@@ -61,26 +112,84 @@ var FeaturevisorSDK = /** @class */ (function () {
61
112
  this.logger.error("could not parse datafile", { error: e });
62
113
  }
63
114
  };
64
- FeaturevisorSDK.prototype.setStickyFeatures = function (stickyFeatures) {
115
+ FeaturevisorInstance.prototype.setStickyFeatures = function (stickyFeatures) {
65
116
  this.stickyFeatures = stickyFeatures;
66
117
  };
67
- FeaturevisorSDK.prototype.getRevision = function () {
118
+ FeaturevisorInstance.prototype.getRevision = function () {
68
119
  return this.datafileReader.getRevision();
69
120
  };
70
- FeaturevisorSDK.prototype.getFeature = function (featureKey) {
121
+ FeaturevisorInstance.prototype.getFeature = function (featureKey) {
71
122
  return typeof featureKey === "string"
72
123
  ? this.datafileReader.getFeature(featureKey) // only key provided
73
124
  : featureKey; // full feature provided
74
125
  };
126
+ /**
127
+ * Statuses
128
+ */
129
+ FeaturevisorInstance.prototype.isReady = function () {
130
+ return this.statuses.ready;
131
+ };
132
+ /**
133
+ * Refresh
134
+ */
135
+ FeaturevisorInstance.prototype.refresh = function () {
136
+ var _this = this;
137
+ this.logger.debug("refreshing datafile");
138
+ if (this.statuses.refreshInProgress) {
139
+ return this.logger.warn("refresh in progress, skipping");
140
+ }
141
+ if (!this.datafileUrl) {
142
+ return this.logger.error("cannot refresh since `datafileUrl` is not provided");
143
+ }
144
+ this.statuses.refreshInProgress = true;
145
+ fetchDatafileContent(this.datafileUrl, this.handleDatafileFetch)
146
+ .then(function (datafile) {
147
+ var currentRevision = _this.getRevision();
148
+ var newRevision = datafile.revision;
149
+ var isNotSameRevision = currentRevision !== newRevision;
150
+ _this.setDatafile(datafile);
151
+ _this.logger.info("refreshed datafile");
152
+ _this.emitter.emit("refresh");
153
+ if (isNotSameRevision) {
154
+ _this.emitter.emit("update");
155
+ }
156
+ _this.statuses.refreshInProgress = false;
157
+ })
158
+ .catch(function (e) {
159
+ _this.logger.error("failed to refresh datafile", { error: e });
160
+ _this.statuses.refreshInProgress = false;
161
+ });
162
+ };
163
+ FeaturevisorInstance.prototype.startRefreshing = function () {
164
+ var _this = this;
165
+ if (!this.datafileUrl) {
166
+ return this.logger.error("cannot start refreshing since `datafileUrl` is not provided");
167
+ }
168
+ if (this.intervalId) {
169
+ return this.logger.warn("refreshing has already started");
170
+ }
171
+ if (!this.refreshInterval) {
172
+ return this.logger.warn("no `refreshInterval` option provided");
173
+ }
174
+ this.intervalId = setInterval(function () {
175
+ _this.refresh();
176
+ }, this.refreshInterval * 1000);
177
+ };
178
+ FeaturevisorInstance.prototype.stopRefreshing = function () {
179
+ if (!this.intervalId) {
180
+ return this.logger.warn("refreshing has not started yet");
181
+ }
182
+ clearInterval(this.intervalId);
183
+ };
75
184
  /**
76
185
  * Bucketing
77
186
  */
78
- FeaturevisorSDK.prototype.getBucketKey = function (feature, attributes) {
187
+ FeaturevisorInstance.prototype.getBucketKey = function (feature, attributes) {
79
188
  var featureKey = feature.key;
80
189
  var prefix = typeof feature.bucketBy === "string" ? feature.bucketBy : feature.bucketBy.join("_");
81
190
  return "".concat(prefix, "_").concat(featureKey);
82
191
  };
83
- FeaturevisorSDK.prototype.getBucketValue = function (feature, attributes) {
192
+ FeaturevisorInstance.prototype.getBucketValue = function (feature, attributes) {
84
193
  var bucketKey = this.getBucketKey(feature, attributes);
85
194
  var value = getBucketedNumber(bucketKey);
86
195
  if (this.configureBucketValue) {
@@ -91,7 +200,7 @@ var FeaturevisorSDK = /** @class */ (function () {
91
200
  /**
92
201
  * Variation
93
202
  */
94
- FeaturevisorSDK.prototype.getVariation = function (featureKey, attributes) {
203
+ FeaturevisorInstance.prototype.getVariation = function (featureKey, attributes) {
95
204
  if (attributes === void 0) { attributes = {}; }
96
205
  try {
97
206
  var key = typeof featureKey === "string" ? featureKey : featureKey.key;
@@ -151,22 +260,22 @@ var FeaturevisorSDK = /** @class */ (function () {
151
260
  return undefined;
152
261
  }
153
262
  };
154
- FeaturevisorSDK.prototype.getVariationBoolean = function (featureKey, attributes) {
263
+ FeaturevisorInstance.prototype.getVariationBoolean = function (featureKey, attributes) {
155
264
  if (attributes === void 0) { attributes = {}; }
156
265
  var variationValue = this.getVariation(featureKey, attributes);
157
266
  return getValueByType(variationValue, "boolean");
158
267
  };
159
- FeaturevisorSDK.prototype.getVariationString = function (featureKey, attributes) {
268
+ FeaturevisorInstance.prototype.getVariationString = function (featureKey, attributes) {
160
269
  if (attributes === void 0) { attributes = {}; }
161
270
  var variationValue = this.getVariation(featureKey, attributes);
162
271
  return getValueByType(variationValue, "string");
163
272
  };
164
- FeaturevisorSDK.prototype.getVariationInteger = function (featureKey, attributes) {
273
+ FeaturevisorInstance.prototype.getVariationInteger = function (featureKey, attributes) {
165
274
  if (attributes === void 0) { attributes = {}; }
166
275
  var variationValue = this.getVariation(featureKey, attributes);
167
276
  return getValueByType(variationValue, "integer");
168
277
  };
169
- FeaturevisorSDK.prototype.getVariationDouble = function (featureKey, attributes) {
278
+ FeaturevisorInstance.prototype.getVariationDouble = function (featureKey, attributes) {
170
279
  if (attributes === void 0) { attributes = {}; }
171
280
  var variationValue = this.getVariation(featureKey, attributes);
172
281
  return getValueByType(variationValue, "double");
@@ -174,7 +283,7 @@ var FeaturevisorSDK = /** @class */ (function () {
174
283
  /**
175
284
  * Activate
176
285
  */
177
- FeaturevisorSDK.prototype.activate = function (featureKey, attributes) {
286
+ FeaturevisorInstance.prototype.activate = function (featureKey, attributes) {
178
287
  if (attributes === void 0) { attributes = {}; }
179
288
  try {
180
289
  var variationValue = this.getVariation(featureKey, attributes);
@@ -193,12 +302,7 @@ var FeaturevisorSDK = /** @class */ (function () {
193
302
  captureAttributes_1[a.key] = attributes[a.key];
194
303
  }
195
304
  });
196
- if (this.emitter) {
197
- this.emitter.emit("activation", featureKey, variationValue, finalAttributes_1, captureAttributes_1);
198
- }
199
- if (this.fromInstance && this.onActivation) {
200
- this.onActivation(featureKey, variationValue, finalAttributes_1, captureAttributes_1);
201
- }
305
+ this.emitter.emit("activation", featureKey, variationValue, finalAttributes_1, captureAttributes_1);
202
306
  return variationValue;
203
307
  }
204
308
  catch (e) {
@@ -206,22 +310,22 @@ var FeaturevisorSDK = /** @class */ (function () {
206
310
  return undefined;
207
311
  }
208
312
  };
209
- FeaturevisorSDK.prototype.activateBoolean = function (featureKey, attributes) {
313
+ FeaturevisorInstance.prototype.activateBoolean = function (featureKey, attributes) {
210
314
  if (attributes === void 0) { attributes = {}; }
211
315
  var variationValue = this.activate(featureKey, attributes);
212
316
  return getValueByType(variationValue, "boolean");
213
317
  };
214
- FeaturevisorSDK.prototype.activateString = function (featureKey, attributes) {
318
+ FeaturevisorInstance.prototype.activateString = function (featureKey, attributes) {
215
319
  if (attributes === void 0) { attributes = {}; }
216
320
  var variationValue = this.activate(featureKey, attributes);
217
321
  return getValueByType(variationValue, "string");
218
322
  };
219
- FeaturevisorSDK.prototype.activateInteger = function (featureKey, attributes) {
323
+ FeaturevisorInstance.prototype.activateInteger = function (featureKey, attributes) {
220
324
  if (attributes === void 0) { attributes = {}; }
221
325
  var variationValue = this.activate(featureKey, attributes);
222
326
  return getValueByType(variationValue, "integer");
223
327
  };
224
- FeaturevisorSDK.prototype.activateDouble = function (featureKey, attributes) {
328
+ FeaturevisorInstance.prototype.activateDouble = function (featureKey, attributes) {
225
329
  if (attributes === void 0) { attributes = {}; }
226
330
  var variationValue = this.activate(featureKey, attributes);
227
331
  return getValueByType(variationValue, "double");
@@ -229,7 +333,7 @@ var FeaturevisorSDK = /** @class */ (function () {
229
333
  /**
230
334
  * Variable
231
335
  */
232
- FeaturevisorSDK.prototype.getVariable = function (featureKey, variableKey, attributes) {
336
+ FeaturevisorInstance.prototype.getVariable = function (featureKey, variableKey, attributes) {
233
337
  if (attributes === void 0) { attributes = {}; }
234
338
  try {
235
339
  var key = typeof featureKey === "string" ? featureKey : featureKey.key;
@@ -285,42 +389,45 @@ var FeaturevisorSDK = /** @class */ (function () {
285
389
  return undefined;
286
390
  }
287
391
  };
288
- FeaturevisorSDK.prototype.getVariableBoolean = function (featureKey, variableKey, attributes) {
392
+ FeaturevisorInstance.prototype.getVariableBoolean = function (featureKey, variableKey, attributes) {
289
393
  if (attributes === void 0) { attributes = {}; }
290
394
  var variableValue = this.getVariable(featureKey, variableKey, attributes);
291
395
  return getValueByType(variableValue, "boolean");
292
396
  };
293
- FeaturevisorSDK.prototype.getVariableString = function (featureKey, variableKey, attributes) {
397
+ FeaturevisorInstance.prototype.getVariableString = function (featureKey, variableKey, attributes) {
294
398
  if (attributes === void 0) { attributes = {}; }
295
399
  var variableValue = this.getVariable(featureKey, variableKey, attributes);
296
400
  return getValueByType(variableValue, "string");
297
401
  };
298
- FeaturevisorSDK.prototype.getVariableInteger = function (featureKey, variableKey, attributes) {
402
+ FeaturevisorInstance.prototype.getVariableInteger = function (featureKey, variableKey, attributes) {
299
403
  if (attributes === void 0) { attributes = {}; }
300
404
  var variableValue = this.getVariable(featureKey, variableKey, attributes);
301
405
  return getValueByType(variableValue, "integer");
302
406
  };
303
- FeaturevisorSDK.prototype.getVariableDouble = function (featureKey, variableKey, attributes) {
407
+ FeaturevisorInstance.prototype.getVariableDouble = function (featureKey, variableKey, attributes) {
304
408
  if (attributes === void 0) { attributes = {}; }
305
409
  var variableValue = this.getVariable(featureKey, variableKey, attributes);
306
410
  return getValueByType(variableValue, "double");
307
411
  };
308
- FeaturevisorSDK.prototype.getVariableArray = function (featureKey, variableKey, attributes) {
412
+ FeaturevisorInstance.prototype.getVariableArray = function (featureKey, variableKey, attributes) {
309
413
  if (attributes === void 0) { attributes = {}; }
310
414
  var variableValue = this.getVariable(featureKey, variableKey, attributes);
311
415
  return getValueByType(variableValue, "array");
312
416
  };
313
- FeaturevisorSDK.prototype.getVariableObject = function (featureKey, variableKey, attributes) {
417
+ FeaturevisorInstance.prototype.getVariableObject = function (featureKey, variableKey, attributes) {
314
418
  if (attributes === void 0) { attributes = {}; }
315
419
  var variableValue = this.getVariable(featureKey, variableKey, attributes);
316
420
  return getValueByType(variableValue, "object");
317
421
  };
318
- FeaturevisorSDK.prototype.getVariableJSON = function (featureKey, variableKey, attributes) {
422
+ FeaturevisorInstance.prototype.getVariableJSON = function (featureKey, variableKey, attributes) {
319
423
  if (attributes === void 0) { attributes = {}; }
320
424
  var variableValue = this.getVariable(featureKey, variableKey, attributes);
321
425
  return getValueByType(variableValue, "json");
322
426
  };
323
- return FeaturevisorSDK;
427
+ return FeaturevisorInstance;
324
428
  }());
325
- export { FeaturevisorSDK };
326
- //# sourceMappingURL=client.js.map
429
+ export { FeaturevisorInstance };
430
+ export function createInstance(options) {
431
+ return new FeaturevisorInstance(options);
432
+ }
433
+ //# sourceMappingURL=instance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance.js","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,YAAY,EAAU,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AAkCnB,IAAM,aAAa,GAAoB;IACrC,aAAa,EAAE,GAAG;IAClB,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;CACb,CAAC;AAIF,SAAS,oBAAoB,CAC3B,WAAW,EACX,mBAA0C;IAE1C,IAAI,mB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EAChC,WAAmB,EACnB,UAA2B;QAA3B,2BAAA,EAAA,eAA2B;QAE3B,IAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAE5E,OAAO,cAAc,CAAC,aAAa,EAAE,OAAO,CAAyB,CAAC;IACxE,CAAC;IAED,gDAAiB,GAAjB,UACE,UAAgC,EAChC,WAAmB,EACnB,UAA2B;QAA3B,2BAAA,EAAA,eAA2B;QAE3B,IAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAE5E,OAAO,cAAc,CAAC,aAAa,EAAE,QAAQ,CAAkB,CAAC;IAClE,CAAC;IAED,8CAAe,GAAf,UACE,UAAgC,EAChC,WAAmB,EACnB,UAA2B;QAA3B,2BAAA,EAAA,eAA2B;QAE3B,IAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAE5E,OAAO,cAAc,CAAC,aAAa,EAAE,MAAM,CAAkB,CAAC;IAChE,CAAC;IACH,2BAAC;AAAD,CAAC,AAvkBD,IAukBC;;AAED,MAAM,UAAU,cAAc,CAAC,OAAwB;IACrD,OAAO,IAAI,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@featurevisor/sdk",
3
- "version": "0.19.0",
3
+ "version": "0.20.1",
4
4
  "description": "Featurevisor SDK for Node.js and the browser",
5
5
  "main": "dist/index.js",
6
6
  "module": "lib/index.js",
@@ -42,9 +42,9 @@
42
42
  },
43
43
  "license": "MIT",
44
44
  "dependencies": {
45
- "@featurevisor/types": "^0.19.0",
45
+ "@featurevisor/types": "^0.20.0",
46
46
  "compare-versions": "^6.0.0-rc.1",
47
47
  "murmurhash": "^2.0.1"
48
48
  },
49
- "gitHead": "4fc6e9d475552a68b8ffd4000f736349d103b718"
49
+ "gitHead": "33e3f3d03125c7ec72d837ed5285bcda7761be42"
50
50
  }
package/src/index.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from "./bucket";
2
- export * from "./client";
3
- export * from "./createInstance";
2
+ export * from "./instance";
4
3
  export * from "./logger";
@@ -1,8 +1,8 @@
1
1
  import { DatafileContent } from "@featurevisor/types";
2
2
 
3
- import { createInstance } from "./createInstance";
3
+ import { createInstance } from "./instance";
4
4
 
5
- describe("sdk: createInstance", function () {
5
+ describe("sdk: instance", function () {
6
6
  it("should be a function", function () {
7
7
  expect(typeof createInstance).toEqual("function");
8
8
  });
@@ -39,6 +39,7 @@ describe("sdk: createInstance", function () {
39
39
 
40
40
  setTimeout(() => {
41
41
  expect(readyCount).toEqual(1);
42
+ expect(sdk.isReady()).toEqual(true);
42
43
  done();
43
44
  }, 0);
44
45
  });