@corsa-bind/napi 0.16.0 → 0.18.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.
- package/dist/index.d.mts +105 -12
- package/dist/index.mjs +39 -8
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +8 -1
- package/index.d.ts +54 -48
- package/index.js +55 -53
- package/package.json +9 -9
- package/dist/api_client.d.mts +0 -43
- package/dist/api_client.mjs +0 -78
- package/dist/api_client.mjs.map +0 -1
- package/dist/api_client_base.d.mts +0 -45
- package/dist/api_client_base.mjs +0 -78
- package/dist/api_client_base.mjs.map +0 -1
- package/dist/binding.d.mts +0 -16
- package/dist/binding.mjs +0 -14
- package/dist/binding.mjs.map +0 -1
- package/dist/distributed_orchestrator.d.mts +0 -29
- package/dist/distributed_orchestrator.mjs +0 -55
- package/dist/distributed_orchestrator.mjs.map +0 -1
- package/dist/index2.d.mts +0 -14
- package/dist/json.mjs +0 -18
- package/dist/json.mjs.map +0 -1
- package/dist/native_utils.d.mts +0 -53
- package/dist/native_utils.mjs +0 -86
- package/dist/native_utils.mjs.map +0 -1
- package/dist/virtual_document.d.mts +0 -29
- package/dist/virtual_document.mjs +0 -50
- package/dist/virtual_document.mjs.map +0 -1
package/index.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@corsa-bind/napi-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@corsa-bind/napi-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '0.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
80
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@corsa-bind/napi-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@corsa-bind/napi-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '0.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
96
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@corsa-bind/napi-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@corsa-bind/napi-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '0.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
117
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@corsa-bind/napi-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@corsa-bind/napi-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '0.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
133
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@corsa-bind/napi-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@corsa-bind/napi-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
150
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@corsa-bind/napi-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@corsa-bind/napi-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '0.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
166
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@corsa-bind/napi-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@corsa-bind/napi-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '0.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
185
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@corsa-bind/napi-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@corsa-bind/napi-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '0.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
201
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@corsa-bind/napi-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@corsa-bind/napi-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '0.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
217
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@corsa-bind/napi-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@corsa-bind/napi-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '0.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
237
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@corsa-bind/napi-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@corsa-bind/napi-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '0.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
253
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@corsa-bind/napi-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '0.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
274
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@corsa-bind/napi-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '0.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
290
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@corsa-bind/napi-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '0.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
308
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@corsa-bind/napi-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '0.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
324
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@corsa-bind/napi-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '0.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
342
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@corsa-bind/napi-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '0.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
358
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@corsa-bind/napi-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '0.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
376
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@corsa-bind/napi-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '0.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
392
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@corsa-bind/napi-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '0.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
410
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@corsa-bind/napi-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '0.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
426
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@corsa-bind/napi-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
443
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@corsa-bind/napi-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
459
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@corsa-bind/napi-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@corsa-bind/napi-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '0.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
479
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@corsa-bind/napi-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@corsa-bind/napi-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '0.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
495
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@corsa-bind/napi-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@corsa-bind/napi-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '0.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
511
|
+
if (bindingPackageVersion !== '0.18.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 0.18.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -591,8 +591,10 @@ module.exports.isStringLikeTypeTexts = nativeBinding.isStringLikeTypeTexts
|
|
|
591
591
|
module.exports.isUnknownLikeTypeTexts = nativeBinding.isUnknownLikeTypeTexts
|
|
592
592
|
module.exports.isUnsafeAssignment = nativeBinding.isUnsafeAssignment
|
|
593
593
|
module.exports.isUnsafeReturn = nativeBinding.isUnsafeReturn
|
|
594
|
-
module.exports.
|
|
594
|
+
module.exports.nativeLintRuleMetas = nativeBinding.nativeLintRuleMetas
|
|
595
|
+
module.exports.nativeStylisticRuleMetas = nativeBinding.nativeStylisticRuleMetas
|
|
595
596
|
module.exports.runNativeLintRule = nativeBinding.runNativeLintRule
|
|
597
|
+
module.exports.runNativeStylisticLint = nativeBinding.runNativeStylisticLint
|
|
596
598
|
module.exports.spawnCorsaApiClientAsync = nativeBinding.spawnCorsaApiClientAsync
|
|
597
599
|
module.exports.splitTopLevelTypeText = nativeBinding.splitTopLevelTypeText
|
|
598
600
|
module.exports.splitTypeText = nativeBinding.splitTypeText
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corsa-bind/napi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Native JS runtime bindings for Corsa stdio workflows",
|
|
5
5
|
"homepage": "https://github.com/ubugeeei/corsa-bind/tree/main/src/bindings/nodejs/corsa_node",
|
|
6
6
|
"bugs": {
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"node": ">=22"
|
|
52
52
|
},
|
|
53
53
|
"optionalDependencies": {
|
|
54
|
-
"@corsa-bind/napi-win32-x64-msvc": "0.
|
|
55
|
-
"@corsa-bind/napi-darwin-x64": "0.
|
|
56
|
-
"@corsa-bind/napi-linux-x64-gnu": "0.
|
|
57
|
-
"@corsa-bind/napi-darwin-arm64": "0.
|
|
58
|
-
"@corsa-bind/napi-win32-arm64-msvc": "0.
|
|
59
|
-
"@corsa-bind/napi-linux-x64-musl": "0.
|
|
60
|
-
"@corsa-bind/napi-linux-arm64-gnu": "0.
|
|
61
|
-
"@corsa-bind/napi-linux-arm64-musl": "0.
|
|
54
|
+
"@corsa-bind/napi-win32-x64-msvc": "0.18.0",
|
|
55
|
+
"@corsa-bind/napi-darwin-x64": "0.18.0",
|
|
56
|
+
"@corsa-bind/napi-linux-x64-gnu": "0.18.0",
|
|
57
|
+
"@corsa-bind/napi-darwin-arm64": "0.18.0",
|
|
58
|
+
"@corsa-bind/napi-win32-arm64-msvc": "0.18.0",
|
|
59
|
+
"@corsa-bind/napi-linux-x64-musl": "0.18.0",
|
|
60
|
+
"@corsa-bind/napi-linux-arm64-gnu": "0.18.0",
|
|
61
|
+
"@corsa-bind/napi-linux-arm64-musl": "0.18.0"
|
|
62
62
|
}
|
|
63
63
|
}
|
package/dist/api_client.d.mts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ApiClientOptions, SymbolResponse, TypeResponse } from "./types.mjs";
|
|
2
|
-
import { CorsaApiClientBase } from "./api_client_base.mjs";
|
|
3
|
-
|
|
4
|
-
//#region api_client.d.ts
|
|
5
|
-
/** High-level JavaScript wrapper over the native Corsa stdio API client. */
|
|
6
|
-
declare class CorsaApiClient extends CorsaApiClientBase {
|
|
7
|
-
private constructor();
|
|
8
|
-
/** Spawns a Corsa API process and returns a synchronous wrapper. */
|
|
9
|
-
static spawn(options: ApiClientOptions): CorsaApiClient;
|
|
10
|
-
/** Spawns a Corsa API process without blocking the JavaScript thread. */
|
|
11
|
-
static spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient>;
|
|
12
|
-
/** Returns the built-in string type for a project snapshot. */
|
|
13
|
-
getStringType(snapshot: string, project: string): TypeResponse;
|
|
14
|
-
/** Returns the built-in string type asynchronously. */
|
|
15
|
-
getStringTypeAsync(snapshot: string, project: string): Promise<TypeResponse>;
|
|
16
|
-
/** Returns type information for the source position, if Corsa can resolve it. */
|
|
17
|
-
getTypeAtPosition(snapshot: string, project: string, file: string, position: number): TypeResponse | undefined;
|
|
18
|
-
/** Returns type information for the source position asynchronously. */
|
|
19
|
-
getTypeAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<TypeResponse | undefined>;
|
|
20
|
-
/** Returns symbol information for the source position, if one exists. */
|
|
21
|
-
getSymbolAtPosition(snapshot: string, project: string, file: string, position: number): SymbolResponse | undefined;
|
|
22
|
-
/** Returns symbol information for the source position asynchronously. */
|
|
23
|
-
getSymbolAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<SymbolResponse | undefined>;
|
|
24
|
-
/** Returns type arguments for a generic object or alias type handle. */
|
|
25
|
-
getTypeArguments(snapshot: string, project: string, typeHandle: string, objectFlags?: number): TypeResponse[];
|
|
26
|
-
/** Returns type arguments asynchronously. */
|
|
27
|
-
getTypeArgumentsAsync(snapshot: string, project: string, typeHandle: string, objectFlags?: number): Promise<TypeResponse[]>;
|
|
28
|
-
/** Returns the apparent type of a symbol handle, if Corsa can resolve it. */
|
|
29
|
-
getTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | undefined;
|
|
30
|
-
/** Returns the apparent type of a symbol handle asynchronously. */
|
|
31
|
-
getTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): Promise<TypeResponse | undefined>;
|
|
32
|
-
/** Returns the declared type of a symbol handle, if Corsa can resolve it. */
|
|
33
|
-
getDeclaredTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | undefined;
|
|
34
|
-
/** Returns the declared type of a symbol handle asynchronously. */
|
|
35
|
-
getDeclaredTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): Promise<TypeResponse | undefined>;
|
|
36
|
-
/** Formats a native type handle as TypeScript source text. */
|
|
37
|
-
typeToString(snapshot: string, project: string, typeHandle: string, location?: string, flags?: number): string;
|
|
38
|
-
/** Formats a native type handle as TypeScript source text asynchronously. */
|
|
39
|
-
typeToStringAsync(snapshot: string, project: string, typeHandle: string, location?: string, flags?: number): Promise<string>;
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { CorsaApiClient };
|
|
43
|
-
//# sourceMappingURL=api_client.d.mts.map
|
package/dist/api_client.mjs
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { binding } from "./binding.mjs";
|
|
2
|
-
import { fromJson, toJson } from "./json.mjs";
|
|
3
|
-
import { CorsaApiClientBase } from "./api_client_base.mjs";
|
|
4
|
-
//#region api_client.ts
|
|
5
|
-
/** High-level JavaScript wrapper over the native Corsa stdio API client. */
|
|
6
|
-
var CorsaApiClient = class CorsaApiClient extends CorsaApiClientBase {
|
|
7
|
-
constructor(inner) {
|
|
8
|
-
super(inner);
|
|
9
|
-
}
|
|
10
|
-
/** Spawns a Corsa API process and returns a synchronous wrapper. */
|
|
11
|
-
static spawn(options) {
|
|
12
|
-
return new CorsaApiClient(binding.CorsaApiClient.spawn(toJson(options)));
|
|
13
|
-
}
|
|
14
|
-
/** Spawns a Corsa API process without blocking the JavaScript thread. */
|
|
15
|
-
static async spawnAsync(options) {
|
|
16
|
-
return new CorsaApiClient(await binding.spawnCorsaApiClientAsync(toJson(options)));
|
|
17
|
-
}
|
|
18
|
-
/** Returns the built-in string type for a project snapshot. */
|
|
19
|
-
getStringType(snapshot, project) {
|
|
20
|
-
return fromJson(this.inner.getStringTypeJson(snapshot, project));
|
|
21
|
-
}
|
|
22
|
-
/** Returns the built-in string type asynchronously. */
|
|
23
|
-
async getStringTypeAsync(snapshot, project) {
|
|
24
|
-
return fromJson(await this.inner.getStringTypeJsonAsync(snapshot, project));
|
|
25
|
-
}
|
|
26
|
-
/** Returns type information for the source position, if Corsa can resolve it. */
|
|
27
|
-
getTypeAtPosition(snapshot, project, file, position) {
|
|
28
|
-
return fromJson(this.inner.getTypeAtPositionJson(snapshot, project, file, position)) ?? void 0;
|
|
29
|
-
}
|
|
30
|
-
/** Returns type information for the source position asynchronously. */
|
|
31
|
-
async getTypeAtPositionAsync(snapshot, project, file, position) {
|
|
32
|
-
return fromJson(await this.inner.getTypeAtPositionJsonAsync(snapshot, project, file, position)) ?? void 0;
|
|
33
|
-
}
|
|
34
|
-
/** Returns symbol information for the source position, if one exists. */
|
|
35
|
-
getSymbolAtPosition(snapshot, project, file, position) {
|
|
36
|
-
return fromJson(this.inner.getSymbolAtPositionJson(snapshot, project, file, position)) ?? void 0;
|
|
37
|
-
}
|
|
38
|
-
/** Returns symbol information for the source position asynchronously. */
|
|
39
|
-
async getSymbolAtPositionAsync(snapshot, project, file, position) {
|
|
40
|
-
return fromJson(await this.inner.getSymbolAtPositionJsonAsync(snapshot, project, file, position)) ?? void 0;
|
|
41
|
-
}
|
|
42
|
-
/** Returns type arguments for a generic object or alias type handle. */
|
|
43
|
-
getTypeArguments(snapshot, project, typeHandle, objectFlags) {
|
|
44
|
-
return fromJson(this.inner.getTypeArgumentsJson(snapshot, project, typeHandle, objectFlags));
|
|
45
|
-
}
|
|
46
|
-
/** Returns type arguments asynchronously. */
|
|
47
|
-
async getTypeArgumentsAsync(snapshot, project, typeHandle, objectFlags) {
|
|
48
|
-
return fromJson(await this.inner.getTypeArgumentsJsonAsync(snapshot, project, typeHandle, objectFlags));
|
|
49
|
-
}
|
|
50
|
-
/** Returns the apparent type of a symbol handle, if Corsa can resolve it. */
|
|
51
|
-
getTypeOfSymbol(snapshot, project, symbol) {
|
|
52
|
-
return fromJson(this.inner.getTypeOfSymbolJson(snapshot, project, symbol)) ?? void 0;
|
|
53
|
-
}
|
|
54
|
-
/** Returns the apparent type of a symbol handle asynchronously. */
|
|
55
|
-
async getTypeOfSymbolAsync(snapshot, project, symbol) {
|
|
56
|
-
return fromJson(await this.inner.getTypeOfSymbolJsonAsync(snapshot, project, symbol)) ?? void 0;
|
|
57
|
-
}
|
|
58
|
-
/** Returns the declared type of a symbol handle, if Corsa can resolve it. */
|
|
59
|
-
getDeclaredTypeOfSymbol(snapshot, project, symbol) {
|
|
60
|
-
return fromJson(this.inner.getDeclaredTypeOfSymbolJson(snapshot, project, symbol)) ?? void 0;
|
|
61
|
-
}
|
|
62
|
-
/** Returns the declared type of a symbol handle asynchronously. */
|
|
63
|
-
async getDeclaredTypeOfSymbolAsync(snapshot, project, symbol) {
|
|
64
|
-
return fromJson(await this.inner.getDeclaredTypeOfSymbolJsonAsync(snapshot, project, symbol)) ?? void 0;
|
|
65
|
-
}
|
|
66
|
-
/** Formats a native type handle as TypeScript source text. */
|
|
67
|
-
typeToString(snapshot, project, typeHandle, location, flags) {
|
|
68
|
-
return this.inner.typeToString(snapshot, project, typeHandle, location, flags);
|
|
69
|
-
}
|
|
70
|
-
/** Formats a native type handle as TypeScript source text asynchronously. */
|
|
71
|
-
async typeToStringAsync(snapshot, project, typeHandle, location, flags) {
|
|
72
|
-
return this.inner.typeToStringAsync(snapshot, project, typeHandle, location, flags);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
//#endregion
|
|
76
|
-
export { CorsaApiClient };
|
|
77
|
-
|
|
78
|
-
//# sourceMappingURL=api_client.mjs.map
|
package/dist/api_client.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api_client.mjs","names":[],"sources":["../ts/api_client.ts"],"sourcesContent":["import { CorsaApiClientBase } from \"./api_client_base\";\nimport { binding } from \"./binding\";\nimport { fromJson, toJson } from \"./json\";\n\nimport type { NativeApiClient } from \"./binding\";\nimport type { ApiClientOptions, SymbolResponse, TypeResponse } from \"./types\";\n\n/** High-level JavaScript wrapper over the native Corsa stdio API client. */\nexport class CorsaApiClient extends CorsaApiClientBase {\n private constructor(inner: NativeApiClient) {\n super(inner);\n }\n\n /** Spawns a Corsa API process and returns a synchronous wrapper. */\n static spawn(options: ApiClientOptions): CorsaApiClient {\n return new CorsaApiClient(binding.CorsaApiClient.spawn(toJson(options)));\n }\n\n /** Spawns a Corsa API process without blocking the JavaScript thread. */\n static async spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient> {\n return new CorsaApiClient(await binding.spawnCorsaApiClientAsync(toJson(options)));\n }\n\n /** Returns the built-in string type for a project snapshot. */\n getStringType(snapshot: string, project: string): TypeResponse {\n return fromJson(this.inner.getStringTypeJson(snapshot, project));\n }\n\n /** Returns the built-in string type asynchronously. */\n async getStringTypeAsync(snapshot: string, project: string): Promise<TypeResponse> {\n return fromJson(await this.inner.getStringTypeJsonAsync(snapshot, project));\n }\n\n /** Returns type information for the source position, if Corsa can resolve it. */\n getTypeAtPosition(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): TypeResponse | undefined {\n return (\n fromJson<TypeResponse | null>(\n this.inner.getTypeAtPositionJson(snapshot, project, file, position),\n ) ?? undefined\n );\n }\n\n /** Returns type information for the source position asynchronously. */\n async getTypeAtPositionAsync(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): Promise<TypeResponse | undefined> {\n return (\n fromJson<TypeResponse | null>(\n await this.inner.getTypeAtPositionJsonAsync(snapshot, project, file, position),\n ) ?? undefined\n );\n }\n\n /** Returns symbol information for the source position, if one exists. */\n getSymbolAtPosition(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): SymbolResponse | undefined {\n return (\n fromJson<SymbolResponse | null>(\n this.inner.getSymbolAtPositionJson(snapshot, project, file, position),\n ) ?? undefined\n );\n }\n\n /** Returns symbol information for the source position asynchronously. */\n async getSymbolAtPositionAsync(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): Promise<SymbolResponse | undefined> {\n return (\n fromJson<SymbolResponse | null>(\n await this.inner.getSymbolAtPositionJsonAsync(snapshot, project, file, position),\n ) ?? undefined\n );\n }\n\n /** Returns type arguments for a generic object or alias type handle. */\n getTypeArguments(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags?: number,\n ): TypeResponse[] {\n return fromJson(this.inner.getTypeArgumentsJson(snapshot, project, typeHandle, objectFlags));\n }\n\n /** Returns type arguments asynchronously. */\n async getTypeArgumentsAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags?: number,\n ): Promise<TypeResponse[]> {\n return fromJson(\n await this.inner.getTypeArgumentsJsonAsync(snapshot, project, typeHandle, objectFlags),\n );\n }\n\n /** Returns the apparent type of a symbol handle, if Corsa can resolve it. */\n getTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | undefined {\n return (\n fromJson<TypeResponse | null>(this.inner.getTypeOfSymbolJson(snapshot, project, symbol)) ??\n undefined\n );\n }\n\n /** Returns the apparent type of a symbol handle asynchronously. */\n async getTypeOfSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<TypeResponse | undefined> {\n return (\n fromJson<TypeResponse | null>(\n await this.inner.getTypeOfSymbolJsonAsync(snapshot, project, symbol),\n ) ?? undefined\n );\n }\n\n /** Returns the declared type of a symbol handle, if Corsa can resolve it. */\n getDeclaredTypeOfSymbol(\n snapshot: string,\n project: string,\n symbol: string,\n ): TypeResponse | undefined {\n return (\n fromJson<TypeResponse | null>(\n this.inner.getDeclaredTypeOfSymbolJson(snapshot, project, symbol),\n ) ?? undefined\n );\n }\n\n /** Returns the declared type of a symbol handle asynchronously. */\n async getDeclaredTypeOfSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<TypeResponse | undefined> {\n return (\n fromJson<TypeResponse | null>(\n await this.inner.getDeclaredTypeOfSymbolJsonAsync(snapshot, project, symbol),\n ) ?? undefined\n );\n }\n\n /** Formats a native type handle as TypeScript source text. */\n typeToString(\n snapshot: string,\n project: string,\n typeHandle: string,\n location?: string,\n flags?: number,\n ): string {\n return this.inner.typeToString(snapshot, project, typeHandle, location, flags);\n }\n\n /** Formats a native type handle as TypeScript source text asynchronously. */\n async typeToStringAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n location?: string,\n flags?: number,\n ): Promise<string> {\n return this.inner.typeToStringAsync(snapshot, project, typeHandle, location, flags);\n }\n}\n"],"mappings":";;;;;AAQA,IAAa,iBAAb,MAAa,uBAAuB,mBAAmB;CACrD,YAAoB,OAAwB;EAC1C,MAAM,MAAM;;;CAId,OAAO,MAAM,SAA2C;EACtD,OAAO,IAAI,eAAe,QAAQ,eAAe,MAAM,OAAO,QAAQ,CAAC,CAAC;;;CAI1E,aAAa,WAAW,SAAoD;EAC1E,OAAO,IAAI,eAAe,MAAM,QAAQ,yBAAyB,OAAO,QAAQ,CAAC,CAAC;;;CAIpF,cAAc,UAAkB,SAA+B;EAC7D,OAAO,SAAS,KAAK,MAAM,kBAAkB,UAAU,QAAQ,CAAC;;;CAIlE,MAAM,mBAAmB,UAAkB,SAAwC;EACjF,OAAO,SAAS,MAAM,KAAK,MAAM,uBAAuB,UAAU,QAAQ,CAAC;;;CAI7E,kBACE,UACA,SACA,MACA,UAC0B;EAC1B,OACE,SACE,KAAK,MAAM,sBAAsB,UAAU,SAAS,MAAM,SAAS,CACpE,IAAI,KAAA;;;CAKT,MAAM,uBACJ,UACA,SACA,MACA,UACmC;EACnC,OACE,SACE,MAAM,KAAK,MAAM,2BAA2B,UAAU,SAAS,MAAM,SAAS,CAC/E,IAAI,KAAA;;;CAKT,oBACE,UACA,SACA,MACA,UAC4B;EAC5B,OACE,SACE,KAAK,MAAM,wBAAwB,UAAU,SAAS,MAAM,SAAS,CACtE,IAAI,KAAA;;;CAKT,MAAM,yBACJ,UACA,SACA,MACA,UACqC;EACrC,OACE,SACE,MAAM,KAAK,MAAM,6BAA6B,UAAU,SAAS,MAAM,SAAS,CACjF,IAAI,KAAA;;;CAKT,iBACE,UACA,SACA,YACA,aACgB;EAChB,OAAO,SAAS,KAAK,MAAM,qBAAqB,UAAU,SAAS,YAAY,YAAY,CAAC;;;CAI9F,MAAM,sBACJ,UACA,SACA,YACA,aACyB;EACzB,OAAO,SACL,MAAM,KAAK,MAAM,0BAA0B,UAAU,SAAS,YAAY,YAAY,CACvF;;;CAIH,gBAAgB,UAAkB,SAAiB,QAA0C;EAC3F,OACE,SAA8B,KAAK,MAAM,oBAAoB,UAAU,SAAS,OAAO,CAAC,IACxF,KAAA;;;CAKJ,MAAM,qBACJ,UACA,SACA,QACmC;EACnC,OACE,SACE,MAAM,KAAK,MAAM,yBAAyB,UAAU,SAAS,OAAO,CACrE,IAAI,KAAA;;;CAKT,wBACE,UACA,SACA,QAC0B;EAC1B,OACE,SACE,KAAK,MAAM,4BAA4B,UAAU,SAAS,OAAO,CAClE,IAAI,KAAA;;;CAKT,MAAM,6BACJ,UACA,SACA,QACmC;EACnC,OACE,SACE,MAAM,KAAK,MAAM,iCAAiC,UAAU,SAAS,OAAO,CAC7E,IAAI,KAAA;;;CAKT,aACE,UACA,SACA,YACA,UACA,OACQ;EACR,OAAO,KAAK,MAAM,aAAa,UAAU,SAAS,YAAY,UAAU,MAAM;;;CAIhF,MAAM,kBACJ,UACA,SACA,YACA,UACA,OACiB;EACjB,OAAO,KAAK,MAAM,kBAAkB,UAAU,SAAS,YAAY,UAAU,MAAM"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { NativeApiClient } from "./binding.mjs";
|
|
2
|
-
import { ConfigResponse, InitializeResponse, UpdateSnapshotParams, UpdateSnapshotResponse } from "./types.mjs";
|
|
3
|
-
|
|
4
|
-
//#region api_client_base.d.ts
|
|
5
|
-
/** Shared lifecycle and transport operations for the public Corsa API client. */
|
|
6
|
-
declare abstract class CorsaApiClientBase {
|
|
7
|
-
protected readonly inner: NativeApiClient;
|
|
8
|
-
/** Wraps a native client handle. Construction is restricted to subclasses. */
|
|
9
|
-
protected constructor(inner: NativeApiClient);
|
|
10
|
-
/** Performs the synchronous Corsa API initialize handshake. */
|
|
11
|
-
initialize(): InitializeResponse;
|
|
12
|
-
/** Performs the asynchronous Corsa API initialize handshake. */
|
|
13
|
-
initializeAsync(): Promise<InitializeResponse>;
|
|
14
|
-
/** Parses a Corsa config file and returns the native config response. */
|
|
15
|
-
parseConfigFile(file: string): ConfigResponse;
|
|
16
|
-
/** Parses a Corsa config file without blocking the JavaScript thread. */
|
|
17
|
-
parseConfigFileAsync(file: string): Promise<ConfigResponse>;
|
|
18
|
-
/** Updates the upstream Corsa project snapshot with optional changed files. */
|
|
19
|
-
updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse;
|
|
20
|
-
/** Updates the upstream Corsa project snapshot asynchronously. */
|
|
21
|
-
updateSnapshotAsync(params?: UpdateSnapshotParams): Promise<UpdateSnapshotResponse>;
|
|
22
|
-
/** Reads a source file from a snapshot as bytes, or `null` if it is unavailable. */
|
|
23
|
-
getSourceFile(snapshot: string, project: string, file: string): Uint8Array | null;
|
|
24
|
-
/** Reads a source file from a snapshot asynchronously. */
|
|
25
|
-
getSourceFileAsync(snapshot: string, project: string, file: string): Promise<Uint8Array | null>;
|
|
26
|
-
/** Calls an arbitrary JSON-RPC method and parses the JSON response. */
|
|
27
|
-
callJson<T>(method: string, params?: unknown): T;
|
|
28
|
-
/** Calls an arbitrary JSON-RPC method asynchronously and parses the response. */
|
|
29
|
-
callJsonAsync<T>(method: string, params?: unknown): Promise<T>;
|
|
30
|
-
/** Calls a binary endpoint and returns raw bytes, or `null` for empty responses. */
|
|
31
|
-
callBinary(method: string, params?: unknown): Uint8Array | null;
|
|
32
|
-
/** Calls a binary endpoint asynchronously. */
|
|
33
|
-
callBinaryAsync(method: string, params?: unknown): Promise<Uint8Array | null>;
|
|
34
|
-
/** Releases a native type, symbol, or snapshot handle when callers are done with it. */
|
|
35
|
-
releaseHandle(handle: string): void;
|
|
36
|
-
/** Releases a native handle asynchronously. */
|
|
37
|
-
releaseHandleAsync(handle: string): Promise<void>;
|
|
38
|
-
/** Closes the underlying Corsa process and transport. */
|
|
39
|
-
close(): void;
|
|
40
|
-
/** Closes the underlying Corsa process asynchronously. */
|
|
41
|
-
closeAsync(): Promise<void>;
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
export { CorsaApiClientBase };
|
|
45
|
-
//# sourceMappingURL=api_client_base.d.mts.map
|
package/dist/api_client_base.mjs
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { fromJson, toJson } from "./json.mjs";
|
|
2
|
-
//#region api_client_base.ts
|
|
3
|
-
/** Shared lifecycle and transport operations for the public Corsa API client. */
|
|
4
|
-
var CorsaApiClientBase = class {
|
|
5
|
-
inner;
|
|
6
|
-
/** Wraps a native client handle. Construction is restricted to subclasses. */
|
|
7
|
-
constructor(inner) {
|
|
8
|
-
this.inner = inner;
|
|
9
|
-
}
|
|
10
|
-
/** Performs the synchronous Corsa API initialize handshake. */
|
|
11
|
-
initialize() {
|
|
12
|
-
return fromJson(this.inner.initializeJson());
|
|
13
|
-
}
|
|
14
|
-
/** Performs the asynchronous Corsa API initialize handshake. */
|
|
15
|
-
async initializeAsync() {
|
|
16
|
-
return fromJson(await this.inner.initializeJsonAsync());
|
|
17
|
-
}
|
|
18
|
-
/** Parses a Corsa config file and returns the native config response. */
|
|
19
|
-
parseConfigFile(file) {
|
|
20
|
-
return fromJson(this.inner.parseConfigFileJson(file));
|
|
21
|
-
}
|
|
22
|
-
/** Parses a Corsa config file without blocking the JavaScript thread. */
|
|
23
|
-
async parseConfigFileAsync(file) {
|
|
24
|
-
return fromJson(await this.inner.parseConfigFileJsonAsync(file));
|
|
25
|
-
}
|
|
26
|
-
/** Updates the upstream Corsa project snapshot with optional changed files. */
|
|
27
|
-
updateSnapshot(params) {
|
|
28
|
-
return fromJson(this.inner.updateSnapshotJson(params ? toJson(params) : void 0));
|
|
29
|
-
}
|
|
30
|
-
/** Updates the upstream Corsa project snapshot asynchronously. */
|
|
31
|
-
async updateSnapshotAsync(params) {
|
|
32
|
-
return fromJson(await this.inner.updateSnapshotJsonAsync(params ? toJson(params) : void 0));
|
|
33
|
-
}
|
|
34
|
-
/** Reads a source file from a snapshot as bytes, or `null` if it is unavailable. */
|
|
35
|
-
getSourceFile(snapshot, project, file) {
|
|
36
|
-
return this.inner.getSourceFile(snapshot, project, file) ?? null;
|
|
37
|
-
}
|
|
38
|
-
/** Reads a source file from a snapshot asynchronously. */
|
|
39
|
-
async getSourceFileAsync(snapshot, project, file) {
|
|
40
|
-
return await this.inner.getSourceFileAsync(snapshot, project, file) ?? null;
|
|
41
|
-
}
|
|
42
|
-
/** Calls an arbitrary JSON-RPC method and parses the JSON response. */
|
|
43
|
-
callJson(method, params) {
|
|
44
|
-
return fromJson(this.inner.callJson(method, params ? toJson(params) : void 0));
|
|
45
|
-
}
|
|
46
|
-
/** Calls an arbitrary JSON-RPC method asynchronously and parses the response. */
|
|
47
|
-
async callJsonAsync(method, params) {
|
|
48
|
-
return fromJson(await this.inner.callJsonAsync(method, params ? toJson(params) : void 0));
|
|
49
|
-
}
|
|
50
|
-
/** Calls a binary endpoint and returns raw bytes, or `null` for empty responses. */
|
|
51
|
-
callBinary(method, params) {
|
|
52
|
-
return this.inner.callBinary(method, params ? toJson(params) : void 0) ?? null;
|
|
53
|
-
}
|
|
54
|
-
/** Calls a binary endpoint asynchronously. */
|
|
55
|
-
async callBinaryAsync(method, params) {
|
|
56
|
-
return await this.inner.callBinaryAsync(method, params ? toJson(params) : void 0) ?? null;
|
|
57
|
-
}
|
|
58
|
-
/** Releases a native type, symbol, or snapshot handle when callers are done with it. */
|
|
59
|
-
releaseHandle(handle) {
|
|
60
|
-
this.inner.releaseHandle(handle);
|
|
61
|
-
}
|
|
62
|
-
/** Releases a native handle asynchronously. */
|
|
63
|
-
async releaseHandleAsync(handle) {
|
|
64
|
-
await this.inner.releaseHandleAsync(handle);
|
|
65
|
-
}
|
|
66
|
-
/** Closes the underlying Corsa process and transport. */
|
|
67
|
-
close() {
|
|
68
|
-
this.inner.close();
|
|
69
|
-
}
|
|
70
|
-
/** Closes the underlying Corsa process asynchronously. */
|
|
71
|
-
async closeAsync() {
|
|
72
|
-
await this.inner.closeAsync();
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
//#endregion
|
|
76
|
-
export { CorsaApiClientBase };
|
|
77
|
-
|
|
78
|
-
//# sourceMappingURL=api_client_base.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api_client_base.mjs","names":[],"sources":["../ts/api_client_base.ts"],"sourcesContent":["import { fromJson, toJson } from \"./json\";\n\nimport type { NativeApiClient } from \"./binding\";\nimport type {\n ConfigResponse,\n InitializeResponse,\n UpdateSnapshotParams,\n UpdateSnapshotResponse,\n} from \"./types\";\n\n/** Shared lifecycle and transport operations for the public Corsa API client. */\nexport abstract class CorsaApiClientBase {\n protected readonly inner: NativeApiClient;\n\n /** Wraps a native client handle. Construction is restricted to subclasses. */\n protected constructor(inner: NativeApiClient) {\n this.inner = inner;\n }\n\n /** Performs the synchronous Corsa API initialize handshake. */\n initialize(): InitializeResponse {\n return fromJson(this.inner.initializeJson());\n }\n\n /** Performs the asynchronous Corsa API initialize handshake. */\n async initializeAsync(): Promise<InitializeResponse> {\n return fromJson(await this.inner.initializeJsonAsync());\n }\n\n /** Parses a Corsa config file and returns the native config response. */\n parseConfigFile(file: string): ConfigResponse {\n return fromJson(this.inner.parseConfigFileJson(file));\n }\n\n /** Parses a Corsa config file without blocking the JavaScript thread. */\n async parseConfigFileAsync(file: string): Promise<ConfigResponse> {\n return fromJson(await this.inner.parseConfigFileJsonAsync(file));\n }\n\n /** Updates the upstream Corsa project snapshot with optional changed files. */\n updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse {\n return fromJson(this.inner.updateSnapshotJson(params ? toJson(params) : undefined));\n }\n\n /** Updates the upstream Corsa project snapshot asynchronously. */\n async updateSnapshotAsync(params?: UpdateSnapshotParams): Promise<UpdateSnapshotResponse> {\n return fromJson(await this.inner.updateSnapshotJsonAsync(params ? toJson(params) : undefined));\n }\n\n /** Reads a source file from a snapshot as bytes, or `null` if it is unavailable. */\n getSourceFile(snapshot: string, project: string, file: string): Uint8Array | null {\n return this.inner.getSourceFile(snapshot, project, file) ?? null;\n }\n\n /** Reads a source file from a snapshot asynchronously. */\n async getSourceFileAsync(\n snapshot: string,\n project: string,\n file: string,\n ): Promise<Uint8Array | null> {\n return (await this.inner.getSourceFileAsync(snapshot, project, file)) ?? null;\n }\n\n /** Calls an arbitrary JSON-RPC method and parses the JSON response. */\n callJson<T>(method: string, params?: unknown): T {\n return fromJson(this.inner.callJson(method, params ? toJson(params) : undefined));\n }\n\n /** Calls an arbitrary JSON-RPC method asynchronously and parses the response. */\n async callJsonAsync<T>(method: string, params?: unknown): Promise<T> {\n return fromJson(await this.inner.callJsonAsync(method, params ? toJson(params) : undefined));\n }\n\n /** Calls a binary endpoint and returns raw bytes, or `null` for empty responses. */\n callBinary(method: string, params?: unknown): Uint8Array | null {\n return this.inner.callBinary(method, params ? toJson(params) : undefined) ?? null;\n }\n\n /** Calls a binary endpoint asynchronously. */\n async callBinaryAsync(method: string, params?: unknown): Promise<Uint8Array | null> {\n return (await this.inner.callBinaryAsync(method, params ? toJson(params) : undefined)) ?? null;\n }\n\n /** Releases a native type, symbol, or snapshot handle when callers are done with it. */\n releaseHandle(handle: string): void {\n this.inner.releaseHandle(handle);\n }\n\n /** Releases a native handle asynchronously. */\n async releaseHandleAsync(handle: string): Promise<void> {\n await this.inner.releaseHandleAsync(handle);\n }\n\n /** Closes the underlying Corsa process and transport. */\n close(): void {\n this.inner.close();\n }\n\n /** Closes the underlying Corsa process asynchronously. */\n async closeAsync(): Promise<void> {\n await this.inner.closeAsync();\n }\n}\n"],"mappings":";;;AAWA,IAAsB,qBAAtB,MAAyC;CACvC;;CAGA,YAAsB,OAAwB;EAC5C,KAAK,QAAQ;;;CAIf,aAAiC;EAC/B,OAAO,SAAS,KAAK,MAAM,gBAAgB,CAAC;;;CAI9C,MAAM,kBAA+C;EACnD,OAAO,SAAS,MAAM,KAAK,MAAM,qBAAqB,CAAC;;;CAIzD,gBAAgB,MAA8B;EAC5C,OAAO,SAAS,KAAK,MAAM,oBAAoB,KAAK,CAAC;;;CAIvD,MAAM,qBAAqB,MAAuC;EAChE,OAAO,SAAS,MAAM,KAAK,MAAM,yBAAyB,KAAK,CAAC;;;CAIlE,eAAe,QAAuD;EACpE,OAAO,SAAS,KAAK,MAAM,mBAAmB,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,CAAC;;;CAIrF,MAAM,oBAAoB,QAAgE;EACxF,OAAO,SAAS,MAAM,KAAK,MAAM,wBAAwB,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,CAAC;;;CAIhG,cAAc,UAAkB,SAAiB,MAAiC;EAChF,OAAO,KAAK,MAAM,cAAc,UAAU,SAAS,KAAK,IAAI;;;CAI9D,MAAM,mBACJ,UACA,SACA,MAC4B;EAC5B,OAAQ,MAAM,KAAK,MAAM,mBAAmB,UAAU,SAAS,KAAK,IAAK;;;CAI3E,SAAY,QAAgB,QAAqB;EAC/C,OAAO,SAAS,KAAK,MAAM,SAAS,QAAQ,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,CAAC;;;CAInF,MAAM,cAAiB,QAAgB,QAA8B;EACnE,OAAO,SAAS,MAAM,KAAK,MAAM,cAAc,QAAQ,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,CAAC;;;CAI9F,WAAW,QAAgB,QAAqC;EAC9D,OAAO,KAAK,MAAM,WAAW,QAAQ,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,IAAI;;;CAI/E,MAAM,gBAAgB,QAAgB,QAA8C;EAClF,OAAQ,MAAM,KAAK,MAAM,gBAAgB,QAAQ,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,IAAK;;;CAI5F,cAAc,QAAsB;EAClC,KAAK,MAAM,cAAc,OAAO;;;CAIlC,MAAM,mBAAmB,QAA+B;EACtD,MAAM,KAAK,MAAM,mBAAmB,OAAO;;;CAI7C,QAAc;EACZ,KAAK,MAAM,OAAO;;;CAIpB,MAAM,aAA4B;EAChC,MAAM,KAAK,MAAM,YAAY"}
|
package/dist/binding.d.mts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as _$___index_js0 from "../index.js";
|
|
2
|
-
|
|
3
|
-
//#region binding.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Resolved native module shape.
|
|
6
|
-
*
|
|
7
|
-
* `napi-rs` output can be loaded either as the namespace object itself or under
|
|
8
|
-
* a default export depending on the runtime bridge. This value normalizes both
|
|
9
|
-
* shapes so wrapper modules can call native methods without repeating the check.
|
|
10
|
-
*/
|
|
11
|
-
declare const binding: typeof _$___index_js0;
|
|
12
|
-
/** Native synchronous/asynchronous Corsa API client instance. */
|
|
13
|
-
type NativeApiClient = InstanceType<typeof binding.CorsaApiClient>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { NativeApiClient, binding };
|
|
16
|
-
//# sourceMappingURL=binding.d.mts.map
|