driftdetect-native 0.9.31
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/drift-native.darwin-arm64.node +0 -0
- package/index.d.ts +675 -0
- package/index.js +337 -0
- package/package.json +61 -0
|
Binary file
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,675 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/* auto-generated by NAPI-RS */
|
|
5
|
+
|
|
6
|
+
/** Scan result exposed to JavaScript */
|
|
7
|
+
export interface JsScanResult {
|
|
8
|
+
root: string
|
|
9
|
+
files: Array<JsFileInfo>
|
|
10
|
+
stats: JsScanStats
|
|
11
|
+
errors: Array<string>
|
|
12
|
+
}
|
|
13
|
+
/** File info exposed to JavaScript */
|
|
14
|
+
export interface JsFileInfo {
|
|
15
|
+
path: string
|
|
16
|
+
size: number
|
|
17
|
+
hash?: string
|
|
18
|
+
language?: string
|
|
19
|
+
}
|
|
20
|
+
/** Scan stats exposed to JavaScript */
|
|
21
|
+
export interface JsScanStats {
|
|
22
|
+
totalFiles: number
|
|
23
|
+
totalBytes: number
|
|
24
|
+
dirsSkipped: number
|
|
25
|
+
filesSkipped: number
|
|
26
|
+
durationMs: number
|
|
27
|
+
}
|
|
28
|
+
/** Scan configuration from JavaScript */
|
|
29
|
+
export interface JsScanConfig {
|
|
30
|
+
root: string
|
|
31
|
+
patterns: Array<string>
|
|
32
|
+
extraIgnores?: Array<string>
|
|
33
|
+
computeHashes?: boolean
|
|
34
|
+
maxFileSize?: number
|
|
35
|
+
threads?: number
|
|
36
|
+
}
|
|
37
|
+
/** Parse result exposed to JavaScript */
|
|
38
|
+
export interface JsParseResult {
|
|
39
|
+
language: string
|
|
40
|
+
functions: Array<JsFunctionInfo>
|
|
41
|
+
classes: Array<JsClassInfo>
|
|
42
|
+
imports: Array<JsImportInfo>
|
|
43
|
+
exports: Array<JsExportInfo>
|
|
44
|
+
calls: Array<JsCallSite>
|
|
45
|
+
errors: Array<JsParseError>
|
|
46
|
+
parseTimeUs: number
|
|
47
|
+
}
|
|
48
|
+
/** Function info exposed to JavaScript */
|
|
49
|
+
export interface JsFunctionInfo {
|
|
50
|
+
name: string
|
|
51
|
+
qualifiedName?: string
|
|
52
|
+
isExported: boolean
|
|
53
|
+
isAsync: boolean
|
|
54
|
+
startLine: number
|
|
55
|
+
endLine: number
|
|
56
|
+
decorators: Array<string>
|
|
57
|
+
}
|
|
58
|
+
/** Class info exposed to JavaScript */
|
|
59
|
+
export interface JsClassInfo {
|
|
60
|
+
name: string
|
|
61
|
+
extends?: string
|
|
62
|
+
implements: Array<string>
|
|
63
|
+
isExported: boolean
|
|
64
|
+
startLine: number
|
|
65
|
+
endLine: number
|
|
66
|
+
}
|
|
67
|
+
/** Import info exposed to JavaScript */
|
|
68
|
+
export interface JsImportInfo {
|
|
69
|
+
source: string
|
|
70
|
+
named: Array<string>
|
|
71
|
+
default?: string
|
|
72
|
+
namespace?: string
|
|
73
|
+
isTypeOnly: boolean
|
|
74
|
+
line: number
|
|
75
|
+
}
|
|
76
|
+
/** Export info exposed to JavaScript */
|
|
77
|
+
export interface JsExportInfo {
|
|
78
|
+
name: string
|
|
79
|
+
fromSource?: string
|
|
80
|
+
isDefault: boolean
|
|
81
|
+
line: number
|
|
82
|
+
}
|
|
83
|
+
/** Call site exposed to JavaScript */
|
|
84
|
+
export interface JsCallSite {
|
|
85
|
+
callee: string
|
|
86
|
+
receiver?: string
|
|
87
|
+
argCount: number
|
|
88
|
+
line: number
|
|
89
|
+
}
|
|
90
|
+
/** Parse error exposed to JavaScript */
|
|
91
|
+
export interface JsParseError {
|
|
92
|
+
message: string
|
|
93
|
+
line: number
|
|
94
|
+
}
|
|
95
|
+
/** Scan a directory for source files */
|
|
96
|
+
export declare function scan(config: JsScanConfig): JsScanResult
|
|
97
|
+
/** Parse source code and extract functions, classes, imports, exports, and calls */
|
|
98
|
+
export declare function parse(source: string, filePath: string): JsParseResult | null
|
|
99
|
+
/** Get list of supported languages */
|
|
100
|
+
export declare function supportedLanguages(): Array<string>
|
|
101
|
+
/** Get the version of drift-core */
|
|
102
|
+
export declare function version(): string
|
|
103
|
+
/** Call graph build result exposed to JavaScript */
|
|
104
|
+
export interface JsBuildResult {
|
|
105
|
+
filesProcessed: number
|
|
106
|
+
totalFunctions: number
|
|
107
|
+
totalCalls: number
|
|
108
|
+
resolvedCalls: number
|
|
109
|
+
resolutionRate: number
|
|
110
|
+
entryPoints: number
|
|
111
|
+
dataAccessors: number
|
|
112
|
+
errors: Array<string>
|
|
113
|
+
durationMs: number
|
|
114
|
+
}
|
|
115
|
+
/** Call graph build configuration from JavaScript */
|
|
116
|
+
export interface JsBuildConfig {
|
|
117
|
+
root: string
|
|
118
|
+
patterns: Array<string>
|
|
119
|
+
resolutionBatchSize?: number
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Build call graph for a project using SQLite storage (recommended)
|
|
123
|
+
*
|
|
124
|
+
* This uses parallel parsing with rayon and batched SQLite writes
|
|
125
|
+
* for optimal performance on large codebases.
|
|
126
|
+
*/
|
|
127
|
+
export declare function buildCallGraph(config: JsBuildConfig): JsBuildResult
|
|
128
|
+
/**
|
|
129
|
+
* Build call graph using legacy JSON shard storage
|
|
130
|
+
*
|
|
131
|
+
* This is the original implementation, kept for backward compatibility.
|
|
132
|
+
* Use build_call_graph() for better performance.
|
|
133
|
+
*/
|
|
134
|
+
export declare function buildCallGraphLegacy(config: JsBuildConfig): JsBuildResult
|
|
135
|
+
/** Data access point exposed to JavaScript */
|
|
136
|
+
export interface JsDataAccessPoint {
|
|
137
|
+
table: string
|
|
138
|
+
operation: string
|
|
139
|
+
fields: Array<string>
|
|
140
|
+
file: string
|
|
141
|
+
line: number
|
|
142
|
+
confidence: number
|
|
143
|
+
framework?: string
|
|
144
|
+
}
|
|
145
|
+
/** Sensitive field exposed to JavaScript */
|
|
146
|
+
export interface JsSensitiveField {
|
|
147
|
+
field: string
|
|
148
|
+
table?: string
|
|
149
|
+
sensitivityType: string
|
|
150
|
+
file: string
|
|
151
|
+
line: number
|
|
152
|
+
confidence: number
|
|
153
|
+
}
|
|
154
|
+
/** ORM model exposed to JavaScript */
|
|
155
|
+
export interface JsOrmModel {
|
|
156
|
+
name: string
|
|
157
|
+
tableName: string
|
|
158
|
+
fields: Array<string>
|
|
159
|
+
file: string
|
|
160
|
+
line: number
|
|
161
|
+
framework: string
|
|
162
|
+
confidence: number
|
|
163
|
+
}
|
|
164
|
+
/** Boundary scan result exposed to JavaScript */
|
|
165
|
+
export interface JsBoundaryScanResult {
|
|
166
|
+
accessPoints: Array<JsDataAccessPoint>
|
|
167
|
+
sensitiveFields: Array<JsSensitiveField>
|
|
168
|
+
models: Array<JsOrmModel>
|
|
169
|
+
filesScanned: number
|
|
170
|
+
durationMs: number
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Scan files for data boundaries (data access points and sensitive fields)
|
|
174
|
+
* Uses AST-first approach with regex fallbacks for SQL strings
|
|
175
|
+
*/
|
|
176
|
+
export declare function scanBoundaries(files: Array<string>): JsBoundaryScanResult
|
|
177
|
+
/** Scan a single source string for boundaries using AST-first approach */
|
|
178
|
+
export declare function scanBoundariesSource(source: string, filePath: string): JsBoundaryScanResult
|
|
179
|
+
/** Module metrics exposed to JavaScript */
|
|
180
|
+
export interface JsModuleMetrics {
|
|
181
|
+
path: string
|
|
182
|
+
ca: number
|
|
183
|
+
ce: number
|
|
184
|
+
instability: number
|
|
185
|
+
abstractness: number
|
|
186
|
+
distance: number
|
|
187
|
+
files: Array<string>
|
|
188
|
+
}
|
|
189
|
+
/** Dependency cycle exposed to JavaScript */
|
|
190
|
+
export interface JsDependencyCycle {
|
|
191
|
+
modules: Array<string>
|
|
192
|
+
severity: string
|
|
193
|
+
filesAffected: number
|
|
194
|
+
}
|
|
195
|
+
/** Coupling hotspot exposed to JavaScript */
|
|
196
|
+
export interface JsCouplingHotspot {
|
|
197
|
+
module: string
|
|
198
|
+
totalCoupling: number
|
|
199
|
+
incoming: Array<string>
|
|
200
|
+
outgoing: Array<string>
|
|
201
|
+
}
|
|
202
|
+
/** Unused export exposed to JavaScript */
|
|
203
|
+
export interface JsUnusedExport {
|
|
204
|
+
name: string
|
|
205
|
+
file: string
|
|
206
|
+
line: number
|
|
207
|
+
exportType: string
|
|
208
|
+
}
|
|
209
|
+
/** Coupling analysis result exposed to JavaScript */
|
|
210
|
+
export interface JsCouplingResult {
|
|
211
|
+
modules: Array<JsModuleMetrics>
|
|
212
|
+
cycles: Array<JsDependencyCycle>
|
|
213
|
+
hotspots: Array<JsCouplingHotspot>
|
|
214
|
+
unusedExports: Array<JsUnusedExport>
|
|
215
|
+
healthScore: number
|
|
216
|
+
filesAnalyzed: number
|
|
217
|
+
durationMs: number
|
|
218
|
+
}
|
|
219
|
+
/** Analyze module coupling using AST-first approach */
|
|
220
|
+
export declare function analyzeCoupling(files: Array<string>): JsCouplingResult
|
|
221
|
+
/** Test file exposed to JavaScript */
|
|
222
|
+
export interface JsTestFile {
|
|
223
|
+
path: string
|
|
224
|
+
testsFile?: string
|
|
225
|
+
framework: string
|
|
226
|
+
testCount: number
|
|
227
|
+
mockCount: number
|
|
228
|
+
}
|
|
229
|
+
/** Test coverage exposed to JavaScript */
|
|
230
|
+
export interface JsTestCoverage {
|
|
231
|
+
sourceFile: string
|
|
232
|
+
testFiles: Array<string>
|
|
233
|
+
coveragePercent?: number
|
|
234
|
+
riskLevel: string
|
|
235
|
+
}
|
|
236
|
+
/** Test topology result exposed to JavaScript */
|
|
237
|
+
export interface JsTestTopologyResult {
|
|
238
|
+
testFiles: Array<JsTestFile>
|
|
239
|
+
coverage: Array<JsTestCoverage>
|
|
240
|
+
uncoveredFiles: Array<string>
|
|
241
|
+
totalTests: number
|
|
242
|
+
skippedTests: number
|
|
243
|
+
filesAnalyzed: number
|
|
244
|
+
durationMs: number
|
|
245
|
+
}
|
|
246
|
+
/** Analyze test topology using AST-first approach */
|
|
247
|
+
export declare function analyzeTestTopology(files: Array<string>): JsTestTopologyResult
|
|
248
|
+
/** Error boundary exposed to JavaScript */
|
|
249
|
+
export interface JsErrorBoundary {
|
|
250
|
+
file: string
|
|
251
|
+
startLine: number
|
|
252
|
+
endLine: number
|
|
253
|
+
boundaryType: string
|
|
254
|
+
caughtTypes: Array<string>
|
|
255
|
+
rethrows: boolean
|
|
256
|
+
logsError: boolean
|
|
257
|
+
isSwallowed: boolean
|
|
258
|
+
}
|
|
259
|
+
/** Error gap exposed to JavaScript */
|
|
260
|
+
export interface JsErrorGap {
|
|
261
|
+
file: string
|
|
262
|
+
line: number
|
|
263
|
+
function: string
|
|
264
|
+
gapType: string
|
|
265
|
+
severity: string
|
|
266
|
+
description: string
|
|
267
|
+
}
|
|
268
|
+
/** Error type exposed to JavaScript */
|
|
269
|
+
export interface JsErrorType {
|
|
270
|
+
name: string
|
|
271
|
+
file: string
|
|
272
|
+
line: number
|
|
273
|
+
extends?: string
|
|
274
|
+
isExported: boolean
|
|
275
|
+
}
|
|
276
|
+
/** Error handling result exposed to JavaScript */
|
|
277
|
+
export interface JsErrorHandlingResult {
|
|
278
|
+
boundaries: Array<JsErrorBoundary>
|
|
279
|
+
gaps: Array<JsErrorGap>
|
|
280
|
+
errorTypes: Array<JsErrorType>
|
|
281
|
+
filesAnalyzed: number
|
|
282
|
+
durationMs: number
|
|
283
|
+
}
|
|
284
|
+
/** Analyze error handling using AST-first approach */
|
|
285
|
+
export declare function analyzeErrorHandling(files: Array<string>): JsErrorHandlingResult
|
|
286
|
+
/** Code location exposed to JavaScript */
|
|
287
|
+
export interface JsCodeLocation {
|
|
288
|
+
file: string
|
|
289
|
+
line: number
|
|
290
|
+
column?: number
|
|
291
|
+
functionId?: string
|
|
292
|
+
}
|
|
293
|
+
/** Call path node exposed to JavaScript */
|
|
294
|
+
export interface JsCallPathNode {
|
|
295
|
+
functionId: string
|
|
296
|
+
functionName: string
|
|
297
|
+
file: string
|
|
298
|
+
line: number
|
|
299
|
+
}
|
|
300
|
+
/** Reachable data access exposed to JavaScript */
|
|
301
|
+
export interface JsReachableDataAccess {
|
|
302
|
+
table: string
|
|
303
|
+
operation: string
|
|
304
|
+
fields: Array<string>
|
|
305
|
+
file: string
|
|
306
|
+
line: number
|
|
307
|
+
confidence: number
|
|
308
|
+
framework?: string
|
|
309
|
+
path: Array<JsCallPathNode>
|
|
310
|
+
depth: number
|
|
311
|
+
}
|
|
312
|
+
/** Sensitive field access exposed to JavaScript */
|
|
313
|
+
export interface JsSensitiveFieldAccess {
|
|
314
|
+
field: string
|
|
315
|
+
table?: string
|
|
316
|
+
sensitivityType: string
|
|
317
|
+
file: string
|
|
318
|
+
line: number
|
|
319
|
+
confidence: number
|
|
320
|
+
paths: Array<Array<JsCallPathNode>>
|
|
321
|
+
accessCount: number
|
|
322
|
+
}
|
|
323
|
+
/** Reachability result exposed to JavaScript */
|
|
324
|
+
export interface JsReachabilityResult {
|
|
325
|
+
origin: JsCodeLocation
|
|
326
|
+
reachableAccess: Array<JsReachableDataAccess>
|
|
327
|
+
tables: Array<string>
|
|
328
|
+
sensitiveFields: Array<JsSensitiveFieldAccess>
|
|
329
|
+
maxDepth: number
|
|
330
|
+
functionsTraversed: number
|
|
331
|
+
}
|
|
332
|
+
/** Reachability options from JavaScript */
|
|
333
|
+
export interface JsReachabilityOptions {
|
|
334
|
+
maxDepth?: number
|
|
335
|
+
sensitiveOnly?: boolean
|
|
336
|
+
tables?: Array<string>
|
|
337
|
+
includeUnresolved?: boolean
|
|
338
|
+
}
|
|
339
|
+
/** Inverse access path exposed to JavaScript */
|
|
340
|
+
export interface JsInverseAccessPath {
|
|
341
|
+
entryPoint: string
|
|
342
|
+
path: Array<JsCallPathNode>
|
|
343
|
+
accessTable: string
|
|
344
|
+
accessOperation: string
|
|
345
|
+
accessFields: Array<string>
|
|
346
|
+
accessFile: string
|
|
347
|
+
accessLine: number
|
|
348
|
+
}
|
|
349
|
+
/** Inverse reachability result exposed to JavaScript */
|
|
350
|
+
export interface JsInverseReachabilityResult {
|
|
351
|
+
targetTable: string
|
|
352
|
+
targetField?: string
|
|
353
|
+
accessPaths: Array<JsInverseAccessPath>
|
|
354
|
+
entryPoints: Array<string>
|
|
355
|
+
totalAccessors: number
|
|
356
|
+
}
|
|
357
|
+
/** Call graph function node from JavaScript */
|
|
358
|
+
export interface JsCallGraphFunction {
|
|
359
|
+
id: string
|
|
360
|
+
name: string
|
|
361
|
+
qualifiedName: string
|
|
362
|
+
file: string
|
|
363
|
+
startLine: number
|
|
364
|
+
endLine: number
|
|
365
|
+
calls: Array<JsCallGraphCallSite>
|
|
366
|
+
dataAccess: Array<JsCallGraphDataAccess>
|
|
367
|
+
isEntryPoint: boolean
|
|
368
|
+
}
|
|
369
|
+
/** Call site for call graph from JavaScript */
|
|
370
|
+
export interface JsCallGraphCallSite {
|
|
371
|
+
calleeName: string
|
|
372
|
+
resolved: boolean
|
|
373
|
+
resolvedCandidates: Array<string>
|
|
374
|
+
line: number
|
|
375
|
+
}
|
|
376
|
+
/** Data access for call graph from JavaScript */
|
|
377
|
+
export interface JsCallGraphDataAccess {
|
|
378
|
+
table: string
|
|
379
|
+
operation: string
|
|
380
|
+
fields: Array<string>
|
|
381
|
+
file: string
|
|
382
|
+
line: number
|
|
383
|
+
confidence: number
|
|
384
|
+
framework?: string
|
|
385
|
+
}
|
|
386
|
+
/** Call graph input from JavaScript */
|
|
387
|
+
export interface JsCallGraphInput {
|
|
388
|
+
functions: Array<JsCallGraphFunction>
|
|
389
|
+
entryPoints: Array<string>
|
|
390
|
+
dataAccessors: Array<string>
|
|
391
|
+
}
|
|
392
|
+
/** Analyze reachability from a function */
|
|
393
|
+
export declare function analyzeReachability(graphInput: JsCallGraphInput, functionId: string, options: JsReachabilityOptions): JsReachabilityResult
|
|
394
|
+
/** Analyze inverse reachability - who can access this data? */
|
|
395
|
+
export declare function analyzeInverseReachability(graphInput: JsCallGraphInput, table: string, field?: string | undefined | null, maxDepth?: number | undefined | null): JsInverseReachabilityResult
|
|
396
|
+
/**
|
|
397
|
+
* Analyze reachability from a function using SQLite storage
|
|
398
|
+
*
|
|
399
|
+
* This queries the SQLite call graph database directly, avoiding the need
|
|
400
|
+
* to load the entire call graph into memory. Recommended for large codebases.
|
|
401
|
+
*
|
|
402
|
+
* Requires: Call graph must be built first using build_call_graph()
|
|
403
|
+
*/
|
|
404
|
+
export declare function analyzeReachabilitySqlite(rootDir: string, functionId: string, options: JsReachabilityOptions): JsReachabilityResult
|
|
405
|
+
/**
|
|
406
|
+
* Analyze inverse reachability using SQLite storage - who can access this data?
|
|
407
|
+
*
|
|
408
|
+
* This queries the SQLite call graph database directly, avoiding the need
|
|
409
|
+
* to load the entire call graph into memory. Recommended for large codebases.
|
|
410
|
+
*
|
|
411
|
+
* Requires: Call graph must be built first using build_call_graph()
|
|
412
|
+
*/
|
|
413
|
+
export declare function analyzeInverseReachabilitySqlite(rootDir: string, table: string, field?: string | undefined | null, maxDepth?: number | undefined | null): JsInverseReachabilityResult
|
|
414
|
+
/** Check if SQLite call graph database exists and has data */
|
|
415
|
+
export declare function isCallGraphAvailable(rootDir: string): boolean
|
|
416
|
+
/** Call graph stats from SQLite database */
|
|
417
|
+
export interface JsCallGraphStats {
|
|
418
|
+
totalFunctions: number
|
|
419
|
+
totalCalls: number
|
|
420
|
+
resolvedCalls: number
|
|
421
|
+
entryPoints: number
|
|
422
|
+
dataAccessors: number
|
|
423
|
+
}
|
|
424
|
+
/** Get call graph statistics from SQLite database */
|
|
425
|
+
export declare function getCallGraphStats(rootDir: string): JsCallGraphStats
|
|
426
|
+
/** Entry point info from SQLite database */
|
|
427
|
+
export interface JsEntryPointInfo {
|
|
428
|
+
id: string
|
|
429
|
+
name: string
|
|
430
|
+
file: string
|
|
431
|
+
line: number
|
|
432
|
+
}
|
|
433
|
+
/** Get all entry points from SQLite call graph */
|
|
434
|
+
export declare function getCallGraphEntryPoints(rootDir: string): Array<JsEntryPointInfo>
|
|
435
|
+
/** Data accessor info from SQLite database */
|
|
436
|
+
export interface JsDataAccessorInfo {
|
|
437
|
+
id: string
|
|
438
|
+
name: string
|
|
439
|
+
file: string
|
|
440
|
+
line: number
|
|
441
|
+
tables: Array<string>
|
|
442
|
+
}
|
|
443
|
+
/** Get all data accessors from SQLite call graph */
|
|
444
|
+
export declare function getCallGraphDataAccessors(rootDir: string): Array<JsDataAccessorInfo>
|
|
445
|
+
/** Detected pattern exposed to JavaScript */
|
|
446
|
+
export interface JsDetectedPattern {
|
|
447
|
+
category: string
|
|
448
|
+
patternType: string
|
|
449
|
+
subcategory?: string
|
|
450
|
+
file: string
|
|
451
|
+
line: number
|
|
452
|
+
column: number
|
|
453
|
+
endLine: number
|
|
454
|
+
endColumn: number
|
|
455
|
+
matchedText: string
|
|
456
|
+
confidence: number
|
|
457
|
+
detectionMethod: string
|
|
458
|
+
}
|
|
459
|
+
/** File patterns exposed to JavaScript */
|
|
460
|
+
export interface JsFilePatterns {
|
|
461
|
+
file: string
|
|
462
|
+
language: string
|
|
463
|
+
patterns: Array<JsDetectedPattern>
|
|
464
|
+
parseTimeUs: number
|
|
465
|
+
detectTimeUs: number
|
|
466
|
+
}
|
|
467
|
+
/** Resolution stats exposed to JavaScript */
|
|
468
|
+
export interface JsResolutionStats {
|
|
469
|
+
totalCalls: number
|
|
470
|
+
resolvedCalls: number
|
|
471
|
+
resolutionRate: number
|
|
472
|
+
sameFileResolutions: number
|
|
473
|
+
crossFileResolutions: number
|
|
474
|
+
unresolvedCalls: number
|
|
475
|
+
}
|
|
476
|
+
/** Call graph summary exposed to JavaScript */
|
|
477
|
+
export interface JsCallGraphSummary {
|
|
478
|
+
totalFunctions: number
|
|
479
|
+
entryPoints: number
|
|
480
|
+
dataAccessors: number
|
|
481
|
+
maxCallDepth: number
|
|
482
|
+
}
|
|
483
|
+
/** Analysis metrics exposed to JavaScript */
|
|
484
|
+
export interface JsAnalysisMetrics {
|
|
485
|
+
filesProcessed: number
|
|
486
|
+
totalLines: number
|
|
487
|
+
parseTimeMs: number
|
|
488
|
+
detectTimeMs: number
|
|
489
|
+
resolveTimeMs: number
|
|
490
|
+
totalTimeMs: number
|
|
491
|
+
}
|
|
492
|
+
/** Unified analysis result exposed to JavaScript */
|
|
493
|
+
export interface JsUnifiedResult {
|
|
494
|
+
filePatterns: Array<JsFilePatterns>
|
|
495
|
+
resolution: JsResolutionStats
|
|
496
|
+
callGraph: JsCallGraphSummary
|
|
497
|
+
metrics: JsAnalysisMetrics
|
|
498
|
+
totalPatterns: number
|
|
499
|
+
totalViolations: number
|
|
500
|
+
}
|
|
501
|
+
/** Unified analysis options from JavaScript */
|
|
502
|
+
export interface JsUnifiedOptions {
|
|
503
|
+
patterns: Array<string>
|
|
504
|
+
categories?: Array<string>
|
|
505
|
+
maxResolutionDepth?: number
|
|
506
|
+
parallel?: boolean
|
|
507
|
+
threads?: number
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Analyze a codebase with unified pattern detection and resolution
|
|
511
|
+
*
|
|
512
|
+
* This is the main entry point for AST-first pattern detection.
|
|
513
|
+
* Combines pattern detection and call resolution in a single pass.
|
|
514
|
+
*/
|
|
515
|
+
export declare function analyzeUnified(root: string, options: JsUnifiedOptions): JsUnifiedResult
|
|
516
|
+
/** Constant info exposed to JavaScript */
|
|
517
|
+
export interface JsConstantInfo {
|
|
518
|
+
name: string
|
|
519
|
+
value: string
|
|
520
|
+
valueType: string
|
|
521
|
+
category: string
|
|
522
|
+
file: string
|
|
523
|
+
line: number
|
|
524
|
+
isExported: boolean
|
|
525
|
+
language: string
|
|
526
|
+
declarationType: string
|
|
527
|
+
}
|
|
528
|
+
/** Secret candidate exposed to JavaScript */
|
|
529
|
+
export interface JsSecretCandidate {
|
|
530
|
+
name: string
|
|
531
|
+
maskedValue: string
|
|
532
|
+
secretType: string
|
|
533
|
+
severity: string
|
|
534
|
+
file: string
|
|
535
|
+
line: number
|
|
536
|
+
confidence: number
|
|
537
|
+
reason: string
|
|
538
|
+
}
|
|
539
|
+
/** Magic number exposed to JavaScript */
|
|
540
|
+
export interface JsMagicNumber {
|
|
541
|
+
value: number
|
|
542
|
+
file: string
|
|
543
|
+
line: number
|
|
544
|
+
context: string
|
|
545
|
+
suggestedName?: string
|
|
546
|
+
}
|
|
547
|
+
/** Value location exposed to JavaScript */
|
|
548
|
+
export interface JsValueLocation {
|
|
549
|
+
value: string
|
|
550
|
+
file: string
|
|
551
|
+
line: number
|
|
552
|
+
}
|
|
553
|
+
/** Value inconsistency exposed to JavaScript */
|
|
554
|
+
export interface JsValueInconsistency {
|
|
555
|
+
namePattern: string
|
|
556
|
+
values: Array<JsValueLocation>
|
|
557
|
+
severity: string
|
|
558
|
+
}
|
|
559
|
+
/** Constants stats exposed to JavaScript */
|
|
560
|
+
export interface JsConstantsStats {
|
|
561
|
+
totalConstants: number
|
|
562
|
+
byCategory: Array<JsCategoryCount>
|
|
563
|
+
byLanguage: Array<JsLanguageCount>
|
|
564
|
+
exportedCount: number
|
|
565
|
+
secretsCount: number
|
|
566
|
+
magicNumbersCount: number
|
|
567
|
+
filesAnalyzed: number
|
|
568
|
+
durationMs: number
|
|
569
|
+
}
|
|
570
|
+
export interface JsCategoryCount {
|
|
571
|
+
category: string
|
|
572
|
+
count: number
|
|
573
|
+
}
|
|
574
|
+
/** Constants analysis result exposed to JavaScript */
|
|
575
|
+
export interface JsConstantsResult {
|
|
576
|
+
constants: Array<JsConstantInfo>
|
|
577
|
+
secrets: Array<JsSecretCandidate>
|
|
578
|
+
magicNumbers: Array<JsMagicNumber>
|
|
579
|
+
inconsistencies: Array<JsValueInconsistency>
|
|
580
|
+
stats: JsConstantsStats
|
|
581
|
+
}
|
|
582
|
+
/** Analyze files for constants, secrets, and magic numbers */
|
|
583
|
+
export declare function analyzeConstants(files: Array<string>): JsConstantsResult
|
|
584
|
+
/** Env access exposed to JavaScript */
|
|
585
|
+
export interface JsEnvAccess {
|
|
586
|
+
name: string
|
|
587
|
+
file: string
|
|
588
|
+
line: number
|
|
589
|
+
hasDefault: boolean
|
|
590
|
+
defaultValue?: string
|
|
591
|
+
accessMethod: string
|
|
592
|
+
language: string
|
|
593
|
+
}
|
|
594
|
+
/** Env variable exposed to JavaScript */
|
|
595
|
+
export interface JsEnvVariable {
|
|
596
|
+
name: string
|
|
597
|
+
sensitivity: string
|
|
598
|
+
accesses: Array<JsEnvAccessLocation>
|
|
599
|
+
isRequired: boolean
|
|
600
|
+
defaultValues: Array<string>
|
|
601
|
+
accessCount: number
|
|
602
|
+
}
|
|
603
|
+
/** Env access location exposed to JavaScript */
|
|
604
|
+
export interface JsEnvAccessLocation {
|
|
605
|
+
file: string
|
|
606
|
+
line: number
|
|
607
|
+
hasDefault: boolean
|
|
608
|
+
}
|
|
609
|
+
/** Environment stats exposed to JavaScript */
|
|
610
|
+
export interface JsEnvironmentStats {
|
|
611
|
+
totalAccesses: number
|
|
612
|
+
uniqueVariables: number
|
|
613
|
+
requiredCount: number
|
|
614
|
+
secretsCount: number
|
|
615
|
+
credentialsCount: number
|
|
616
|
+
configCount: number
|
|
617
|
+
byLanguage: Array<JsLanguageCount>
|
|
618
|
+
filesAnalyzed: number
|
|
619
|
+
durationMs: number
|
|
620
|
+
}
|
|
621
|
+
export interface JsLanguageCount {
|
|
622
|
+
language: string
|
|
623
|
+
count: number
|
|
624
|
+
}
|
|
625
|
+
/** Environment analysis result exposed to JavaScript */
|
|
626
|
+
export interface JsEnvironmentResult {
|
|
627
|
+
accesses: Array<JsEnvAccess>
|
|
628
|
+
variables: Array<JsEnvVariable>
|
|
629
|
+
required: Array<JsEnvVariable>
|
|
630
|
+
secrets: Array<JsEnvVariable>
|
|
631
|
+
stats: JsEnvironmentStats
|
|
632
|
+
}
|
|
633
|
+
/** Analyze files for environment variable usage */
|
|
634
|
+
export declare function analyzeEnvironment(files: Array<string>): JsEnvironmentResult
|
|
635
|
+
/** Wrapper info exposed to JavaScript */
|
|
636
|
+
export interface JsWrapperInfo {
|
|
637
|
+
name: string
|
|
638
|
+
file: string
|
|
639
|
+
line: number
|
|
640
|
+
wraps: Array<string>
|
|
641
|
+
category: string
|
|
642
|
+
isExported: boolean
|
|
643
|
+
usageCount: number
|
|
644
|
+
confidence: number
|
|
645
|
+
}
|
|
646
|
+
/** Wrapper cluster exposed to JavaScript */
|
|
647
|
+
export interface JsWrapperCluster {
|
|
648
|
+
id: string
|
|
649
|
+
category: string
|
|
650
|
+
wrappedPrimitive: string
|
|
651
|
+
wrappers: Array<JsWrapperInfo>
|
|
652
|
+
confidence: number
|
|
653
|
+
totalUsage: number
|
|
654
|
+
}
|
|
655
|
+
/** Wrappers stats exposed to JavaScript */
|
|
656
|
+
export interface JsWrappersStats {
|
|
657
|
+
totalWrappers: number
|
|
658
|
+
clusterCount: number
|
|
659
|
+
byCategory: Array<JsCategoryCount>
|
|
660
|
+
topPrimitives: Array<JsPrimitiveCount>
|
|
661
|
+
filesAnalyzed: number
|
|
662
|
+
durationMs: number
|
|
663
|
+
}
|
|
664
|
+
export interface JsPrimitiveCount {
|
|
665
|
+
primitive: string
|
|
666
|
+
count: number
|
|
667
|
+
}
|
|
668
|
+
/** Wrappers analysis result exposed to JavaScript */
|
|
669
|
+
export interface JsWrappersResult {
|
|
670
|
+
wrappers: Array<JsWrapperInfo>
|
|
671
|
+
clusters: Array<JsWrapperCluster>
|
|
672
|
+
stats: JsWrappersStats
|
|
673
|
+
}
|
|
674
|
+
/** Analyze files for wrapper patterns */
|
|
675
|
+
export declare function analyzeWrappers(files: Array<string>): JsWrappersResult
|
package/index.js
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/* prettier-ignore */
|
|
4
|
+
|
|
5
|
+
/* auto-generated by NAPI-RS */
|
|
6
|
+
|
|
7
|
+
const { existsSync, readFileSync } = require('fs')
|
|
8
|
+
const { join } = require('path')
|
|
9
|
+
|
|
10
|
+
const { platform, arch } = process
|
|
11
|
+
|
|
12
|
+
let nativeBinding = null
|
|
13
|
+
let localFileExisted = false
|
|
14
|
+
let loadError = null
|
|
15
|
+
|
|
16
|
+
function isMusl() {
|
|
17
|
+
// For Node 10
|
|
18
|
+
if (!process.report || typeof process.report.getReport !== 'function') {
|
|
19
|
+
try {
|
|
20
|
+
const lddPath = require('child_process').execSync('which ldd').toString().trim()
|
|
21
|
+
return readFileSync(lddPath, 'utf8').includes('musl')
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return true
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
const { glibcVersionRuntime } = process.report.getReport().header
|
|
27
|
+
return !glibcVersionRuntime
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
switch (platform) {
|
|
32
|
+
case 'android':
|
|
33
|
+
switch (arch) {
|
|
34
|
+
case 'arm64':
|
|
35
|
+
localFileExisted = existsSync(join(__dirname, 'drift-native.android-arm64.node'))
|
|
36
|
+
try {
|
|
37
|
+
if (localFileExisted) {
|
|
38
|
+
nativeBinding = require('./drift-native.android-arm64.node')
|
|
39
|
+
} else {
|
|
40
|
+
nativeBinding = require('driftdetect-native-android-arm64')
|
|
41
|
+
}
|
|
42
|
+
} catch (e) {
|
|
43
|
+
loadError = e
|
|
44
|
+
}
|
|
45
|
+
break
|
|
46
|
+
case 'arm':
|
|
47
|
+
localFileExisted = existsSync(join(__dirname, 'drift-native.android-arm-eabi.node'))
|
|
48
|
+
try {
|
|
49
|
+
if (localFileExisted) {
|
|
50
|
+
nativeBinding = require('./drift-native.android-arm-eabi.node')
|
|
51
|
+
} else {
|
|
52
|
+
nativeBinding = require('driftdetect-native-android-arm-eabi')
|
|
53
|
+
}
|
|
54
|
+
} catch (e) {
|
|
55
|
+
loadError = e
|
|
56
|
+
}
|
|
57
|
+
break
|
|
58
|
+
default:
|
|
59
|
+
throw new Error(`Unsupported architecture on Android ${arch}`)
|
|
60
|
+
}
|
|
61
|
+
break
|
|
62
|
+
case 'win32':
|
|
63
|
+
switch (arch) {
|
|
64
|
+
case 'x64':
|
|
65
|
+
localFileExisted = existsSync(
|
|
66
|
+
join(__dirname, 'drift-native.win32-x64-msvc.node')
|
|
67
|
+
)
|
|
68
|
+
try {
|
|
69
|
+
if (localFileExisted) {
|
|
70
|
+
nativeBinding = require('./drift-native.win32-x64-msvc.node')
|
|
71
|
+
} else {
|
|
72
|
+
nativeBinding = require('driftdetect-native-win32-x64-msvc')
|
|
73
|
+
}
|
|
74
|
+
} catch (e) {
|
|
75
|
+
loadError = e
|
|
76
|
+
}
|
|
77
|
+
break
|
|
78
|
+
case 'ia32':
|
|
79
|
+
localFileExisted = existsSync(
|
|
80
|
+
join(__dirname, 'drift-native.win32-ia32-msvc.node')
|
|
81
|
+
)
|
|
82
|
+
try {
|
|
83
|
+
if (localFileExisted) {
|
|
84
|
+
nativeBinding = require('./drift-native.win32-ia32-msvc.node')
|
|
85
|
+
} else {
|
|
86
|
+
nativeBinding = require('driftdetect-native-win32-ia32-msvc')
|
|
87
|
+
}
|
|
88
|
+
} catch (e) {
|
|
89
|
+
loadError = e
|
|
90
|
+
}
|
|
91
|
+
break
|
|
92
|
+
case 'arm64':
|
|
93
|
+
localFileExisted = existsSync(
|
|
94
|
+
join(__dirname, 'drift-native.win32-arm64-msvc.node')
|
|
95
|
+
)
|
|
96
|
+
try {
|
|
97
|
+
if (localFileExisted) {
|
|
98
|
+
nativeBinding = require('./drift-native.win32-arm64-msvc.node')
|
|
99
|
+
} else {
|
|
100
|
+
nativeBinding = require('driftdetect-native-win32-arm64-msvc')
|
|
101
|
+
}
|
|
102
|
+
} catch (e) {
|
|
103
|
+
loadError = e
|
|
104
|
+
}
|
|
105
|
+
break
|
|
106
|
+
default:
|
|
107
|
+
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
|
108
|
+
}
|
|
109
|
+
break
|
|
110
|
+
case 'darwin':
|
|
111
|
+
localFileExisted = existsSync(join(__dirname, 'drift-native.darwin-universal.node'))
|
|
112
|
+
try {
|
|
113
|
+
if (localFileExisted) {
|
|
114
|
+
nativeBinding = require('./drift-native.darwin-universal.node')
|
|
115
|
+
} else {
|
|
116
|
+
nativeBinding = require('driftdetect-native-darwin-universal')
|
|
117
|
+
}
|
|
118
|
+
break
|
|
119
|
+
} catch {}
|
|
120
|
+
switch (arch) {
|
|
121
|
+
case 'x64':
|
|
122
|
+
localFileExisted = existsSync(join(__dirname, 'drift-native.darwin-x64.node'))
|
|
123
|
+
try {
|
|
124
|
+
if (localFileExisted) {
|
|
125
|
+
nativeBinding = require('./drift-native.darwin-x64.node')
|
|
126
|
+
} else {
|
|
127
|
+
nativeBinding = require('driftdetect-native-darwin-x64')
|
|
128
|
+
}
|
|
129
|
+
} catch (e) {
|
|
130
|
+
loadError = e
|
|
131
|
+
}
|
|
132
|
+
break
|
|
133
|
+
case 'arm64':
|
|
134
|
+
localFileExisted = existsSync(
|
|
135
|
+
join(__dirname, 'drift-native.darwin-arm64.node')
|
|
136
|
+
)
|
|
137
|
+
try {
|
|
138
|
+
if (localFileExisted) {
|
|
139
|
+
nativeBinding = require('./drift-native.darwin-arm64.node')
|
|
140
|
+
} else {
|
|
141
|
+
nativeBinding = require('driftdetect-native-darwin-arm64')
|
|
142
|
+
}
|
|
143
|
+
} catch (e) {
|
|
144
|
+
loadError = e
|
|
145
|
+
}
|
|
146
|
+
break
|
|
147
|
+
default:
|
|
148
|
+
throw new Error(`Unsupported architecture on macOS: ${arch}`)
|
|
149
|
+
}
|
|
150
|
+
break
|
|
151
|
+
case 'freebsd':
|
|
152
|
+
if (arch !== 'x64') {
|
|
153
|
+
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
|
|
154
|
+
}
|
|
155
|
+
localFileExisted = existsSync(join(__dirname, 'drift-native.freebsd-x64.node'))
|
|
156
|
+
try {
|
|
157
|
+
if (localFileExisted) {
|
|
158
|
+
nativeBinding = require('./drift-native.freebsd-x64.node')
|
|
159
|
+
} else {
|
|
160
|
+
nativeBinding = require('driftdetect-native-freebsd-x64')
|
|
161
|
+
}
|
|
162
|
+
} catch (e) {
|
|
163
|
+
loadError = e
|
|
164
|
+
}
|
|
165
|
+
break
|
|
166
|
+
case 'linux':
|
|
167
|
+
switch (arch) {
|
|
168
|
+
case 'x64':
|
|
169
|
+
if (isMusl()) {
|
|
170
|
+
localFileExisted = existsSync(
|
|
171
|
+
join(__dirname, 'drift-native.linux-x64-musl.node')
|
|
172
|
+
)
|
|
173
|
+
try {
|
|
174
|
+
if (localFileExisted) {
|
|
175
|
+
nativeBinding = require('./drift-native.linux-x64-musl.node')
|
|
176
|
+
} else {
|
|
177
|
+
nativeBinding = require('driftdetect-native-linux-x64-musl')
|
|
178
|
+
}
|
|
179
|
+
} catch (e) {
|
|
180
|
+
loadError = e
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
localFileExisted = existsSync(
|
|
184
|
+
join(__dirname, 'drift-native.linux-x64-gnu.node')
|
|
185
|
+
)
|
|
186
|
+
try {
|
|
187
|
+
if (localFileExisted) {
|
|
188
|
+
nativeBinding = require('./drift-native.linux-x64-gnu.node')
|
|
189
|
+
} else {
|
|
190
|
+
nativeBinding = require('driftdetect-native-linux-x64-gnu')
|
|
191
|
+
}
|
|
192
|
+
} catch (e) {
|
|
193
|
+
loadError = e
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
break
|
|
197
|
+
case 'arm64':
|
|
198
|
+
if (isMusl()) {
|
|
199
|
+
localFileExisted = existsSync(
|
|
200
|
+
join(__dirname, 'drift-native.linux-arm64-musl.node')
|
|
201
|
+
)
|
|
202
|
+
try {
|
|
203
|
+
if (localFileExisted) {
|
|
204
|
+
nativeBinding = require('./drift-native.linux-arm64-musl.node')
|
|
205
|
+
} else {
|
|
206
|
+
nativeBinding = require('driftdetect-native-linux-arm64-musl')
|
|
207
|
+
}
|
|
208
|
+
} catch (e) {
|
|
209
|
+
loadError = e
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
localFileExisted = existsSync(
|
|
213
|
+
join(__dirname, 'drift-native.linux-arm64-gnu.node')
|
|
214
|
+
)
|
|
215
|
+
try {
|
|
216
|
+
if (localFileExisted) {
|
|
217
|
+
nativeBinding = require('./drift-native.linux-arm64-gnu.node')
|
|
218
|
+
} else {
|
|
219
|
+
nativeBinding = require('driftdetect-native-linux-arm64-gnu')
|
|
220
|
+
}
|
|
221
|
+
} catch (e) {
|
|
222
|
+
loadError = e
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
break
|
|
226
|
+
case 'arm':
|
|
227
|
+
if (isMusl()) {
|
|
228
|
+
localFileExisted = existsSync(
|
|
229
|
+
join(__dirname, 'drift-native.linux-arm-musleabihf.node')
|
|
230
|
+
)
|
|
231
|
+
try {
|
|
232
|
+
if (localFileExisted) {
|
|
233
|
+
nativeBinding = require('./drift-native.linux-arm-musleabihf.node')
|
|
234
|
+
} else {
|
|
235
|
+
nativeBinding = require('driftdetect-native-linux-arm-musleabihf')
|
|
236
|
+
}
|
|
237
|
+
} catch (e) {
|
|
238
|
+
loadError = e
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
localFileExisted = existsSync(
|
|
242
|
+
join(__dirname, 'drift-native.linux-arm-gnueabihf.node')
|
|
243
|
+
)
|
|
244
|
+
try {
|
|
245
|
+
if (localFileExisted) {
|
|
246
|
+
nativeBinding = require('./drift-native.linux-arm-gnueabihf.node')
|
|
247
|
+
} else {
|
|
248
|
+
nativeBinding = require('driftdetect-native-linux-arm-gnueabihf')
|
|
249
|
+
}
|
|
250
|
+
} catch (e) {
|
|
251
|
+
loadError = e
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
break
|
|
255
|
+
case 'riscv64':
|
|
256
|
+
if (isMusl()) {
|
|
257
|
+
localFileExisted = existsSync(
|
|
258
|
+
join(__dirname, 'drift-native.linux-riscv64-musl.node')
|
|
259
|
+
)
|
|
260
|
+
try {
|
|
261
|
+
if (localFileExisted) {
|
|
262
|
+
nativeBinding = require('./drift-native.linux-riscv64-musl.node')
|
|
263
|
+
} else {
|
|
264
|
+
nativeBinding = require('driftdetect-native-linux-riscv64-musl')
|
|
265
|
+
}
|
|
266
|
+
} catch (e) {
|
|
267
|
+
loadError = e
|
|
268
|
+
}
|
|
269
|
+
} else {
|
|
270
|
+
localFileExisted = existsSync(
|
|
271
|
+
join(__dirname, 'drift-native.linux-riscv64-gnu.node')
|
|
272
|
+
)
|
|
273
|
+
try {
|
|
274
|
+
if (localFileExisted) {
|
|
275
|
+
nativeBinding = require('./drift-native.linux-riscv64-gnu.node')
|
|
276
|
+
} else {
|
|
277
|
+
nativeBinding = require('driftdetect-native-linux-riscv64-gnu')
|
|
278
|
+
}
|
|
279
|
+
} catch (e) {
|
|
280
|
+
loadError = e
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
break
|
|
284
|
+
case 's390x':
|
|
285
|
+
localFileExisted = existsSync(
|
|
286
|
+
join(__dirname, 'drift-native.linux-s390x-gnu.node')
|
|
287
|
+
)
|
|
288
|
+
try {
|
|
289
|
+
if (localFileExisted) {
|
|
290
|
+
nativeBinding = require('./drift-native.linux-s390x-gnu.node')
|
|
291
|
+
} else {
|
|
292
|
+
nativeBinding = require('driftdetect-native-linux-s390x-gnu')
|
|
293
|
+
}
|
|
294
|
+
} catch (e) {
|
|
295
|
+
loadError = e
|
|
296
|
+
}
|
|
297
|
+
break
|
|
298
|
+
default:
|
|
299
|
+
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
|
300
|
+
}
|
|
301
|
+
break
|
|
302
|
+
default:
|
|
303
|
+
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (!nativeBinding) {
|
|
307
|
+
if (loadError) {
|
|
308
|
+
throw loadError
|
|
309
|
+
}
|
|
310
|
+
throw new Error(`Failed to load native binding`)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const { scan, parse, supportedLanguages, version, buildCallGraph, buildCallGraphLegacy, scanBoundaries, scanBoundariesSource, analyzeCoupling, analyzeTestTopology, analyzeErrorHandling, analyzeReachability, analyzeInverseReachability, analyzeReachabilitySqlite, analyzeInverseReachabilitySqlite, isCallGraphAvailable, getCallGraphStats, getCallGraphEntryPoints, getCallGraphDataAccessors, analyzeUnified, analyzeConstants, analyzeEnvironment, analyzeWrappers } = nativeBinding
|
|
314
|
+
|
|
315
|
+
module.exports.scan = scan
|
|
316
|
+
module.exports.parse = parse
|
|
317
|
+
module.exports.supportedLanguages = supportedLanguages
|
|
318
|
+
module.exports.version = version
|
|
319
|
+
module.exports.buildCallGraph = buildCallGraph
|
|
320
|
+
module.exports.buildCallGraphLegacy = buildCallGraphLegacy
|
|
321
|
+
module.exports.scanBoundaries = scanBoundaries
|
|
322
|
+
module.exports.scanBoundariesSource = scanBoundariesSource
|
|
323
|
+
module.exports.analyzeCoupling = analyzeCoupling
|
|
324
|
+
module.exports.analyzeTestTopology = analyzeTestTopology
|
|
325
|
+
module.exports.analyzeErrorHandling = analyzeErrorHandling
|
|
326
|
+
module.exports.analyzeReachability = analyzeReachability
|
|
327
|
+
module.exports.analyzeInverseReachability = analyzeInverseReachability
|
|
328
|
+
module.exports.analyzeReachabilitySqlite = analyzeReachabilitySqlite
|
|
329
|
+
module.exports.analyzeInverseReachabilitySqlite = analyzeInverseReachabilitySqlite
|
|
330
|
+
module.exports.isCallGraphAvailable = isCallGraphAvailable
|
|
331
|
+
module.exports.getCallGraphStats = getCallGraphStats
|
|
332
|
+
module.exports.getCallGraphEntryPoints = getCallGraphEntryPoints
|
|
333
|
+
module.exports.getCallGraphDataAccessors = getCallGraphDataAccessors
|
|
334
|
+
module.exports.analyzeUnified = analyzeUnified
|
|
335
|
+
module.exports.analyzeConstants = analyzeConstants
|
|
336
|
+
module.exports.analyzeEnvironment = analyzeEnvironment
|
|
337
|
+
module.exports.analyzeWrappers = analyzeWrappers
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "driftdetect-native",
|
|
3
|
+
"version": "0.9.31",
|
|
4
|
+
"description": "Native Rust core for Drift - high-performance code analysis",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"napi": {
|
|
8
|
+
"name": "drift-native",
|
|
9
|
+
"triples": {
|
|
10
|
+
"defaults": true,
|
|
11
|
+
"additional": [
|
|
12
|
+
"aarch64-apple-darwin",
|
|
13
|
+
"aarch64-unknown-linux-gnu",
|
|
14
|
+
"aarch64-unknown-linux-musl",
|
|
15
|
+
"x86_64-unknown-linux-musl"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.js",
|
|
21
|
+
"index.d.ts",
|
|
22
|
+
"*.node"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">= 18"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/AgenDrift/drift.git",
|
|
30
|
+
"directory": "crates/drift-napi"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"drift",
|
|
34
|
+
"code-analysis",
|
|
35
|
+
"ast",
|
|
36
|
+
"parser",
|
|
37
|
+
"call-graph",
|
|
38
|
+
"rust",
|
|
39
|
+
"napi"
|
|
40
|
+
],
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@napi-rs/cli": "^2.18.0"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "napi build --platform --release",
|
|
47
|
+
"build:debug": "napi build --platform",
|
|
48
|
+
"prepublishOnly": "napi prepublish -t npm",
|
|
49
|
+
"artifacts": "napi artifacts",
|
|
50
|
+
"version": "napi version"
|
|
51
|
+
},
|
|
52
|
+
"optionalDependencies": {
|
|
53
|
+
"driftdetect-native-win32-x64-msvc": "0.9.31",
|
|
54
|
+
"driftdetect-native-darwin-x64": "0.9.31",
|
|
55
|
+
"driftdetect-native-linux-x64-gnu": "0.9.31",
|
|
56
|
+
"driftdetect-native-darwin-arm64": "0.9.31",
|
|
57
|
+
"driftdetect-native-linux-arm64-gnu": "0.9.31",
|
|
58
|
+
"driftdetect-native-linux-arm64-musl": "0.9.31",
|
|
59
|
+
"driftdetect-native-linux-x64-musl": "0.9.31"
|
|
60
|
+
}
|
|
61
|
+
}
|