airgen-cli 0.3.2 → 0.4.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/dist/commands/reports.js
CHANGED
|
@@ -44,10 +44,10 @@ export function registerReportCommands(program, client) {
|
|
|
44
44
|
]);
|
|
45
45
|
const stats = {
|
|
46
46
|
requirements: reqs.meta?.totalItems ?? 0,
|
|
47
|
-
traceLinks: (links.
|
|
47
|
+
traceLinks: (links.traceLinks ?? []).length,
|
|
48
48
|
documents: (docs.documents ?? []).length,
|
|
49
49
|
diagrams: (diagrams.diagrams ?? []).length,
|
|
50
|
-
baselines: (baselines.
|
|
50
|
+
baselines: (baselines.items ?? []).length,
|
|
51
51
|
};
|
|
52
52
|
if (isJsonMode()) {
|
|
53
53
|
output(stats);
|
|
@@ -131,7 +131,7 @@ export function registerReportCommands(program, client) {
|
|
|
131
131
|
fetchAllRequirements(client, tenant, project),
|
|
132
132
|
client.get(`/trace-links/${tenant}/${project}`),
|
|
133
133
|
]);
|
|
134
|
-
const links = linkData.
|
|
134
|
+
const links = linkData.traceLinks ?? [];
|
|
135
135
|
const linked = new Set();
|
|
136
136
|
for (const l of links) {
|
|
137
137
|
if (l.sourceRequirementId)
|
|
@@ -4,15 +4,27 @@ export function registerRequirementCommands(program, client) {
|
|
|
4
4
|
const cmd = program.command("requirements").alias("reqs").description("Manage requirements");
|
|
5
5
|
cmd
|
|
6
6
|
.command("list")
|
|
7
|
-
.description("List requirements with pagination")
|
|
7
|
+
.description("List requirements with pagination and optional filters")
|
|
8
8
|
.argument("<tenant>", "Tenant slug")
|
|
9
9
|
.argument("<project>", "Project slug")
|
|
10
10
|
.option("-p, --page <n>", "Page number", "1")
|
|
11
11
|
.option("-l, --limit <n>", "Items per page", "25")
|
|
12
12
|
.option("--sort <field>", "Sort by: ref, createdAt, qaScore")
|
|
13
13
|
.option("--order <dir>", "Sort order: asc, desc")
|
|
14
|
+
.option("--tags <tags>", "Comma-separated tags to filter by (server-side)")
|
|
15
|
+
.option("--document <slug>", "Filter by document slug (server-side)")
|
|
14
16
|
.action(async (tenant, project, opts) => {
|
|
15
|
-
const
|
|
17
|
+
const params = {
|
|
18
|
+
page: opts.page,
|
|
19
|
+
limit: opts.limit,
|
|
20
|
+
sortBy: opts.sort,
|
|
21
|
+
sortOrder: opts.order,
|
|
22
|
+
};
|
|
23
|
+
if (opts.tags)
|
|
24
|
+
params.tags = opts.tags;
|
|
25
|
+
if (opts.document)
|
|
26
|
+
params.documentSlug = opts.document;
|
|
27
|
+
const data = await client.get(`/requirements/${tenant}/${project}`, params);
|
|
16
28
|
const reqs = data.data ?? [];
|
|
17
29
|
const meta = data.meta;
|
|
18
30
|
if (isJsonMode()) {
|
|
@@ -179,7 +191,7 @@ export function registerRequirementCommands(program, client) {
|
|
|
179
191
|
});
|
|
180
192
|
cmd
|
|
181
193
|
.command("filter")
|
|
182
|
-
.description("Advanced filtering with multiple criteria")
|
|
194
|
+
.description("Advanced server-side filtering with multiple criteria")
|
|
183
195
|
.argument("<tenant>", "Tenant slug")
|
|
184
196
|
.argument("<project>", "Project slug")
|
|
185
197
|
.option("--tags <tags>", "Comma-separated tags")
|
|
@@ -190,35 +202,38 @@ export function registerRequirementCommands(program, client) {
|
|
|
190
202
|
.option("--qa-max <n>", "Max QA score")
|
|
191
203
|
.option("--document <slug>", "Document slug")
|
|
192
204
|
.option("--section <id>", "Section ID")
|
|
193
|
-
.option("--contains <text>", "Text contains")
|
|
205
|
+
.option("--contains <text>", "Text contains (case-insensitive)")
|
|
194
206
|
.option("-p, --page <n>", "Page number", "1")
|
|
195
207
|
.option("-l, --limit <n>", "Items per page", "50")
|
|
208
|
+
.option("--sort <field>", "Sort by: ref, createdAt, qaScore")
|
|
209
|
+
.option("--order <dir>", "Sort order: asc, desc")
|
|
196
210
|
.action(async (tenant, project, opts) => {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
211
|
+
const params = {
|
|
212
|
+
page: opts.page,
|
|
213
|
+
limit: opts.limit,
|
|
214
|
+
sortBy: opts.sort,
|
|
215
|
+
sortOrder: opts.order,
|
|
216
|
+
};
|
|
217
|
+
if (opts.tags)
|
|
218
|
+
params.tags = opts.tags;
|
|
204
219
|
if (opts.pattern)
|
|
205
|
-
|
|
220
|
+
params.pattern = opts.pattern;
|
|
206
221
|
if (opts.verification)
|
|
207
|
-
|
|
222
|
+
params.verification = opts.verification;
|
|
208
223
|
if (opts.compliance)
|
|
209
|
-
|
|
224
|
+
params.complianceStatus = opts.compliance;
|
|
210
225
|
if (opts.qaMin)
|
|
211
|
-
|
|
226
|
+
params.qaScoreMin = opts.qaMin;
|
|
212
227
|
if (opts.qaMax)
|
|
213
|
-
|
|
228
|
+
params.qaScoreMax = opts.qaMax;
|
|
214
229
|
if (opts.document)
|
|
215
|
-
|
|
230
|
+
params.documentSlug = opts.document;
|
|
216
231
|
if (opts.section)
|
|
217
|
-
|
|
218
|
-
if (opts.contains)
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
232
|
+
params.sectionId = opts.section;
|
|
233
|
+
if (opts.contains)
|
|
234
|
+
params.textContains = opts.contains;
|
|
235
|
+
const data = await client.get(`/requirements/${tenant}/${project}`, params);
|
|
236
|
+
const reqs = data.data ?? [];
|
|
222
237
|
if (isJsonMode()) {
|
|
223
238
|
output(reqs);
|
|
224
239
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "airgen-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "AIRGen CLI — requirements engineering from the command line",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
|
35
|
-
"url": "https://github.com/
|
|
35
|
+
"url": "https://github.com/Hollando78/airgen.git",
|
|
36
36
|
"directory": "packages/cli"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|