@rigour-labs/core 3.0.3 → 3.0.5

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.
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Deprecated APIs Gate
3
+ *
4
+ * Detects usage of deprecated, removed, or insecure stdlib/framework APIs.
5
+ * AI models are trained on historical code and frequently suggest deprecated patterns
6
+ * that introduce security vulnerabilities, performance issues, or will break on upgrade.
7
+ *
8
+ * Categories:
9
+ * 1. Security-deprecated: APIs removed for security reasons (e.g. new Buffer(), md5 for passwords)
10
+ * 2. Removed APIs: Methods that no longer exist in current versions
11
+ * 3. Superseded APIs: Working but replaced by better alternatives
12
+ *
13
+ * Supported languages:
14
+ * JS/TS — Node.js 22.x deprecations, Web API deprecations
15
+ * Python — Python 3.12+ deprecations and removals
16
+ * Go — Deprecated stdlib patterns (ioutil, etc.)
17
+ * C# — Deprecated .NET APIs (WebClient, BinaryFormatter, etc.)
18
+ * Java — Deprecated JDK APIs (Date, Vector, Hashtable, etc.)
19
+ *
20
+ * @since v3.0.0
21
+ * @since v3.0.3 — Go, C#, Java deprecated API detection added
22
+ */
23
+ import { Gate, GateContext } from './base.js';
24
+ import { Failure, Provenance } from '../types/index.js';
25
+ export interface DeprecatedApiUsage {
26
+ file: string;
27
+ line: number;
28
+ api: string;
29
+ reason: string;
30
+ replacement: string;
31
+ category: 'security' | 'removed' | 'superseded';
32
+ }
33
+ export interface DeprecatedApisConfig {
34
+ enabled?: boolean;
35
+ check_node?: boolean;
36
+ check_python?: boolean;
37
+ check_web?: boolean;
38
+ check_go?: boolean;
39
+ check_csharp?: boolean;
40
+ check_java?: boolean;
41
+ block_security_deprecated?: boolean;
42
+ ignore_patterns?: string[];
43
+ }
44
+ export declare class DeprecatedApisGate extends Gate {
45
+ private config;
46
+ constructor(config?: DeprecatedApisConfig);
47
+ protected get provenance(): Provenance;
48
+ run(context: GateContext): Promise<Failure[]>;
49
+ private checkNodeDeprecated;
50
+ private checkWebDeprecated;
51
+ private checkPythonDeprecated;
52
+ private checkGoDeprecated;
53
+ private checkCSharpDeprecated;
54
+ private checkJavaDeprecated;
55
+ }