sfscanner 0.1.0 → 0.2.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/README.md +141 -214
- package/THIRD_PARTY_NOTICES.md +385 -48
- package/dist/_types/contracts/preflight-prerequisite-types.d.ts +73 -0
- package/dist/_types/packages/scanner-cli/src/index.d.ts +6 -0
- package/dist/_types/packages/scanner-cli/src/v2/arguments.d.ts +102 -0
- package/dist/_types/packages/scanner-cli/src/v2/cli-runner.d.ts +22 -0
- package/dist/{v2 → _types/packages/scanner-cli/src/v2}/commands.d.ts +10 -5
- package/dist/{v2 → _types/packages/scanner-cli/src/v2}/contracts.d.ts +53 -9
- package/dist/_types/packages/scanner-cli/src/v2/help.d.ts +64 -0
- package/dist/_types/packages/scanner-cli/src/v2/metadata-output.d.ts +37 -0
- package/dist/_types/packages/scanner-cli/src/v2/preflight-readiness.d.ts +108 -0
- package/dist/_types/packages/scanner-cli/src/v2/privacy-prepare.d.ts +39 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +26129 -0
- package/dist/index.js.map +7 -0
- package/dist/main.js +26874 -12830
- package/dist/main.js.map +4 -4
- package/dist/mcp.js +19357 -7477
- package/dist/mcp.js.map +4 -4
- package/dist/scan-worker.js +28702 -0
- package/dist/scan-worker.js.map +7 -0
- package/dist/v2/arguments.d.ts +1 -86
- package/dist/v2/arguments.js +220 -21
- package/dist/v2/arguments.js.map +3 -3
- package/dist/v2/cli-runner.d.ts +1 -28
- package/dist/v2/cli-runner.js +19080 -7387
- package/dist/v2/cli-runner.js.map +4 -4
- package/dist/v2/help.d.ts +1 -27
- package/dist/v2/help.js +77 -9
- package/dist/v2/help.js.map +2 -2
- package/dist/v2/metadata-output.d.ts +1 -37
- package/dist/v2/metadata-output.js +20917 -276
- package/dist/v2/metadata-output.js.map +4 -4
- package/dist/v2/preflight-readiness.d.ts +1 -0
- package/dist/v2/preflight-readiness.js +447 -0
- package/dist/v2/preflight-readiness.js.map +7 -0
- package/dist/v2/privacy-prepare.d.ts +1 -0
- package/dist/v2/privacy-prepare.js +232 -0
- package/dist/v2/privacy-prepare.js.map +7 -0
- package/package.json +82 -67
- package/dist/v2/atomic-output.d.ts +0 -34
- package/dist/v2/batch-runner.d.ts +0 -44
- package/dist/v2/config.d.ts +0 -16
- package/dist/v2/exit-reducer.d.ts +0 -23
- package/dist/v2/input-read.d.ts +0 -26
- package/dist/v2/input-selection.d.ts +0 -38
- package/dist/v2/json-output.d.ts +0 -97
- package/dist/v2/metadata-validation.d.ts +0 -4
- package/dist/v2/ndjson-output.d.ts +0 -3
- package/dist/v2/sarif-helpers.d.ts +0 -69
- package/dist/v2/sarif-output.d.ts +0 -40
- package/dist/v2/table-output.d.ts +0 -2
- package/dist/v2/worker-host.d.ts +0 -24
package/dist/v2/json-output.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { type ScannerResultV2 } from '@hub/contracts/scanner-v2-result';
|
|
2
|
-
import type { BatchErrorCodeV2, BatchResultV2 } from './batch-runner';
|
|
3
|
-
export type ProjectionFormatV2 = 'json' | 'ndjson' | 'sarif' | 'table';
|
|
4
|
-
export type ProjectionSourceV2 = Readonly<{
|
|
5
|
-
profile: 'BUILT_IN' | 'CONFIG' | 'CLI';
|
|
6
|
-
rules: 'BUILT_IN' | 'CONFIG' | 'CLI';
|
|
7
|
-
semantics: 'BUILT_IN' | 'CONFIG' | 'CLI';
|
|
8
|
-
limits: 'BUILT_IN' | 'CONFIG' | 'CLI';
|
|
9
|
-
target: 'DEFAULT' | 'CONFIG' | 'CLI';
|
|
10
|
-
unsignedDevelopment: 'DEFAULT' | 'CONFIG' | 'CLI';
|
|
11
|
-
}>;
|
|
12
|
-
export type ProjectionOptionsV2 = Readonly<{
|
|
13
|
-
format: ProjectionFormatV2;
|
|
14
|
-
profile: string;
|
|
15
|
-
failOn: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW' | 'INFO';
|
|
16
|
-
requireComplete: boolean;
|
|
17
|
-
concurrency: number;
|
|
18
|
-
allowUnsignedDevelopmentRules: boolean;
|
|
19
|
-
sources: ProjectionSourceV2;
|
|
20
|
-
}>;
|
|
21
|
-
type ArtifactV2 = Readonly<{
|
|
22
|
-
profile: {
|
|
23
|
-
id: string;
|
|
24
|
-
version: string;
|
|
25
|
-
};
|
|
26
|
-
ruleset: {
|
|
27
|
-
id: string;
|
|
28
|
-
version: string;
|
|
29
|
-
digest: string;
|
|
30
|
-
signatureStatus: 'VERIFIED' | 'UNVERIFIED';
|
|
31
|
-
};
|
|
32
|
-
semantics: {
|
|
33
|
-
id: string;
|
|
34
|
-
version: string;
|
|
35
|
-
digest: string;
|
|
36
|
-
};
|
|
37
|
-
target: ScannerResultV2['target'];
|
|
38
|
-
limits: {
|
|
39
|
-
schemaVersion: 'scanner-limits-v2';
|
|
40
|
-
digest: string;
|
|
41
|
-
};
|
|
42
|
-
}>;
|
|
43
|
-
type CliErrorCodeV2 = BatchErrorCodeV2 | 'OUTPUT_WRITE_FAILED';
|
|
44
|
-
type CliErrorV2 = Readonly<{
|
|
45
|
-
kind: 'INPUT' | 'INCOMPLETE' | 'INTERNAL' | 'CANCELLED';
|
|
46
|
-
code: CliErrorCodeV2;
|
|
47
|
-
message: string;
|
|
48
|
-
}>;
|
|
49
|
-
type CliItemV2 = Readonly<{
|
|
50
|
-
input: string;
|
|
51
|
-
ok: true;
|
|
52
|
-
result: ScannerResultV2;
|
|
53
|
-
} | {
|
|
54
|
-
input: string;
|
|
55
|
-
ok: false;
|
|
56
|
-
error: CliErrorV2;
|
|
57
|
-
}>;
|
|
58
|
-
type SummaryV2 = Readonly<{
|
|
59
|
-
total: number;
|
|
60
|
-
complete: number;
|
|
61
|
-
degraded: number;
|
|
62
|
-
indeterminate: number;
|
|
63
|
-
inputErrors: number;
|
|
64
|
-
internalErrors: number;
|
|
65
|
-
cancelled: number;
|
|
66
|
-
findings: number;
|
|
67
|
-
}>;
|
|
68
|
-
export type CliEnvelopeV2 = Readonly<{
|
|
69
|
-
schemaVersion: 'n8n-scan-v2';
|
|
70
|
-
tool: Readonly<{
|
|
71
|
-
name: 'n8n-scan';
|
|
72
|
-
version: string;
|
|
73
|
-
buildDigest: string;
|
|
74
|
-
}>;
|
|
75
|
-
artifacts: ArtifactV2;
|
|
76
|
-
invocation: Readonly<{
|
|
77
|
-
schema: 'v2';
|
|
78
|
-
format: 'json' | 'ndjson' | 'sarif' | 'table';
|
|
79
|
-
profile: string;
|
|
80
|
-
failOn: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW' | 'INFO';
|
|
81
|
-
requireComplete: boolean;
|
|
82
|
-
concurrency: number;
|
|
83
|
-
allowUnsignedDevelopmentRules: boolean;
|
|
84
|
-
sources: ProjectionSourceV2;
|
|
85
|
-
}>;
|
|
86
|
-
results: readonly CliItemV2[];
|
|
87
|
-
summary: SummaryV2;
|
|
88
|
-
exitReason: 'UNDER_THRESHOLD' | 'FINDING_THRESHOLD' | 'REQUIRE_COMPLETE' | 'ITEM_FAILURE' | 'USAGE' | 'INTERNAL' | 'CANCELLED';
|
|
89
|
-
}>;
|
|
90
|
-
export type ProjectedBatchV2 = Readonly<{
|
|
91
|
-
envelope: CliEnvelopeV2;
|
|
92
|
-
items: readonly CliItemV2[];
|
|
93
|
-
}>;
|
|
94
|
-
export declare const DEFAULT_PROJECTION_OPTIONS: ProjectionOptionsV2;
|
|
95
|
-
export declare function serializeEnvelopeV2(batch: BatchResultV2, options?: ProjectionOptionsV2): string;
|
|
96
|
-
export declare function projectBatchV2(batch: BatchResultV2, options?: ProjectionOptionsV2 | ProjectionFormatV2): ProjectedBatchV2;
|
|
97
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CliMetadataDocumentV2 } from './commands';
|
|
2
|
-
export declare function checkPlain(o: unknown): Record<string, unknown>;
|
|
3
|
-
export declare function checkDenseArray<T>(arr: unknown): T[];
|
|
4
|
-
export declare function validateDocumentShape(doc: unknown): asserts doc is CliMetadataDocumentV2;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { type ScannerResultV2 } from '@hub/contracts/scanner-v2-result';
|
|
2
|
-
import type { SourceSpanV2, SubjectV2 } from '@hub/contracts/scanner-v2-source';
|
|
3
|
-
import type { BatchSarifInputV2, SarifV2Limits } from './sarif-output';
|
|
4
|
-
export type Bounds = {
|
|
5
|
-
rules: number;
|
|
6
|
-
results: number;
|
|
7
|
-
notifications: number;
|
|
8
|
-
taxonomies: number;
|
|
9
|
-
taxa: number;
|
|
10
|
-
tags: number;
|
|
11
|
-
flows: number;
|
|
12
|
-
steps: number;
|
|
13
|
-
};
|
|
14
|
-
export type NotifItem = {
|
|
15
|
-
code: string;
|
|
16
|
-
level: 'warning' | 'error';
|
|
17
|
-
location?: Record<string, unknown>;
|
|
18
|
-
locKey: string;
|
|
19
|
-
id?: string;
|
|
20
|
-
label?: string;
|
|
21
|
-
};
|
|
22
|
-
export type BatchId = {
|
|
23
|
-
engineId: string;
|
|
24
|
-
engineVersion: string;
|
|
25
|
-
engineBuildDigest: string;
|
|
26
|
-
profileId: string;
|
|
27
|
-
profileVersion: string;
|
|
28
|
-
rulesetId: string;
|
|
29
|
-
rulesetVersion: string;
|
|
30
|
-
rulesetDigest: string;
|
|
31
|
-
rulesetSig: string;
|
|
32
|
-
semanticsId: string;
|
|
33
|
-
semanticsVersion: string;
|
|
34
|
-
semanticsDigest: string;
|
|
35
|
-
targetContextDigest: string;
|
|
36
|
-
targetEdition: string;
|
|
37
|
-
targetDeployment: string;
|
|
38
|
-
targetRole: string;
|
|
39
|
-
targetTaskRunner: string;
|
|
40
|
-
limitsSchemaVersion: string;
|
|
41
|
-
limitsDigest: string;
|
|
42
|
-
};
|
|
43
|
-
export type InputIdentity = {
|
|
44
|
-
rawUri: unknown;
|
|
45
|
-
label: string;
|
|
46
|
-
};
|
|
47
|
-
export declare const FALLBACK: Bounds;
|
|
48
|
-
export declare const SEV_ORDER: Record<string, number>;
|
|
49
|
-
export declare const LEVELS: Record<string, 'error' | 'warning' | 'note'>;
|
|
50
|
-
export declare const ALLOWED_ERRORS: Set<string>;
|
|
51
|
-
export declare const prop: (v: unknown, k: string) => unknown;
|
|
52
|
-
export declare const inv: () => never;
|
|
53
|
-
export declare function checkResult(r: unknown): ScannerResultV2;
|
|
54
|
-
export declare function inputIdentity(value: unknown): InputIdentity;
|
|
55
|
-
export declare function extractItems(input: BatchSarifInputV2): {
|
|
56
|
-
items: readonly unknown[];
|
|
57
|
-
repoRoot?: string;
|
|
58
|
-
selRoot?: string;
|
|
59
|
-
limits?: SarifV2Limits;
|
|
60
|
-
};
|
|
61
|
-
export declare function safePath(v: unknown): v is string;
|
|
62
|
-
export declare function safeUri(raw: unknown, repoRoot?: string, selRoot?: string): string | undefined;
|
|
63
|
-
export declare function readPos(v: unknown): SourceSpanV2['start'] | undefined;
|
|
64
|
-
export declare function readSpan(source: unknown): SourceSpanV2 | undefined;
|
|
65
|
-
export declare function subjectKey(s: SubjectV2): string;
|
|
66
|
-
export declare function subjectSpan(subj: SubjectV2): SourceSpanV2 | undefined;
|
|
67
|
-
export declare function physical(uri: string, s: SourceSpanV2): Record<string, unknown>;
|
|
68
|
-
export declare function freeze<T>(v: T, seen?: WeakSet<object>): T;
|
|
69
|
-
export declare function sameId(a: BatchId, b: BatchId): boolean;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { ScannerResultV2 } from '@hub/contracts/scanner-v2-result';
|
|
2
|
-
export type SarifLog = Readonly<{
|
|
3
|
-
version: '2.1.0';
|
|
4
|
-
$schema: string;
|
|
5
|
-
runs: readonly SarifRun[];
|
|
6
|
-
}>;
|
|
7
|
-
export type SarifRun = Readonly<{
|
|
8
|
-
tool: {
|
|
9
|
-
driver: Record<string, unknown>;
|
|
10
|
-
};
|
|
11
|
-
results: readonly Record<string, unknown>[];
|
|
12
|
-
invocations: readonly Record<string, unknown>[];
|
|
13
|
-
taxonomies?: readonly Record<string, unknown>[];
|
|
14
|
-
}>;
|
|
15
|
-
export type SarifV2Limits = Readonly<{
|
|
16
|
-
maxRules?: number;
|
|
17
|
-
maxResults?: number;
|
|
18
|
-
maxNotifications?: number;
|
|
19
|
-
maxTaxonomies?: number;
|
|
20
|
-
maxTaxa?: number;
|
|
21
|
-
maxTags?: number;
|
|
22
|
-
maxFlows?: number;
|
|
23
|
-
maxTraceSteps?: number;
|
|
24
|
-
}>;
|
|
25
|
-
export type BatchSarifEnvelopeV2 = Readonly<{
|
|
26
|
-
items?: readonly unknown[];
|
|
27
|
-
results?: readonly unknown[];
|
|
28
|
-
input?: Readonly<{
|
|
29
|
-
label: string;
|
|
30
|
-
uri?: string;
|
|
31
|
-
}>;
|
|
32
|
-
result?: ScannerResultV2;
|
|
33
|
-
repositoryRoot?: string;
|
|
34
|
-
selectionRoot?: string;
|
|
35
|
-
limits?: SarifV2Limits;
|
|
36
|
-
}>;
|
|
37
|
-
export type BatchSarifInputV2 = BatchSarifEnvelopeV2 | readonly unknown[];
|
|
38
|
-
export declare function buildBatchSarifV2(input: BatchSarifInputV2): SarifLog;
|
|
39
|
-
export declare function buildSarifV2(input: BatchSarifInputV2): SarifLog;
|
|
40
|
-
export declare function serializeSarifV2(input: BatchSarifInputV2): string;
|
package/dist/v2/worker-host.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type WorkerHostStatus = 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'TIMEOUT';
|
|
2
|
-
export type WorkerHostRun<T> = Readonly<{
|
|
3
|
-
status: 'COMPLETED';
|
|
4
|
-
value: T;
|
|
5
|
-
} | {
|
|
6
|
-
status: Exclude<WorkerHostStatus, 'COMPLETED'>;
|
|
7
|
-
}>;
|
|
8
|
-
export type SigintSource = Readonly<{
|
|
9
|
-
on: (event: 'SIGINT', listener: () => void) => unknown;
|
|
10
|
-
off?: (event: 'SIGINT', listener: () => void) => unknown;
|
|
11
|
-
removeListener?: (event: 'SIGINT', listener: () => void) => unknown;
|
|
12
|
-
}>;
|
|
13
|
-
export type SigintController = Readonly<{
|
|
14
|
-
signal: AbortSignal;
|
|
15
|
-
dispose: () => void;
|
|
16
|
-
}>;
|
|
17
|
-
export type WorkerHostOptions = Readonly<{
|
|
18
|
-
signal?: AbortSignal;
|
|
19
|
-
sigint?: SigintSource;
|
|
20
|
-
timeoutMs?: number;
|
|
21
|
-
now?: () => number;
|
|
22
|
-
}>;
|
|
23
|
-
export declare function createSigintController(source?: SigintSource): SigintController;
|
|
24
|
-
export declare function runHostedScan<T>(task: () => T | PromiseLike<T>, options?: WorkerHostOptions): Promise<WorkerHostRun<T>>;
|