launchdarkly-js-sdk-common 3.5.0 → 4.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "launchdarkly-js-sdk-common",
3
- "version": "3.5.0",
3
+ "version": "4.0.0",
4
4
  "description": "LaunchDarkly SDK for JavaScript - common code",
5
5
  "author": "LaunchDarkly <team@launchdarkly.com>",
6
6
  "license": "Apache-2.0",
@@ -73,7 +73,7 @@
73
73
  "dependencies": {
74
74
  "base64-js": "^1.3.0",
75
75
  "fast-deep-equal": "^2.0.1",
76
- "uuid": "^3.3.2"
76
+ "uuid": "^8.0.0"
77
77
  },
78
78
  "repository": {
79
79
  "type": "git",
package/typings.d.ts CHANGED
@@ -46,18 +46,6 @@ declare module 'launchdarkly-js-sdk-common' {
46
46
  error: (message: string) => void;
47
47
  }
48
48
 
49
- /**
50
- * A basic implementation of logging that uses the global `console` object. This is used by
51
- * default in the browser SDK. It sends messages of "debug", "info", "warn", or "error"
52
- * level (if enable) to `console.log()`, `console.info()`, `console.warn()`, and `console.error()`
53
- * respectively.
54
- *
55
- * To make LDClient use this logger, put it in the `logger` property of [[LDOptions]].
56
- *
57
- * @deprecated Please use `basicLogger` instead.
58
- */
59
- export function createConsoleLogger(minimumLevel: string): LDLogger;
60
-
61
49
  /**
62
50
  * LaunchDarkly initialization options that are supported by all variants of the JS client.
63
51
  * The browser SDK and Electron SDK may support additional options.
@@ -223,17 +211,6 @@ declare module 'launchdarkly-js-sdk-common' {
223
211
  */
224
212
  flushInterval?: number;
225
213
 
226
- /**
227
- * If specified, enables event sampling so that only some fraction of analytics events will be
228
- * sent pseudo-randomly.
229
- *
230
- * When set to greater than zero, there is a 1 in `samplingInterval` chance that events will be
231
- * sent: for example, a value of 20 means that on average 1 in 20, or 5%, of all events will be sent.
232
- *
233
- * @deprecated This feature will be removed in a future version.
234
- */
235
- samplingInterval?: number;
236
-
237
214
  /**
238
215
  * How long (in milliseconds) to wait after a failure of the stream connection before trying to
239
216
  * reconnect.
@@ -374,12 +351,8 @@ declare module 'launchdarkly-js-sdk-common' {
374
351
  /**
375
352
  * Describes the reason that a flag evaluation produced a particular value. This is
376
353
  * part of the [[LDEvaluationDetail]] object returned by [[LDClient.variationDetail]].
377
- *
378
- * This type is separate from `[[LDEvaluationReason]]` for backwards compatibility. In
379
- * earlier versions of this SDK, `[[LDEvaluationReason]]` was incorrectly defined as
380
- * being non-nullable.
381
354
  */
382
- interface NonNullableLDEvaluationReason {
355
+ interface LDEvaluationReason {
383
356
  /**
384
357
  * The general category of the reason:
385
358
  *
@@ -415,14 +388,6 @@ declare module 'launchdarkly-js-sdk-common' {
415
388
  prerequisiteKey?: string;
416
389
  }
417
390
 
418
- /**
419
- * Describes the reason that a flag evaluation produced a particular value. This is
420
- * part of the [[LDEvaluationDetail]] object returned by [[LDClient.variationDetail]].
421
- *
422
- * Will be null when `[[LDOptions.evaluationReasons]]` is `false`.
423
- */
424
- export type LDEvaluationReason = NonNullableLDEvaluationReason | null;
425
-
426
391
  /**
427
392
  * An object that combines the result of a feature flag evaluation with information about
428
393
  * how it was calculated.
@@ -446,8 +411,10 @@ declare module 'launchdarkly-js-sdk-common' {
446
411
 
447
412
  /**
448
413
  * An object describing the main factor that influenced the flag evaluation value.
414
+ * This will be `null`/`undefined` if the SDK was not configured to get evaluation
415
+ * reasons.
449
416
  */
450
- reason: LDEvaluationReason;
417
+ reason?: LDEvaluationReason;
451
418
  }
452
419
 
453
420
  /**