qatools-cli 1.2.20 → 1.2.21
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/context-sync.js +8 -4
- package/package.json +1 -1
- package/qatools.js +70 -2
package/context-sync.js
CHANGED
|
@@ -95,13 +95,17 @@ function requestsIntegrationPrompt(projectName) {
|
|
|
95
95
|
" identifies a request, so sending all of them every time is fine — it updates, it does not duplicate;",
|
|
96
96
|
" - reads the status of the same ids: action \"status\", at most 500 per call;",
|
|
97
97
|
" - stores each status on the app's own request record (e.g. a field qaStatus).",
|
|
98
|
+
" To show the team's replies (and let users comment), read them with action comments and send users' comments with",
|
|
99
|
+
" action comment — both take the app's own request id, also for synced requests.",
|
|
98
100
|
"4. Show the status on the request page, in the app's language, with the votes: new → received; accepted → accepted",
|
|
99
101
|
" (it is linked to a requirement); planned → the release name and its planned date (releaseDate); released →",
|
|
100
102
|
" released; declined → declined with the reason (members write it for the users).",
|
|
101
103
|
"5. Verify it yourself before you say it works: (A) run the job once, or (B) create a request and vote through your",
|
|
102
104
|
" own routes; then `qatools feature-requests` must list the requests with their votes, and the app must show",
|
|
103
|
-
" status \"new\".
|
|
104
|
-
" that (and the next sync for A)
|
|
105
|
+
" status \"new\". Then link one request to a requirement in a sprint yourself: `qatools feature-request-link --id",
|
|
106
|
+
" <app id> --requirement <key>`; after that (and the next sync for A) the app must show \"planned\" with the release",
|
|
107
|
+
" and date. Unless the link is right, undo it: `qatools feature-request-unlink --id <app id>`. Report what you saw.",
|
|
108
|
+
" Declining (`qatools feature-request-decline --id <id> --reason \"…\"`) is a member's decision — never do it yourself.",
|
|
105
109
|
"6. If the app's requirements in qa-tools do not cover the request page or this sync, say so — the user decides",
|
|
106
110
|
" whether to add requirements.",
|
|
107
111
|
"",
|
|
@@ -129,8 +133,8 @@ function requestsIntegrationPrompt(projectName) {
|
|
|
129
133
|
' { "action": "comment", "userId": "u2", "userName": "Anna", "id": "qa-…", "text": "…" }',
|
|
130
134
|
' { "action": "comments", "id": "qa-…" } → { "comments": [ { "author": "Anna", "team": false, "text": "…", "at": "…" },',
|
|
131
135
|
' { "author": "team", "team": true, "text": "…", "at": "…" } ] }',
|
|
132
|
-
" Replies from the project's members come back with author \"team\".
|
|
133
|
-
" refused (409) — their votes come from the app.",
|
|
136
|
+
" Replies from the project's members come back with author \"team\". comment and comments also work for requests the",
|
|
137
|
+
" app syncs itself (A), with the app's own id. Votes on synced requests are refused (409) — their votes come from the app.",
|
|
134
138
|
"",
|
|
135
139
|
"Errors: 401 missing key, 403 wrong or revoked key, 400 bad body (e.g. no userId, no title, title over 300",
|
|
136
140
|
"characters), 404 unknown request, 409 vote on a synced request, 429 more than 600 calls a minute from one server.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qatools-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.21",
|
|
4
4
|
"description": "CLI for QA Tools — requirements, epics, sprints, sessions, App Context sync, project agenda. The companion to qa-tools.com.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"release": "npm version patch --no-git-tag-version && npm publish",
|
package/qatools.js
CHANGED
|
@@ -905,7 +905,8 @@ program
|
|
|
905
905
|
if (!requests.length) { console.log("No requests from users yet. Connect the app: qatools requests-integration-prompt"); process.exit(0); }
|
|
906
906
|
console.log(`${requests.length} request(s):\n`);
|
|
907
907
|
for (const r of requests) {
|
|
908
|
-
|
|
908
|
+
const where = r.status === "planned" ? ` → ${r.sprint} (${r.releaseDate})` : r.status === "declined" && r.reason ? ` — "${r.reason}"` : "";
|
|
909
|
+
console.log(` ▲ ${String(r.votes || 0).padStart(4)} ${r.status.padEnd(8)} ${r.title} (id ${r.externalId}${r.requirementKey ? `, requirement ${r.requirementKey}` : ""})${where}`);
|
|
909
910
|
}
|
|
910
911
|
process.exit(0);
|
|
911
912
|
} catch (e) {
|
|
@@ -914,6 +915,61 @@ program
|
|
|
914
915
|
}
|
|
915
916
|
});
|
|
916
917
|
|
|
918
|
+
// signals.feature-requests-cli: act on a request from the terminal — a request by the app's id, a requirement by its key
|
|
919
|
+
async function decideRequestFromCli(options, action, extra) {
|
|
920
|
+
await authenticate(options);
|
|
921
|
+
const projectId = options.project || getCredentials()?.projectId;
|
|
922
|
+
if (!projectId) { console.error("No project configured. Run: qatools setup, or pass --project <id>"); process.exit(1); }
|
|
923
|
+
try {
|
|
924
|
+
const { data } = await httpsCallable(functions, "decideFeatureRequest")({ projectId, externalId: String(options.id), action, ...extra });
|
|
925
|
+
return data;
|
|
926
|
+
} catch (e) {
|
|
927
|
+
console.error(e.message);
|
|
928
|
+
process.exit(1);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
program
|
|
933
|
+
.command("feature-request-link")
|
|
934
|
+
.description("Link a request from the app's users to a requirement; the app then shows it as accepted, or planned when the requirement is in a sprint")
|
|
935
|
+
.requiredOption("--id <id>", "The request's id in the app")
|
|
936
|
+
.requiredOption("--requirement <key>", "Requirement key, e.g. reports.export")
|
|
937
|
+
.option("--project <id>", "Target project ID (overrides default)")
|
|
938
|
+
.option("-e, --email <email>", "Login email")
|
|
939
|
+
.option("-p, --password <password>", "Login password")
|
|
940
|
+
.action(async (options) => {
|
|
941
|
+
await decideRequestFromCli(options, "link", { requirementKey: options.requirement });
|
|
942
|
+
console.log(`✓ Request ${options.id} linked to ${options.requirement}. Its status for the app: qatools feature-requests`);
|
|
943
|
+
process.exit(0);
|
|
944
|
+
});
|
|
945
|
+
|
|
946
|
+
program
|
|
947
|
+
.command("feature-request-unlink")
|
|
948
|
+
.description("Undo a link: the request is no longer linked to a requirement")
|
|
949
|
+
.requiredOption("--id <id>", "The request's id in the app")
|
|
950
|
+
.option("--project <id>", "Target project ID (overrides default)")
|
|
951
|
+
.option("-e, --email <email>", "Login email")
|
|
952
|
+
.option("-p, --password <password>", "Login password")
|
|
953
|
+
.action(async (options) => {
|
|
954
|
+
const res = await decideRequestFromCli(options, "unlink", {});
|
|
955
|
+
console.log(`✓ Request ${options.id} unlinked (status: ${res.state}).`);
|
|
956
|
+
process.exit(0);
|
|
957
|
+
});
|
|
958
|
+
|
|
959
|
+
program
|
|
960
|
+
.command("feature-request-decline")
|
|
961
|
+
.description("Decline a request with a reason the app shows to its users. A member's decision: refused for Claude's API key.")
|
|
962
|
+
.requiredOption("--id <id>", "The request's id in the app")
|
|
963
|
+
.requiredOption("--reason <text>", "Why — shown to the app's users")
|
|
964
|
+
.option("--project <id>", "Target project ID (overrides default)")
|
|
965
|
+
.option("-e, --email <email>", "Login email")
|
|
966
|
+
.option("-p, --password <password>", "Login password")
|
|
967
|
+
.action(async (options) => {
|
|
968
|
+
await decideRequestFromCli(options, "decline", { reason: options.reason });
|
|
969
|
+
console.log(`✓ Request ${options.id} declined.`);
|
|
970
|
+
process.exit(0);
|
|
971
|
+
});
|
|
972
|
+
|
|
917
973
|
// requirements.baseline-from-code: reconstruct requirements for what is already built
|
|
918
974
|
program
|
|
919
975
|
.command("baseline-prompt")
|
|
@@ -4204,10 +4260,22 @@ const mcpTools = [
|
|
|
4204
4260
|
},
|
|
4205
4261
|
{
|
|
4206
4262
|
name: "list_feature_requests",
|
|
4207
|
-
description: "Requests from the app's users (signals.user-feature-requests), most votes first: title, votes,
|
|
4263
|
+
description: "Requests from the app's users (signals.user-feature-requests), most votes first: title, votes, status as the app sees it (new / accepted / planned / released / declined), requirementKey, sprint and releaseDate. Link or unlink with link_feature_request / unlink_feature_request; declining is a member's decision (web app or CLI with a member login).",
|
|
4208
4264
|
inputSchema: mcpSchema(),
|
|
4209
4265
|
run: async (a) => (await mcpCall("listFeatureRequests", { projectId: a.projectId })).requests,
|
|
4210
4266
|
},
|
|
4267
|
+
{
|
|
4268
|
+
name: "link_feature_request",
|
|
4269
|
+
description: "Link a request from the app's users to a requirement (signals.feature-requests-cli). The app then shows it as accepted, or planned with the release and date when the requirement is in a sprint — so link only where the requirement really covers the request.",
|
|
4270
|
+
inputSchema: mcpSchema({ id: mcpStr("The request's id in the app (externalId)"), requirementKey: mcpStr("Requirement key, e.g. reports.export") }, ["id", "requirementKey"]),
|
|
4271
|
+
run: async (a) => mcpCall("decideFeatureRequest", { projectId: a.projectId, externalId: a.id, action: "link", requirementKey: a.requirementKey }),
|
|
4272
|
+
},
|
|
4273
|
+
{
|
|
4274
|
+
name: "unlink_feature_request",
|
|
4275
|
+
description: "Undo a link between a request from the app's users and a requirement.",
|
|
4276
|
+
inputSchema: mcpSchema({ id: mcpStr("The request's id in the app (externalId)") }, ["id"]),
|
|
4277
|
+
run: async (a) => mcpCall("decideFeatureRequest", { projectId: a.projectId, externalId: a.id, action: "unlink" }),
|
|
4278
|
+
},
|
|
4211
4279
|
{
|
|
4212
4280
|
name: "requests_integration_prompt",
|
|
4213
4281
|
description: "Procedure, API and example code for connecting this app's own feature-request page to qa-tools: requests and votes in, status (planned / released / declined) back to the app. Use when the app has a page where users request features or vote.",
|