@launchdarkly/js-sdk-common 2.3.1 → 2.4.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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to `@launchdarkly/js-sdk-common` will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## [2.4.0](https://github.com/launchdarkly/js-core/compare/js-sdk-common-v2.3.1...js-sdk-common-v2.4.0) (2024-04-09)
6
+
7
+
8
+ ### Features
9
+
10
+ * Add identify timeout to client-sdk. ([#420](https://github.com/launchdarkly/js-core/issues/420)) ([5d73dfe](https://github.com/launchdarkly/js-core/commit/5d73dfeb0d5cdacf620e65e214dd2e334363490e))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Identify incorrectly rejected in client-sdk ([#426](https://github.com/launchdarkly/js-core/issues/426)) ([a019dd6](https://github.com/launchdarkly/js-core/commit/a019dd66b1b852d888e10b78aec9693d7de195fe))
16
+
5
17
  ## [2.3.1](https://github.com/launchdarkly/js-core/compare/js-sdk-common-v2.3.0...js-sdk-common-v2.3.1) (2024-03-25)
6
18
 
7
19
 
@@ -12,5 +12,13 @@ export type LDInternalOptions = {
12
12
  analyticsEventPath?: string;
13
13
  diagnosticEventPath?: string;
14
14
  includeAuthorizationHeader?: boolean;
15
+ /**
16
+ * In seconds. Log a warning if identifyTimeout is greater than this value.
17
+ *
18
+ * Mobile - 15s.
19
+ * Browser - 5s.
20
+ * Server - 60s.
21
+ */
22
+ highTimeoutThreshold?: number;
15
23
  };
16
24
  //# sourceMappingURL=LDInternalOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LDInternalOptions.d.ts","sourceRoot":"","sources":["../../../src/internal/events/LDInternalOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC,CAAC"}
1
+ {"version":3,"file":"LDInternalOptions.d.ts","sourceRoot":"","sources":["../../../src/internal/events/LDInternalOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC"}
@@ -6,6 +6,7 @@ import fastDeepEqual from './fast-deep-equal';
6
6
  import { base64UrlEncode, defaultHeaders, httpErrorMessage, LDHeaders, shouldRetry } from './http';
7
7
  import noop from './noop';
8
8
  import sleep from './sleep';
9
+ import timedPromise from './timedPromise';
9
10
  import { VoidFunction } from './VoidFunction';
10
- export { base64UrlEncode, clone, debounce, deepCompact, defaultHeaders, fastDeepEqual, httpErrorMessage, noop, LDHeaders, shouldRetry, secondsToMillis, sleep, VoidFunction, };
11
+ export { base64UrlEncode, clone, debounce, deepCompact, defaultHeaders, fastDeepEqual, httpErrorMessage, noop, LDHeaders, shouldRetry, secondsToMillis, sleep, timedPromise, VoidFunction, };
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACnG,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EACL,eAAe,EACf,KAAK,EACL,QAAQ,EACR,WAAW,EACX,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,IAAI,EACJ,SAAS,EACT,WAAW,EACX,eAAe,EACf,KAAK,EACL,YAAY,GACb,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACnG,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EACL,eAAe,EACf,KAAK,EACL,QAAQ,EACR,WAAW,EACX,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,IAAI,EACJ,SAAS,EACT,WAAW,EACX,eAAe,EACf,KAAK,EACL,YAAY,EACZ,YAAY,GACb,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sleep = exports.secondsToMillis = exports.shouldRetry = exports.noop = exports.httpErrorMessage = exports.fastDeepEqual = exports.defaultHeaders = exports.deepCompact = exports.debounce = exports.clone = exports.base64UrlEncode = void 0;
3
+ exports.timedPromise = exports.sleep = exports.secondsToMillis = exports.shouldRetry = exports.noop = exports.httpErrorMessage = exports.fastDeepEqual = exports.defaultHeaders = exports.deepCompact = exports.debounce = exports.clone = exports.base64UrlEncode = void 0;
4
4
  const clone_1 = require("./clone");
5
5
  exports.clone = clone_1.default;
6
6
  const date_1 = require("./date");
@@ -20,4 +20,6 @@ const noop_1 = require("./noop");
20
20
  exports.noop = noop_1.default;
21
21
  const sleep_1 = require("./sleep");
22
22
  exports.sleep = sleep_1.default;
23
+ const timedPromise_1 = require("./timedPromise");
24
+ exports.timedPromise = timedPromise_1.default;
23
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,mCAA4B;AAY1B,gBAZK,eAAK,CAYL;AAXP,iCAAyC;AAoBvC,gGApBO,sBAAe,OAoBP;AAnBjB,yCAAkC;AAWhC,mBAXK,kBAAQ,CAWL;AAVV,+CAAwC;AAWtC,sBAXK,qBAAW,CAWL;AAVb,uDAA8C;AAY5C,wBAZK,yBAAa,CAYL;AAXf,iCAAmG;AAMjG,gGANO,sBAAe,OAMP;AAIf,+FAVwB,qBAAc,OAUxB;AAEd,iGAZwC,uBAAgB,OAYxC;AAGhB,4FAfqE,kBAAW,OAerE;AAdb,iCAA0B;AAYxB,eAZK,cAAI,CAYL;AAXN,mCAA4B;AAe1B,gBAfK,eAAK,CAeL"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,mCAA4B;AAa1B,gBAbK,eAAK,CAaL;AAZP,iCAAyC;AAqBvC,gGArBO,sBAAe,OAqBP;AApBjB,yCAAkC;AAYhC,mBAZK,kBAAQ,CAYL;AAXV,+CAAwC;AAYtC,sBAZK,qBAAW,CAYL;AAXb,uDAA8C;AAa5C,wBAbK,yBAAa,CAaL;AAZf,iCAAmG;AAOjG,gGAPO,sBAAe,OAOP;AAIf,+FAXwB,qBAAc,OAWxB;AAEd,iGAbwC,uBAAgB,OAaxC;AAGhB,4FAhBqE,kBAAW,OAgBrE;AAfb,iCAA0B;AAaxB,eAbK,cAAI,CAaL;AAZN,mCAA4B;AAgB1B,gBAhBK,eAAK,CAgBL;AAfP,iDAA0C;AAgBxC,uBAhBK,sBAAY,CAgBL"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns a promise which errors after t seconds.
3
+ *
4
+ * @param t Timeout in seconds.
5
+ * @param taskName Name of task being timed for logging and error reporting.
6
+ */
7
+ declare const timedPromise: (t: number, taskName: string) => Promise<void>;
8
+ export default timedPromise;
9
+ //# sourceMappingURL=timedPromise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timedPromise.d.ts","sourceRoot":"","sources":["../../src/utils/timedPromise.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,QAAA,MAAM,YAAY,MAAO,MAAM,YAAY,MAAM,kBAM7C,CAAC;AAEL,eAAe,YAAY,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Returns a promise which errors after t seconds.
5
+ *
6
+ * @param t Timeout in seconds.
7
+ * @param taskName Name of task being timed for logging and error reporting.
8
+ */
9
+ const timedPromise = (t, taskName) => new Promise((_res, reject) => {
10
+ setTimeout(() => {
11
+ const e = `${taskName} timed out after ${t} seconds.`;
12
+ reject(new Error(e));
13
+ }, t * 1000);
14
+ });
15
+ exports.default = timedPromise;
16
+ //# sourceMappingURL=timedPromise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timedPromise.js","sourceRoot":"","sources":["../../src/utils/timedPromise.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,QAAgB,EAAE,EAAE,CACnD,IAAI,OAAO,CAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;IACjC,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,CAAC,GAAG,GAAG,QAAQ,oBAAoB,CAAC,WAAW,CAAC;QACtD,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AACf,CAAC,CAAC,CAAC;AAEL,kBAAe,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@launchdarkly/js-sdk-common",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",