@configdirector/react-native-sdk 0.9.3 → 1.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.
@@ -1211,11 +1211,13 @@ const isDroppedEventsEmpty = (droppedEvents) => {
1211
1211
  var ClientEventReporter = class {
1212
1212
  constructor(options) {
1213
1213
  _defineProperty(this, "sdkKey", void 0);
1214
+ _defineProperty(this, "sdkIdentity", void 0);
1214
1215
  _defineProperty(this, "logger", void 0);
1215
1216
  _defineProperty(this, "url", void 0);
1216
1217
  _defineProperty(this, "executeRequests", true);
1217
1218
  this.sdkKey = options.sdkKey;
1218
1219
  this.logger = options.logger;
1220
+ this.sdkIdentity = options.sdkIdentity;
1219
1221
  this.url = options.urlFactory("client/telemetry/v1", options.baseUrl);
1220
1222
  }
1221
1223
  async report({ context, discreteEvents, aggregatedEvents, droppedEvents }) {
@@ -1225,6 +1227,10 @@ var ClientEventReporter = class {
1225
1227
  };
1226
1228
  const eventReport = {
1227
1229
  clientSdkKey: this.sdkKey,
1230
+ metaContext: {
1231
+ sdkName: this.sdkIdentity.sdkName,
1232
+ sdkVersion: this.sdkIdentity.sdkVersion
1233
+ },
1228
1234
  context,
1229
1235
  discreteEvents,
1230
1236
  aggregatedEvents,
@@ -1591,13 +1597,10 @@ const generateValueId = (v) => {
1591
1597
  //#endregion
1592
1598
  //#region src/ReactNativeTelemetryClient.ts
1593
1599
  var ReactNativeTelemetryClient = class {
1594
- constructor(sdkKey, baseUrl, logger, urlFactory) {
1600
+ constructor(options) {
1595
1601
  _defineProperty(this, "collector", void 0);
1596
1602
  this.collector = new ClientTelemetryEventCollector({
1597
- sdkKey,
1598
- logger,
1599
- baseUrl,
1600
- urlFactory,
1603
+ ...options,
1601
1604
  valueIdGenerator: async (v) => generateValueId(v)
1602
1605
  });
1603
1606
  }
@@ -1644,11 +1647,18 @@ const urlFactory = (input, base) => new MinimalUrl(input, base);
1644
1647
  //#region src/client.ts
1645
1648
  const createClient = (clientSdkKey, clientOptions) => {
1646
1649
  var _clientOptions$logger, _clientOptions$connec;
1647
- const logger = (_clientOptions$logger = clientOptions === null || clientOptions === void 0 ? void 0 : clientOptions.logger) !== null && _clientOptions$logger !== void 0 ? _clientOptions$logger : createConsoleLogger("warn");
1648
- return new DefaultConfigDirectorClient(new ReactNativeTelemetryClient(clientSdkKey, (clientOptions === null || clientOptions === void 0 || (_clientOptions$connec = clientOptions.connection) === null || _clientOptions$connec === void 0 ? void 0 : _clientOptions$connec.url) ? urlFactory(clientOptions.connection.url) : CLIENT_BASE_URL, logger, urlFactory), clientSdkKey, {
1650
+ const sdkIdentity = {
1649
1651
  sdkName: "react-native-sdk",
1650
- sdkVersion: "0.9.3"
1651
- }, {
1652
+ sdkVersion: "1.0.0"
1653
+ };
1654
+ const logger = (_clientOptions$logger = clientOptions === null || clientOptions === void 0 ? void 0 : clientOptions.logger) !== null && _clientOptions$logger !== void 0 ? _clientOptions$logger : createConsoleLogger("warn");
1655
+ return new DefaultConfigDirectorClient(new ReactNativeTelemetryClient({
1656
+ sdkKey: clientSdkKey,
1657
+ sdkIdentity,
1658
+ baseUrl: (clientOptions === null || clientOptions === void 0 || (_clientOptions$connec = clientOptions.connection) === null || _clientOptions$connec === void 0 ? void 0 : _clientOptions$connec.url) ? urlFactory(clientOptions.connection.url) : CLIENT_BASE_URL,
1659
+ logger,
1660
+ urlFactory
1661
+ }), clientSdkKey, sdkIdentity, {
1652
1662
  ...clientOptions,
1653
1663
  logger
1654
1664
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configdirector/react-native-sdk",
3
- "version": "0.9.3",
3
+ "version": "1.0.0",
4
4
  "description": "React Native client SDK for ConfigDirector. ConfigDirector is a remote configuration and feature flag service.",
5
5
  "license": "MIT",
6
6
  "author": "ConfigDirector",
@@ -41,13 +41,14 @@
41
41
  "example": "yarn workspace @configdirector/react-native-sdk-example",
42
42
  "clean": "rm -fr dist",
43
43
  "build": "tsdown",
44
+ "verify:dist": "node ../../scripts/verify-dist-version.mjs",
44
45
  "prepare": "yarn build",
45
46
  "typecheck": "tsc",
46
47
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
47
48
  "test": "jest --watchAll",
48
49
  "ci:test": "jest --ci",
49
50
  "coverage": "jest --ci --coverage",
50
- "release": "yarn clean && yarn lint && yarn ci:test && yarn build && npm publish --access public"
51
+ "release": "yarn clean && yarn lint && yarn ci:test && yarn build && yarn verify:dist && npm publish --access public"
51
52
  },
52
53
  "publishConfig": {
53
54
  "registry": "https://registry.npmjs.org/"