driftdetect-core 0.1.1 → 0.1.3
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/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/learning/index.d.ts +8 -0
- package/dist/learning/index.d.ts.map +1 -0
- package/dist/learning/index.js +8 -0
- package/dist/learning/index.js.map +1 -0
- package/dist/learning/learning-store.d.ts +63 -0
- package/dist/learning/learning-store.d.ts.map +1 -0
- package/dist/learning/learning-store.js +168 -0
- package/dist/learning/learning-store.js.map +1 -0
- package/dist/learning/types.d.ts +178 -0
- package/dist/learning/types.d.ts.map +1 -0
- package/dist/learning/types.js +28 -0
- package/dist/learning/types.js.map +1 -0
- package/dist/store/contract-store.d.ts +79 -0
- package/dist/store/contract-store.d.ts.map +1 -0
- package/dist/store/contract-store.js +506 -0
- package/dist/store/contract-store.js.map +1 -0
- package/dist/types/contracts.d.ts +280 -0
- package/dist/types/contracts.d.ts.map +1 -0
- package/dist/types/contracts.js +14 -0
- package/dist/types/contracts.js.map +1 -0
- package/package.json +9 -3
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract type definitions
|
|
3
|
+
*
|
|
4
|
+
* Contracts represent the relationship between backend API endpoints
|
|
5
|
+
* and frontend TypeScript types. They enable detection of mismatches
|
|
6
|
+
* between what the backend returns and what the frontend expects.
|
|
7
|
+
*
|
|
8
|
+
* @requirements - Track BE↔FE type mismatches (the "silent failure killer")
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Status of a contract in the system
|
|
12
|
+
*
|
|
13
|
+
* - discovered: Contract found but not yet reviewed
|
|
14
|
+
* - verified: Contract verified as correct
|
|
15
|
+
* - mismatch: Contract has field mismatches
|
|
16
|
+
* - ignored: Contract explicitly ignored by user
|
|
17
|
+
*/
|
|
18
|
+
export type ContractStatus = 'discovered' | 'verified' | 'mismatch' | 'ignored';
|
|
19
|
+
/**
|
|
20
|
+
* A field in an API response or TypeScript type
|
|
21
|
+
*/
|
|
22
|
+
export interface ContractField {
|
|
23
|
+
/** Field name */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Field type (e.g., 'string', 'number', 'boolean', 'object', 'array') */
|
|
26
|
+
type: string;
|
|
27
|
+
/** Whether the field is optional */
|
|
28
|
+
optional: boolean;
|
|
29
|
+
/** Whether the field is nullable */
|
|
30
|
+
nullable: boolean;
|
|
31
|
+
/** Nested fields (for objects) */
|
|
32
|
+
children?: ContractField[];
|
|
33
|
+
/** Array element type (for arrays) */
|
|
34
|
+
arrayType?: string;
|
|
35
|
+
/** Line number where field is defined */
|
|
36
|
+
line?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A mismatch between backend and frontend field definitions
|
|
40
|
+
*/
|
|
41
|
+
export interface FieldMismatch {
|
|
42
|
+
/** Field name/path (e.g., 'user.email' for nested) */
|
|
43
|
+
fieldPath: string;
|
|
44
|
+
/** Type of mismatch */
|
|
45
|
+
mismatchType: 'missing_in_frontend' | 'missing_in_backend' | 'type_mismatch' | 'optionality_mismatch' | 'nullability_mismatch';
|
|
46
|
+
/** Backend field definition (if exists) */
|
|
47
|
+
backendField?: ContractField;
|
|
48
|
+
/** Frontend field definition (if exists) */
|
|
49
|
+
frontendField?: ContractField;
|
|
50
|
+
/** Human-readable description of the mismatch */
|
|
51
|
+
description: string;
|
|
52
|
+
/** Severity of the mismatch */
|
|
53
|
+
severity: 'error' | 'warning' | 'info';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* HTTP methods
|
|
57
|
+
*/
|
|
58
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
59
|
+
/**
|
|
60
|
+
* Backend endpoint definition extracted from source code
|
|
61
|
+
*/
|
|
62
|
+
export interface BackendEndpoint {
|
|
63
|
+
/** HTTP method */
|
|
64
|
+
method: HttpMethod;
|
|
65
|
+
/** Route path (e.g., '/api/users/{id}') */
|
|
66
|
+
path: string;
|
|
67
|
+
/** Normalized path for matching (e.g., '/api/users/:id') */
|
|
68
|
+
normalizedPath: string;
|
|
69
|
+
/** File where endpoint is defined */
|
|
70
|
+
file: string;
|
|
71
|
+
/** Line number of endpoint definition */
|
|
72
|
+
line: number;
|
|
73
|
+
/** Response fields extracted from the endpoint */
|
|
74
|
+
responseFields: ContractField[];
|
|
75
|
+
/** Request body fields (for POST/PUT/PATCH) */
|
|
76
|
+
requestFields?: ContractField[];
|
|
77
|
+
/** Response type name (if using a schema/model) */
|
|
78
|
+
responseTypeName?: string;
|
|
79
|
+
/** Framework detected (e.g., 'fastapi', 'express', 'flask') */
|
|
80
|
+
framework: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Frontend API call definition extracted from source code
|
|
84
|
+
*/
|
|
85
|
+
export interface FrontendApiCall {
|
|
86
|
+
/** HTTP method */
|
|
87
|
+
method: HttpMethod;
|
|
88
|
+
/** Route path (e.g., '/api/users/${id}') */
|
|
89
|
+
path: string;
|
|
90
|
+
/** Normalized path for matching */
|
|
91
|
+
normalizedPath: string;
|
|
92
|
+
/** File where API call is made */
|
|
93
|
+
file: string;
|
|
94
|
+
/** Line number of API call */
|
|
95
|
+
line: number;
|
|
96
|
+
/** TypeScript type used for the response */
|
|
97
|
+
responseType?: string;
|
|
98
|
+
/** Fields expected in the response */
|
|
99
|
+
responseFields: ContractField[];
|
|
100
|
+
/** Request body type */
|
|
101
|
+
requestType?: string;
|
|
102
|
+
/** Request body fields */
|
|
103
|
+
requestFields?: ContractField[];
|
|
104
|
+
/** Library used (e.g., 'fetch', 'axios', 'react-query') */
|
|
105
|
+
library: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Confidence information for a contract
|
|
109
|
+
*/
|
|
110
|
+
export interface ContractConfidence {
|
|
111
|
+
/** Overall confidence score (0.0 to 1.0) */
|
|
112
|
+
score: number;
|
|
113
|
+
/** Confidence level */
|
|
114
|
+
level: 'high' | 'medium' | 'low' | 'uncertain';
|
|
115
|
+
/** How confident we are in the endpoint matching */
|
|
116
|
+
matchConfidence: number;
|
|
117
|
+
/** How confident we are in the field extraction */
|
|
118
|
+
fieldExtractionConfidence: number;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Metadata for a contract
|
|
122
|
+
*/
|
|
123
|
+
export interface ContractMetadata {
|
|
124
|
+
/** ISO timestamp when contract was first detected */
|
|
125
|
+
firstSeen: string;
|
|
126
|
+
/** ISO timestamp when contract was last seen */
|
|
127
|
+
lastSeen: string;
|
|
128
|
+
/** ISO timestamp when contract was verified (if verified) */
|
|
129
|
+
verifiedAt?: string;
|
|
130
|
+
/** User who verified the contract */
|
|
131
|
+
verifiedBy?: string;
|
|
132
|
+
/** Tags for categorization */
|
|
133
|
+
tags?: string[];
|
|
134
|
+
/** Custom metadata */
|
|
135
|
+
custom?: Record<string, unknown>;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* A contract between a backend endpoint and frontend type
|
|
139
|
+
*
|
|
140
|
+
* This is the primary contract type used throughout the system.
|
|
141
|
+
*/
|
|
142
|
+
export interface Contract {
|
|
143
|
+
/** Unique contract identifier */
|
|
144
|
+
id: string;
|
|
145
|
+
/** HTTP method */
|
|
146
|
+
method: HttpMethod;
|
|
147
|
+
/** Normalized endpoint path */
|
|
148
|
+
endpoint: string;
|
|
149
|
+
/** Backend endpoint definition */
|
|
150
|
+
backend: BackendEndpoint;
|
|
151
|
+
/** Frontend API call definitions (may have multiple calls to same endpoint) */
|
|
152
|
+
frontend: FrontendApiCall[];
|
|
153
|
+
/** Field mismatches detected */
|
|
154
|
+
mismatches: FieldMismatch[];
|
|
155
|
+
/** Contract status */
|
|
156
|
+
status: ContractStatus;
|
|
157
|
+
/** Confidence information */
|
|
158
|
+
confidence: ContractConfidence;
|
|
159
|
+
/** Contract metadata */
|
|
160
|
+
metadata: ContractMetadata;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Stored contract format (used in JSON files)
|
|
164
|
+
*/
|
|
165
|
+
export interface StoredContract {
|
|
166
|
+
/** Unique contract ID */
|
|
167
|
+
id: string;
|
|
168
|
+
/** HTTP method */
|
|
169
|
+
method: HttpMethod;
|
|
170
|
+
/** Normalized endpoint path */
|
|
171
|
+
endpoint: string;
|
|
172
|
+
/** Backend endpoint definition */
|
|
173
|
+
backend: BackendEndpoint;
|
|
174
|
+
/** Frontend API call definitions */
|
|
175
|
+
frontend: FrontendApiCall[];
|
|
176
|
+
/** Field mismatches detected */
|
|
177
|
+
mismatches: FieldMismatch[];
|
|
178
|
+
/** Confidence information */
|
|
179
|
+
confidence: ContractConfidence;
|
|
180
|
+
/** Contract metadata */
|
|
181
|
+
metadata: ContractMetadata;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Format of a contract file stored in .drift/contracts/
|
|
185
|
+
*/
|
|
186
|
+
export interface ContractFile {
|
|
187
|
+
/** Schema version */
|
|
188
|
+
version: string;
|
|
189
|
+
/** Contract status this file contains */
|
|
190
|
+
status: ContractStatus;
|
|
191
|
+
/** Contracts in this file */
|
|
192
|
+
contracts: StoredContract[];
|
|
193
|
+
/** ISO timestamp of last update */
|
|
194
|
+
lastUpdated: string;
|
|
195
|
+
/** Checksum for integrity verification */
|
|
196
|
+
checksum?: string;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Current schema version for contract files
|
|
200
|
+
*/
|
|
201
|
+
export declare const CONTRACT_FILE_VERSION = "1.0.0";
|
|
202
|
+
/**
|
|
203
|
+
* Query options for filtering contracts
|
|
204
|
+
*/
|
|
205
|
+
export interface ContractQuery {
|
|
206
|
+
/** Filter by contract IDs */
|
|
207
|
+
ids?: string[];
|
|
208
|
+
/** Filter by status */
|
|
209
|
+
status?: ContractStatus | ContractStatus[];
|
|
210
|
+
/** Filter by HTTP method */
|
|
211
|
+
method?: HttpMethod | HttpMethod[];
|
|
212
|
+
/** Filter by endpoint path (partial match) */
|
|
213
|
+
endpoint?: string;
|
|
214
|
+
/** Filter contracts with mismatches */
|
|
215
|
+
hasMismatches?: boolean;
|
|
216
|
+
/** Filter by minimum mismatch count */
|
|
217
|
+
minMismatches?: number;
|
|
218
|
+
/** Filter by backend file */
|
|
219
|
+
backendFile?: string;
|
|
220
|
+
/** Filter by frontend file */
|
|
221
|
+
frontendFile?: string;
|
|
222
|
+
/** Filter by minimum confidence score */
|
|
223
|
+
minConfidence?: number;
|
|
224
|
+
/** Search in endpoint path */
|
|
225
|
+
search?: string;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Sort options for contract queries
|
|
229
|
+
*/
|
|
230
|
+
export interface ContractSortOptions {
|
|
231
|
+
/** Field to sort by */
|
|
232
|
+
field: 'endpoint' | 'method' | 'mismatchCount' | 'confidence' | 'firstSeen' | 'lastSeen';
|
|
233
|
+
/** Sort direction */
|
|
234
|
+
direction: 'asc' | 'desc';
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Complete query options for contracts
|
|
238
|
+
*/
|
|
239
|
+
export interface ContractQueryOptions {
|
|
240
|
+
/** Filter criteria */
|
|
241
|
+
filter?: ContractQuery;
|
|
242
|
+
/** Sort options */
|
|
243
|
+
sort?: ContractSortOptions;
|
|
244
|
+
/** Pagination */
|
|
245
|
+
pagination?: {
|
|
246
|
+
offset?: number;
|
|
247
|
+
limit?: number;
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Result of a contract query
|
|
252
|
+
*/
|
|
253
|
+
export interface ContractQueryResult {
|
|
254
|
+
/** Matching contracts */
|
|
255
|
+
contracts: Contract[];
|
|
256
|
+
/** Total count (before pagination) */
|
|
257
|
+
total: number;
|
|
258
|
+
/** Whether there are more results */
|
|
259
|
+
hasMore: boolean;
|
|
260
|
+
/** Query execution time in milliseconds */
|
|
261
|
+
executionTime: number;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Statistics about contracts
|
|
265
|
+
*/
|
|
266
|
+
export interface ContractStats {
|
|
267
|
+
/** Total number of contracts */
|
|
268
|
+
totalContracts: number;
|
|
269
|
+
/** Contracts by status */
|
|
270
|
+
byStatus: Record<ContractStatus, number>;
|
|
271
|
+
/** Contracts by HTTP method */
|
|
272
|
+
byMethod: Record<HttpMethod, number>;
|
|
273
|
+
/** Total number of mismatches */
|
|
274
|
+
totalMismatches: number;
|
|
275
|
+
/** Mismatches by type */
|
|
276
|
+
mismatchesByType: Record<FieldMismatch['mismatchType'], number>;
|
|
277
|
+
/** ISO timestamp of last update */
|
|
278
|
+
lastUpdated: string;
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/types/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAMhF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IAEb,oCAAoC;IACpC,QAAQ,EAAE,OAAO,CAAC;IAElB,oCAAoC;IACpC,QAAQ,EAAE,OAAO,CAAC;IAElB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAE3B,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAElB,uBAAuB;IACvB,YAAY,EAAE,qBAAqB,GAAG,oBAAoB,GAAG,eAAe,G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c,CAAC,EAAE,MAAM,CAAC,CAAC;IAEhE,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract type definitions
|
|
3
|
+
*
|
|
4
|
+
* Contracts represent the relationship between backend API endpoints
|
|
5
|
+
* and frontend TypeScript types. They enable detection of mismatches
|
|
6
|
+
* between what the backend returns and what the frontend expects.
|
|
7
|
+
*
|
|
8
|
+
* @requirements - Track BE↔FE type mismatches (the "silent failure killer")
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Current schema version for contract files
|
|
12
|
+
*/
|
|
13
|
+
export const CONTRACT_FILE_VERSION = '1.0.0';
|
|
14
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/types/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAoRH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "driftdetect-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Core pattern detection and analysis engine for Drift",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/
|
|
8
|
+
"url": "https://github.com/dadbodgeoff/drift"
|
|
9
9
|
},
|
|
10
|
-
"keywords": [
|
|
10
|
+
"keywords": [
|
|
11
|
+
"architecture",
|
|
12
|
+
"drift",
|
|
13
|
+
"patterns",
|
|
14
|
+
"code-quality",
|
|
15
|
+
"static-analysis"
|
|
16
|
+
],
|
|
11
17
|
"type": "module",
|
|
12
18
|
"main": "./dist/index.js",
|
|
13
19
|
"types": "./dist/index.d.ts",
|