@recappi/sdk 1.0.0 → 1.1.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.
Files changed (3) hide show
  1. package/README.md +59 -25
  2. package/index.cjs +323 -526
  3. package/package.json +54 -65
package/index.cjs CHANGED
@@ -4,758 +4,557 @@
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
6
  const { readFileSync } = require('node:fs')
7
- let nativeBinding = null;
8
- const loadErrors = [];
7
+ let nativeBinding = null
8
+ const loadErrors = []
9
9
 
10
10
  const isMusl = () => {
11
- let musl = false;
12
- if (process.platform === "linux") {
13
- musl = isMuslFromFilesystem();
11
+ let musl = false
12
+ if (process.platform === 'linux') {
13
+ musl = isMuslFromFilesystem()
14
14
  if (musl === null) {
15
- musl = isMuslFromReport();
15
+ musl = isMuslFromReport()
16
16
  }
17
17
  if (musl === null) {
18
- musl = isMuslFromChildProcess();
18
+ musl = isMuslFromChildProcess()
19
19
  }
20
20
  }
21
- return musl;
22
- };
21
+ return musl
22
+ }
23
23
 
24
- const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
24
+ const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
25
25
 
26
26
  const isMuslFromFilesystem = () => {
27
27
  try {
28
- return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
28
+ return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
29
29
  } catch {
30
- return null;
30
+ return null
31
31
  }
32
- };
32
+ }
33
33
 
34
34
  const isMuslFromReport = () => {
35
- let report = null;
36
- if (typeof process.report?.getReport === "function") {
37
- process.report.excludeNetwork = true;
38
- report = process.report.getReport();
35
+ let report = null
36
+ if (typeof process.report?.getReport === 'function') {
37
+ process.report.excludeNetwork = true
38
+ report = process.report.getReport()
39
39
  }
40
40
  if (!report) {
41
- return null;
41
+ return null
42
42
  }
43
43
  if (report.header && report.header.glibcVersionRuntime) {
44
- return false;
44
+ return false
45
45
  }
46
46
  if (Array.isArray(report.sharedObjects)) {
47
47
  if (report.sharedObjects.some(isFileMusl)) {
48
- return true;
48
+ return true
49
49
  }
50
50
  }
51
- return false;
52
- };
51
+ return false
52
+ }
53
53
 
54
54
  const isMuslFromChildProcess = () => {
55
55
  try {
56
- return require("child_process")
57
- .execSync("ldd --version", { encoding: "utf8" })
58
- .includes("musl");
56
+ return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
59
57
  } catch (e) {
60
58
  // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
61
- return false;
59
+ return false
62
60
  }
63
- };
61
+ }
64
62
 
65
63
  function requireNative() {
66
64
  if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
67
65
  try {
68
66
  return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
69
67
  } catch (err) {
70
- loadErrors.push(err);
68
+ loadErrors.push(err)
71
69
  }
72
- } else if (process.platform === "android") {
73
- if (process.arch === "arm64") {
70
+ } else if (process.platform === 'android') {
71
+ if (process.arch === 'arm64') {
74
72
  try {
75
- return require("./recording.android-arm64.node");
73
+ return require('./recording.android-arm64.node')
76
74
  } catch (e) {
77
- loadErrors.push(e);
75
+ loadErrors.push(e)
78
76
  }
79
77
  try {
80
- const binding = require("@recappi/sdk-android-arm64");
81
- const bindingPackageVersion =
82
- require("@recappi/sdk-android-arm64/package.json").version;
83
- if (
84
- bindingPackageVersion !== "1.0.0" &&
85
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
86
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
87
- ) {
88
- throw new Error(
89
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
90
- );
91
- }
92
- return binding;
78
+ const binding = require('@recappi/sdk-android-arm64')
79
+ const bindingPackageVersion = require('@recappi/sdk-android-arm64/package.json').version
80
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
+ }
83
+ return binding
93
84
  } catch (e) {
94
- loadErrors.push(e);
85
+ loadErrors.push(e)
95
86
  }
96
- } else if (process.arch === "arm") {
87
+ } else if (process.arch === 'arm') {
97
88
  try {
98
- return require("./recording.android-arm-eabi.node");
89
+ return require('./recording.android-arm-eabi.node')
99
90
  } catch (e) {
100
- loadErrors.push(e);
91
+ loadErrors.push(e)
101
92
  }
102
93
  try {
103
- const binding = require("@recappi/sdk-android-arm-eabi");
104
- const bindingPackageVersion =
105
- require("@recappi/sdk-android-arm-eabi/package.json").version;
106
- if (
107
- bindingPackageVersion !== "1.0.0" &&
108
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
109
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
110
- ) {
111
- throw new Error(
112
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
113
- );
114
- }
115
- return binding;
94
+ const binding = require('@recappi/sdk-android-arm-eabi')
95
+ const bindingPackageVersion = require('@recappi/sdk-android-arm-eabi/package.json').version
96
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
+ }
99
+ return binding
116
100
  } catch (e) {
117
- loadErrors.push(e);
101
+ loadErrors.push(e)
118
102
  }
119
103
  } else {
120
- loadErrors.push(
121
- new Error(`Unsupported architecture on Android ${process.arch}`),
122
- );
104
+ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
123
105
  }
124
- } else if (process.platform === "win32") {
125
- if (process.arch === "x64") {
126
- if (
127
- process.config?.variables?.shlib_suffix === "dll.a" ||
128
- process.config?.variables?.node_target_type === "shared_library"
129
- ) {
106
+ } else if (process.platform === 'win32') {
107
+ if (process.arch === 'x64') {
108
+ if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
130
109
  try {
131
- return require("./recording.win32-x64-gnu.node");
132
- } catch (e) {
133
- loadErrors.push(e);
134
- }
135
- try {
136
- const binding = require("@recappi/sdk-win32-x64-gnu");
137
- const bindingPackageVersion =
138
- require("@recappi/sdk-win32-x64-gnu/package.json").version;
139
- if (
140
- bindingPackageVersion !== "1.0.0" &&
141
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
142
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
143
- ) {
144
- throw new Error(
145
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
146
- );
147
- }
148
- return binding;
149
- } catch (e) {
150
- loadErrors.push(e);
110
+ return require('./recording.win32-x64-gnu.node')
111
+ } catch (e) {
112
+ loadErrors.push(e)
113
+ }
114
+ try {
115
+ const binding = require('@recappi/sdk-win32-x64-gnu')
116
+ const bindingPackageVersion = require('@recappi/sdk-win32-x64-gnu/package.json').version
117
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
151
119
  }
120
+ return binding
121
+ } catch (e) {
122
+ loadErrors.push(e)
123
+ }
152
124
  } else {
153
125
  try {
154
- return require("./recording.win32-x64-msvc.node");
155
- } catch (e) {
156
- loadErrors.push(e);
157
- }
158
- try {
159
- const binding = require("@recappi/sdk-win32-x64-msvc");
160
- const bindingPackageVersion =
161
- require("@recappi/sdk-win32-x64-msvc/package.json").version;
162
- if (
163
- bindingPackageVersion !== "1.0.0" &&
164
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
165
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
166
- ) {
167
- throw new Error(
168
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
169
- );
170
- }
171
- return binding;
172
- } catch (e) {
173
- loadErrors.push(e);
126
+ return require('./recording.win32-x64-msvc.node')
127
+ } catch (e) {
128
+ loadErrors.push(e)
129
+ }
130
+ try {
131
+ const binding = require('@recappi/sdk-win32-x64-msvc')
132
+ const bindingPackageVersion = require('@recappi/sdk-win32-x64-msvc/package.json').version
133
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
174
135
  }
136
+ return binding
137
+ } catch (e) {
138
+ loadErrors.push(e)
175
139
  }
176
- } else if (process.arch === "ia32") {
140
+ }
141
+ } else if (process.arch === 'ia32') {
177
142
  try {
178
- return require("./recording.win32-ia32-msvc.node");
143
+ return require('./recording.win32-ia32-msvc.node')
179
144
  } catch (e) {
180
- loadErrors.push(e);
145
+ loadErrors.push(e)
181
146
  }
182
147
  try {
183
- const binding = require("@recappi/sdk-win32-ia32-msvc");
184
- const bindingPackageVersion =
185
- require("@recappi/sdk-win32-ia32-msvc/package.json").version;
186
- if (
187
- bindingPackageVersion !== "1.0.0" &&
188
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
189
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
190
- ) {
191
- throw new Error(
192
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
193
- );
194
- }
195
- return binding;
148
+ const binding = require('@recappi/sdk-win32-ia32-msvc')
149
+ const bindingPackageVersion = require('@recappi/sdk-win32-ia32-msvc/package.json').version
150
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
+ }
153
+ return binding
196
154
  } catch (e) {
197
- loadErrors.push(e);
155
+ loadErrors.push(e)
198
156
  }
199
- } else if (process.arch === "arm64") {
157
+ } else if (process.arch === 'arm64') {
200
158
  try {
201
- return require("./recording.win32-arm64-msvc.node");
159
+ return require('./recording.win32-arm64-msvc.node')
202
160
  } catch (e) {
203
- loadErrors.push(e);
161
+ loadErrors.push(e)
204
162
  }
205
163
  try {
206
- const binding = require("@recappi/sdk-win32-arm64-msvc");
207
- const bindingPackageVersion =
208
- require("@recappi/sdk-win32-arm64-msvc/package.json").version;
209
- if (
210
- bindingPackageVersion !== "1.0.0" &&
211
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
212
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
213
- ) {
214
- throw new Error(
215
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
216
- );
217
- }
218
- return binding;
164
+ const binding = require('@recappi/sdk-win32-arm64-msvc')
165
+ const bindingPackageVersion = require('@recappi/sdk-win32-arm64-msvc/package.json').version
166
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
+ }
169
+ return binding
219
170
  } catch (e) {
220
- loadErrors.push(e);
171
+ loadErrors.push(e)
221
172
  }
222
173
  } else {
223
- loadErrors.push(
224
- new Error(`Unsupported architecture on Windows: ${process.arch}`),
225
- );
174
+ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
226
175
  }
227
- } else if (process.platform === "darwin") {
176
+ } else if (process.platform === 'darwin') {
228
177
  try {
229
- return require("./recording.darwin-universal.node");
178
+ return require('./recording.darwin-universal.node')
230
179
  } catch (e) {
231
- loadErrors.push(e);
180
+ loadErrors.push(e)
232
181
  }
233
182
  try {
234
- const binding = require("@recappi/sdk-darwin-universal");
235
- const bindingPackageVersion =
236
- require("@recappi/sdk-darwin-universal/package.json").version;
237
- if (
238
- bindingPackageVersion !== "1.0.0" &&
239
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
240
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
241
- ) {
242
- throw new Error(
243
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
244
- );
245
- }
246
- return binding;
183
+ const binding = require('@recappi/sdk-darwin-universal')
184
+ const bindingPackageVersion = require('@recappi/sdk-darwin-universal/package.json').version
185
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
+ }
188
+ return binding
247
189
  } catch (e) {
248
- loadErrors.push(e);
190
+ loadErrors.push(e)
249
191
  }
250
- if (process.arch === "x64") {
192
+ if (process.arch === 'x64') {
251
193
  try {
252
- return require("./recording.darwin-x64.node");
194
+ return require('./recording.darwin-x64.node')
253
195
  } catch (e) {
254
- loadErrors.push(e);
196
+ loadErrors.push(e)
255
197
  }
256
198
  try {
257
- const binding = require("@recappi/sdk-darwin-x64");
258
- const bindingPackageVersion =
259
- require("@recappi/sdk-darwin-x64/package.json").version;
260
- if (
261
- bindingPackageVersion !== "1.0.0" &&
262
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
263
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
264
- ) {
265
- throw new Error(
266
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
267
- );
268
- }
269
- return binding;
199
+ const binding = require('@recappi/sdk-darwin-x64')
200
+ const bindingPackageVersion = require('@recappi/sdk-darwin-x64/package.json').version
201
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
+ }
204
+ return binding
270
205
  } catch (e) {
271
- loadErrors.push(e);
206
+ loadErrors.push(e)
272
207
  }
273
- } else if (process.arch === "arm64") {
208
+ } else if (process.arch === 'arm64') {
274
209
  try {
275
- return require("./recording.darwin-arm64.node");
210
+ return require('./recording.darwin-arm64.node')
276
211
  } catch (e) {
277
- loadErrors.push(e);
212
+ loadErrors.push(e)
278
213
  }
279
214
  try {
280
- const binding = require("@recappi/sdk-darwin-arm64");
281
- const bindingPackageVersion =
282
- require("@recappi/sdk-darwin-arm64/package.json").version;
283
- if (
284
- bindingPackageVersion !== "1.0.0" &&
285
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
286
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
287
- ) {
288
- throw new Error(
289
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
290
- );
291
- }
292
- return binding;
215
+ const binding = require('@recappi/sdk-darwin-arm64')
216
+ const bindingPackageVersion = require('@recappi/sdk-darwin-arm64/package.json').version
217
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
+ }
220
+ return binding
293
221
  } catch (e) {
294
- loadErrors.push(e);
222
+ loadErrors.push(e)
295
223
  }
296
224
  } else {
297
- loadErrors.push(
298
- new Error(`Unsupported architecture on macOS: ${process.arch}`),
299
- );
225
+ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
300
226
  }
301
- } else if (process.platform === "freebsd") {
302
- if (process.arch === "x64") {
227
+ } else if (process.platform === 'freebsd') {
228
+ if (process.arch === 'x64') {
303
229
  try {
304
- return require("./recording.freebsd-x64.node");
230
+ return require('./recording.freebsd-x64.node')
305
231
  } catch (e) {
306
- loadErrors.push(e);
232
+ loadErrors.push(e)
307
233
  }
308
234
  try {
309
- const binding = require("@recappi/sdk-freebsd-x64");
310
- const bindingPackageVersion =
311
- require("@recappi/sdk-freebsd-x64/package.json").version;
312
- if (
313
- bindingPackageVersion !== "1.0.0" &&
314
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
315
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
316
- ) {
317
- throw new Error(
318
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
319
- );
320
- }
321
- return binding;
235
+ const binding = require('@recappi/sdk-freebsd-x64')
236
+ const bindingPackageVersion = require('@recappi/sdk-freebsd-x64/package.json').version
237
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
+ }
240
+ return binding
322
241
  } catch (e) {
323
- loadErrors.push(e);
242
+ loadErrors.push(e)
324
243
  }
325
- } else if (process.arch === "arm64") {
244
+ } else if (process.arch === 'arm64') {
326
245
  try {
327
- return require("./recording.freebsd-arm64.node");
246
+ return require('./recording.freebsd-arm64.node')
328
247
  } catch (e) {
329
- loadErrors.push(e);
248
+ loadErrors.push(e)
330
249
  }
331
250
  try {
332
- const binding = require("@recappi/sdk-freebsd-arm64");
333
- const bindingPackageVersion =
334
- require("@recappi/sdk-freebsd-arm64/package.json").version;
335
- if (
336
- bindingPackageVersion !== "1.0.0" &&
337
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
338
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
339
- ) {
340
- throw new Error(
341
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
342
- );
343
- }
344
- return binding;
251
+ const binding = require('@recappi/sdk-freebsd-arm64')
252
+ const bindingPackageVersion = require('@recappi/sdk-freebsd-arm64/package.json').version
253
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
+ }
256
+ return binding
345
257
  } catch (e) {
346
- loadErrors.push(e);
258
+ loadErrors.push(e)
347
259
  }
348
260
  } else {
349
- loadErrors.push(
350
- new Error(`Unsupported architecture on FreeBSD: ${process.arch}`),
351
- );
261
+ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
352
262
  }
353
- } else if (process.platform === "linux") {
354
- if (process.arch === "x64") {
263
+ } else if (process.platform === 'linux') {
264
+ if (process.arch === 'x64') {
355
265
  if (isMusl()) {
356
266
  try {
357
- return require("./recording.linux-x64-musl.node");
267
+ return require('./recording.linux-x64-musl.node')
358
268
  } catch (e) {
359
- loadErrors.push(e);
269
+ loadErrors.push(e)
360
270
  }
361
271
  try {
362
- const binding = require("@recappi/sdk-linux-x64-musl");
363
- const bindingPackageVersion =
364
- require("@recappi/sdk-linux-x64-musl/package.json").version;
365
- if (
366
- bindingPackageVersion !== "1.0.0" &&
367
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
368
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
369
- ) {
370
- throw new Error(
371
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
372
- );
272
+ const binding = require('@recappi/sdk-linux-x64-musl')
273
+ const bindingPackageVersion = require('@recappi/sdk-linux-x64-musl/package.json').version
274
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
373
276
  }
374
- return binding;
277
+ return binding
375
278
  } catch (e) {
376
- loadErrors.push(e);
279
+ loadErrors.push(e)
377
280
  }
378
281
  } else {
379
282
  try {
380
- return require("./recording.linux-x64-gnu.node");
283
+ return require('./recording.linux-x64-gnu.node')
381
284
  } catch (e) {
382
- loadErrors.push(e);
285
+ loadErrors.push(e)
383
286
  }
384
287
  try {
385
- const binding = require("@recappi/sdk-linux-x64-gnu");
386
- const bindingPackageVersion =
387
- require("@recappi/sdk-linux-x64-gnu/package.json").version;
388
- if (
389
- bindingPackageVersion !== "1.0.0" &&
390
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
391
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
392
- ) {
393
- throw new Error(
394
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
395
- );
288
+ const binding = require('@recappi/sdk-linux-x64-gnu')
289
+ const bindingPackageVersion = require('@recappi/sdk-linux-x64-gnu/package.json').version
290
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
396
292
  }
397
- return binding;
293
+ return binding
398
294
  } catch (e) {
399
- loadErrors.push(e);
295
+ loadErrors.push(e)
400
296
  }
401
297
  }
402
- } else if (process.arch === "arm64") {
298
+ } else if (process.arch === 'arm64') {
403
299
  if (isMusl()) {
404
300
  try {
405
- return require("./recording.linux-arm64-musl.node");
301
+ return require('./recording.linux-arm64-musl.node')
406
302
  } catch (e) {
407
- loadErrors.push(e);
303
+ loadErrors.push(e)
408
304
  }
409
305
  try {
410
- const binding = require("@recappi/sdk-linux-arm64-musl");
411
- const bindingPackageVersion =
412
- require("@recappi/sdk-linux-arm64-musl/package.json").version;
413
- if (
414
- bindingPackageVersion !== "1.0.0" &&
415
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
416
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
417
- ) {
418
- throw new Error(
419
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
420
- );
306
+ const binding = require('@recappi/sdk-linux-arm64-musl')
307
+ const bindingPackageVersion = require('@recappi/sdk-linux-arm64-musl/package.json').version
308
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
421
310
  }
422
- return binding;
311
+ return binding
423
312
  } catch (e) {
424
- loadErrors.push(e);
313
+ loadErrors.push(e)
425
314
  }
426
315
  } else {
427
316
  try {
428
- return require("./recording.linux-arm64-gnu.node");
317
+ return require('./recording.linux-arm64-gnu.node')
429
318
  } catch (e) {
430
- loadErrors.push(e);
319
+ loadErrors.push(e)
431
320
  }
432
321
  try {
433
- const binding = require("@recappi/sdk-linux-arm64-gnu");
434
- const bindingPackageVersion =
435
- require("@recappi/sdk-linux-arm64-gnu/package.json").version;
436
- if (
437
- bindingPackageVersion !== "1.0.0" &&
438
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
439
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
440
- ) {
441
- throw new Error(
442
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
443
- );
322
+ const binding = require('@recappi/sdk-linux-arm64-gnu')
323
+ const bindingPackageVersion = require('@recappi/sdk-linux-arm64-gnu/package.json').version
324
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
444
326
  }
445
- return binding;
327
+ return binding
446
328
  } catch (e) {
447
- loadErrors.push(e);
329
+ loadErrors.push(e)
448
330
  }
449
331
  }
450
- } else if (process.arch === "arm") {
332
+ } else if (process.arch === 'arm') {
451
333
  if (isMusl()) {
452
334
  try {
453
- return require("./recording.linux-arm-musleabihf.node");
335
+ return require('./recording.linux-arm-musleabihf.node')
454
336
  } catch (e) {
455
- loadErrors.push(e);
337
+ loadErrors.push(e)
456
338
  }
457
339
  try {
458
- const binding = require("@recappi/sdk-linux-arm-musleabihf");
459
- const bindingPackageVersion =
460
- require("@recappi/sdk-linux-arm-musleabihf/package.json").version;
461
- if (
462
- bindingPackageVersion !== "1.0.0" &&
463
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
464
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
465
- ) {
466
- throw new Error(
467
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
468
- );
340
+ const binding = require('@recappi/sdk-linux-arm-musleabihf')
341
+ const bindingPackageVersion = require('@recappi/sdk-linux-arm-musleabihf/package.json').version
342
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
469
344
  }
470
- return binding;
345
+ return binding
471
346
  } catch (e) {
472
- loadErrors.push(e);
347
+ loadErrors.push(e)
473
348
  }
474
349
  } else {
475
350
  try {
476
- return require("./recording.linux-arm-gnueabihf.node");
351
+ return require('./recording.linux-arm-gnueabihf.node')
477
352
  } catch (e) {
478
- loadErrors.push(e);
353
+ loadErrors.push(e)
479
354
  }
480
355
  try {
481
- const binding = require("@recappi/sdk-linux-arm-gnueabihf");
482
- const bindingPackageVersion =
483
- require("@recappi/sdk-linux-arm-gnueabihf/package.json").version;
484
- if (
485
- bindingPackageVersion !== "1.0.0" &&
486
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
487
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
488
- ) {
489
- throw new Error(
490
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
491
- );
356
+ const binding = require('@recappi/sdk-linux-arm-gnueabihf')
357
+ const bindingPackageVersion = require('@recappi/sdk-linux-arm-gnueabihf/package.json').version
358
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
492
360
  }
493
- return binding;
361
+ return binding
494
362
  } catch (e) {
495
- loadErrors.push(e);
363
+ loadErrors.push(e)
496
364
  }
497
365
  }
498
- } else if (process.arch === "loong64") {
366
+ } else if (process.arch === 'loong64') {
499
367
  if (isMusl()) {
500
368
  try {
501
- return require("./recording.linux-loong64-musl.node");
369
+ return require('./recording.linux-loong64-musl.node')
502
370
  } catch (e) {
503
- loadErrors.push(e);
371
+ loadErrors.push(e)
504
372
  }
505
373
  try {
506
- const binding = require("@recappi/sdk-linux-loong64-musl");
507
- const bindingPackageVersion =
508
- require("@recappi/sdk-linux-loong64-musl/package.json").version;
509
- if (
510
- bindingPackageVersion !== "1.0.0" &&
511
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
512
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
513
- ) {
514
- throw new Error(
515
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
516
- );
374
+ const binding = require('@recappi/sdk-linux-loong64-musl')
375
+ const bindingPackageVersion = require('@recappi/sdk-linux-loong64-musl/package.json').version
376
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
517
378
  }
518
- return binding;
379
+ return binding
519
380
  } catch (e) {
520
- loadErrors.push(e);
381
+ loadErrors.push(e)
521
382
  }
522
383
  } else {
523
384
  try {
524
- return require("./recording.linux-loong64-gnu.node");
385
+ return require('./recording.linux-loong64-gnu.node')
525
386
  } catch (e) {
526
- loadErrors.push(e);
387
+ loadErrors.push(e)
527
388
  }
528
389
  try {
529
- const binding = require("@recappi/sdk-linux-loong64-gnu");
530
- const bindingPackageVersion =
531
- require("@recappi/sdk-linux-loong64-gnu/package.json").version;
532
- if (
533
- bindingPackageVersion !== "1.0.0" &&
534
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
535
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
536
- ) {
537
- throw new Error(
538
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
539
- );
390
+ const binding = require('@recappi/sdk-linux-loong64-gnu')
391
+ const bindingPackageVersion = require('@recappi/sdk-linux-loong64-gnu/package.json').version
392
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
540
394
  }
541
- return binding;
395
+ return binding
542
396
  } catch (e) {
543
- loadErrors.push(e);
397
+ loadErrors.push(e)
544
398
  }
545
399
  }
546
- } else if (process.arch === "riscv64") {
400
+ } else if (process.arch === 'riscv64') {
547
401
  if (isMusl()) {
548
402
  try {
549
- return require("./recording.linux-riscv64-musl.node");
403
+ return require('./recording.linux-riscv64-musl.node')
550
404
  } catch (e) {
551
- loadErrors.push(e);
405
+ loadErrors.push(e)
552
406
  }
553
407
  try {
554
- const binding = require("@recappi/sdk-linux-riscv64-musl");
555
- const bindingPackageVersion =
556
- require("@recappi/sdk-linux-riscv64-musl/package.json").version;
557
- if (
558
- bindingPackageVersion !== "1.0.0" &&
559
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
560
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
561
- ) {
562
- throw new Error(
563
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
564
- );
408
+ const binding = require('@recappi/sdk-linux-riscv64-musl')
409
+ const bindingPackageVersion = require('@recappi/sdk-linux-riscv64-musl/package.json').version
410
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
565
412
  }
566
- return binding;
413
+ return binding
567
414
  } catch (e) {
568
- loadErrors.push(e);
415
+ loadErrors.push(e)
569
416
  }
570
417
  } else {
571
418
  try {
572
- return require("./recording.linux-riscv64-gnu.node");
419
+ return require('./recording.linux-riscv64-gnu.node')
573
420
  } catch (e) {
574
- loadErrors.push(e);
421
+ loadErrors.push(e)
575
422
  }
576
423
  try {
577
- const binding = require("@recappi/sdk-linux-riscv64-gnu");
578
- const bindingPackageVersion =
579
- require("@recappi/sdk-linux-riscv64-gnu/package.json").version;
580
- if (
581
- bindingPackageVersion !== "1.0.0" &&
582
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
583
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
584
- ) {
585
- throw new Error(
586
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
587
- );
424
+ const binding = require('@recappi/sdk-linux-riscv64-gnu')
425
+ const bindingPackageVersion = require('@recappi/sdk-linux-riscv64-gnu/package.json').version
426
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
588
428
  }
589
- return binding;
429
+ return binding
590
430
  } catch (e) {
591
- loadErrors.push(e);
431
+ loadErrors.push(e)
592
432
  }
593
433
  }
594
- } else if (process.arch === "ppc64") {
434
+ } else if (process.arch === 'ppc64') {
595
435
  try {
596
- return require("./recording.linux-ppc64-gnu.node");
436
+ return require('./recording.linux-ppc64-gnu.node')
597
437
  } catch (e) {
598
- loadErrors.push(e);
438
+ loadErrors.push(e)
599
439
  }
600
440
  try {
601
- const binding = require("@recappi/sdk-linux-ppc64-gnu");
602
- const bindingPackageVersion =
603
- require("@recappi/sdk-linux-ppc64-gnu/package.json").version;
604
- if (
605
- bindingPackageVersion !== "1.0.0" &&
606
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
607
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
608
- ) {
609
- throw new Error(
610
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
611
- );
612
- }
613
- return binding;
441
+ const binding = require('@recappi/sdk-linux-ppc64-gnu')
442
+ const bindingPackageVersion = require('@recappi/sdk-linux-ppc64-gnu/package.json').version
443
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
+ }
446
+ return binding
614
447
  } catch (e) {
615
- loadErrors.push(e);
448
+ loadErrors.push(e)
616
449
  }
617
- } else if (process.arch === "s390x") {
450
+ } else if (process.arch === 's390x') {
618
451
  try {
619
- return require("./recording.linux-s390x-gnu.node");
452
+ return require('./recording.linux-s390x-gnu.node')
620
453
  } catch (e) {
621
- loadErrors.push(e);
454
+ loadErrors.push(e)
622
455
  }
623
456
  try {
624
- const binding = require("@recappi/sdk-linux-s390x-gnu");
625
- const bindingPackageVersion =
626
- require("@recappi/sdk-linux-s390x-gnu/package.json").version;
627
- if (
628
- bindingPackageVersion !== "1.0.0" &&
629
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
630
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
631
- ) {
632
- throw new Error(
633
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
634
- );
635
- }
636
- return binding;
457
+ const binding = require('@recappi/sdk-linux-s390x-gnu')
458
+ const bindingPackageVersion = require('@recappi/sdk-linux-s390x-gnu/package.json').version
459
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
+ }
462
+ return binding
637
463
  } catch (e) {
638
- loadErrors.push(e);
464
+ loadErrors.push(e)
639
465
  }
640
466
  } else {
641
- loadErrors.push(
642
- new Error(`Unsupported architecture on Linux: ${process.arch}`),
643
- );
467
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
644
468
  }
645
- } else if (process.platform === "openharmony") {
646
- if (process.arch === "arm64") {
469
+ } else if (process.platform === 'openharmony') {
470
+ if (process.arch === 'arm64') {
647
471
  try {
648
- return require("./recording.openharmony-arm64.node");
472
+ return require('./recording.openharmony-arm64.node')
649
473
  } catch (e) {
650
- loadErrors.push(e);
474
+ loadErrors.push(e)
651
475
  }
652
476
  try {
653
- const binding = require("@recappi/sdk-openharmony-arm64");
654
- const bindingPackageVersion =
655
- require("@recappi/sdk-openharmony-arm64/package.json").version;
656
- if (
657
- bindingPackageVersion !== "1.0.0" &&
658
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
659
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
660
- ) {
661
- throw new Error(
662
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
663
- );
664
- }
665
- return binding;
477
+ const binding = require('@recappi/sdk-openharmony-arm64')
478
+ const bindingPackageVersion = require('@recappi/sdk-openharmony-arm64/package.json').version
479
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
+ }
482
+ return binding
666
483
  } catch (e) {
667
- loadErrors.push(e);
484
+ loadErrors.push(e)
668
485
  }
669
- } else if (process.arch === "x64") {
486
+ } else if (process.arch === 'x64') {
670
487
  try {
671
- return require("./recording.openharmony-x64.node");
488
+ return require('./recording.openharmony-x64.node')
672
489
  } catch (e) {
673
- loadErrors.push(e);
490
+ loadErrors.push(e)
674
491
  }
675
492
  try {
676
- const binding = require("@recappi/sdk-openharmony-x64");
677
- const bindingPackageVersion =
678
- require("@recappi/sdk-openharmony-x64/package.json").version;
679
- if (
680
- bindingPackageVersion !== "1.0.0" &&
681
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
682
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
683
- ) {
684
- throw new Error(
685
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
686
- );
687
- }
688
- return binding;
493
+ const binding = require('@recappi/sdk-openharmony-x64')
494
+ const bindingPackageVersion = require('@recappi/sdk-openharmony-x64/package.json').version
495
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
+ }
498
+ return binding
689
499
  } catch (e) {
690
- loadErrors.push(e);
500
+ loadErrors.push(e)
691
501
  }
692
- } else if (process.arch === "arm") {
502
+ } else if (process.arch === 'arm') {
693
503
  try {
694
- return require("./recording.openharmony-arm.node");
504
+ return require('./recording.openharmony-arm.node')
695
505
  } catch (e) {
696
- loadErrors.push(e);
506
+ loadErrors.push(e)
697
507
  }
698
508
  try {
699
- const binding = require("@recappi/sdk-openharmony-arm");
700
- const bindingPackageVersion =
701
- require("@recappi/sdk-openharmony-arm/package.json").version;
702
- if (
703
- bindingPackageVersion !== "1.0.0" &&
704
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
705
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
706
- ) {
707
- throw new Error(
708
- `Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
709
- );
710
- }
711
- return binding;
509
+ const binding = require('@recappi/sdk-openharmony-arm')
510
+ const bindingPackageVersion = require('@recappi/sdk-openharmony-arm/package.json').version
511
+ if (bindingPackageVersion !== '1.1.0' && 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 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
+ }
514
+ return binding
712
515
  } catch (e) {
713
- loadErrors.push(e);
516
+ loadErrors.push(e)
714
517
  }
715
518
  } else {
716
- loadErrors.push(
717
- new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`),
718
- );
519
+ loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
719
520
  }
720
521
  } else {
721
- loadErrors.push(
722
- new Error(
723
- `Unsupported OS: ${process.platform}, architecture: ${process.arch}`,
724
- ),
725
- );
522
+ loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
726
523
  }
727
524
  }
728
525
 
729
- nativeBinding = requireNative();
526
+ nativeBinding = requireNative()
730
527
 
731
528
  if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
732
- let wasiBinding = null;
733
- let wasiBindingError = null;
529
+ let wasiBinding = null
530
+ let wasiBindingError = null
734
531
  try {
735
- wasiBinding = require("./recording.wasi.cjs");
736
- nativeBinding = wasiBinding;
532
+ wasiBinding = require('./recording.wasi.cjs')
533
+ nativeBinding = wasiBinding
737
534
  } catch (err) {
738
535
  if (process.env.NAPI_RS_FORCE_WASI) {
739
- wasiBindingError = err;
536
+ wasiBindingError = err
740
537
  }
741
538
  }
742
- if (!nativeBinding) {
539
+ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
743
540
  try {
744
- wasiBinding = require("@recappi/sdk-wasm32-wasi");
745
- nativeBinding = wasiBinding;
541
+ wasiBinding = require('@recappi/sdk-wasm32-wasi')
542
+ nativeBinding = wasiBinding
746
543
  } catch (err) {
747
544
  if (process.env.NAPI_RS_FORCE_WASI) {
748
- wasiBindingError.cause = err;
749
- loadErrors.push(err);
545
+ if (!wasiBindingError) {
546
+ wasiBindingError = err
547
+ } else {
548
+ wasiBindingError.cause = err
549
+ }
550
+ loadErrors.push(err)
750
551
  }
751
552
  }
752
553
  }
753
- if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
754
- const error = new Error(
755
- "WASI binding not found and NAPI_RS_FORCE_WASI is set to error",
756
- );
757
- error.cause = wasiBindingError;
758
- throw error;
554
+ if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
555
+ const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
556
+ error.cause = wasiBindingError
557
+ throw error
759
558
  }
760
559
  }
761
560
 
@@ -764,25 +563,23 @@ if (!nativeBinding) {
764
563
  throw new Error(
765
564
  `Cannot find native binding. ` +
766
565
  `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
767
- "Please try `npm i` again after removing both package-lock.json and node_modules directory.",
566
+ 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
768
567
  {
769
568
  cause: loadErrors.reduce((err, cur) => {
770
- cur.cause = err;
771
- return cur;
569
+ cur.cause = err
570
+ return cur
772
571
  }),
773
572
  },
774
- );
573
+ )
775
574
  }
776
- throw new Error(`Failed to load native binding`);
575
+ throw new Error(`Failed to load native binding`)
777
576
  }
778
577
 
779
- module.exports = nativeBinding;
780
- module.exports.ApplicationInfo = nativeBinding.ApplicationInfo;
781
- module.exports.ApplicationListChangedSubscriber =
782
- nativeBinding.ApplicationListChangedSubscriber;
783
- module.exports.ApplicationStateChangedSubscriber =
784
- nativeBinding.ApplicationStateChangedSubscriber;
785
- module.exports.AudioCaptureSession = nativeBinding.AudioCaptureSession;
786
- module.exports.ShareableContent = nativeBinding.ShareableContent;
787
- module.exports.decodeAudio = nativeBinding.decodeAudio;
788
- module.exports.decodeAudioSync = nativeBinding.decodeAudioSync;
578
+ module.exports = nativeBinding
579
+ module.exports.ApplicationInfo = nativeBinding.ApplicationInfo
580
+ module.exports.ApplicationListChangedSubscriber = nativeBinding.ApplicationListChangedSubscriber
581
+ module.exports.ApplicationStateChangedSubscriber = nativeBinding.ApplicationStateChangedSubscriber
582
+ module.exports.AudioCaptureSession = nativeBinding.AudioCaptureSession
583
+ module.exports.ShareableContent = nativeBinding.ShareableContent
584
+ module.exports.decodeAudio = nativeBinding.decodeAudio
585
+ module.exports.decodeAudioSync = nativeBinding.decodeAudioSync