@statsig/statsig-node-core 0.5.0 → 0.5.1-beta.2506070235

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/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { StatsigNapiInternal, StatsigOptions } from './statsig-generated';
2
2
  export * from './statsig-generated';
3
+ export * from './sticky_values';
3
4
  export declare class Statsig extends StatsigNapiInternal {
4
5
  private static _sharedInstance;
5
6
  static shared(): Statsig;
package/index.js CHANGED
@@ -32,6 +32,7 @@ const node_fetch_1 = __importDefault(require("node-fetch"));
32
32
  const error_boundary_1 = require("./error_boundary");
33
33
  const statsig_generated_1 = require("./statsig-generated");
34
34
  __exportStar(require("./statsig-generated"), exports);
35
+ __exportStar(require("./sticky_values"), exports);
35
36
  function createProxyAgent(options) {
36
37
  const proxy = options === null || options === void 0 ? void 0 : options.proxyConfig;
37
38
  if ((proxy === null || proxy === void 0 ? void 0 : proxy.proxyHost) && (proxy === null || proxy === void 0 ? void 0 : proxy.proxyProtocol)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statsig/statsig-node-core",
3
- "version": "0.5.0",
3
+ "version": "0.5.1-beta.2506070235",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "jest --colors",
@@ -45,13 +45,13 @@
45
45
  ]
46
46
  },
47
47
  "optionalDependencies": {
48
- "@statsig/statsig-node-core-linux-x64-musl": "0.5.0",
49
- "@statsig/statsig-node-core-linux-x64-gnu": "0.5.0",
50
- "@statsig/statsig-node-core-win32-x64-msvc": "0.5.0",
51
- "@statsig/statsig-node-core-darwin-x64": "0.5.0",
52
- "@statsig/statsig-node-core-win32-ia32-msvc": "0.5.0",
53
- "@statsig/statsig-node-core-linux-arm64-musl": "0.5.0",
54
- "@statsig/statsig-node-core-linux-arm64-gnu": "0.5.0",
55
- "@statsig/statsig-node-core-darwin-arm64": "0.5.0"
48
+ "@statsig/statsig-node-core-linux-x64-musl": "0.5.1-beta.2506070235",
49
+ "@statsig/statsig-node-core-linux-x64-gnu": "0.5.1-beta.2506070235",
50
+ "@statsig/statsig-node-core-win32-x64-msvc": "0.5.1-beta.2506070235",
51
+ "@statsig/statsig-node-core-darwin-x64": "0.5.1-beta.2506070235",
52
+ "@statsig/statsig-node-core-win32-ia32-msvc": "0.5.1-beta.2506070235",
53
+ "@statsig/statsig-node-core-linux-arm64-musl": "0.5.1-beta.2506070235",
54
+ "@statsig/statsig-node-core-linux-arm64-gnu": "0.5.1-beta.2506070235",
55
+ "@statsig/statsig-node-core-darwin-arm64": "0.5.1-beta.2506070235"
56
56
  }
57
57
  }
@@ -112,6 +112,8 @@ export declare function __internal__testDataStore(store: DataStore, path: string
112
112
 
113
113
  export declare function __internal__testObservabilityClient(client: ObservabilityClient, action: string, metricName: string, value: number, tags?: Record<string, string> | undefined | null): Promise<void>
114
114
 
115
+ export declare function __internal__testPersistentStorage(store: PersistentStorage, action: string, key?: string | undefined | null, configName?: string | undefined | null, data?: any | undefined | null): Promise<Record<string, string> | null>
116
+
115
117
  export interface ClientInitResponseOptions {
116
118
  hashAlgorithm?: string
117
119
  clientSdkKey?: string
@@ -191,6 +193,12 @@ export interface ParameterStoreEvaluationOptions {
191
193
  disableExposureLogging?: boolean
192
194
  }
193
195
 
196
+ export interface PersistentStorage {
197
+ load: (key: string) => UserPersistedValues | null
198
+ save: (key: string, config_name: string, data: StickyValues) => void
199
+ delete: (key: string, config_name: string) => void
200
+ }
201
+
194
202
  export interface ProxyConfig {
195
203
  proxyHost?: string
196
204
  proxyPort?: number
@@ -372,4 +372,5 @@ module.exports.StatsigNapiInternal = nativeBinding.StatsigNapiInternal
372
372
  module.exports.StatsigUser = nativeBinding.StatsigUser
373
373
  module.exports.__internal__testDataStore = nativeBinding.__internal__testDataStore
374
374
  module.exports.__internal__testObservabilityClient = nativeBinding.__internal__testObservabilityClient
375
+ module.exports.__internal__testPersistentStorage = nativeBinding.__internal__testPersistentStorage
375
376
  module.exports.OverrideAdapterType = nativeBinding.OverrideAdapterType
@@ -0,0 +1,14 @@
1
+ import { SecondaryExposure } from './statsig-generated';
2
+ export type StickyValues = {
3
+ value: boolean;
4
+ json_value: Record<string, unknown>;
5
+ rule_id: string;
6
+ group_name: string | null;
7
+ secondary_exposures: SecondaryExposure[];
8
+ undelegated_secondary_exposures: SecondaryExposure[];
9
+ config_delegate: string | null;
10
+ explicit_parameters: string[] | null;
11
+ time: number;
12
+ configVersion?: number | undefined;
13
+ };
14
+ export type UserPersistedValues = Record<string, StickyValues>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
File without changes