@statsig/client-core 3.16.0 → 3.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statsig/client-core",
3
- "version": "3.16.0",
3
+ "version": "3.16.1",
4
4
  "license": "ISC",
5
5
  "homepage": "https://github.com/statsig-io/js-client-monorepo",
6
6
  "repository": {
@@ -29,6 +29,7 @@ export type LayerEvaluation = Flatten<Omit<ExperimentEvaluation, 'id_type'> & {
29
29
  allocated_experiment_name: string;
30
30
  explicit_parameters: string[];
31
31
  undelegated_secondary_exposures?: SecondaryExposure[] | string[];
32
+ parameter_rule_ids?: Record<string, string>;
32
33
  }>;
33
34
  export type AnyEvaluation = GateEvaluation | ExperimentEvaluation | DynamicConfigEvaluation | LayerEvaluation;
34
35
  export type EvaluationDetails = {
@@ -1,4 +1,5 @@
1
1
  import { DataAdapterResult } from './StatsigDataAdapter';
2
+ import { StatsigEvent } from './StatsigEvent';
2
3
  import { DynamicConfig, Experiment, FeatureGate, Layer } from './StatsigTypes';
3
4
  import { Flatten } from './TypingUtils';
4
5
  export type StatsigLoadingStatus = 'Uninitialized' | 'Loading' | 'Ready';
@@ -41,6 +42,9 @@ type EventNameToEventDataMap = {
41
42
  layer_evaluation: {
42
43
  layer: Layer;
43
44
  };
45
+ log_event_called: {
46
+ event: StatsigEvent;
47
+ };
44
48
  };
45
49
  /**
46
50
  * Type representing various events emitted by a Statsig client.
@@ -66,6 +70,8 @@ type EventNameToEventDataMap = {
66
70
  * `experiment_evaluation` - Fired when any experiment is checked from the Statsig client.
67
71
  *
68
72
  * `layer_evaluation` - Fired when any layer is checked from the Statsig client.
73
+ *
74
+ * `log_event_called` - Fired when log event is called.
69
75
  */
70
76
  export type AnyStatsigClientEvent = Flatten<{
71
77
  [K in keyof EventNameToEventDataMap]: {
@@ -63,7 +63,7 @@ const _createConfigExposure = (user, config, exposureMapping) => {
63
63
  };
64
64
  exports._createConfigExposure = _createConfigExposure;
65
65
  const _createLayerParameterExposure = (user, layer, parameterName, exposureMapping) => {
66
- var _a, _b, _c, _d;
66
+ var _a, _b, _c, _d, _e, _f;
67
67
  const evaluation = layer.__evaluation;
68
68
  const isExplicit = ((_a = evaluation === null || evaluation === void 0 ? void 0 : evaluation.explicit_parameters) === null || _a === void 0 ? void 0 : _a.includes(parameterName)) === true;
69
69
  let allocatedExperiment = '';
@@ -72,14 +72,15 @@ const _createLayerParameterExposure = (user, layer, parameterName, exposureMappi
72
72
  allocatedExperiment = (_c = evaluation.allocated_experiment_name) !== null && _c !== void 0 ? _c : '';
73
73
  secondaryExposures = evaluation.secondary_exposures;
74
74
  }
75
+ const parameterRuleIDs = (_d = layer.__evaluation) === null || _d === void 0 ? void 0 : _d.parameter_rule_ids;
75
76
  const metadata = {
76
77
  config: layer.name,
77
78
  parameterName,
78
- ruleID: layer.ruleID,
79
+ ruleID: (_e = parameterRuleIDs === null || parameterRuleIDs === void 0 ? void 0 : parameterRuleIDs[parameterName]) !== null && _e !== void 0 ? _e : layer.ruleID,
79
80
  allocatedExperiment,
80
81
  isExplicitParameter: String(isExplicit),
81
82
  };
82
- if (((_d = layer.__evaluation) === null || _d === void 0 ? void 0 : _d.version) != null) {
83
+ if (((_f = layer.__evaluation) === null || _f === void 0 ? void 0 : _f.version) != null) {
83
84
  metadata['configVersion'] = layer.__evaluation.version;
84
85
  }
85
86
  return _createExposure(LAYER_EXPOSURE_NAME, user, layer.details, metadata, _mapExposures(secondaryExposures, exposureMapping));
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "3.16.0";
1
+ export declare const SDK_VERSION = "3.16.1";
2
2
  export type StatsigMetadata = {
3
3
  readonly [key: string]: string | undefined | null;
4
4
  readonly appVersion?: string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StatsigMetadataProvider = exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = '3.16.0';
4
+ exports.SDK_VERSION = '3.16.1';
5
5
  let metadata = {
6
6
  sdkVersion: exports.SDK_VERSION,
7
7
  sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients
@@ -1,5 +1,5 @@
1
1
  import { StatsigClientInterface } from './ClientInterfaces';
2
2
  export type StatsigPlugin<T extends StatsigClientInterface> = {
3
- readonly __plugin: 'session-replay' | 'auto-capture';
3
+ readonly __plugin: 'session-replay' | 'auto-capture' | 'triggered-session-replay';
4
4
  bind: (client: T) => void;
5
5
  };