ccqa 1.40.8 → 1.42.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.
- package/dist/bin/ccqa.mjs +714 -315
- package/dist/hub-client/index.d.mts +37 -0
- package/dist/hub-client/index.mjs +48 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -547,6 +547,26 @@ declare const SpendLogResponseSchema: z.ZodObject<{
|
|
|
547
547
|
}, z.core.$strip>>;
|
|
548
548
|
}, z.core.$strip>;
|
|
549
549
|
type SpendLogResponse = z.infer<typeof SpendLogResponseSchema>;
|
|
550
|
+
declare const CoverageEdgesDocSchema: z.ZodObject<{
|
|
551
|
+
specs: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
552
|
+
files: z.ZodArray<z.ZodString>;
|
|
553
|
+
measuredAt: z.ZodNumber;
|
|
554
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
555
|
+
}, z.core.$strip>>;
|
|
556
|
+
}, z.core.$strip>;
|
|
557
|
+
type CoverageEdgesDoc = z.infer<typeof CoverageEdgesDocSchema>;
|
|
558
|
+
/**
|
|
559
|
+
* Body of `PUT /projects/:project/coverage-edges` — the specs one run
|
|
560
|
+
* measured. Merged into the stored document, never replacing other specs'
|
|
561
|
+
* entries; an empty file set is not a measurement and is rejected per entry.
|
|
562
|
+
*/
|
|
563
|
+
declare const CoverageEdgesUpsertSchema: z.ZodObject<{
|
|
564
|
+
specs: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
565
|
+
files: z.ZodArray<z.ZodString>;
|
|
566
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
567
|
+
}, z.core.$strip>>;
|
|
568
|
+
}, z.core.$strip>;
|
|
569
|
+
type CoverageEdgesUpsert = z.infer<typeof CoverageEdgesUpsertSchema>;
|
|
550
570
|
//#endregion
|
|
551
571
|
//#region src/coverage/resolve-stream.d.ts
|
|
552
572
|
/**
|
|
@@ -1159,6 +1179,23 @@ interface HubClient {
|
|
|
1159
1179
|
getCoverage(project: string, q?: {
|
|
1160
1180
|
runId?: string;
|
|
1161
1181
|
}): Promise<HubCoverageAnswer>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Merge one run's measured reach into the project's coverage-edge ledger
|
|
1184
|
+
* (ADR-0026). The hub stamps `measuredAt` with its own clock.
|
|
1185
|
+
*/
|
|
1186
|
+
putCoverageEdges(project: string, upsert: CoverageEdgesUpsert): Promise<void>;
|
|
1187
|
+
/** The coverage-edge ledger, or `null` when nothing is stored (or the hub predates it). */
|
|
1188
|
+
getCoverageEdges(project: string): Promise<CoverageEdgesDoc | null>;
|
|
1189
|
+
/**
|
|
1190
|
+
* Source maps for what a commit deployed, addressed by the asset path the
|
|
1191
|
+
* browser requests. Coverage falls back to these when the build keeps its
|
|
1192
|
+
* maps out of the CDN, which is the usual choice — a map hands out source.
|
|
1193
|
+
*/
|
|
1194
|
+
putSourceMap(project: string, commit: string, assetPath: string, map: Uint8Array): Promise<void>;
|
|
1195
|
+
getSourceMap(project: string, commit: string, assetPath: string): Promise<string | null>;
|
|
1196
|
+
listSourceMaps(project: string, commit: string): Promise<string[]>;
|
|
1197
|
+
/** Ends a push, letting the hub drop the commits it no longer keeps. */
|
|
1198
|
+
sweepSourceMaps(project: string): Promise<void>;
|
|
1162
1199
|
getTriage(id: string): Promise<RunTriage>;
|
|
1163
1200
|
putActualCause(id: string, c: {
|
|
1164
1201
|
feature: string;
|
|
@@ -153,6 +153,43 @@ function createHubClient(opts) {
|
|
|
153
153
|
runId: q.runId
|
|
154
154
|
})}`);
|
|
155
155
|
},
|
|
156
|
+
putCoverageEdges(project, upsert) {
|
|
157
|
+
return request(`/api/v1/projects/${encodeURIComponent(project)}/coverage-edges`, {
|
|
158
|
+
method: "PUT",
|
|
159
|
+
headers: { "Content-Type": "application/json" },
|
|
160
|
+
body: JSON.stringify(upsert)
|
|
161
|
+
}).then(() => void 0);
|
|
162
|
+
},
|
|
163
|
+
async getCoverageEdges(project) {
|
|
164
|
+
try {
|
|
165
|
+
return await json(`/api/v1/projects/${encodeURIComponent(project)}/coverage-edges`);
|
|
166
|
+
} catch (err) {
|
|
167
|
+
if (err instanceof HubApiError && err.status === 404) return null;
|
|
168
|
+
throw err;
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
putSourceMap(project, commit, assetPath, map) {
|
|
172
|
+
return request(`${sourceMapPath(project, commit)}/${encodeAssetPath(assetPath)}`, {
|
|
173
|
+
method: "PUT",
|
|
174
|
+
headers: { "Content-Type": "application/json" },
|
|
175
|
+
body: toBodyInit(map)
|
|
176
|
+
}).then(() => void 0);
|
|
177
|
+
},
|
|
178
|
+
async getSourceMap(project, commit, assetPath) {
|
|
179
|
+
try {
|
|
180
|
+
return await text(`${sourceMapPath(project, commit)}/${encodeAssetPath(assetPath)}`);
|
|
181
|
+
} catch (err) {
|
|
182
|
+
if (err instanceof HubApiError && err.status === 404) return null;
|
|
183
|
+
throw err;
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
sweepSourceMaps(project) {
|
|
187
|
+
return noBody(`/api/v1/projects/${encodeURIComponent(project)}/sourcemaps/sweep`, "POST");
|
|
188
|
+
},
|
|
189
|
+
async listSourceMaps(project, commit) {
|
|
190
|
+
const { paths } = await json(sourceMapPath(project, commit));
|
|
191
|
+
return paths;
|
|
192
|
+
},
|
|
156
193
|
getTriage(id) {
|
|
157
194
|
return json(`/api/v1/runs/${encodeURIComponent(id)}/triage`);
|
|
158
195
|
},
|
|
@@ -366,6 +403,17 @@ function auditDismissalsPath(project) {
|
|
|
366
403
|
function perspectivesPath(project) {
|
|
367
404
|
return `/api/v1/projects/${encodeURIComponent(project)}/perspectives`;
|
|
368
405
|
}
|
|
406
|
+
/** `/api/v1/projects/<project>/sourcemaps/<commit>` — the scope a push and a read share. */
|
|
407
|
+
function sourceMapPath(project, commit) {
|
|
408
|
+
return `/api/v1/projects/${encodeURIComponent(project)}/sourcemaps/${encodeURIComponent(commit)}`;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Asset paths keep their separators — the route matches the rest of the URL as
|
|
412
|
+
* one wildcard segment — so only the parts between them are escaped.
|
|
413
|
+
*/
|
|
414
|
+
function encodeAssetPath(assetPath) {
|
|
415
|
+
return assetPath.split("/").map(encodeURIComponent).join("/");
|
|
416
|
+
}
|
|
369
417
|
function queryString(params) {
|
|
370
418
|
const out = new URLSearchParams();
|
|
371
419
|
for (const [key, value] of Object.entries(params)) if (value !== void 0) out.set(key, String(value));
|
package/dist/package.json
CHANGED