@oai-statsig/statsig-node-core 0.32.0-beta.20260918.1821 → 0.32.0-beta.20260920.1827
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 +1 -1
- package/index.js +1 -1
- package/package.json +10 -10
- package/statsig-generated.js +323 -115
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { DynamicConfigEvaluationOptions, ExperimentEvaluationOptions, FeatureGat
|
|
|
2
2
|
import { DynamicConfig, Experiment, FeatureGate, Layer } from './statsig_types';
|
|
3
3
|
export * from './statsig-generated';
|
|
4
4
|
export * from './statsig_types';
|
|
5
|
-
export declare const SDK_VERSION = "0.32.0-beta.
|
|
5
|
+
export declare const SDK_VERSION = "0.32.0-beta.20260920.1827";
|
|
6
6
|
export declare class Statsig extends StatsigNapiInternal {
|
|
7
7
|
private static _sharedInstance;
|
|
8
8
|
static shared(): Statsig;
|
package/index.js
CHANGED
|
@@ -31,7 +31,7 @@ const statsig_generated_1 = require("./statsig-generated");
|
|
|
31
31
|
const statsig_types_1 = require("./statsig_types");
|
|
32
32
|
__exportStar(require("./statsig-generated"), exports);
|
|
33
33
|
__exportStar(require("./statsig_types"), exports);
|
|
34
|
-
exports.SDK_VERSION = '0.32.0-beta.
|
|
34
|
+
exports.SDK_VERSION = '0.32.0-beta.20260920.1827';
|
|
35
35
|
const inspectSym = Symbol.for('nodejs.util.inspect.custom');
|
|
36
36
|
// @ts-expect-error - prototype assignment
|
|
37
37
|
statsig_generated_1.StatsigUser.prototype[inspectSym] = function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oai-statsig/statsig-node-core",
|
|
3
|
-
"version": "0.32.0-beta.
|
|
3
|
+
"version": "0.32.0-beta.20260920.1827",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest --colors"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@babel/helpers": "7.26.10",
|
|
20
|
-
"@napi-rs/cli": "3.
|
|
20
|
+
"@napi-rs/cli": "3.4.1",
|
|
21
21
|
"@octokit/endpoint": "10.1.3",
|
|
22
22
|
"@octokit/plugin-paginate-rest": "11.4.1",
|
|
23
23
|
"@octokit/request": "9.2.1",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"optionalDependencies": {
|
|
63
|
-
"@oai-statsig/statsig-node-core-darwin-arm64": "0.32.0-beta.
|
|
64
|
-
"@oai-statsig/statsig-node-core-darwin-x64": "0.32.0-beta.
|
|
65
|
-
"@oai-statsig/statsig-node-core-linux-arm64-gnu": "0.32.0-beta.
|
|
66
|
-
"@oai-statsig/statsig-node-core-linux-arm64-musl": "0.32.0-beta.
|
|
67
|
-
"@oai-statsig/statsig-node-core-linux-x64-gnu": "0.32.0-beta.
|
|
68
|
-
"@oai-statsig/statsig-node-core-linux-x64-musl": "0.32.0-beta.
|
|
69
|
-
"@oai-statsig/statsig-node-core-win32-ia32-msvc": "0.32.0-beta.
|
|
70
|
-
"@oai-statsig/statsig-node-core-win32-x64-msvc": "0.32.0-beta.
|
|
63
|
+
"@oai-statsig/statsig-node-core-darwin-arm64": "0.32.0-beta.20260920.1827",
|
|
64
|
+
"@oai-statsig/statsig-node-core-darwin-x64": "0.32.0-beta.20260920.1827",
|
|
65
|
+
"@oai-statsig/statsig-node-core-linux-arm64-gnu": "0.32.0-beta.20260920.1827",
|
|
66
|
+
"@oai-statsig/statsig-node-core-linux-arm64-musl": "0.32.0-beta.20260920.1827",
|
|
67
|
+
"@oai-statsig/statsig-node-core-linux-x64-gnu": "0.32.0-beta.20260920.1827",
|
|
68
|
+
"@oai-statsig/statsig-node-core-linux-x64-musl": "0.32.0-beta.20260920.1827",
|
|
69
|
+
"@oai-statsig/statsig-node-core-win32-ia32-msvc": "0.32.0-beta.20260920.1827",
|
|
70
|
+
"@oai-statsig/statsig-node-core-win32-x64-msvc": "0.32.0-beta.20260920.1827"
|
|
71
71
|
}
|
|
72
72
|
}
|
package/statsig-generated.js
CHANGED
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
|
-
const { createRequire } = require('node:module')
|
|
7
|
-
require = createRequire(__filename)
|
|
8
|
-
|
|
9
6
|
const { readFileSync } = require('node:fs')
|
|
10
7
|
let nativeBinding = null
|
|
11
8
|
const loadErrors = []
|
|
@@ -35,7 +32,11 @@ const isMuslFromFilesystem = () => {
|
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
const isMuslFromReport = () => {
|
|
38
|
-
|
|
35
|
+
let report = null
|
|
36
|
+
if (typeof process.report?.getReport === 'function') {
|
|
37
|
+
process.report.excludeNetwork = true
|
|
38
|
+
report = process.report.getReport()
|
|
39
|
+
}
|
|
39
40
|
if (!report) {
|
|
40
41
|
return null
|
|
41
42
|
}
|
|
@@ -60,7 +61,13 @@ const isMuslFromChildProcess = () => {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
function requireNative() {
|
|
63
|
-
if (process.
|
|
64
|
+
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
65
|
+
try {
|
|
66
|
+
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
|
|
67
|
+
} catch (err) {
|
|
68
|
+
loadErrors.push(err)
|
|
69
|
+
}
|
|
70
|
+
} else if (process.platform === 'android') {
|
|
64
71
|
if (process.arch === 'arm64') {
|
|
65
72
|
try {
|
|
66
73
|
return require('./statsig-node-core.android-arm64.node')
|
|
@@ -68,11 +75,15 @@ function requireNative() {
|
|
|
68
75
|
loadErrors.push(e)
|
|
69
76
|
}
|
|
70
77
|
try {
|
|
71
|
-
|
|
78
|
+
const binding = require('@oai-statsig/statsig-node-core-android-arm64')
|
|
79
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-android-arm64/package.json').version
|
|
80
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
|
+
}
|
|
83
|
+
return binding
|
|
72
84
|
} catch (e) {
|
|
73
85
|
loadErrors.push(e)
|
|
74
86
|
}
|
|
75
|
-
|
|
76
87
|
} else if (process.arch === 'arm') {
|
|
77
88
|
try {
|
|
78
89
|
return require('./statsig-node-core.android-arm-eabi.node')
|
|
@@ -80,27 +91,53 @@ function requireNative() {
|
|
|
80
91
|
loadErrors.push(e)
|
|
81
92
|
}
|
|
82
93
|
try {
|
|
83
|
-
|
|
94
|
+
const binding = require('@oai-statsig/statsig-node-core-android-arm-eabi')
|
|
95
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-android-arm-eabi/package.json').version
|
|
96
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
|
+
}
|
|
99
|
+
return binding
|
|
84
100
|
} catch (e) {
|
|
85
101
|
loadErrors.push(e)
|
|
86
102
|
}
|
|
87
|
-
|
|
88
103
|
} else {
|
|
89
104
|
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
|
|
90
105
|
}
|
|
91
106
|
} else if (process.platform === 'win32') {
|
|
92
107
|
if (process.arch === 'x64') {
|
|
108
|
+
if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
|
|
109
|
+
try {
|
|
110
|
+
return require('./statsig-node-core.win32-x64-gnu.node')
|
|
111
|
+
} catch (e) {
|
|
112
|
+
loadErrors.push(e)
|
|
113
|
+
}
|
|
93
114
|
try {
|
|
115
|
+
const binding = require('@oai-statsig/statsig-node-core-win32-x64-gnu')
|
|
116
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-win32-x64-gnu/package.json').version
|
|
117
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
|
+
}
|
|
120
|
+
return binding
|
|
121
|
+
} catch (e) {
|
|
122
|
+
loadErrors.push(e)
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
try {
|
|
94
126
|
return require('./statsig-node-core.win32-x64-msvc.node')
|
|
95
127
|
} catch (e) {
|
|
96
128
|
loadErrors.push(e)
|
|
97
129
|
}
|
|
98
130
|
try {
|
|
99
|
-
|
|
131
|
+
const binding = require('@oai-statsig/statsig-node-core-win32-x64-msvc')
|
|
132
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-win32-x64-msvc/package.json').version
|
|
133
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
|
+
}
|
|
136
|
+
return binding
|
|
100
137
|
} catch (e) {
|
|
101
138
|
loadErrors.push(e)
|
|
102
139
|
}
|
|
103
|
-
|
|
140
|
+
}
|
|
104
141
|
} else if (process.arch === 'ia32') {
|
|
105
142
|
try {
|
|
106
143
|
return require('./statsig-node-core.win32-ia32-msvc.node')
|
|
@@ -108,11 +145,15 @@ function requireNative() {
|
|
|
108
145
|
loadErrors.push(e)
|
|
109
146
|
}
|
|
110
147
|
try {
|
|
111
|
-
|
|
148
|
+
const binding = require('@oai-statsig/statsig-node-core-win32-ia32-msvc')
|
|
149
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-win32-ia32-msvc/package.json').version
|
|
150
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
|
+
}
|
|
153
|
+
return binding
|
|
112
154
|
} catch (e) {
|
|
113
155
|
loadErrors.push(e)
|
|
114
156
|
}
|
|
115
|
-
|
|
116
157
|
} else if (process.arch === 'arm64') {
|
|
117
158
|
try {
|
|
118
159
|
return require('./statsig-node-core.win32-arm64-msvc.node')
|
|
@@ -120,26 +161,34 @@ function requireNative() {
|
|
|
120
161
|
loadErrors.push(e)
|
|
121
162
|
}
|
|
122
163
|
try {
|
|
123
|
-
|
|
164
|
+
const binding = require('@oai-statsig/statsig-node-core-win32-arm64-msvc')
|
|
165
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-win32-arm64-msvc/package.json').version
|
|
166
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
|
+
}
|
|
169
|
+
return binding
|
|
124
170
|
} catch (e) {
|
|
125
171
|
loadErrors.push(e)
|
|
126
172
|
}
|
|
127
|
-
|
|
128
173
|
} else {
|
|
129
174
|
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
|
|
130
175
|
}
|
|
131
176
|
} else if (process.platform === 'darwin') {
|
|
132
177
|
try {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
178
|
+
return require('./statsig-node-core.darwin-universal.node')
|
|
179
|
+
} catch (e) {
|
|
180
|
+
loadErrors.push(e)
|
|
181
|
+
}
|
|
182
|
+
try {
|
|
183
|
+
const binding = require('@oai-statsig/statsig-node-core-darwin-universal')
|
|
184
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-darwin-universal/package.json').version
|
|
185
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
|
+
}
|
|
188
|
+
return binding
|
|
189
|
+
} catch (e) {
|
|
190
|
+
loadErrors.push(e)
|
|
191
|
+
}
|
|
143
192
|
if (process.arch === 'x64') {
|
|
144
193
|
try {
|
|
145
194
|
return require('./statsig-node-core.darwin-x64.node')
|
|
@@ -147,11 +196,15 @@ function requireNative() {
|
|
|
147
196
|
loadErrors.push(e)
|
|
148
197
|
}
|
|
149
198
|
try {
|
|
150
|
-
|
|
199
|
+
const binding = require('@oai-statsig/statsig-node-core-darwin-x64')
|
|
200
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-darwin-x64/package.json').version
|
|
201
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
|
+
}
|
|
204
|
+
return binding
|
|
151
205
|
} catch (e) {
|
|
152
206
|
loadErrors.push(e)
|
|
153
207
|
}
|
|
154
|
-
|
|
155
208
|
} else if (process.arch === 'arm64') {
|
|
156
209
|
try {
|
|
157
210
|
return require('./statsig-node-core.darwin-arm64.node')
|
|
@@ -159,11 +212,15 @@ function requireNative() {
|
|
|
159
212
|
loadErrors.push(e)
|
|
160
213
|
}
|
|
161
214
|
try {
|
|
162
|
-
|
|
215
|
+
const binding = require('@oai-statsig/statsig-node-core-darwin-arm64')
|
|
216
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-darwin-arm64/package.json').version
|
|
217
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
|
+
}
|
|
220
|
+
return binding
|
|
163
221
|
} catch (e) {
|
|
164
222
|
loadErrors.push(e)
|
|
165
223
|
}
|
|
166
|
-
|
|
167
224
|
} else {
|
|
168
225
|
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
|
|
169
226
|
}
|
|
@@ -175,11 +232,15 @@ function requireNative() {
|
|
|
175
232
|
loadErrors.push(e)
|
|
176
233
|
}
|
|
177
234
|
try {
|
|
178
|
-
|
|
235
|
+
const binding = require('@oai-statsig/statsig-node-core-freebsd-x64')
|
|
236
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-freebsd-x64/package.json').version
|
|
237
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
|
+
}
|
|
240
|
+
return binding
|
|
179
241
|
} catch (e) {
|
|
180
242
|
loadErrors.push(e)
|
|
181
243
|
}
|
|
182
|
-
|
|
183
244
|
} else if (process.arch === 'arm64') {
|
|
184
245
|
try {
|
|
185
246
|
return require('./statsig-node-core.freebsd-arm64.node')
|
|
@@ -187,11 +248,15 @@ function requireNative() {
|
|
|
187
248
|
loadErrors.push(e)
|
|
188
249
|
}
|
|
189
250
|
try {
|
|
190
|
-
|
|
251
|
+
const binding = require('@oai-statsig/statsig-node-core-freebsd-arm64')
|
|
252
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-freebsd-arm64/package.json').version
|
|
253
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
|
+
}
|
|
256
|
+
return binding
|
|
191
257
|
} catch (e) {
|
|
192
258
|
loadErrors.push(e)
|
|
193
259
|
}
|
|
194
|
-
|
|
195
260
|
} else {
|
|
196
261
|
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
|
|
197
262
|
}
|
|
@@ -199,133 +264,259 @@ function requireNative() {
|
|
|
199
264
|
if (process.arch === 'x64') {
|
|
200
265
|
if (isMusl()) {
|
|
201
266
|
try {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
267
|
+
return require('./statsig-node-core.linux-x64-musl.node')
|
|
268
|
+
} catch (e) {
|
|
269
|
+
loadErrors.push(e)
|
|
270
|
+
}
|
|
271
|
+
try {
|
|
272
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-x64-musl')
|
|
273
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-x64-musl/package.json').version
|
|
274
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
|
+
}
|
|
277
|
+
return binding
|
|
278
|
+
} catch (e) {
|
|
279
|
+
loadErrors.push(e)
|
|
280
|
+
}
|
|
212
281
|
} else {
|
|
213
282
|
try {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
283
|
+
return require('./statsig-node-core.linux-x64-gnu.node')
|
|
284
|
+
} catch (e) {
|
|
285
|
+
loadErrors.push(e)
|
|
286
|
+
}
|
|
287
|
+
try {
|
|
288
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-x64-gnu')
|
|
289
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-x64-gnu/package.json').version
|
|
290
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
|
+
}
|
|
293
|
+
return binding
|
|
294
|
+
} catch (e) {
|
|
295
|
+
loadErrors.push(e)
|
|
296
|
+
}
|
|
224
297
|
}
|
|
225
298
|
} else if (process.arch === 'arm64') {
|
|
226
299
|
if (isMusl()) {
|
|
227
300
|
try {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
301
|
+
return require('./statsig-node-core.linux-arm64-musl.node')
|
|
302
|
+
} catch (e) {
|
|
303
|
+
loadErrors.push(e)
|
|
304
|
+
}
|
|
305
|
+
try {
|
|
306
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-arm64-musl')
|
|
307
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-arm64-musl/package.json').version
|
|
308
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
|
+
}
|
|
311
|
+
return binding
|
|
312
|
+
} catch (e) {
|
|
313
|
+
loadErrors.push(e)
|
|
314
|
+
}
|
|
238
315
|
} else {
|
|
239
316
|
try {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
317
|
+
return require('./statsig-node-core.linux-arm64-gnu.node')
|
|
318
|
+
} catch (e) {
|
|
319
|
+
loadErrors.push(e)
|
|
320
|
+
}
|
|
321
|
+
try {
|
|
322
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-arm64-gnu')
|
|
323
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-arm64-gnu/package.json').version
|
|
324
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
|
+
}
|
|
327
|
+
return binding
|
|
328
|
+
} catch (e) {
|
|
329
|
+
loadErrors.push(e)
|
|
330
|
+
}
|
|
250
331
|
}
|
|
251
332
|
} else if (process.arch === 'arm') {
|
|
252
333
|
if (isMusl()) {
|
|
253
334
|
try {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
335
|
+
return require('./statsig-node-core.linux-arm-musleabihf.node')
|
|
336
|
+
} catch (e) {
|
|
337
|
+
loadErrors.push(e)
|
|
338
|
+
}
|
|
339
|
+
try {
|
|
340
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-arm-musleabihf')
|
|
341
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-arm-musleabihf/package.json').version
|
|
342
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
|
+
}
|
|
345
|
+
return binding
|
|
346
|
+
} catch (e) {
|
|
347
|
+
loadErrors.push(e)
|
|
348
|
+
}
|
|
349
|
+
} else {
|
|
350
|
+
try {
|
|
351
|
+
return require('./statsig-node-core.linux-arm-gnueabihf.node')
|
|
352
|
+
} catch (e) {
|
|
353
|
+
loadErrors.push(e)
|
|
354
|
+
}
|
|
355
|
+
try {
|
|
356
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-arm-gnueabihf')
|
|
357
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-arm-gnueabihf/package.json').version
|
|
358
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
|
+
}
|
|
361
|
+
return binding
|
|
362
|
+
} catch (e) {
|
|
363
|
+
loadErrors.push(e)
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
} else if (process.arch === 'loong64') {
|
|
367
|
+
if (isMusl()) {
|
|
368
|
+
try {
|
|
369
|
+
return require('./statsig-node-core.linux-loong64-musl.node')
|
|
370
|
+
} catch (e) {
|
|
371
|
+
loadErrors.push(e)
|
|
372
|
+
}
|
|
373
|
+
try {
|
|
374
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-loong64-musl')
|
|
375
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-loong64-musl/package.json').version
|
|
376
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
|
+
}
|
|
379
|
+
return binding
|
|
380
|
+
} catch (e) {
|
|
381
|
+
loadErrors.push(e)
|
|
382
|
+
}
|
|
383
|
+
} else {
|
|
384
|
+
try {
|
|
385
|
+
return require('./statsig-node-core.linux-loong64-gnu.node')
|
|
386
|
+
} catch (e) {
|
|
387
|
+
loadErrors.push(e)
|
|
388
|
+
}
|
|
389
|
+
try {
|
|
390
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-loong64-gnu')
|
|
391
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-loong64-gnu/package.json').version
|
|
392
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
|
+
}
|
|
395
|
+
return binding
|
|
396
|
+
} catch (e) {
|
|
397
|
+
loadErrors.push(e)
|
|
398
|
+
}
|
|
262
399
|
}
|
|
263
|
-
|
|
400
|
+
} else if (process.arch === 'riscv64') {
|
|
401
|
+
if (isMusl()) {
|
|
402
|
+
try {
|
|
403
|
+
return require('./statsig-node-core.linux-riscv64-musl.node')
|
|
404
|
+
} catch (e) {
|
|
405
|
+
loadErrors.push(e)
|
|
406
|
+
}
|
|
407
|
+
try {
|
|
408
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-riscv64-musl')
|
|
409
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-riscv64-musl/package.json').version
|
|
410
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
|
+
}
|
|
413
|
+
return binding
|
|
414
|
+
} catch (e) {
|
|
415
|
+
loadErrors.push(e)
|
|
416
|
+
}
|
|
264
417
|
} else {
|
|
265
418
|
try {
|
|
266
|
-
|
|
419
|
+
return require('./statsig-node-core.linux-riscv64-gnu.node')
|
|
420
|
+
} catch (e) {
|
|
421
|
+
loadErrors.push(e)
|
|
422
|
+
}
|
|
423
|
+
try {
|
|
424
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-riscv64-gnu')
|
|
425
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-riscv64-gnu/package.json').version
|
|
426
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
|
+
}
|
|
429
|
+
return binding
|
|
430
|
+
} catch (e) {
|
|
431
|
+
loadErrors.push(e)
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
} else if (process.arch === 'ppc64') {
|
|
435
|
+
try {
|
|
436
|
+
return require('./statsig-node-core.linux-ppc64-gnu.node')
|
|
267
437
|
} catch (e) {
|
|
268
438
|
loadErrors.push(e)
|
|
269
439
|
}
|
|
270
440
|
try {
|
|
271
|
-
|
|
441
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-ppc64-gnu')
|
|
442
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-ppc64-gnu/package.json').version
|
|
443
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
|
+
}
|
|
446
|
+
return binding
|
|
272
447
|
} catch (e) {
|
|
273
448
|
loadErrors.push(e)
|
|
274
449
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
if (isMusl()) {
|
|
279
|
-
try {
|
|
280
|
-
return require('./statsig-node-core.linux-riscv64-musl.node')
|
|
450
|
+
} else if (process.arch === 's390x') {
|
|
451
|
+
try {
|
|
452
|
+
return require('./statsig-node-core.linux-s390x-gnu.node')
|
|
281
453
|
} catch (e) {
|
|
282
454
|
loadErrors.push(e)
|
|
283
455
|
}
|
|
284
456
|
try {
|
|
285
|
-
|
|
457
|
+
const binding = require('@oai-statsig/statsig-node-core-linux-s390x-gnu')
|
|
458
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-linux-s390x-gnu/package.json').version
|
|
459
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
|
+
}
|
|
462
|
+
return binding
|
|
286
463
|
} catch (e) {
|
|
287
464
|
loadErrors.push(e)
|
|
288
465
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
466
|
+
} else {
|
|
467
|
+
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
|
|
468
|
+
}
|
|
469
|
+
} else if (process.platform === 'openharmony') {
|
|
470
|
+
if (process.arch === 'arm64') {
|
|
471
|
+
try {
|
|
472
|
+
return require('./statsig-node-core.openharmony-arm64.node')
|
|
293
473
|
} catch (e) {
|
|
294
474
|
loadErrors.push(e)
|
|
295
475
|
}
|
|
296
476
|
try {
|
|
297
|
-
|
|
477
|
+
const binding = require('@oai-statsig/statsig-node-core-openharmony-arm64')
|
|
478
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-openharmony-arm64/package.json').version
|
|
479
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
|
+
}
|
|
482
|
+
return binding
|
|
298
483
|
} catch (e) {
|
|
299
484
|
loadErrors.push(e)
|
|
300
485
|
}
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
} else if (process.arch === 'ppc64') {
|
|
486
|
+
} else if (process.arch === 'x64') {
|
|
304
487
|
try {
|
|
305
|
-
return require('./statsig-node-core.
|
|
488
|
+
return require('./statsig-node-core.openharmony-x64.node')
|
|
306
489
|
} catch (e) {
|
|
307
490
|
loadErrors.push(e)
|
|
308
491
|
}
|
|
309
492
|
try {
|
|
310
|
-
|
|
493
|
+
const binding = require('@oai-statsig/statsig-node-core-openharmony-x64')
|
|
494
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-openharmony-x64/package.json').version
|
|
495
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
|
+
}
|
|
498
|
+
return binding
|
|
311
499
|
} catch (e) {
|
|
312
500
|
loadErrors.push(e)
|
|
313
501
|
}
|
|
314
|
-
|
|
315
|
-
} else if (process.arch === 's390x') {
|
|
502
|
+
} else if (process.arch === 'arm') {
|
|
316
503
|
try {
|
|
317
|
-
return require('./statsig-node-core.
|
|
504
|
+
return require('./statsig-node-core.openharmony-arm.node')
|
|
318
505
|
} catch (e) {
|
|
319
506
|
loadErrors.push(e)
|
|
320
507
|
}
|
|
321
508
|
try {
|
|
322
|
-
|
|
509
|
+
const binding = require('@oai-statsig/statsig-node-core-openharmony-arm')
|
|
510
|
+
const bindingPackageVersion = require('@oai-statsig/statsig-node-core-openharmony-arm/package.json').version
|
|
511
|
+
if (bindingPackageVersion !== '0.32.0-beta.20260920.1827' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 0.32.0-beta.20260920.1827 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
|
+
}
|
|
514
|
+
return binding
|
|
323
515
|
} catch (e) {
|
|
324
516
|
loadErrors.push(e)
|
|
325
517
|
}
|
|
326
|
-
|
|
327
518
|
} else {
|
|
328
|
-
loadErrors.push(new Error(`Unsupported architecture on
|
|
519
|
+
loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
|
|
329
520
|
}
|
|
330
521
|
} else {
|
|
331
522
|
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
|
|
@@ -335,35 +526,52 @@ function requireNative() {
|
|
|
335
526
|
nativeBinding = requireNative()
|
|
336
527
|
|
|
337
528
|
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
529
|
+
let wasiBinding = null
|
|
530
|
+
let wasiBindingError = null
|
|
338
531
|
try {
|
|
339
|
-
|
|
532
|
+
wasiBinding = require('./statsig-node-core.wasi.cjs')
|
|
533
|
+
nativeBinding = wasiBinding
|
|
340
534
|
} catch (err) {
|
|
341
535
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
342
|
-
|
|
536
|
+
wasiBindingError = err
|
|
343
537
|
}
|
|
344
538
|
}
|
|
345
539
|
if (!nativeBinding) {
|
|
346
540
|
try {
|
|
347
|
-
|
|
541
|
+
wasiBinding = require('@oai-statsig/statsig-node-core-wasm32-wasi')
|
|
542
|
+
nativeBinding = wasiBinding
|
|
348
543
|
} catch (err) {
|
|
349
544
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
545
|
+
wasiBindingError.cause = err
|
|
350
546
|
loadErrors.push(err)
|
|
351
547
|
}
|
|
352
548
|
}
|
|
353
549
|
}
|
|
550
|
+
if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
|
|
551
|
+
const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
|
|
552
|
+
error.cause = wasiBindingError
|
|
553
|
+
throw error
|
|
554
|
+
}
|
|
354
555
|
}
|
|
355
556
|
|
|
356
557
|
if (!nativeBinding) {
|
|
357
558
|
if (loadErrors.length > 0) {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
559
|
+
throw new Error(
|
|
560
|
+
`Cannot find native binding. ` +
|
|
561
|
+
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
|
562
|
+
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
|
|
563
|
+
{
|
|
564
|
+
cause: loadErrors.reduce((err, cur) => {
|
|
565
|
+
cur.cause = err
|
|
566
|
+
return cur
|
|
567
|
+
}),
|
|
568
|
+
},
|
|
569
|
+
)
|
|
363
570
|
}
|
|
364
571
|
throw new Error(`Failed to load native binding`)
|
|
365
572
|
}
|
|
366
573
|
|
|
574
|
+
module.exports = nativeBinding
|
|
367
575
|
module.exports.InternedStore = nativeBinding.InternedStore
|
|
368
576
|
module.exports.LayerParamExposureData = nativeBinding.LayerParamExposureData
|
|
369
577
|
module.exports.ParameterStore = nativeBinding.ParameterStore
|