@bloodhound-rs/core 0.2.0 → 0.3.0-beta.1.41397912597.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +15 -0
- package/dist/native.js +54 -54
- package/dist/types.d.ts +2 -126
- package/dist/types.js +0 -6
- package/package.json +23 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @bloodhound-rs/core
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d2a0e91: Associate plugin manifest resources with project-relative files and source maps, including companion assets for inline maps. Add optional source-preview metadata types. The Playground can preview original project files or source-map snapshots at mapped locations and link an external source map to scans produced without the plugin.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- bed0c9a: Extract browser-safe manifest parsing, indexing and source previews into a shared package. Publish @bloodhound-rs/playground with independent React manifest selector and viewer components, a ready-to-use ManifestPlayground composition, injectable UI components and authenticated source loading. Export styles and a headless manifest entry for direct consumption. Keep core's existing public report types available through type re-exports.
|
|
12
|
+
- b824b4c: Publish the core, native platform packages, and Rollup plugin with synchronized release metadata and updated platform package descriptions. No runtime API changes.
|
|
13
|
+
- Updated dependencies [bed0c9a]
|
|
14
|
+
- @bloodhound-rs/manifest@0.1.0
|
|
15
|
+
|
|
3
16
|
## 0.2.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -12,6 +12,21 @@ pnpm add @bloodhound-rs/core
|
|
|
12
12
|
|
|
13
13
|
Requires Node.js 22+. Keep optional dependencies enabled so the native package for the current platform is installed. Supported targets are macOS arm64/x64, Linux glibc arm64/x64, and Windows x64. Linux musl is not supported.
|
|
14
14
|
|
|
15
|
+
## Embed the Playground
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { ManifestViewer, ManifestPlayground } from '@bloodhound-rs/playground';
|
|
19
|
+
import '@bloodhound-rs/playground/styles.css';
|
|
20
|
+
|
|
21
|
+
// Platform-owned report and resource selection.
|
|
22
|
+
<ManifestViewer manifest={manifest} components={components} loadText={loadText} />;
|
|
23
|
+
|
|
24
|
+
// Includes the file/URL selector.
|
|
25
|
+
<ManifestPlayground components={components} loadText={loadText} />;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Install `@bloodhound-rs/playground` in a React 18/19 host. The package supports injected UI components and source loading, and exports headless parsing through `@bloodhound-rs/playground/manifest`. It is built and versioned alongside the scanner packages through Changesets. See [Playground integration](packages/playground/README.md) for the API.
|
|
29
|
+
|
|
15
30
|
## SDK
|
|
16
31
|
|
|
17
32
|
```ts
|
package/dist/native.js
CHANGED
|
@@ -92,8 +92,8 @@ function requireNative() {
|
|
|
92
92
|
try {
|
|
93
93
|
const binding = require('@bloodhound-rs/core-android-arm64')
|
|
94
94
|
const bindingPackageVersion = require('@bloodhound-rs/core-android-arm64/package.json').version
|
|
95
|
-
if (bindingPackageVersion !== '0.
|
|
96
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
95
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
96
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
97
97
|
}
|
|
98
98
|
return binding
|
|
99
99
|
} catch (e) {
|
|
@@ -108,8 +108,8 @@ function requireNative() {
|
|
|
108
108
|
try {
|
|
109
109
|
const binding = require('@bloodhound-rs/core-android-arm-eabi')
|
|
110
110
|
const bindingPackageVersion = require('@bloodhound-rs/core-android-arm-eabi/package.json').version
|
|
111
|
-
if (bindingPackageVersion !== '0.
|
|
112
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
111
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
112
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
113
113
|
}
|
|
114
114
|
return binding
|
|
115
115
|
} catch (e) {
|
|
@@ -129,8 +129,8 @@ function requireNative() {
|
|
|
129
129
|
try {
|
|
130
130
|
const binding = require('@bloodhound-rs/core-win32-x64-gnu')
|
|
131
131
|
const bindingPackageVersion = require('@bloodhound-rs/core-win32-x64-gnu/package.json').version
|
|
132
|
-
if (bindingPackageVersion !== '0.
|
|
133
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
132
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
133
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
134
134
|
}
|
|
135
135
|
return binding
|
|
136
136
|
} catch (e) {
|
|
@@ -145,8 +145,8 @@ function requireNative() {
|
|
|
145
145
|
try {
|
|
146
146
|
const binding = require('@bloodhound-rs/core-win32-x64-msvc')
|
|
147
147
|
const bindingPackageVersion = require('@bloodhound-rs/core-win32-x64-msvc/package.json').version
|
|
148
|
-
if (bindingPackageVersion !== '0.
|
|
149
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
148
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
149
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
150
150
|
}
|
|
151
151
|
return binding
|
|
152
152
|
} catch (e) {
|
|
@@ -162,8 +162,8 @@ function requireNative() {
|
|
|
162
162
|
try {
|
|
163
163
|
const binding = require('@bloodhound-rs/core-win32-ia32-msvc')
|
|
164
164
|
const bindingPackageVersion = require('@bloodhound-rs/core-win32-ia32-msvc/package.json').version
|
|
165
|
-
if (bindingPackageVersion !== '0.
|
|
166
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
165
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
166
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
167
167
|
}
|
|
168
168
|
return binding
|
|
169
169
|
} catch (e) {
|
|
@@ -178,8 +178,8 @@ function requireNative() {
|
|
|
178
178
|
try {
|
|
179
179
|
const binding = require('@bloodhound-rs/core-win32-arm64-msvc')
|
|
180
180
|
const bindingPackageVersion = require('@bloodhound-rs/core-win32-arm64-msvc/package.json').version
|
|
181
|
-
if (bindingPackageVersion !== '0.
|
|
182
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
181
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
182
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
183
183
|
}
|
|
184
184
|
return binding
|
|
185
185
|
} catch (e) {
|
|
@@ -197,8 +197,8 @@ function requireNative() {
|
|
|
197
197
|
try {
|
|
198
198
|
const binding = require('@bloodhound-rs/core-darwin-universal')
|
|
199
199
|
const bindingPackageVersion = require('@bloodhound-rs/core-darwin-universal/package.json').version
|
|
200
|
-
if (bindingPackageVersion !== '0.
|
|
201
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
200
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
201
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
202
202
|
}
|
|
203
203
|
return binding
|
|
204
204
|
} catch (e) {
|
|
@@ -213,8 +213,8 @@ function requireNative() {
|
|
|
213
213
|
try {
|
|
214
214
|
const binding = require('@bloodhound-rs/core-darwin-x64')
|
|
215
215
|
const bindingPackageVersion = require('@bloodhound-rs/core-darwin-x64/package.json').version
|
|
216
|
-
if (bindingPackageVersion !== '0.
|
|
217
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
216
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
217
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
218
218
|
}
|
|
219
219
|
return binding
|
|
220
220
|
} catch (e) {
|
|
@@ -229,8 +229,8 @@ function requireNative() {
|
|
|
229
229
|
try {
|
|
230
230
|
const binding = require('@bloodhound-rs/core-darwin-arm64')
|
|
231
231
|
const bindingPackageVersion = require('@bloodhound-rs/core-darwin-arm64/package.json').version
|
|
232
|
-
if (bindingPackageVersion !== '0.
|
|
233
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
232
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
233
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
234
234
|
}
|
|
235
235
|
return binding
|
|
236
236
|
} catch (e) {
|
|
@@ -249,8 +249,8 @@ function requireNative() {
|
|
|
249
249
|
try {
|
|
250
250
|
const binding = require('@bloodhound-rs/core-freebsd-x64')
|
|
251
251
|
const bindingPackageVersion = require('@bloodhound-rs/core-freebsd-x64/package.json').version
|
|
252
|
-
if (bindingPackageVersion !== '0.
|
|
253
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
252
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
253
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
254
254
|
}
|
|
255
255
|
return binding
|
|
256
256
|
} catch (e) {
|
|
@@ -265,8 +265,8 @@ function requireNative() {
|
|
|
265
265
|
try {
|
|
266
266
|
const binding = require('@bloodhound-rs/core-freebsd-arm64')
|
|
267
267
|
const bindingPackageVersion = require('@bloodhound-rs/core-freebsd-arm64/package.json').version
|
|
268
|
-
if (bindingPackageVersion !== '0.
|
|
269
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
268
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
269
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
270
270
|
}
|
|
271
271
|
return binding
|
|
272
272
|
} catch (e) {
|
|
@@ -286,8 +286,8 @@ function requireNative() {
|
|
|
286
286
|
try {
|
|
287
287
|
const binding = require('@bloodhound-rs/core-linux-x64-musl')
|
|
288
288
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-x64-musl/package.json').version
|
|
289
|
-
if (bindingPackageVersion !== '0.
|
|
290
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
289
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
290
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
291
291
|
}
|
|
292
292
|
return binding
|
|
293
293
|
} catch (e) {
|
|
@@ -302,8 +302,8 @@ function requireNative() {
|
|
|
302
302
|
try {
|
|
303
303
|
const binding = require('@bloodhound-rs/core-linux-x64-gnu')
|
|
304
304
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-x64-gnu/package.json').version
|
|
305
|
-
if (bindingPackageVersion !== '0.
|
|
306
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
305
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
306
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
307
307
|
}
|
|
308
308
|
return binding
|
|
309
309
|
} catch (e) {
|
|
@@ -320,8 +320,8 @@ function requireNative() {
|
|
|
320
320
|
try {
|
|
321
321
|
const binding = require('@bloodhound-rs/core-linux-arm64-musl')
|
|
322
322
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-arm64-musl/package.json').version
|
|
323
|
-
if (bindingPackageVersion !== '0.
|
|
324
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
323
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
324
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
325
325
|
}
|
|
326
326
|
return binding
|
|
327
327
|
} catch (e) {
|
|
@@ -336,8 +336,8 @@ function requireNative() {
|
|
|
336
336
|
try {
|
|
337
337
|
const binding = require('@bloodhound-rs/core-linux-arm64-gnu')
|
|
338
338
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-arm64-gnu/package.json').version
|
|
339
|
-
if (bindingPackageVersion !== '0.
|
|
340
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
339
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
340
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
341
341
|
}
|
|
342
342
|
return binding
|
|
343
343
|
} catch (e) {
|
|
@@ -354,8 +354,8 @@ function requireNative() {
|
|
|
354
354
|
try {
|
|
355
355
|
const binding = require('@bloodhound-rs/core-linux-arm-musleabihf')
|
|
356
356
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-arm-musleabihf/package.json').version
|
|
357
|
-
if (bindingPackageVersion !== '0.
|
|
358
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
357
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
358
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
359
359
|
}
|
|
360
360
|
return binding
|
|
361
361
|
} catch (e) {
|
|
@@ -370,8 +370,8 @@ function requireNative() {
|
|
|
370
370
|
try {
|
|
371
371
|
const binding = require('@bloodhound-rs/core-linux-arm-gnueabihf')
|
|
372
372
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-arm-gnueabihf/package.json').version
|
|
373
|
-
if (bindingPackageVersion !== '0.
|
|
374
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
373
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
374
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
375
375
|
}
|
|
376
376
|
return binding
|
|
377
377
|
} catch (e) {
|
|
@@ -388,8 +388,8 @@ function requireNative() {
|
|
|
388
388
|
try {
|
|
389
389
|
const binding = require('@bloodhound-rs/core-linux-loong64-musl')
|
|
390
390
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-loong64-musl/package.json').version
|
|
391
|
-
if (bindingPackageVersion !== '0.
|
|
392
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
391
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
392
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
393
393
|
}
|
|
394
394
|
return binding
|
|
395
395
|
} catch (e) {
|
|
@@ -404,8 +404,8 @@ function requireNative() {
|
|
|
404
404
|
try {
|
|
405
405
|
const binding = require('@bloodhound-rs/core-linux-loong64-gnu')
|
|
406
406
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-loong64-gnu/package.json').version
|
|
407
|
-
if (bindingPackageVersion !== '0.
|
|
408
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
407
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
408
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
409
409
|
}
|
|
410
410
|
return binding
|
|
411
411
|
} catch (e) {
|
|
@@ -422,8 +422,8 @@ function requireNative() {
|
|
|
422
422
|
try {
|
|
423
423
|
const binding = require('@bloodhound-rs/core-linux-riscv64-musl')
|
|
424
424
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-riscv64-musl/package.json').version
|
|
425
|
-
if (bindingPackageVersion !== '0.
|
|
426
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
425
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
426
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
427
427
|
}
|
|
428
428
|
return binding
|
|
429
429
|
} catch (e) {
|
|
@@ -438,8 +438,8 @@ function requireNative() {
|
|
|
438
438
|
try {
|
|
439
439
|
const binding = require('@bloodhound-rs/core-linux-riscv64-gnu')
|
|
440
440
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-riscv64-gnu/package.json').version
|
|
441
|
-
if (bindingPackageVersion !== '0.
|
|
442
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
441
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
442
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
443
443
|
}
|
|
444
444
|
return binding
|
|
445
445
|
} catch (e) {
|
|
@@ -455,8 +455,8 @@ function requireNative() {
|
|
|
455
455
|
try {
|
|
456
456
|
const binding = require('@bloodhound-rs/core-linux-ppc64-gnu')
|
|
457
457
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-ppc64-gnu/package.json').version
|
|
458
|
-
if (bindingPackageVersion !== '0.
|
|
459
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
458
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
459
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
460
460
|
}
|
|
461
461
|
return binding
|
|
462
462
|
} catch (e) {
|
|
@@ -471,8 +471,8 @@ function requireNative() {
|
|
|
471
471
|
try {
|
|
472
472
|
const binding = require('@bloodhound-rs/core-linux-s390x-gnu')
|
|
473
473
|
const bindingPackageVersion = require('@bloodhound-rs/core-linux-s390x-gnu/package.json').version
|
|
474
|
-
if (bindingPackageVersion !== '0.
|
|
475
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
474
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
475
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
476
476
|
}
|
|
477
477
|
return binding
|
|
478
478
|
} catch (e) {
|
|
@@ -491,8 +491,8 @@ function requireNative() {
|
|
|
491
491
|
try {
|
|
492
492
|
const binding = require('@bloodhound-rs/core-openharmony-arm64')
|
|
493
493
|
const bindingPackageVersion = require('@bloodhound-rs/core-openharmony-arm64/package.json').version
|
|
494
|
-
if (bindingPackageVersion !== '0.
|
|
495
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
494
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
495
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
496
496
|
}
|
|
497
497
|
return binding
|
|
498
498
|
} catch (e) {
|
|
@@ -507,8 +507,8 @@ function requireNative() {
|
|
|
507
507
|
try {
|
|
508
508
|
const binding = require('@bloodhound-rs/core-openharmony-x64')
|
|
509
509
|
const bindingPackageVersion = require('@bloodhound-rs/core-openharmony-x64/package.json').version
|
|
510
|
-
if (bindingPackageVersion !== '0.
|
|
511
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
510
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
511
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
512
512
|
}
|
|
513
513
|
return binding
|
|
514
514
|
} catch (e) {
|
|
@@ -523,8 +523,8 @@ function requireNative() {
|
|
|
523
523
|
try {
|
|
524
524
|
const binding = require('@bloodhound-rs/core-openharmony-arm')
|
|
525
525
|
const bindingPackageVersion = require('@bloodhound-rs/core-openharmony-arm/package.json').version
|
|
526
|
-
if (bindingPackageVersion !== '0.
|
|
527
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
526
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
527
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
528
528
|
}
|
|
529
529
|
return binding
|
|
530
530
|
} catch (e) {
|
|
@@ -664,8 +664,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
664
664
|
if (!candidateFailed) {
|
|
665
665
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
666
666
|
const bindingPackageVersion = require('@bloodhound-rs/core-wasm32-wasi/package.json').version
|
|
667
|
-
if (bindingPackageVersion !== '0.
|
|
668
|
-
throw new Error(`WASI binding package version mismatch, expected 0.
|
|
667
|
+
if (bindingPackageVersion !== '0.3.0-beta.1.41397912597.1') {
|
|
668
|
+
throw new Error(`WASI binding package version mismatch, expected 0.3.0-beta.1.41397912597.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
wasiBinding = require('@bloodhound-rs/core-wasm32-wasi')
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ResourceKind, ScriptMode, DependencyMode } from '@bloodhound-rs/manifest/types';
|
|
2
|
+
export type * from '@bloodhound-rs/manifest/types';
|
|
1
3
|
/**
|
|
2
4
|
* Public types of `@bloodhound-rs/core`.
|
|
3
5
|
*
|
|
@@ -17,13 +19,6 @@ export type Source = {
|
|
|
17
19
|
/** Logical URL used to resolve relative dependencies and to label the resource. */
|
|
18
20
|
resourceUrl?: string;
|
|
19
21
|
};
|
|
20
|
-
export type ResourceKind = 'js' | 'html' | 'css';
|
|
21
|
-
/**
|
|
22
|
-
* How a JavaScript resource executes. Top-level `var`/`function` in a classic
|
|
23
|
-
* script become `window` properties; in a module they stay module-local.
|
|
24
|
-
*/
|
|
25
|
-
export type ScriptMode = 'classic' | 'module';
|
|
26
|
-
export type DependencyMode = 'single' | 'recursive';
|
|
27
22
|
export interface ScanEntry {
|
|
28
23
|
kind: ResourceKind;
|
|
29
24
|
source: Source;
|
|
@@ -101,122 +96,3 @@ export interface ScanOptions {
|
|
|
101
96
|
/** Cancels a running scan. The result is a manifest with `status: 'cancelled'`. */
|
|
102
97
|
signal?: AbortSignal;
|
|
103
98
|
}
|
|
104
|
-
/**
|
|
105
|
-
* Pollution categories reported by the scanner.
|
|
106
|
-
*
|
|
107
|
-
* | rule | meaning |
|
|
108
|
-
* |------------------------|---------------------------------------------------------------------|
|
|
109
|
-
* | `global-write` | `window.x = …`, top-level `var`/`function` in classic scripts |
|
|
110
|
-
* | `document-write` | `document.body.className = …`, `document.body.setAttribute(…)` |
|
|
111
|
-
* | `builtin-mutation` | `Array.prototype.x = …`, `Promise.allSettled = …` |
|
|
112
|
-
* | `host-api-override` | `window.fetch = …`, `XMLHttpRequest.prototype.open = …` |
|
|
113
|
-
* | `dom-insertion` | `document.body.appendChild(…)`, `document.write(…)` |
|
|
114
|
-
* | `style-injection` | `<style>`/`<link>` inserted by script without removal |
|
|
115
|
-
* | `document-style-write` | `document.body.style.x = …`, `documentElement.style.setProperty(…)` |
|
|
116
|
-
* | `global-listener` | `window.addEventListener(…)` without `removeEventListener` |
|
|
117
|
-
* | `html-global-style` | `style=` attribute on `<html>`/`<body>` |
|
|
118
|
-
*/
|
|
119
|
-
export type Rule = 'global-write' | 'document-write' | 'builtin-mutation' | 'host-api-override' | 'dom-insertion' | 'style-injection' | 'document-style-write' | 'global-listener' | 'html-global-style';
|
|
120
|
-
export type Severity = 'info' | 'warning' | 'error';
|
|
121
|
-
/**
|
|
122
|
-
* `high`: the receiver is provably the global object, `document`, or a builtin.
|
|
123
|
-
* `medium`: the receiver was tracked through a reassignable alias or a branch.
|
|
124
|
-
*/
|
|
125
|
-
export type Confidence = 'high' | 'medium';
|
|
126
|
-
export type ScanStatus = 'completed' | 'partial' | 'failed' | 'cancelled';
|
|
127
|
-
export type SourceStatus = 'completed' | 'partial' | 'failed';
|
|
128
|
-
export type DependencyStatus = 'resolved' | 'not-followed' | 'unresolved';
|
|
129
|
-
export type DependencyKind = 'script' | 'inline-script' | 'style' | 'module-preload' | 'iframe' | 'import' | 'dynamic-import' | 'worker' | 'dynamic-script' | 'dynamic-style';
|
|
130
|
-
/** Lines are 1-based; columns are 0-based UTF-16 code units. */
|
|
131
|
-
export interface Location {
|
|
132
|
-
line: number;
|
|
133
|
-
column: number;
|
|
134
|
-
endLine: number;
|
|
135
|
-
endColumn: number;
|
|
136
|
-
/** Original position from a source map when `sourceMaps` was enabled. */
|
|
137
|
-
original?: {
|
|
138
|
-
source: string;
|
|
139
|
-
line: number;
|
|
140
|
-
column: number;
|
|
141
|
-
name?: string;
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
export interface ManifestSource {
|
|
145
|
-
/** Manifest-local id such as `s1`. */
|
|
146
|
-
id: string;
|
|
147
|
-
kind: ResourceKind;
|
|
148
|
-
/** Logical URL. Absent for anonymous inline content. */
|
|
149
|
-
url?: string;
|
|
150
|
-
/** Present for inline scripts extracted from an HTML parent. */
|
|
151
|
-
inline?: {
|
|
152
|
-
parent: string;
|
|
153
|
-
line: number;
|
|
154
|
-
column: number;
|
|
155
|
-
};
|
|
156
|
-
scriptMode?: ScriptMode;
|
|
157
|
-
status: SourceStatus;
|
|
158
|
-
bytes: number;
|
|
159
|
-
contentHash: string;
|
|
160
|
-
/** Ids of the sources that referenced this one. Empty for entries. */
|
|
161
|
-
referrers: string[];
|
|
162
|
-
/** Shortest chain of source ids from an entry to this source, inclusive. */
|
|
163
|
-
chain: string[];
|
|
164
|
-
}
|
|
165
|
-
export interface ManifestFinding {
|
|
166
|
-
/** Source id containing the pollution. */
|
|
167
|
-
source: string;
|
|
168
|
-
rule: Rule;
|
|
169
|
-
severity: Severity;
|
|
170
|
-
/** Dotted path of the polluted target, e.g. `window.sharedConfig`. */
|
|
171
|
-
target: string;
|
|
172
|
-
/** `write` | `update` | `define` | `delete` | `declare` | `insert` | `listen` | `style`. */
|
|
173
|
-
operation: string;
|
|
174
|
-
confidence: Confidence;
|
|
175
|
-
location: Location;
|
|
176
|
-
/** Trimmed excerpt of the offending expression. */
|
|
177
|
-
snippet: string;
|
|
178
|
-
detail?: string;
|
|
179
|
-
}
|
|
180
|
-
export interface ManifestDependency {
|
|
181
|
-
from: string;
|
|
182
|
-
/** Set when the dependency was resolved and analyzed. */
|
|
183
|
-
to?: string;
|
|
184
|
-
kind: DependencyKind;
|
|
185
|
-
specifier?: string;
|
|
186
|
-
url?: string;
|
|
187
|
-
status: DependencyStatus;
|
|
188
|
-
reason?: string;
|
|
189
|
-
location: Location;
|
|
190
|
-
}
|
|
191
|
-
export interface ManifestGap {
|
|
192
|
-
source?: string;
|
|
193
|
-
reason: string;
|
|
194
|
-
count: number;
|
|
195
|
-
detail?: string;
|
|
196
|
-
location?: Location;
|
|
197
|
-
}
|
|
198
|
-
export interface Summary {
|
|
199
|
-
sources: number;
|
|
200
|
-
findings: number;
|
|
201
|
-
errors: number;
|
|
202
|
-
warnings: number;
|
|
203
|
-
dependencies: number;
|
|
204
|
-
unresolved: number;
|
|
205
|
-
gaps: number;
|
|
206
|
-
bytes: number;
|
|
207
|
-
elapsedMs: number;
|
|
208
|
-
}
|
|
209
|
-
/** The scan result. */
|
|
210
|
-
export interface Manifest {
|
|
211
|
-
schemaVersion: 2;
|
|
212
|
-
scannerVersion: string;
|
|
213
|
-
status: ScanStatus;
|
|
214
|
-
dependencyMode: DependencyMode;
|
|
215
|
-
summary: Summary;
|
|
216
|
-
/** Source ids of the entries, in request order. */
|
|
217
|
-
entries: string[];
|
|
218
|
-
sources: ManifestSource[];
|
|
219
|
-
findings: ManifestFinding[];
|
|
220
|
-
dependencies: ManifestDependency[];
|
|
221
|
-
gaps: ManifestGap[];
|
|
222
|
-
}
|
package/dist/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloodhound-rs/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-beta.1.41397912597.1",
|
|
4
4
|
"description": "Rust static scanner that finds global-environment pollution in JavaScript and HTML",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,13 +23,19 @@
|
|
|
23
23
|
],
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@changesets/cli": "3.0.3",
|
|
26
|
+
"@jridgewell/trace-mapping": "^0.3.31",
|
|
26
27
|
"@napi-rs/cli": "3.10.8",
|
|
27
28
|
"@types/node": "^22.19.0",
|
|
28
29
|
"prettier": "3.6.2",
|
|
29
30
|
"rolldown": "1.2.14",
|
|
30
31
|
"rollup": "^4.64.12",
|
|
31
32
|
"typescript": "^5.9.3",
|
|
32
|
-
"
|
|
33
|
+
"react": "^18.3.1",
|
|
34
|
+
"react-dom": "^18.3.1",
|
|
35
|
+
"@types/react": "^18.3.0",
|
|
36
|
+
"@types/react-dom": "^18.3.0",
|
|
37
|
+
"@bloodhound-rs/rollup-plugin": "0.3.0-beta.1.41397912597.1",
|
|
38
|
+
"@bloodhound-rs/playground": "0.1.0-beta.1.41397912597.1"
|
|
33
39
|
},
|
|
34
40
|
"napi": {
|
|
35
41
|
"binaryName": "bloodhound",
|
|
@@ -51,18 +57,22 @@
|
|
|
51
57
|
"url": "git+https://github.com/Justinidlerz/bloodhound.git"
|
|
52
58
|
},
|
|
53
59
|
"optionalDependencies": {
|
|
54
|
-
"@bloodhound-rs/core-darwin-arm64": "0.
|
|
55
|
-
"@bloodhound-rs/core-
|
|
56
|
-
"@bloodhound-rs/core-linux-
|
|
57
|
-
"@bloodhound-rs/core-
|
|
58
|
-
"@bloodhound-rs/core-
|
|
60
|
+
"@bloodhound-rs/core-darwin-arm64": "0.3.0-beta.1.41397912597.1",
|
|
61
|
+
"@bloodhound-rs/core-darwin-x64": "0.3.0-beta.1.41397912597.1",
|
|
62
|
+
"@bloodhound-rs/core-linux-arm64-gnu": "0.3.0-beta.1.41397912597.1",
|
|
63
|
+
"@bloodhound-rs/core-linux-x64-gnu": "0.3.0-beta.1.41397912597.1",
|
|
64
|
+
"@bloodhound-rs/core-win32-x64-msvc": "0.3.0-beta.1.41397912597.1"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@bloodhound-rs/manifest": "0.1.0-beta.1.41397912597.1"
|
|
59
68
|
},
|
|
60
69
|
"scripts": {
|
|
61
70
|
"build:native": "node scripts/build-native.mjs",
|
|
62
|
-
"build:ts": "tsc -p tsconfig.json",
|
|
71
|
+
"build:ts": "pnpm build:manifest && tsc -p tsconfig.json",
|
|
63
72
|
"build:plugin": "pnpm --filter @bloodhound-rs/rollup-plugin build",
|
|
64
|
-
"build": "
|
|
65
|
-
"
|
|
73
|
+
"build:js": "pnpm build:ts && pnpm build:plugin && pnpm build:playground-package",
|
|
74
|
+
"build": "node scripts/clean-dist.mjs && pnpm build:native && pnpm build:js",
|
|
75
|
+
"typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit --strict --skipLibCheck --module NodeNext --target ES2023 tests/types.test.ts && pnpm --filter @bloodhound-rs/rollup-plugin typecheck && pnpm typecheck:playground && pnpm --filter @bloodhound-rs/manifest typecheck && pnpm --filter @bloodhound-rs/playground typecheck",
|
|
66
76
|
"example": "node examples/scan.mjs",
|
|
67
77
|
"example:html": "node examples/scan-html.mjs",
|
|
68
78
|
"example:rollup": "rollup -c examples/rollup/rollup.config.mjs",
|
|
@@ -81,6 +91,8 @@
|
|
|
81
91
|
"test:rust": "cargo test --locked --lib",
|
|
82
92
|
"test:scripts": "node --test tests/scripts.test.mjs tests/release.test.mjs",
|
|
83
93
|
"test:sdk": "node --test tests/sdk.test.mjs",
|
|
84
|
-
"test:plugin": "pnpm --filter @bloodhound-rs/rollup-plugin test"
|
|
94
|
+
"test:plugin": "pnpm --filter @bloodhound-rs/rollup-plugin test",
|
|
95
|
+
"build:manifest": "pnpm --filter @bloodhound-rs/manifest build",
|
|
96
|
+
"build:playground-package": "pnpm --filter @bloodhound-rs/playground... build"
|
|
85
97
|
}
|
|
86
98
|
}
|