autoremediator 0.2.2 → 0.4.0

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.
@@ -1,2 +1,446 @@
1
+ import http from 'node:http';
2
+ import { remediate, remediateFromScan, planRemediation } from '../index.js';
1
3
 
2
- export { }
4
+ /**
5
+ * autoremediator OpenAPI HTTP server
6
+ *
7
+ * Exposes POST /remediate and POST /remediate-from-scan as a lightweight
8
+ * HTTP server using Node.js built-in http module (no framework dependency).
9
+ *
10
+ * Start: node dist/openapi/server.js [--port 3000]
11
+ */
12
+
13
+ interface OpenApiServerDeps {
14
+ remediateFn: typeof remediate;
15
+ remediateFromScanFn: typeof remediateFromScan;
16
+ planRemediationFn: typeof planRemediation;
17
+ }
18
+ declare function createOpenApiServer(deps?: OpenApiServerDeps): http.Server;
19
+ declare const OPENAPI_SPEC: {
20
+ openapi: string;
21
+ info: {
22
+ title: string;
23
+ version: string;
24
+ description: string;
25
+ };
26
+ paths: {
27
+ "/remediate": {
28
+ post: {
29
+ operationId: string;
30
+ summary: string;
31
+ requestBody: {
32
+ required: boolean;
33
+ content: {
34
+ "application/json": {
35
+ schema: {
36
+ type: string;
37
+ required: string[];
38
+ properties: {
39
+ cveId: {
40
+ type: string;
41
+ description: string;
42
+ pattern: string;
43
+ };
44
+ options: {
45
+ type: string;
46
+ description: string;
47
+ properties: {
48
+ cwd: {
49
+ type: string;
50
+ };
51
+ packageManager: {
52
+ type: string;
53
+ enum: string[];
54
+ };
55
+ dryRun: {
56
+ type: string;
57
+ };
58
+ preview: {
59
+ type: string;
60
+ };
61
+ runTests: {
62
+ type: string;
63
+ };
64
+ llmProvider: {
65
+ type: string;
66
+ enum: string[];
67
+ };
68
+ patchesDir: {
69
+ type: string;
70
+ };
71
+ policy: {
72
+ type: string;
73
+ };
74
+ requestId: {
75
+ type: string;
76
+ };
77
+ sessionId: {
78
+ type: string;
79
+ };
80
+ parentRunId: {
81
+ type: string;
82
+ };
83
+ idempotencyKey: {
84
+ type: string;
85
+ };
86
+ resume: {
87
+ type: string;
88
+ };
89
+ actor: {
90
+ type: string;
91
+ };
92
+ source: {
93
+ type: string;
94
+ enum: string[];
95
+ };
96
+ constraints: {
97
+ type: string;
98
+ properties: {
99
+ directDependenciesOnly: {
100
+ type: string;
101
+ };
102
+ preferVersionBump: {
103
+ type: string;
104
+ };
105
+ };
106
+ };
107
+ };
108
+ };
109
+ };
110
+ };
111
+ };
112
+ };
113
+ };
114
+ responses: {
115
+ "200": {
116
+ description: string;
117
+ content: {
118
+ "application/json": {
119
+ schema: {
120
+ type: string;
121
+ };
122
+ };
123
+ };
124
+ };
125
+ "400": {
126
+ description: string;
127
+ content: {
128
+ "application/json": {
129
+ schema: {
130
+ type: string;
131
+ properties: {
132
+ error: {
133
+ type: string;
134
+ };
135
+ };
136
+ };
137
+ };
138
+ };
139
+ };
140
+ };
141
+ };
142
+ };
143
+ "/plan-remediation": {
144
+ post: {
145
+ operationId: string;
146
+ summary: string;
147
+ requestBody: {
148
+ required: boolean;
149
+ content: {
150
+ "application/json": {
151
+ schema: {
152
+ type: string;
153
+ required: string[];
154
+ properties: {
155
+ cveId: {
156
+ type: string;
157
+ description: string;
158
+ pattern: string;
159
+ };
160
+ options: {
161
+ type: string;
162
+ description: string;
163
+ properties: {
164
+ cwd: {
165
+ type: string;
166
+ };
167
+ packageManager: {
168
+ type: string;
169
+ enum: string[];
170
+ };
171
+ runTests: {
172
+ type: string;
173
+ };
174
+ llmProvider: {
175
+ type: string;
176
+ enum: string[];
177
+ };
178
+ patchesDir: {
179
+ type: string;
180
+ };
181
+ policy: {
182
+ type: string;
183
+ };
184
+ requestId: {
185
+ type: string;
186
+ };
187
+ sessionId: {
188
+ type: string;
189
+ };
190
+ parentRunId: {
191
+ type: string;
192
+ };
193
+ idempotencyKey: {
194
+ type: string;
195
+ };
196
+ resume: {
197
+ type: string;
198
+ };
199
+ actor: {
200
+ type: string;
201
+ };
202
+ source: {
203
+ type: string;
204
+ enum: string[];
205
+ };
206
+ constraints: {
207
+ type: string;
208
+ properties: {
209
+ directDependenciesOnly: {
210
+ type: string;
211
+ };
212
+ preferVersionBump: {
213
+ type: string;
214
+ };
215
+ };
216
+ };
217
+ };
218
+ };
219
+ };
220
+ };
221
+ };
222
+ };
223
+ };
224
+ responses: {
225
+ "200": {
226
+ description: string;
227
+ content: {
228
+ "application/json": {
229
+ schema: {
230
+ type: string;
231
+ };
232
+ };
233
+ };
234
+ };
235
+ "400": {
236
+ description: string;
237
+ content: {
238
+ "application/json": {
239
+ schema: {
240
+ type: string;
241
+ properties: {
242
+ error: {
243
+ type: string;
244
+ };
245
+ };
246
+ };
247
+ };
248
+ };
249
+ };
250
+ };
251
+ };
252
+ };
253
+ "/remediate-from-scan": {
254
+ post: {
255
+ operationId: string;
256
+ summary: string;
257
+ requestBody: {
258
+ required: boolean;
259
+ content: {
260
+ "application/json": {
261
+ schema: {
262
+ type: string;
263
+ required: string[];
264
+ properties: {
265
+ inputPath: {
266
+ type: string;
267
+ description: string;
268
+ };
269
+ options: {
270
+ type: string;
271
+ description: string;
272
+ properties: {
273
+ cwd: {
274
+ type: string;
275
+ };
276
+ packageManager: {
277
+ type: string;
278
+ enum: string[];
279
+ };
280
+ dryRun: {
281
+ type: string;
282
+ };
283
+ preview: {
284
+ type: string;
285
+ };
286
+ runTests: {
287
+ type: string;
288
+ };
289
+ llmProvider: {
290
+ type: string;
291
+ enum: string[];
292
+ };
293
+ format: {
294
+ type: string;
295
+ enum: string[];
296
+ };
297
+ patchesDir: {
298
+ type: string;
299
+ };
300
+ policy: {
301
+ type: string;
302
+ };
303
+ evidence: {
304
+ type: string;
305
+ };
306
+ requestId: {
307
+ type: string;
308
+ };
309
+ sessionId: {
310
+ type: string;
311
+ };
312
+ parentRunId: {
313
+ type: string;
314
+ };
315
+ idempotencyKey: {
316
+ type: string;
317
+ };
318
+ resume: {
319
+ type: string;
320
+ };
321
+ actor: {
322
+ type: string;
323
+ };
324
+ source: {
325
+ type: string;
326
+ enum: string[];
327
+ };
328
+ constraints: {
329
+ type: string;
330
+ properties: {
331
+ directDependenciesOnly: {
332
+ type: string;
333
+ };
334
+ preferVersionBump: {
335
+ type: string;
336
+ };
337
+ };
338
+ };
339
+ };
340
+ };
341
+ };
342
+ };
343
+ };
344
+ };
345
+ };
346
+ responses: {
347
+ "200": {
348
+ description: string;
349
+ content: {
350
+ "application/json": {
351
+ schema: {
352
+ type: string;
353
+ properties: {
354
+ schemaVersion: {
355
+ type: string;
356
+ };
357
+ status: {
358
+ type: string;
359
+ enum: string[];
360
+ };
361
+ generatedAt: {
362
+ type: string;
363
+ };
364
+ cveIds: {
365
+ type: string;
366
+ items: {
367
+ type: string;
368
+ };
369
+ };
370
+ reports: {
371
+ type: string;
372
+ items: {
373
+ type: string;
374
+ };
375
+ };
376
+ successCount: {
377
+ type: string;
378
+ };
379
+ failedCount: {
380
+ type: string;
381
+ };
382
+ errors: {
383
+ type: string;
384
+ items: {
385
+ type: string;
386
+ };
387
+ };
388
+ evidenceFile: {
389
+ type: string;
390
+ };
391
+ patchCount: {
392
+ type: string;
393
+ };
394
+ patchesDir: {
395
+ type: string;
396
+ };
397
+ };
398
+ };
399
+ };
400
+ };
401
+ };
402
+ "400": {
403
+ description: string;
404
+ content: {
405
+ "application/json": {
406
+ schema: {
407
+ type: string;
408
+ properties: {
409
+ error: {
410
+ type: string;
411
+ };
412
+ };
413
+ };
414
+ };
415
+ };
416
+ };
417
+ };
418
+ };
419
+ };
420
+ "/health": {
421
+ get: {
422
+ operationId: string;
423
+ summary: string;
424
+ responses: {
425
+ "200": {
426
+ description: string;
427
+ content: {
428
+ "application/json": {
429
+ schema: {
430
+ type: string;
431
+ properties: {
432
+ status: {
433
+ type: string;
434
+ };
435
+ };
436
+ };
437
+ };
438
+ };
439
+ };
440
+ };
441
+ };
442
+ };
443
+ };
444
+ };
445
+
446
+ export { OPENAPI_SPEC, createOpenApiServer };