@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 CHANGED
@@ -10148,7 +10148,9 @@ async function handleJiraResponse(res) {
10148
10148
  let detail = "";
10149
10149
  try {
10150
10150
  const body = await res.json();
10151
- detail = body.errorMessages?.[0] ?? "";
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 startAt = request.cursor ? Math.max(0, Number.parseInt(request.cursor, 10) || 0) : 0;
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 data = await jiraPost(baseUrl, "/rest/api/3/search/jql", auth, request.context.timeoutMs, {
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 nextStart = data.startAt + data.issues.length;
10318
- const hasMore = nextStart < data.total;
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
- detail = body.errorMessages?.[0] ?? "";
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 startAt = request.cursor ? Math.max(0, Number.parseInt(request.cursor, 10) || 0) : 0;
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 data = await jiraPost(baseUrl, "/rest/api/3/search/jql", auth, request.context.timeoutMs, {
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 nextStart = data.startAt + data.issues.length;
18394
- const hasMore = nextStart < data.total;
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/cli",
3
- "version": "3.88.3",
3
+ "version": "3.88.4",
4
4
  "description": "Knowledge Driven Development toolkit",
5
5
  "license": "MIT",
6
6
  "repository": {