pompelmi 0.6.0 → 0.7.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/README.md +2 -0
- package/dist/pompelmi.cjs.js +110 -0
- package/dist/pompelmi.cjs.js.map +1 -1
- package/dist/pompelmi.esm.js +108 -1
- package/dist/pompelmi.esm.js.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/scan.d.ts +26 -0
- package/package.json +5 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ export { scanFiles } from './scan';
|
|
|
2
2
|
export { validateFile } from './validate';
|
|
3
3
|
export { useFileScanner } from './useFileScanner';
|
|
4
4
|
export { scanFilesWithYara } from './scan';
|
|
5
|
+
export { scanFilesWithHeuristicsAndYara, prefilterBrowser } from './scan';
|
|
6
|
+
export type { BrowserPolicy, PrefilterResult } from './scan';
|
|
5
7
|
export type { YaraMatch } from './yara/index';
|
|
6
8
|
export type { NodeScanOptions, NodeFileEntry } from './node/scanDir';
|
|
7
9
|
export { scanFilesWithRemoteYara } from './scan/remote';
|
|
10
|
+
export * from './types';
|
|
11
|
+
export { mapMatchesToVerdict } from './verdict';
|
package/dist/types/scan.d.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import type { YaraMatch } from './yara/index';
|
|
2
|
+
type Severity = 'clean' | 'suspicious' | 'malicious';
|
|
3
|
+
export type BrowserPolicy = {
|
|
4
|
+
includeExtensions: string[];
|
|
5
|
+
allowedMimeTypes: string[];
|
|
6
|
+
maxFileSizeBytes: number;
|
|
7
|
+
denyScriptableSvg?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type PrefilterResult = {
|
|
10
|
+
severity: Severity;
|
|
11
|
+
reasons: string[];
|
|
12
|
+
mime?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function prefilterBrowser(bytes: Uint8Array, filename: string, policy: BrowserPolicy): PrefilterResult;
|
|
2
15
|
/**
|
|
3
16
|
* Reads an array of File objects via FileReader and returns their text.
|
|
4
17
|
*/
|
|
@@ -13,3 +26,16 @@ export declare function scanFilesWithYara(files: File[], rulesSource: string): P
|
|
|
13
26
|
matches: YaraMatch[];
|
|
14
27
|
};
|
|
15
28
|
}>>;
|
|
29
|
+
/**
|
|
30
|
+
* Scan files with fast browser heuristics + optional YARA.
|
|
31
|
+
* Returns content, prefilter verdict, and YARA matches.
|
|
32
|
+
*/
|
|
33
|
+
export declare function scanFilesWithHeuristicsAndYara(files: File[], rulesSource: string, policy: BrowserPolicy): Promise<Array<{
|
|
34
|
+
file: File;
|
|
35
|
+
content: string;
|
|
36
|
+
prefilter: PrefilterResult;
|
|
37
|
+
yara: {
|
|
38
|
+
matches: YaraMatch[];
|
|
39
|
+
};
|
|
40
|
+
}>>;
|
|
41
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pompelmi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Prototipo di scanner di file lato cliente",
|
|
5
5
|
"main": "dist/pompelmi.cjs.js",
|
|
6
6
|
"module": "dist/pompelmi.esm.js",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"devDependencies": {
|
|
25
|
+
"@astrojs/mdx": "^4.3.3",
|
|
26
|
+
"@astrojs/sitemap": "^3.4.2",
|
|
27
|
+
"@astrojs/starlight": "^0.35.2",
|
|
28
|
+
"@astrojs/tailwind": "^6.0.2",
|
|
25
29
|
"@babel/core": "^7.28.0",
|
|
26
30
|
"@babel/preset-env": "^7.28.0",
|
|
27
31
|
"@babel/preset-typescript": "^7.27.1",
|