@qulib/core 0.6.0 → 0.8.2

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.
Files changed (39) hide show
  1. package/dist/__tests__/fixtures/api-fixture-repo/app/api/orders/route.d.ts +7 -0
  2. package/dist/__tests__/fixtures/api-fixture-repo/app/api/orders/route.d.ts.map +1 -0
  3. package/dist/__tests__/fixtures/api-fixture-repo/app/api/orders/route.js +7 -0
  4. package/dist/__tests__/fixtures/api-fixture-repo/app/api/users/route.d.ts +10 -0
  5. package/dist/__tests__/fixtures/api-fixture-repo/app/api/users/route.d.ts.map +1 -0
  6. package/dist/__tests__/fixtures/api-fixture-repo/app/api/users/route.js +9 -0
  7. package/dist/__tests__/fixtures/api-fixture-repo/pages/api/health.d.ts +9 -0
  8. package/dist/__tests__/fixtures/api-fixture-repo/pages/api/health.d.ts.map +1 -0
  9. package/dist/__tests__/fixtures/api-fixture-repo/pages/api/health.js +10 -0
  10. package/dist/adapters/api-adapter.d.ts +26 -0
  11. package/dist/adapters/api-adapter.d.ts.map +1 -1
  12. package/dist/adapters/api-adapter.js +156 -2
  13. package/dist/adapters/cypress-e2e-adapter.d.ts.map +1 -1
  14. package/dist/adapters/cypress-e2e-adapter.js +63 -2
  15. package/dist/adapters/playwright-adapter.d.ts.map +1 -1
  16. package/dist/adapters/playwright-adapter.js +71 -2
  17. package/dist/index.d.ts +6 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +3 -0
  20. package/dist/scaffold-tests.d.ts +34 -0
  21. package/dist/scaffold-tests.d.ts.map +1 -0
  22. package/dist/scaffold-tests.js +113 -0
  23. package/dist/schemas/automation-maturity.schema.d.ts +8 -8
  24. package/dist/schemas/automation-maturity.schema.d.ts.map +1 -1
  25. package/dist/schemas/automation-maturity.schema.js +1 -0
  26. package/dist/schemas/gap-analysis.schema.d.ts +8 -8
  27. package/dist/schemas/gap-analysis.schema.js +1 -1
  28. package/dist/schemas/public-surface.schema.d.ts +5 -5
  29. package/dist/schemas/repo-analysis.schema.d.ts +7 -7
  30. package/dist/tools/repo/api-surface.d.ts +59 -0
  31. package/dist/tools/repo/api-surface.d.ts.map +1 -0
  32. package/dist/tools/repo/api-surface.js +414 -0
  33. package/dist/tools/scoring/api-coverage.d.ts +74 -0
  34. package/dist/tools/scoring/api-coverage.d.ts.map +1 -0
  35. package/dist/tools/scoring/api-coverage.js +158 -0
  36. package/dist/tools/scoring/automation-maturity.d.ts +11 -1
  37. package/dist/tools/scoring/automation-maturity.d.ts.map +1 -1
  38. package/dist/tools/scoring/automation-maturity.js +43 -9
  39. package/package.json +4 -2
@@ -20,7 +20,7 @@ export declare const AutomationMaturityApplicabilitySchema: z.ZodEnum<["applicab
20
20
  * Existing consumers that don't read them keep working; honest reports populate them.
21
21
  */
22
22
  export declare const AutomationMaturityDimensionSchema: z.ZodObject<{
23
- dimension: z.ZodEnum<["test-coverage-breadth", "framework-adoption", "test-id-hygiene", "ci-integration", "auth-test-coverage", "component-test-ratio"]>;
23
+ dimension: z.ZodEnum<["test-coverage-breadth", "framework-adoption", "test-id-hygiene", "ci-integration", "auth-test-coverage", "component-test-ratio", "api-test-coverage"]>;
24
24
  score: z.ZodNumber;
25
25
  weight: z.ZodNumber;
26
26
  evidence: z.ZodArray<z.ZodString, "many">;
@@ -30,7 +30,7 @@ export declare const AutomationMaturityDimensionSchema: z.ZodObject<{
30
30
  guidance: z.ZodOptional<z.ZodString>;
31
31
  }, "strip", z.ZodTypeAny, {
32
32
  recommendations: string[];
33
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
33
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
34
34
  score: number;
35
35
  weight: number;
36
36
  evidence: string[];
@@ -39,7 +39,7 @@ export declare const AutomationMaturityDimensionSchema: z.ZodObject<{
39
39
  guidance?: string | undefined;
40
40
  }, {
41
41
  recommendations: string[];
42
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
42
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
43
43
  score: number;
44
44
  weight: number;
45
45
  evidence: string[];
@@ -54,7 +54,7 @@ export declare const AutomationMaturitySchema: z.ZodObject<{
54
54
  level: z.ZodNumber;
55
55
  label: z.ZodString;
56
56
  dimensions: z.ZodArray<z.ZodObject<{
57
- dimension: z.ZodEnum<["test-coverage-breadth", "framework-adoption", "test-id-hygiene", "ci-integration", "auth-test-coverage", "component-test-ratio"]>;
57
+ dimension: z.ZodEnum<["test-coverage-breadth", "framework-adoption", "test-id-hygiene", "ci-integration", "auth-test-coverage", "component-test-ratio", "api-test-coverage"]>;
58
58
  score: z.ZodNumber;
59
59
  weight: z.ZodNumber;
60
60
  evidence: z.ZodArray<z.ZodString, "many">;
@@ -64,7 +64,7 @@ export declare const AutomationMaturitySchema: z.ZodObject<{
64
64
  guidance: z.ZodOptional<z.ZodString>;
65
65
  }, "strip", z.ZodTypeAny, {
66
66
  recommendations: string[];
67
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
67
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
68
68
  score: number;
69
69
  weight: number;
70
70
  evidence: string[];
@@ -73,7 +73,7 @@ export declare const AutomationMaturitySchema: z.ZodObject<{
73
73
  guidance?: string | undefined;
74
74
  }, {
75
75
  recommendations: string[];
76
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
76
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
77
77
  score: number;
78
78
  weight: number;
79
79
  evidence: string[];
@@ -91,7 +91,7 @@ export declare const AutomationMaturitySchema: z.ZodObject<{
91
91
  overallScore: number;
92
92
  dimensions: {
93
93
  recommendations: string[];
94
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
94
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
95
95
  score: number;
96
96
  weight: number;
97
97
  evidence: string[];
@@ -109,7 +109,7 @@ export declare const AutomationMaturitySchema: z.ZodObject<{
109
109
  overallScore: number;
110
110
  dimensions: {
111
111
  recommendations: string[];
112
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
112
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
113
113
  score: number;
114
114
  weight: number;
115
115
  evidence: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"automation-maturity.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/automation-maturity.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qCAAqC,wDAIhD,CAAC;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB5C,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASnC,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AACpG,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"automation-maturity.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/automation-maturity.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qCAAqC,wDAIhD,CAAC;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB5C,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASnC,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AACpG,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -31,6 +31,7 @@ export const AutomationMaturityDimensionSchema = z.object({
31
31
  'ci-integration',
32
32
  'auth-test-coverage',
33
33
  'component-test-ratio',
34
+ 'api-test-coverage',
34
35
  ]),
35
36
  score: z.number().min(0).max(100),
36
37
  weight: z.number().min(0).max(1),
@@ -4,7 +4,7 @@ export declare const GapSchema: z.ZodObject<{
4
4
  path: z.ZodString;
5
5
  severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
6
6
  reason: z.ZodString;
7
- category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage"]>;
7
+ category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage", "untested-api-endpoint"]>;
8
8
  description: z.ZodOptional<z.ZodString>;
9
9
  recommendation: z.ZodOptional<z.ZodString>;
10
10
  }, "strip", z.ZodTypeAny, {
@@ -12,7 +12,7 @@ export declare const GapSchema: z.ZodObject<{
12
12
  id: string;
13
13
  severity: "critical" | "high" | "medium" | "low";
14
14
  reason: string;
15
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
15
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
16
16
  recommendation?: string | undefined;
17
17
  description?: string | undefined;
18
18
  }, {
@@ -20,7 +20,7 @@ export declare const GapSchema: z.ZodObject<{
20
20
  id: string;
21
21
  severity: "critical" | "high" | "medium" | "low";
22
22
  reason: string;
23
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
23
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
24
24
  recommendation?: string | undefined;
25
25
  description?: string | undefined;
26
26
  }>;
@@ -163,7 +163,7 @@ export declare const GapAnalysisSchema: z.ZodObject<{
163
163
  path: z.ZodString;
164
164
  severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
165
165
  reason: z.ZodString;
166
- category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage"]>;
166
+ category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage", "untested-api-endpoint"]>;
167
167
  description: z.ZodOptional<z.ZodString>;
168
168
  recommendation: z.ZodOptional<z.ZodString>;
169
169
  }, "strip", z.ZodTypeAny, {
@@ -171,7 +171,7 @@ export declare const GapAnalysisSchema: z.ZodObject<{
171
171
  id: string;
172
172
  severity: "critical" | "high" | "medium" | "low";
173
173
  reason: string;
174
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
174
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
175
175
  recommendation?: string | undefined;
176
176
  description?: string | undefined;
177
177
  }, {
@@ -179,7 +179,7 @@ export declare const GapAnalysisSchema: z.ZodObject<{
179
179
  id: string;
180
180
  severity: "critical" | "high" | "medium" | "low";
181
181
  reason: string;
182
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
182
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
183
183
  recommendation?: string | undefined;
184
184
  description?: string | undefined;
185
185
  }>, "many">;
@@ -445,7 +445,7 @@ export declare const GapAnalysisSchema: z.ZodObject<{
445
445
  id: string;
446
446
  severity: "critical" | "high" | "medium" | "low";
447
447
  reason: string;
448
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
448
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
449
449
  recommendation?: string | undefined;
450
450
  description?: string | undefined;
451
451
  }[];
@@ -524,7 +524,7 @@ export declare const GapAnalysisSchema: z.ZodObject<{
524
524
  id: string;
525
525
  severity: "critical" | "high" | "medium" | "low";
526
526
  reason: string;
527
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
527
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
528
528
  recommendation?: string | undefined;
529
529
  description?: string | undefined;
530
530
  }[];
@@ -5,7 +5,7 @@ export const GapSchema = z.object({
5
5
  path: z.string(),
6
6
  severity: z.enum(['critical', 'high', 'medium', 'low']),
7
7
  reason: z.string(),
8
- category: z.enum(['untested-route', 'a11y', 'console-error', 'broken-link', 'auth-surface', 'coverage']),
8
+ category: z.enum(['untested-route', 'a11y', 'console-error', 'broken-link', 'auth-surface', 'coverage', 'untested-api-endpoint']),
9
9
  description: z.string().optional(),
10
10
  recommendation: z.string().optional(),
11
11
  });
@@ -118,7 +118,7 @@ export declare const PublicSurfaceSchema: z.ZodObject<{
118
118
  path: z.ZodString;
119
119
  severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
120
120
  reason: z.ZodString;
121
- category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage"]>;
121
+ category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage", "untested-api-endpoint"]>;
122
122
  description: z.ZodOptional<z.ZodString>;
123
123
  recommendation: z.ZodOptional<z.ZodString>;
124
124
  }, "strip", z.ZodTypeAny, {
@@ -126,7 +126,7 @@ export declare const PublicSurfaceSchema: z.ZodObject<{
126
126
  id: string;
127
127
  severity: "critical" | "high" | "medium" | "low";
128
128
  reason: string;
129
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
129
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
130
130
  recommendation?: string | undefined;
131
131
  description?: string | undefined;
132
132
  }, {
@@ -134,7 +134,7 @@ export declare const PublicSurfaceSchema: z.ZodObject<{
134
134
  id: string;
135
135
  severity: "critical" | "high" | "medium" | "low";
136
136
  reason: string;
137
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
137
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
138
138
  recommendation?: string | undefined;
139
139
  description?: string | undefined;
140
140
  }>, "many">;
@@ -181,7 +181,7 @@ export declare const PublicSurfaceSchema: z.ZodObject<{
181
181
  id: string;
182
182
  severity: "critical" | "high" | "medium" | "low";
183
183
  reason: string;
184
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
184
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
185
185
  recommendation?: string | undefined;
186
186
  description?: string | undefined;
187
187
  }[];
@@ -224,7 +224,7 @@ export declare const PublicSurfaceSchema: z.ZodObject<{
224
224
  id: string;
225
225
  severity: "critical" | "high" | "medium" | "low";
226
226
  reason: string;
227
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
227
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
228
228
  recommendation?: string | undefined;
229
229
  description?: string | undefined;
230
230
  }[];
@@ -156,7 +156,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
156
156
  level: z.ZodNumber;
157
157
  label: z.ZodString;
158
158
  dimensions: z.ZodArray<z.ZodObject<{
159
- dimension: z.ZodEnum<["test-coverage-breadth", "framework-adoption", "test-id-hygiene", "ci-integration", "auth-test-coverage", "component-test-ratio"]>;
159
+ dimension: z.ZodEnum<["test-coverage-breadth", "framework-adoption", "test-id-hygiene", "ci-integration", "auth-test-coverage", "component-test-ratio", "api-test-coverage"]>;
160
160
  score: z.ZodNumber;
161
161
  weight: z.ZodNumber;
162
162
  evidence: z.ZodArray<z.ZodString, "many">;
@@ -166,7 +166,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
166
166
  guidance: z.ZodOptional<z.ZodString>;
167
167
  }, "strip", z.ZodTypeAny, {
168
168
  recommendations: string[];
169
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
169
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
170
170
  score: number;
171
171
  weight: number;
172
172
  evidence: string[];
@@ -175,7 +175,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
175
175
  guidance?: string | undefined;
176
176
  }, {
177
177
  recommendations: string[];
178
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
178
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
179
179
  score: number;
180
180
  weight: number;
181
181
  evidence: string[];
@@ -193,7 +193,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
193
193
  overallScore: number;
194
194
  dimensions: {
195
195
  recommendations: string[];
196
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
196
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
197
197
  score: number;
198
198
  weight: number;
199
199
  evidence: string[];
@@ -211,7 +211,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
211
211
  overallScore: number;
212
212
  dimensions: {
213
213
  recommendations: string[];
214
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
214
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
215
215
  score: number;
216
216
  weight: number;
217
217
  evidence: string[];
@@ -261,7 +261,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
261
261
  overallScore: number;
262
262
  dimensions: {
263
263
  recommendations: string[];
264
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
264
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
265
265
  score: number;
266
266
  weight: number;
267
267
  evidence: string[];
@@ -311,7 +311,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
311
311
  overallScore: number;
312
312
  dimensions: {
313
313
  recommendations: string[];
314
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
314
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
315
315
  score: number;
316
316
  weight: number;
317
317
  evidence: string[];
@@ -0,0 +1,59 @@
1
+ /**
2
+ * @module tools/repo/api-surface
3
+ * @packageBoundary @qulib/core
4
+ *
5
+ * Evidence-only API surface discovery. Three tiers of confidence:
6
+ * Tier1 — OpenAPI / Swagger spec files (YAML or JSON). Only reads `summary` and
7
+ * `parameters` from a real spec; never fabricates endpoints.
8
+ * Tier2 — Framework route files: Next.js App-Router `route.ts` exports,
9
+ * Next.js Pages `pages/api/`, Express router calls from RepoAnalysis.routes,
10
+ * Fastify `fastify.{method}`, Hono `app.{method}`, NestJS decorators.
11
+ * Tier3 — Opt-in heuristics. Currently: tRPC router definition files.
12
+ * Only activated when `options.enableTier3 === true`.
13
+ *
14
+ * Every endpoint carries:
15
+ * sourceFile — repo-relative file path that evidence was read from
16
+ * sourceTier — 'openapi' | 'framework' | 'heuristic'
17
+ * confidence — 'high' | 'medium' | 'low'
18
+ *
19
+ * NEVER invents endpoints or parameters. When a spec file cannot be parsed,
20
+ * or a file pattern does not clearly indicate a route, the file is skipped.
21
+ */
22
+ import type { RepoAnalysis } from '../../schemas/repo-analysis.schema.js';
23
+ export interface DiscoveredEndpoint {
24
+ /** HTTP method inferred from the source — 'unknown' when ambiguous */
25
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'unknown';
26
+ /** Path as extracted from source — may contain framework-specific params like [id] or :id */
27
+ path: string;
28
+ /** Repo-relative file path the evidence was read from */
29
+ sourceFile: string;
30
+ /** Discovery tier */
31
+ sourceTier: 'openapi' | 'framework' | 'heuristic';
32
+ /** Evidence confidence */
33
+ confidence: 'high' | 'medium' | 'low';
34
+ /** Human-readable summary from spec, if available (Tier1 only) */
35
+ summary?: string;
36
+ /** Parameter names extracted from spec (Tier1 only; never fabricated) */
37
+ parameterNames?: string[];
38
+ }
39
+ export interface ApiSurface {
40
+ discoveredAt: string;
41
+ repoPath: string;
42
+ endpoints: DiscoveredEndpoint[];
43
+ /** Number of OpenAPI/Swagger spec files found and successfully parsed */
44
+ openApiSpecsFound: number;
45
+ /** Tier3 heuristics were enabled */
46
+ tier3Enabled: boolean;
47
+ }
48
+ export interface DiscoverApiSurfaceOptions {
49
+ /** Enable Tier3 heuristic discovery (default false — opt-in) */
50
+ enableTier3?: boolean;
51
+ }
52
+ export declare function discoverApiSurface(repoPath: string, options?: DiscoverApiSurfaceOptions): Promise<ApiSurface>;
53
+ /**
54
+ * Variant that also incorporates RepoAnalysis.routes (Express routes already
55
+ * extracted by scanRepo). Use this when you already have a RepoAnalysis to avoid
56
+ * double-reading files.
57
+ */
58
+ export declare function discoverApiSurfaceWithRepo(repoPath: string, repo: RepoAnalysis, options?: DiscoverApiSurfaceOptions): Promise<ApiSurface>;
59
+ //# sourceMappingURL=api-surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-surface.d.ts","sourceRoot":"","sources":["../../../src/tools/repo/api-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAiC1E,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAChE,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,UAAU,EAAE,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;IAClD,0BAA0B;IAC1B,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,yEAAyE;IACzE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oCAAoC;IACpC,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB;IACxC,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAwXD,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,UAAU,CAAC,CAoCrB;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,YAAY,EAClB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,UAAU,CAAC,CAQrB"}