specweave 1.0.405 → 1.0.407
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/plugins/specweave-ado/lib/ado-spec-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-spec-sync.js +16 -5
- package/dist/plugins/specweave-ado/lib/ado-spec-sync.js.map +1 -1
- package/dist/plugins/specweave-jira/lib/jira-paginated-search.d.ts +5 -0
- package/dist/plugins/specweave-jira/lib/jira-paginated-search.d.ts.map +1 -1
- package/dist/plugins/specweave-jira/lib/jira-paginated-search.js +18 -12
- package/dist/plugins/specweave-jira/lib/jira-paginated-search.js.map +1 -1
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +31 -10
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/update.d.ts.map +1 -1
- package/dist/src/cli/commands/update.js +30 -20
- package/dist/src/cli/commands/update.js.map +1 -1
- package/dist/src/cli/helpers/init/plugin-installer.js +2 -9
- package/dist/src/cli/helpers/init/plugin-installer.js.map +1 -1
- package/dist/src/core/background/job-launcher.js +2 -2
- package/dist/src/core/background/job-launcher.js.map +1 -1
- package/dist/src/core/doctor/checkers/installation-health-checker.d.ts.map +1 -1
- package/dist/src/core/doctor/checkers/installation-health-checker.js +21 -6
- package/dist/src/core/doctor/checkers/installation-health-checker.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave-ado/lib/ado-spec-sync.js +14 -5
- package/plugins/specweave-ado/lib/ado-spec-sync.ts +17 -5
- package/plugins/specweave-jira/lib/jira-paginated-search.js +12 -11
- package/plugins/specweave-jira/lib/jira-paginated-search.ts +20 -12
|
@@ -7,14 +7,15 @@ async function searchAllIssues(client, options) {
|
|
|
7
7
|
let startAt = 0;
|
|
8
8
|
let total = Infinity;
|
|
9
9
|
while (startAt < total) {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
10
|
+
const body = {
|
|
11
|
+
jql,
|
|
12
|
+
startAt,
|
|
13
|
+
maxResults
|
|
14
|
+
};
|
|
15
|
+
if (fields) {
|
|
16
|
+
body.fields = fields.split(",").map((f) => f.trim());
|
|
17
|
+
}
|
|
18
|
+
const response = await requestWithRetry(client, "/search/jql", body);
|
|
18
19
|
const data = response.data;
|
|
19
20
|
total = data.total;
|
|
20
21
|
const issues = data.issues || [];
|
|
@@ -24,9 +25,9 @@ async function searchAllIssues(client, options) {
|
|
|
24
25
|
}
|
|
25
26
|
return allIssues;
|
|
26
27
|
}
|
|
27
|
-
async function requestWithRetry(client, url,
|
|
28
|
+
async function requestWithRetry(client, url, body, attempt = 0) {
|
|
28
29
|
try {
|
|
29
|
-
return await client.
|
|
30
|
+
return await client.post(url, body);
|
|
30
31
|
} catch (error) {
|
|
31
32
|
const axiosError = error;
|
|
32
33
|
const status = axiosError.response?.status;
|
|
@@ -37,7 +38,7 @@ async function requestWithRetry(client, url, config, attempt = 0) {
|
|
|
37
38
|
`Rate limited (429). Retry ${attempt + 1}/${MAX_RETRIES} after ${retryAfterMs}ms...`
|
|
38
39
|
);
|
|
39
40
|
await sleep(retryAfterMs);
|
|
40
|
-
return requestWithRetry(client, url,
|
|
41
|
+
return requestWithRetry(client, url, body, attempt + 1);
|
|
41
42
|
}
|
|
42
43
|
if (status === 429) {
|
|
43
44
|
throw new Error(
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* Provides a paginated JQL search that fetches all results
|
|
5
5
|
* by iterating through pages using startAt/maxResults.
|
|
6
6
|
*
|
|
7
|
+
* Uses POST /search/jql endpoint (Atlassian Cloud deprecated
|
|
8
|
+
* GET /search; POST /search also returns 410).
|
|
9
|
+
*
|
|
7
10
|
* Includes exponential backoff retry on HTTP 429 (rate limit).
|
|
8
11
|
*
|
|
9
12
|
* @module jira-paginated-search
|
|
@@ -25,6 +28,8 @@ export interface PaginatedSearchOptions {
|
|
|
25
28
|
* Search all issues matching a JQL query with full pagination.
|
|
26
29
|
* Handles rate limiting with exponential backoff.
|
|
27
30
|
*
|
|
31
|
+
* Uses POST /search/jql (the replacement for the deprecated GET/POST /search).
|
|
32
|
+
*
|
|
28
33
|
* @param client - Axios instance configured with JIRA auth
|
|
29
34
|
* @param options - Search options (jql, fields, maxResults per page)
|
|
30
35
|
* @returns All matching issues across all pages
|
|
@@ -39,14 +44,17 @@ export async function searchAllIssues(
|
|
|
39
44
|
let total = Infinity;
|
|
40
45
|
|
|
41
46
|
while (startAt < total) {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const body: Record<string, any> = {
|
|
48
|
+
jql,
|
|
49
|
+
startAt,
|
|
50
|
+
maxResults,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
if (fields) {
|
|
54
|
+
body.fields = fields.split(',').map((f: string) => f.trim());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const response = await requestWithRetry(client, '/search/jql', body);
|
|
50
58
|
|
|
51
59
|
const data = response.data;
|
|
52
60
|
total = data.total;
|
|
@@ -63,16 +71,16 @@ export async function searchAllIssues(
|
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
/**
|
|
66
|
-
* Make an HTTP
|
|
74
|
+
* Make an HTTP POST request with exponential backoff retry on 429.
|
|
67
75
|
*/
|
|
68
76
|
async function requestWithRetry(
|
|
69
77
|
client: AxiosInstance,
|
|
70
78
|
url: string,
|
|
71
|
-
|
|
79
|
+
body: any,
|
|
72
80
|
attempt: number = 0
|
|
73
81
|
): Promise<any> {
|
|
74
82
|
try {
|
|
75
|
-
return await client.
|
|
83
|
+
return await client.post(url, body);
|
|
76
84
|
} catch (error: any) {
|
|
77
85
|
const axiosError = error as AxiosError;
|
|
78
86
|
const status = axiosError.response?.status;
|
|
@@ -89,7 +97,7 @@ async function requestWithRetry(
|
|
|
89
97
|
);
|
|
90
98
|
|
|
91
99
|
await sleep(retryAfterMs);
|
|
92
|
-
return requestWithRetry(client, url,
|
|
100
|
+
return requestWithRetry(client, url, body, attempt + 1);
|
|
93
101
|
}
|
|
94
102
|
|
|
95
103
|
if (status === 429) {
|