@kaddo/cli 3.88.3 → 3.88.4
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/core.js +11 -9
- package/dist/index.js +11 -9
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -10148,7 +10148,9 @@ async function handleJiraResponse(res) {
|
|
|
10148
10148
|
let detail = "";
|
|
10149
10149
|
try {
|
|
10150
10150
|
const body = await res.json();
|
|
10151
|
-
|
|
10151
|
+
const msgs = body.errorMessages?.filter(Boolean) ?? [];
|
|
10152
|
+
const fieldErrs = body.errors ? Object.entries(body.errors).map(([k, v]) => `${k}: ${v}`) : [];
|
|
10153
|
+
detail = [...msgs, ...fieldErrs].join("; ");
|
|
10152
10154
|
} catch {
|
|
10153
10155
|
}
|
|
10154
10156
|
throw integrationError("INTEGRATION_PROVIDER_ERROR", detail || `Jira responded with status ${res.status}.`);
|
|
@@ -10304,19 +10306,19 @@ function createJiraAdapter() {
|
|
|
10304
10306
|
const auth = authHeader(email, apiToken);
|
|
10305
10307
|
const jql = buildJql(request.filters);
|
|
10306
10308
|
const pageSize = Math.min(Math.max(1, request.pageSize ?? DEFAULT_PAGE_SIZE), 100);
|
|
10307
|
-
const
|
|
10309
|
+
const nextPageToken = request.cursor || void 0;
|
|
10308
10310
|
try {
|
|
10309
|
-
const fullJql = jql ? jql + " ORDER BY updated DESC" : "ORDER BY updated DESC";
|
|
10310
|
-
const
|
|
10311
|
+
const fullJql = jql ? jql + " ORDER BY updated DESC" : "updated >= -30d ORDER BY updated DESC";
|
|
10312
|
+
const body = {
|
|
10311
10313
|
jql: fullJql,
|
|
10312
|
-
startAt,
|
|
10313
10314
|
maxResults: pageSize,
|
|
10314
10315
|
fields: SEARCH_FIELDS.split(",")
|
|
10315
|
-
}
|
|
10316
|
+
};
|
|
10317
|
+
if (nextPageToken) body.nextPageToken = nextPageToken;
|
|
10318
|
+
const data = await jiraPost(baseUrl, "/rest/api/3/search/jql", auth, request.context.timeoutMs, body);
|
|
10316
10319
|
const items = data.issues.map((issue) => normalizeIssue(issue, baseUrl, request.context.integrationId));
|
|
10317
|
-
const
|
|
10318
|
-
|
|
10319
|
-
return { items, hasMore, ...hasMore ? { nextCursor: String(nextStart) } : {} };
|
|
10320
|
+
const hasMore = data.isLast === false;
|
|
10321
|
+
return { items, hasMore, ...hasMore && data.nextPageToken ? { nextCursor: data.nextPageToken } : {} };
|
|
10320
10322
|
} catch (err) {
|
|
10321
10323
|
throw normalizeProviderError(err);
|
|
10322
10324
|
}
|
package/dist/index.js
CHANGED
|
@@ -18224,7 +18224,9 @@ async function handleJiraResponse(res) {
|
|
|
18224
18224
|
let detail = "";
|
|
18225
18225
|
try {
|
|
18226
18226
|
const body = await res.json();
|
|
18227
|
-
|
|
18227
|
+
const msgs = body.errorMessages?.filter(Boolean) ?? [];
|
|
18228
|
+
const fieldErrs = body.errors ? Object.entries(body.errors).map(([k, v]) => `${k}: ${v}`) : [];
|
|
18229
|
+
detail = [...msgs, ...fieldErrs].join("; ");
|
|
18228
18230
|
} catch {
|
|
18229
18231
|
}
|
|
18230
18232
|
throw integrationError("INTEGRATION_PROVIDER_ERROR", detail || `Jira responded with status ${res.status}.`);
|
|
@@ -18380,19 +18382,19 @@ function createJiraAdapter() {
|
|
|
18380
18382
|
const auth = authHeader(email, apiToken);
|
|
18381
18383
|
const jql = buildJql(request.filters);
|
|
18382
18384
|
const pageSize = Math.min(Math.max(1, request.pageSize ?? DEFAULT_PAGE_SIZE), 100);
|
|
18383
|
-
const
|
|
18385
|
+
const nextPageToken = request.cursor || void 0;
|
|
18384
18386
|
try {
|
|
18385
|
-
const fullJql = jql ? jql + " ORDER BY updated DESC" : "ORDER BY updated DESC";
|
|
18386
|
-
const
|
|
18387
|
+
const fullJql = jql ? jql + " ORDER BY updated DESC" : "updated >= -30d ORDER BY updated DESC";
|
|
18388
|
+
const body = {
|
|
18387
18389
|
jql: fullJql,
|
|
18388
|
-
startAt,
|
|
18389
18390
|
maxResults: pageSize,
|
|
18390
18391
|
fields: SEARCH_FIELDS.split(",")
|
|
18391
|
-
}
|
|
18392
|
+
};
|
|
18393
|
+
if (nextPageToken) body.nextPageToken = nextPageToken;
|
|
18394
|
+
const data = await jiraPost(baseUrl, "/rest/api/3/search/jql", auth, request.context.timeoutMs, body);
|
|
18392
18395
|
const items = data.issues.map((issue) => normalizeIssue(issue, baseUrl, request.context.integrationId));
|
|
18393
|
-
const
|
|
18394
|
-
|
|
18395
|
-
return { items, hasMore, ...hasMore ? { nextCursor: String(nextStart) } : {} };
|
|
18396
|
+
const hasMore = data.isLast === false;
|
|
18397
|
+
return { items, hasMore, ...hasMore && data.nextPageToken ? { nextCursor: data.nextPageToken } : {} };
|
|
18396
18398
|
} catch (err) {
|
|
18397
18399
|
throw normalizeProviderError(err);
|
|
18398
18400
|
}
|