@launchdarkly/js-sdk-common 1.1.0-beta.1 → 1.2.0-alpha

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,20 @@
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
+ ## [1.1.0](https://github.com/launchdarkly/js-core/compare/js-sdk-common-v1.0.3...js-sdk-common-v1.1.0) (2023-08-14)
6
+
7
+
8
+ ### Features
9
+
10
+ * Allow specifying the user agent per-sdk implementation. ([#226](https://github.com/launchdarkly/js-core/issues/226)) ([e57716f](https://github.com/launchdarkly/js-core/commit/e57716f3f6f0ba8568e32b0937903ca46e5470ad))
11
+
12
+ ## [1.0.3](https://github.com/launchdarkly/js-core/compare/js-sdk-common-v1.0.2...js-sdk-common-v1.0.3) (2023-08-10)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * Switch to es2017 target to ensure native async/await. ([a83e4e6](https://github.com/launchdarkly/js-core/commit/a83e4e62d04c66105a1b0e8893640a7ca2d641e4))
18
+
5
19
  ## [1.0.2](https://github.com/launchdarkly/js-core/compare/js-sdk-common-v1.0.1...js-sdk-common-v1.0.2) (2023-06-13)
6
20
 
7
21
 
@@ -38,6 +38,11 @@ export interface SdkData {
38
38
  * The version of the SDK.
39
39
  */
40
40
  version?: string;
41
+ /**
42
+ * If this is a top-level (not a wrapper) SDK this will be used to create the user agent string.
43
+ * It will take the form 'userAgentBase/version`.
44
+ */
45
+ userAgentBase?: string;
41
46
  /**
42
47
  * Name of the wrapper SDK if present.
43
48
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Info.d.ts","sourceRoot":"","sources":["../../../src/api/platform/Info.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,EAAE,CAAC,EAAE;QACH;;;WAGG;QACH,IAAI,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;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,YAAY,IAAI,YAAY,CAAC;IAE7B;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC;CACpB"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This is for internal use only.
3
+ *
4
+ * Edge sdks use clientSideID to query feature stores. They also send analytics
5
+ * using this clientSideID. This is a hybrid behavior because they are based
6
+ * on js-server-common, but uses the clientSideID instead of the sdkKey for the
7
+ * above reasons. These internal options allow the edge sdks to use the
8
+ * EventSender to send analytics to the correct LD endpoints using
9
+ * the clientSideId.
10
+ */
11
+ export type LDInternalOptions = {
12
+ analyticsEventPath?: string;
13
+ diagnosticEventPath?: string;
14
+ includeAuthorizationHeader?: boolean;
15
+ };
16
+ //# sourceMappingURL=LDInternalOptions.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=LDInternalOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LDInternalOptions.js","sourceRoot":"","sources":["../../../src/internal/events/LDInternalOptions.ts"],"names":[],"mappings":""}
@@ -3,5 +3,6 @@ import InputCustomEvent from './InputCustomEvent';
3
3
  import InputEvalEvent from './InputEvalEvent';
4
4
  import InputEvent from './InputEvent';
5
5
  import InputIdentifyEvent from './InputIdentifyEvent';
6
- export { InputCustomEvent, InputEvalEvent, InputEvent, InputIdentifyEvent, EventProcessor };
6
+ import type { LDInternalOptions } from './LDInternalOptions';
7
+ export { EventProcessor, InputCustomEvent, InputEvalEvent, InputEvent, InputIdentifyEvent, LDInternalOptions, };
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,iBAAiB,GAClB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EventProcessor = exports.InputIdentifyEvent = exports.InputEvalEvent = exports.InputCustomEvent = void 0;
3
+ exports.InputIdentifyEvent = exports.InputEvalEvent = exports.InputCustomEvent = exports.EventProcessor = void 0;
4
4
  const EventProcessor_1 = require("./EventProcessor");
5
5
  exports.EventProcessor = EventProcessor_1.default;
6
6
  const InputCustomEvent_1 = require("./InputCustomEvent");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internal/events/index.ts"],"names":[],"mappings":";;;AAAA,qDAA8C;AAM6B,yBANpE,wBAAc,CAMoE;AALzF,yDAAkD;AAKzC,2BALF,0BAAgB,CAKE;AAJzB,qDAA8C;AAInB,yBAJpB,wBAAc,CAIoB;AAFzC,6DAAsD;AAEC,6BAFhD,4BAAkB,CAEgD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internal/events/index.ts"],"names":[],"mappings":";;;AAAA,qDAA8C;AAQ5C,yBARK,wBAAc,CAQL;AAPhB,yDAAkD;AAQhD,2BARK,0BAAgB,CAQL;AAPlB,qDAA8C;AAQ5C,yBARK,wBAAc,CAQL;AANhB,6DAAsD;AAQpD,6BARK,4BAAkB,CAQL"}
@@ -5,6 +5,19 @@ export default class ServiceEndpoints {
5
5
  readonly streaming: string;
6
6
  readonly polling: string;
7
7
  readonly events: string;
8
- constructor(streaming: string, polling: string, events: string);
8
+ /** Valid paths are:
9
+ * /bulk
10
+ * /events/bulk/envId
11
+ * /mobile
12
+ */
13
+ readonly analyticsEventPath: string;
14
+ /** Valid paths are:
15
+ * /diagnostic
16
+ * /events/diagnostic/envId
17
+ * /mobile/events/diagnostic
18
+ */
19
+ readonly diagnosticEventPath: string;
20
+ readonly includeAuthorizationHeader: boolean;
21
+ constructor(streaming: string, polling: string, events: string, analyticsEventPath?: string, diagnosticEventPath?: string, includeAuthorizationHeader?: boolean);
9
22
  }
10
23
  //# sourceMappingURL=ServiceEndpoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceEndpoints.d.ts","sourceRoot":"","sources":["../../src/options/ServiceEndpoints.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC,SAAgB,SAAS,EAAE,MAAM,CAAC;IAElC,SAAgB,OAAO,EAAE,MAAM,CAAC;IAEhC,SAAgB,MAAM,EAAE,MAAM,CAAC;gBAEZ,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAKtE"}
1
+ {"version":3,"file":"ServiceEndpoints.d.ts","sourceRoot":"","sources":["../../src/options/ServiceEndpoints.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC,SAAgB,SAAS,EAAE,MAAM,CAAC;IAElC,SAAgB,OAAO,EAAE,MAAM,CAAC;IAEhC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B;;;;OAIG;IACH,SAAgB,kBAAkB,EAAE,MAAM,CAAC;IAE3C;;;;OAIG;IACH,SAAgB,mBAAmB,EAAE,MAAM,CAAC;IAG5C,SAAgB,0BAA0B,EAAE,OAAO,CAAC;gBAGlD,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,kBAAkB,GAAE,MAAgB,EACpC,mBAAmB,GAAE,MAAsB,EAC3C,0BAA0B,GAAE,OAAc;CAS7C"}
@@ -7,10 +7,13 @@ function canonicalizeUri(uri) {
7
7
  * Specifies the base service URIs used by SDK components.
8
8
  */
9
9
  class ServiceEndpoints {
10
- constructor(streaming, polling, events) {
10
+ constructor(streaming, polling, events, analyticsEventPath = '/bulk', diagnosticEventPath = '/diagnostic', includeAuthorizationHeader = true) {
11
11
  this.streaming = canonicalizeUri(streaming);
12
12
  this.polling = canonicalizeUri(polling);
13
13
  this.events = canonicalizeUri(events);
14
+ this.analyticsEventPath = analyticsEventPath;
15
+ this.diagnosticEventPath = diagnosticEventPath;
16
+ this.includeAuthorizationHeader = includeAuthorizationHeader;
14
17
  }
15
18
  }
16
19
  exports.default = ServiceEndpoints;
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceEndpoints.js","sourceRoot":"","sources":["../../src/options/ServiceEndpoints.ts"],"names":[],"mappings":";;AAAA,SAAS,eAAe,CAAC,GAAW;IAClC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAqB,gBAAgB;IAOnC,YAAmB,SAAiB,EAAE,OAAe,EAAE,MAAc;QACnE,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF;AAZD,mCAYC"}
1
+ {"version":3,"file":"ServiceEndpoints.js","sourceRoot":"","sources":["../../src/options/ServiceEndpoints.ts"],"names":[],"mappings":";;AAAA,SAAS,eAAe,CAAC,GAAW;IAClC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAqB,gBAAgB;IAwBnC,YACE,SAAiB,EACjB,OAAe,EACf,MAAc,EACd,qBAA6B,OAAO,EACpC,sBAA8B,aAAa,EAC3C,6BAAsC,IAAI;QAE1C,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;IAC/D,CAAC;CACF;AAvCD,mCAuCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@launchdarkly/js-sdk-common",
3
- "version": "1.1.0-beta.1",
3
+ "version": "1.2.0-alpha",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -19,7 +19,6 @@
19
19
  "client"
20
20
  ],
21
21
  "scripts": {
22
- "doc": "../../../scripts/build-doc.sh .",
23
22
  "test": "npx jest --ci",
24
23
  "build": "npx tsc",
25
24
  "clean": "npx tsc --build --clean",
@@ -42,7 +41,7 @@
42
41
  "launchdarkly-js-test-helpers": "^2.2.0",
43
42
  "prettier": "^3.0.0",
44
43
  "ts-jest": "^29.0.5",
45
- "typedoc": "0.23.26",
46
- "typescript": "^5.1.6"
44
+ "typedoc": "0.25.0",
45
+ "typescript": "5.1.6"
47
46
  }
48
47
  }