ccqa 1.0.0 → 1.1.1
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/README.md +3 -0
- package/dist/bin/ccqa.mjs +2081 -1490
- package/dist/hub-client/index.d.mts +10 -0
- package/dist/hub-client/index.mjs +25 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -592,6 +592,16 @@ interface HubClient {
|
|
|
592
592
|
getPrompt(project: string, name: PromptName): Promise<string | null>;
|
|
593
593
|
listPrompts(project: string): Promise<HubPromptMeta[]>;
|
|
594
594
|
deletePrompt(project: string, name: PromptName): Promise<void>;
|
|
595
|
+
/** The project's perspectives document (coverage inventory), stored hub-only. */
|
|
596
|
+
putPerspectives(project: string, doc: unknown): Promise<void>;
|
|
597
|
+
getPerspectives(project: string): Promise<unknown | null>;
|
|
598
|
+
/** Set (or clear, with an empty string) the human note on one spec's entry. */
|
|
599
|
+
patchPerspectivesNote(project: string, c: {
|
|
600
|
+
feature: string;
|
|
601
|
+
spec: string;
|
|
602
|
+
note: string;
|
|
603
|
+
}): Promise<void>;
|
|
604
|
+
deletePerspectives(project: string): Promise<void>;
|
|
595
605
|
}
|
|
596
606
|
declare function createHubClient(opts: HubClientOptions): HubClient;
|
|
597
607
|
//#endregion
|
|
@@ -200,6 +200,27 @@ function createHubClient(opts) {
|
|
|
200
200
|
},
|
|
201
201
|
deletePrompt(project, name) {
|
|
202
202
|
return noBody(`${promptsPath(project)}/${encodeURIComponent(name)}`, "DELETE");
|
|
203
|
+
},
|
|
204
|
+
putPerspectives(project, doc) {
|
|
205
|
+
return putJson(perspectivesPath(project), doc);
|
|
206
|
+
},
|
|
207
|
+
patchPerspectivesNote(project, c) {
|
|
208
|
+
return request(perspectivesPath(project), {
|
|
209
|
+
method: "PATCH",
|
|
210
|
+
headers: { "Content-Type": "application/json" },
|
|
211
|
+
body: JSON.stringify(c)
|
|
212
|
+
}).then(() => void 0);
|
|
213
|
+
},
|
|
214
|
+
async getPerspectives(project) {
|
|
215
|
+
try {
|
|
216
|
+
return await json(perspectivesPath(project));
|
|
217
|
+
} catch (err) {
|
|
218
|
+
if (err instanceof HubApiError && err.status === 404) return null;
|
|
219
|
+
throw err;
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
deletePerspectives(project) {
|
|
223
|
+
return noBody(perspectivesPath(project), "DELETE");
|
|
203
224
|
}
|
|
204
225
|
};
|
|
205
226
|
}
|
|
@@ -211,6 +232,10 @@ function scopePath(project, kind, profile) {
|
|
|
211
232
|
function promptsPath(project) {
|
|
212
233
|
return `/api/v1/projects/${encodeURIComponent(project)}/prompts`;
|
|
213
234
|
}
|
|
235
|
+
/** Perspectives are one document per project: `/api/v1/projects/<project>/perspectives`. */
|
|
236
|
+
function perspectivesPath(project) {
|
|
237
|
+
return `/api/v1/projects/${encodeURIComponent(project)}/perspectives`;
|
|
238
|
+
}
|
|
214
239
|
function queryString(params) {
|
|
215
240
|
const out = new URLSearchParams();
|
|
216
241
|
for (const [key, value] of Object.entries(params)) if (value !== void 0) out.set(key, String(value));
|
package/dist/package.json
CHANGED