@uploadista/flow-security-nodes 0.0.20-beta.7 → 0.0.20-beta.9
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/.turbo/turbo-build.log +6 -6
- package/README.md +62 -52
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/package.json +8 -8
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @uploadista/flow-security-nodes@0.0.20-beta.
|
|
4
|
-
> tsdown
|
|
3
|
+
> @uploadista/flow-security-nodes@0.0.20-beta.8 build /Users/denislaboureyras/Documents/uploadista/dev/uploadista-workspace/uploadista-sdk/packages/flow/security/nodes
|
|
4
|
+
> tsc --noEmit && tsdown
|
|
5
5
|
|
|
6
|
-
[34mℹ[39m tsdown [2mv0.
|
|
6
|
+
[34mℹ[39m tsdown [2mv0.18.0[22m powered by rolldown [2mv1.0.0-beta.53[22m
|
|
7
7
|
[34mℹ[39m config file: [4m/Users/denislaboureyras/Documents/uploadista/dev/uploadista-workspace/uploadista-sdk/packages/flow/security/nodes/tsdown.config.ts[24m
|
|
8
8
|
[34mℹ[39m entry: [34msrc/index.ts[39m
|
|
9
9
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mindex.mjs[22m [2m1.26 kB[22m [2m│ gzip: 0.73 kB[22m
|
|
15
15
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22mindex.mjs.map [2m5.67 kB[22m [2m│ gzip: 2.19 kB[22m
|
|
16
16
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22mindex.d.mts.map [2m0.54 kB[22m [2m│ gzip: 0.29 kB[22m
|
|
17
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m3.29 kB[22m [2m│ gzip: 1.
|
|
17
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m3.29 kB[22m [2m│ gzip: 1.21 kB[22m
|
|
18
18
|
[34mℹ[39m [34m[ESM][39m 4 files, total: 10.76 kB
|
|
19
|
-
[32m✔[39m Build complete in [
|
|
19
|
+
[32m✔[39m Build complete in [32m6097ms[39m
|
|
20
20
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22mindex.d.cts.map [2m0.54 kB[22m [2m│ gzip: 0.29 kB[22m
|
|
21
21
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mindex.d.cts[22m[39m [2m3.29 kB[22m [2m│ gzip: 1.20 kB[22m
|
|
22
22
|
[34mℹ[39m [33m[CJS][39m 2 files, total: 3.83 kB
|
|
23
|
-
[32m✔[39m Build complete in [
|
|
23
|
+
[32m✔[39m Build complete in [32m6110ms[39m
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @uploadista/flow-security-nodes
|
|
2
2
|
|
|
3
|
-
Security processing nodes for Uploadista
|
|
3
|
+
Security processing nodes for Uploadista flows. Includes virus scanning and malware detection.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -8,74 +8,94 @@ Security processing nodes for Uploadista Flow, including virus scanning and malw
|
|
|
8
8
|
npm install @uploadista/flow-security-nodes
|
|
9
9
|
# or
|
|
10
10
|
pnpm add @uploadista/flow-security-nodes
|
|
11
|
-
# or
|
|
12
|
-
yarn add @uploadista/flow-security-nodes
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
##
|
|
13
|
+
## Quick Start
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **Plugin Architecture**: Support for multiple antivirus engines (ClamAV, cloud services, etc.)
|
|
15
|
+
```typescript
|
|
16
|
+
import { createScanVirusNode } from "@uploadista/flow-security-nodes";
|
|
17
|
+
```
|
|
21
18
|
|
|
22
|
-
##
|
|
19
|
+
## Node Types
|
|
23
20
|
|
|
24
21
|
### Scan Virus Node
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
#### Usage
|
|
23
|
+
Scan files for viruses and malware using ClamAV.
|
|
29
24
|
|
|
30
25
|
```typescript
|
|
31
26
|
import { createScanVirusNode } from "@uploadista/flow-security-nodes";
|
|
32
|
-
import { Effect } from "effect";
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
// Fail flow if virus detected (recommended for production)
|
|
29
|
+
const scanNode = yield* createScanVirusNode("scan-1", {
|
|
30
|
+
action: "fail",
|
|
31
|
+
timeout: 60000,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Continue with metadata (useful for logging/auditing)
|
|
35
|
+
const auditNode = yield* createScanVirusNode("scan-2", {
|
|
36
|
+
action: "pass",
|
|
37
|
+
timeout: 120000,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// With keepOutput option
|
|
41
|
+
const keepOutputNode = yield* createScanVirusNode("scan-3", {
|
|
42
|
+
action: "fail",
|
|
43
|
+
}, {
|
|
44
|
+
keepOutput: true,
|
|
46
45
|
});
|
|
47
46
|
```
|
|
48
47
|
|
|
49
48
|
#### Parameters
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
| Parameter | Type | Required | Default | Description |
|
|
51
|
+
|-----------|------|----------|---------|-------------|
|
|
52
|
+
| `action` | `"fail" \| "pass"` | No | `"fail"` | Action when virus detected |
|
|
53
|
+
| `timeout` | `number` (1000-300000) | No | `60000` | Max scan time in milliseconds |
|
|
54
|
+
|
|
55
|
+
#### Options
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
| Option | Type | Default | Description |
|
|
58
|
+
|--------|------|---------|-------------|
|
|
59
|
+
| `keepOutput` | `boolean` | `false` | Keep output in flow results |
|
|
60
|
+
|
|
61
|
+
#### Actions
|
|
62
|
+
|
|
63
|
+
| Action | Description |
|
|
64
|
+
|--------|-------------|
|
|
65
|
+
| `fail` | Stop flow execution when virus detected (recommended for production) |
|
|
66
|
+
| `pass` | Continue processing with detection metadata (useful for logging/auditing) |
|
|
67
|
+
|
|
68
|
+
#### Scan Results Metadata
|
|
59
69
|
|
|
60
70
|
All scan results are stored in `file.metadata.virusScan`:
|
|
61
71
|
|
|
62
72
|
```typescript
|
|
63
73
|
type VirusScanMetadata = {
|
|
64
|
-
scanned: boolean;
|
|
65
|
-
isClean: boolean;
|
|
74
|
+
scanned: boolean; // Whether file was scanned
|
|
75
|
+
isClean: boolean; // Whether file is clean (no viruses)
|
|
66
76
|
detectedViruses: string[]; // Array of detected virus names
|
|
67
|
-
scanDate: string;
|
|
68
|
-
engineVersion: string;
|
|
77
|
+
scanDate: string; // ISO 8601 timestamp
|
|
78
|
+
engineVersion: string; // Antivirus engine version
|
|
69
79
|
definitionsDate: string; // Virus definitions date
|
|
70
80
|
};
|
|
71
81
|
```
|
|
72
82
|
|
|
73
|
-
####
|
|
83
|
+
#### Error Codes
|
|
84
|
+
|
|
85
|
+
| Error Code | Description |
|
|
86
|
+
|------------|-------------|
|
|
87
|
+
| `VIRUS_DETECTED` | Malware found in file (when action=fail) |
|
|
88
|
+
| `CLAMAV_NOT_INSTALLED` | ClamAV not available on system |
|
|
89
|
+
| `VIRUS_SCAN_FAILED` | Generic scanning operation failure |
|
|
90
|
+
| `SCAN_TIMEOUT` | Scanning exceeded timeout limit |
|
|
91
|
+
|
|
92
|
+
## Example Flow
|
|
74
93
|
|
|
75
94
|
```typescript
|
|
76
95
|
import { createFlow } from "@uploadista/core/flow";
|
|
77
96
|
import { createScanVirusNode } from "@uploadista/flow-security-nodes";
|
|
78
97
|
import { ClamScanPluginLayer } from "@uploadista/flow-security-clamscan";
|
|
98
|
+
import { Effect } from "effect";
|
|
79
99
|
|
|
80
100
|
const secureUploadFlow = createFlow({
|
|
81
101
|
nodes: [
|
|
@@ -83,13 +103,13 @@ const secureUploadFlow = createFlow({
|
|
|
83
103
|
createInputNode("input-1"),
|
|
84
104
|
|
|
85
105
|
// 2. Scan for viruses - fail if infected
|
|
86
|
-
createScanVirusNode("scan-1", {
|
|
106
|
+
yield* createScanVirusNode("scan-1", {
|
|
87
107
|
action: "fail",
|
|
88
108
|
timeout: 60000,
|
|
89
109
|
}),
|
|
90
110
|
|
|
91
111
|
// 3. Process clean files
|
|
92
|
-
|
|
112
|
+
yield* createResizeNode("resize-1", {
|
|
93
113
|
width: 1920,
|
|
94
114
|
height: 1080,
|
|
95
115
|
}),
|
|
@@ -107,22 +127,12 @@ const secureUploadFlow = createFlow({
|
|
|
107
127
|
}).pipe(Effect.provide(ClamScanPluginLayer()));
|
|
108
128
|
```
|
|
109
129
|
|
|
110
|
-
## Error Codes
|
|
111
|
-
|
|
112
|
-
The scan virus node may return the following error codes:
|
|
113
|
-
|
|
114
|
-
- `VIRUS_DETECTED`: Virus or malware detected in file (when `action: "fail"`)
|
|
115
|
-
- `VIRUS_SCAN_FAILED`: Generic scanning operation failure
|
|
116
|
-
- `CLAMAV_NOT_INSTALLED`: ClamAV or configured antivirus not available
|
|
117
|
-
- `SCAN_TIMEOUT`: Scanning exceeded timeout limit
|
|
118
|
-
|
|
119
130
|
## Requirements
|
|
120
131
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
## TypeScript
|
|
132
|
+
- **VirusScanPlugin**: Required for scanning (e.g., `@uploadista/flow-security-clamscan`)
|
|
133
|
+
- ClamAV installed on the system (daemon or binary)
|
|
124
134
|
|
|
125
|
-
|
|
135
|
+
See [@uploadista/flow-security-clamscan](../clamscan) for ClamAV plugin setup.
|
|
126
136
|
|
|
127
137
|
## License
|
|
128
138
|
|
package/dist/index.d.cts
CHANGED
|
@@ -83,7 +83,7 @@ declare function createScanVirusNode(id: string, params?: ScanVirusParams, optio
|
|
|
83
83
|
circuitBreaker?: _uploadista_core_flow0.FlowCircuitBreakerConfig;
|
|
84
84
|
} & {
|
|
85
85
|
type: _uploadista_core_flow0.NodeType;
|
|
86
|
-
}, _uploadista_core_errors0.UploadistaError, VirusScanPlugin | _uploadista_core_upload0.
|
|
86
|
+
}, _uploadista_core_errors0.UploadistaError, VirusScanPlugin | _uploadista_core_upload0.UploadEngine>;
|
|
87
87
|
//#endregion
|
|
88
88
|
export { ScanAction, type ScanAction as ScanActionType, type ScanMetadata, type ScanResult, ScanVirusParams, type ScanVirusParams as ScanVirusParamsType, createScanVirusNode };
|
|
89
89
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/scan-virus-node.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;cAaa,YAAU,CAAA,CAAA;;;AAAvB,CAAA,CAAA;AACY,KAAA,UAAA,GAAa,CAAA,CAAE,KAAa,CAAA,OAAA,UAAR,CAAA;AAKhC;;;cAAa,iBAAe,CAAA,CAAA;;;;EAAA,CAAA,CAAA,CAAA;EAAA,OAAA,cAAA,cAAA,YAAA,CAAA,CAAA;AAgB5B,CAAA,eAAY,CAAA;AA8BI,KA9BJ,eAAA,GAAkB,CAAA,CAAE,KA8BG,CAAA,OA9BU,eA8BV,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnB,mBAAA,sBAEN;;IAC0B,MAAA,CAAA,OAD0B,sBAAA,CAC1B,YAAA;yBAAA,uBAAA,CAAA,UAAA;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/scan-virus-node.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;cAaa,YAAU,CAAA,CAAA;;;AAAvB,CAAA,CAAA;AACY,KAAA,UAAA,GAAa,CAAA,CAAE,KAAa,CAAA,OAAA,UAAR,CAAA;AAKhC;;;cAAa,iBAAe,CAAA,CAAA;;;;EAAA,CAAA,CAAA,CAAA;EAAA,OAAA,cAAA,cAAA,YAAA,CAAA,CAAA;AAgB5B,CAAA,eAAY,CAAA;AA8BI,KA9BJ,eAAA,GAAkB,CAAA,CAAE,KA8BG,CAAA,OA9BU,eA8BV,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnB,mBAAA,sBAEN;;IAC0B,MAAA,CAAA,OAD0B,sBAAA,CAC1B,YAAA;yBAAA,uBAAA,CAAA,UAAA;;;;;;;aAqE2l1M;;iEAAA,uBAAA,CAAA,UAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -83,7 +83,7 @@ declare function createScanVirusNode(id: string, params?: ScanVirusParams, optio
|
|
|
83
83
|
circuitBreaker?: _uploadista_core_flow0.FlowCircuitBreakerConfig;
|
|
84
84
|
} & {
|
|
85
85
|
type: _uploadista_core_flow0.NodeType;
|
|
86
|
-
}, _uploadista_core_errors0.UploadistaError, VirusScanPlugin | _uploadista_core_upload0.
|
|
86
|
+
}, _uploadista_core_errors0.UploadistaError, VirusScanPlugin | _uploadista_core_upload0.UploadEngine>;
|
|
87
87
|
//#endregion
|
|
88
88
|
export { ScanAction, type ScanAction as ScanActionType, type ScanMetadata, type ScanResult, ScanVirusParams, type ScanVirusParams as ScanVirusParamsType, createScanVirusNode };
|
|
89
89
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/scan-virus-node.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;cAaa,YAAU,CAAA,CAAA;;;AAAvB,CAAA,CAAA;AACY,KAAA,UAAA,GAAa,CAAA,CAAE,KAAa,CAAA,OAAA,UAAR,CAAA;AAKhC;;;cAAa,iBAAe,CAAA,CAAA;;;;EAAA,CAAA,CAAA,CAAA;EAAA,OAAA,cAAA,cAAA,YAAA,CAAA,CAAA;AAgB5B,CAAA,eAAY,CAAA;AA8BI,KA9BJ,eAAA,GAAkB,CAAA,CAAE,KA8BG,CAAA,OA9BU,eA8BV,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnB,mBAAA,sBAEN;;IAC0B,MAAA,CAAA,OAD0B,sBAAA,CAC1B,YAAA;yBAAA,uBAAA,CAAA,UAAA;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/scan-virus-node.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;cAaa,YAAU,CAAA,CAAA;;;AAAvB,CAAA,CAAA;AACY,KAAA,UAAA,GAAa,CAAA,CAAE,KAAa,CAAA,OAAA,UAAR,CAAA;AAKhC;;;cAAa,iBAAe,CAAA,CAAA;;;;EAAA,CAAA,CAAA,CAAA;EAAA,OAAA,cAAA,cAAA,YAAA,CAAA,CAAA;AAgB5B,CAAA,eAAY,CAAA;AA8BI,KA9BJ,eAAA,GAAkB,CAAA,CAAE,KA8BG,CAAA,OA9BU,eA8BV,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnB,mBAAA,sBAEN;;IAC0B,MAAA,CAAA,OAD0B,sBAAA,CAC1B,YAAA;yBAAA,uBAAA,CAAA,UAAA;;;;;;;aAqE2l1M;;iEAAA,uBAAA,CAAA,UAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadista/flow-security-nodes",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.20-beta.
|
|
4
|
+
"version": "0.0.20-beta.9",
|
|
5
5
|
"description": "Security processing nodes for Uploadista Flow",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Uploadista",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@uploadista/core": "0.0.20-beta.
|
|
17
|
+
"@uploadista/core": "0.0.20-beta.9"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"effect": "^3.0.0",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@effect/vitest": "0.27.0",
|
|
25
|
-
"@types/node": "24.10.
|
|
26
|
-
"effect": "3.19.
|
|
27
|
-
"tsdown": "0.
|
|
25
|
+
"@types/node": "24.10.4",
|
|
26
|
+
"effect": "3.19.12",
|
|
27
|
+
"tsdown": "0.18.0",
|
|
28
28
|
"vitest": "4.0.15",
|
|
29
|
-
"zod": "4.
|
|
30
|
-
"@uploadista/typescript-config": "0.0.20-beta.
|
|
29
|
+
"zod": "4.2.0",
|
|
30
|
+
"@uploadista/typescript-config": "0.0.20-beta.9"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
|
-
"build": "tsdown",
|
|
33
|
+
"build": "tsc --noEmit && tsdown",
|
|
34
34
|
"format": "biome format --write ./src",
|
|
35
35
|
"lint": "biome lint --write ./src",
|
|
36
36
|
"check": "biome check --write ./src",
|